|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
WI-FI: the panel's Wi-Fi, for two jobs in a browser – every file on the card to download, and a panel firmware image to upload – and the screen that writes an uploaded image (PANEL UPDATE). More...
Go to the source code of this file.
Data Structures | |
| struct | wifi_view_t |
| struct | update_view_t |
Macros | |
| #define | WIFI_SSID_MAX 32 |
| The longest network name, in bytes. | |
| #define | WIFI_PASS_MAX 63 |
| The longest password, in characters. | |
| #define | WIFI_SCAN_ROWS 16 |
| The most networks a scan lists. | |
| #define | WIFI_VER_MAX 32 |
| The longest version string an image or a release carries. | |
| #define | WIFI_REQ_AP 0x001u |
| #define | WIFI_REQ_JOIN 0x002u |
| #define | WIFI_REQ_OFF 0x004u |
| #define | WIFI_REQ_SCAN 0x008u |
| #define | WIFI_REQ_SAVE_NET 0x010u |
| #define | WIFI_REQ_FORGET 0x020u |
| #define | WIFI_REQ_CODE_ON 0x040u |
| #define | WIFI_REQ_CODE_OFF 0x080u |
| #define | WIFI_REQ_DISCARD 0x100u |
| #define | WIFI_REQ_INSTALL 0x200u |
Enumerations | |
| enum | wifi_radio_t { WIFI_RADIO_OFF = 0 , WIFI_RADIO_STARTING , WIFI_RADIO_AP , WIFI_RADIO_SCANNING , WIFI_RADIO_JOINING , WIFI_RADIO_ADDRESS , WIFI_RADIO_JOINED } |
| enum | wifi_why_t { WIFI_WHY_NONE = 0 , WIFI_WHY_ARMED , WIFI_WHY_SUPPLY , WIFI_WHY_RUN , WIFI_WHY_STOP , WIFI_WHY_IDLE , WIFI_WHY_GUESSES , WIFI_WHY_ASKED , WIFI_WHY_INSTALL , WIFI_WHY_FAILED , WIFI_WHY_JOIN , WIFI_WHY_UNAVAILABLE } |
| enum | wifi_join_t { WIFI_JOIN_OK = 0 , WIFI_JOIN_PASSWORD , WIFI_JOIN_NOT_FOUND , WIFI_JOIN_NO_ADDRESS , WIFI_JOIN_LOST } |
| enum | wifi_up_t { WIFI_UP_IDLE = 0 , WIFI_UP_RECEIVING , WIFI_UP_STAGED , WIFI_UP_FAILED } |
| enum | wifi_offer_t { WIFI_OFFER_NEWER = 0 , WIFI_OFFER_OLDER , WIFI_OFFER_REBUILD , WIFI_OFFER_INSTALLED } |
| enum | wifi_gate_t { WIFI_GATE_OPEN = 0 , WIFI_GATE_ARMED , WIFI_GATE_SUPPLY , WIFI_GATE_RUN , WIFI_GATE_DRAWING , WIFI_GATE_COPROC } |
| enum | update_state_t { UPDATE_WRITING = 0 , UPDATE_RESTARTING , UPDATE_FAILED , UPDATE_FETCHING , UPDATE_FETCH_FAILED } |
| Where PANEL UPDATE stands. More... | |
Functions | |
| void | wifi_screen_set (const wifi_view_t *v) |
| void | wifi_screen_set_unavailable (void) |
| const wifi_view_t * | wifi_screen_view (void) |
| unsigned | wifi_screen_take (void) |
| void | wifi_screen_net (char ssid[WIFI_SSID_MAX+1], char pass[WIFI_PASS_MAX+1]) |
| void | wifi_screen_invalidate (void) |
| gfx_rect_t | wifi_screen_key_area (void) |
| Where the keyboard opens: the body less UI_MARGIN at its sides and top, ending 4px above the alert band, 1008 x 484px. | |
| const ui_textkey_t * | wifi_screen_textkey (void) |
| The screen's keyboard, open or closed; for tests and the renderer, which check what a tap typed. | |
| const ui_screen_t * | wifi_screen (void) |
| The WI-FI screen, for the router. | |
| int | wifi_screen_jobs_lines (void) |
| void | update_screen_set (const update_view_t *v) |
| Hand PANEL UPDATE what to show. | |
| bool | update_screen_take_close (void) |
| bool | update_screen_take_cancel (void) |
| void | update_screen_invalidate (void) |
| Repaint PANEL UPDATE on the next frame. | |
| const ui_screen_t * | update_screen (void) |
| The PANEL UPDATE screen, for the router. | |
WI-FI: the panel's Wi-Fi, for two jobs in a browser – every file on the card to download, and a panel firmware image to upload – and the screen that writes an uploaded image (PANEL UPDATE).
The screen opens from LOGS and runs the radio only while it is open. It offers the panel's own access point always, and the home network when one is kept: chosen from a scan, or typed for a hidden one, the password typed on the Wi-Fi keyboard (ui_textkey_open_wifi()). It shows what a browser needs – network, password, address, name, access code – and why the radio went off when it did.
An uploaded image waits on the panel as a question naming both versions. The browser cannot start the write: INSTALL is a 2s hold here (UI_HOLD_S), and the hold ends unfired when the image goes away under it – a STOP, an ARM, CANCEL – or the install gate closes.
The screen commands nothing itself. The application hands it what to show (wifi_screen_set()) and drains what it asks for (wifi_screen_take()), as it does STOP: the UI (user interface) never calls into hardware. The enums here mirror the Wi-Fi session's and the installer's, which live in other components; the application maps one to the other in one place.
Pure C, no ESP-IDF (Espressif Internet-of-Things Development Framework).
SPDX-License-Identifier: MIT
| #define WIFI_REQ_AP 0x001u |
What the screen asks for: bits of wifi_screen_take(). start the access point
| #define WIFI_REQ_CODE_OFF 0x080u |
the page asks for no access code
| #define WIFI_REQ_CODE_ON 0x040u |
the page asks for the access code
| #define WIFI_REQ_DISCARD 0x100u |
drop the staged image
| #define WIFI_REQ_FORGET 0x020u |
forget the kept home network
| #define WIFI_REQ_INSTALL 0x200u |
the 2s hold completed
| #define WIFI_REQ_JOIN 0x002u |
join the kept home network
| #define WIFI_REQ_OFF 0x004u |
radio off
| #define WIFI_REQ_SAVE_NET 0x010u |
keep wifi_screen_net()'s network
| #define WIFI_REQ_SCAN 0x008u |
scan for networks
| enum update_state_t |
Where PANEL UPDATE stands.
| enum wifi_gate_t |
Whether flash may be written now (fw_gate_t).
| Enumerator | |
|---|---|
| WIFI_GATE_DRAWING | a board drawing is fetched or kept |
| WIFI_GATE_COPROC | the IOmcu's update runs |
| enum wifi_join_t |
How a join failed (wa_join_err_t).
| enum wifi_offer_t |
What a staged image is to the running one (fw_offer_t).
| Enumerator | |
|---|---|
| WIFI_OFFER_REBUILD | same version, another build |
| WIFI_OFFER_INSTALLED | the build that runs: nothing to install |
| enum wifi_radio_t |
The radio, as the session has it (wa_state_t).
| enum wifi_up_t |
The upload, as the receiver has it (fw_upload_state_t).
| enum wifi_why_t |
| const ui_screen_t * update_screen | ( | void | ) |
The PANEL UPDATE screen, for the router.
| void update_screen_set | ( | const update_view_t * | v | ) |
Hand PANEL UPDATE what to show.
| v | The view, copied. |
| bool update_screen_take_cancel | ( | void | ) |
True once CANCEL was tapped on a download; cleared when read.
| bool update_screen_take_close | ( | void | ) |
True once CLOSE was tapped on a failed write or download; cleared when read.
| const ui_screen_t * wifi_screen | ( | void | ) |
The WI-FI screen, for the router.
| void wifi_screen_invalidate | ( | void | ) |
Repaint on the next frame.
| int wifi_screen_jobs_lines | ( | void | ) |
The lines the card's first sentence takes, WF_JOBS_1 and WF_JOBS_2 joined by a space and wrapped once; for tests.
| gfx_rect_t wifi_screen_key_area | ( | void | ) |
Where the keyboard opens: the body less UI_MARGIN at its sides and top, ending 4px above the alert band, 1008 x 484px.
| void wifi_screen_net | ( | char | ssid[WIFI_SSID_MAX+1], |
| char | pass[WIFI_PASS_MAX+1] ) |
The network WIFI_REQ_SAVE_NET keeps: its name and its password.
| void wifi_screen_set | ( | const wifi_view_t * | v | ) |
Hand the screen what to show.
| void wifi_screen_set_unavailable | ( | void | ) |
Wi-Fi could not be set up at start: show WIFI_WHY_UNAVAILABLE with every control off. Needs no view from the caller, so it holds when the memory for one is what ran out.
| unsigned wifi_screen_take | ( | void | ) |
The requests since the last call, as WIFI_REQ_* bits; cleared.
| const ui_textkey_t * wifi_screen_textkey | ( | void | ) |
The screen's keyboard, open or closed; for tests and the renderer, which check what a tap typed.
| const wifi_view_t * wifi_screen_view | ( | void | ) |
What is showing, for the application and the tests.