rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
wa_page.c File Reference

The Wi-Fi page: the code form, the card listing and the upload answers in English and German. See wa_page.h. More...

#include "wa_page.h"
#include <string.h>
#include "wa_guard.h"
#include "wa_zip.h"
#include "wall_clock.h"
#include "ui_text.def"

Macros

#define UI_WEB_TEXT(id, en, de)
 One identifier per UI_WEB_TEXT() entry.
#define UI_WEB_TEXT(id, en, de)
 One identifier per UI_WEB_TEXT() entry.
#define WA_PAGE_DE(id, de)
 The German entry of text id as the table gives it.
#define UI_WEB_TEXT(id, en, de)
 One identifier per UI_WEB_TEXT() entry.

Enumerations

enum  p_text_t { P_COUNT }
 The page's texts, P_<ID> for each UI_WEB_TEXT() of ui_text.def.

Functions

static const char * pt (bool de, p_text_t t)
 One text of the page in the page's language.
static void head (wa_out_t *o, const wa_page_info_t *pi)
void wa_page_code (wa_out_t *o, const wa_page_info_t *pi, bool wrong)
static void firmware (wa_out_t *o, const wa_page_info_t *pi)
static void folder (wa_out_t *o, const wa_page_info_t *pi, const char *path)
static void files (wa_out_t *o, const wa_page_info_t *pi, const wa_fs_t *fs)
void wa_page_main (wa_out_t *o, const wa_page_info_t *pi, const wa_fs_t *fs)
void wa_page_upload_result (wa_out_t *o, bool de, fw_err_t e, const fw_image_info_t *info, bool same)

Variables

static const char *const k_en [P_COUNT]
 The page's texts in English.
static const char *const k_de [P_COUNT]
 The page's texts in German; NULL where the table has no German.

Detailed Description

The Wi-Fi page: the code form, the card listing and the upload answers in English and German. See wa_page.h.

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ UI_WEB_TEXT [1/3]

#define UI_WEB_TEXT ( id,
en,
de )
Value:
[id] = WA_PAGE_DE(id, de),
#define WA_PAGE_DE(id, de)
The German entry of text id as the table gives it.
Definition wa_page.c:39

One identifier per UI_WEB_TEXT() entry.

◆ UI_WEB_TEXT [2/3]

#define UI_WEB_TEXT ( id,
en,
de )
Value:
[id] = (en),

One identifier per UI_WEB_TEXT() entry.

◆ UI_WEB_TEXT [3/3]

#define UI_WEB_TEXT ( id,
en,
de )
Value:
id,

One identifier per UI_WEB_TEXT() entry.

◆ WA_PAGE_DE

#define WA_PAGE_DE ( id,
de )
Value:
(de)

The German entry of text id as the table gives it.

test_wa_page_de defines it before it includes this file, to blank one entry.

Function Documentation

◆ pt()

const char * pt ( bool de,
p_text_t t )
static

One text of the page in the page's language.

Parameters
deGerman page.
tThe text.
Returns
The German entry, or the English where the German is NULL.

◆ wa_page_code()

void wa_page_code ( wa_out_t * o,
const wa_page_info_t * pi,
bool wrong )

The code form; wrong adds that the last code was wrong.

◆ wa_page_main()

void wa_page_main ( wa_out_t * o,
const wa_page_info_t * pi,
const wa_fs_t * fs )

The whole page, with two walks of fs: one adding up, one listing.

◆ wa_page_upload_result()

void wa_page_upload_result ( wa_out_t * o,
bool de,
fw_err_t e,
const fw_image_info_t * info,
bool same )

The text an upload's response carries: e as fw_upload_end() or fw_upload_begin() gave it, and for FW_OK the version received in info, which same says is the build that runs.

Variable Documentation

◆ k_de

const char* const k_de[P_COUNT]
static
Initial value:
= {
#define UI_WEB_TEXT(id, en, de)
}

The page's texts in German; NULL where the table has no German.

◆ k_en

const char* const k_en[P_COUNT]
static
Initial value:
= {
#define UI_WEB_TEXT(id, en, de)
}

The page's texts in English.