|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
wa_fetch.h says what the jobs do; fw_release.h how strictly answers are read. More...
Data Structures | |
| struct | sink_t |
| struct | sums_t |
Functions | |
| void | wa_fetch_init (wa_fetch_t *f, fw_version_t running) |
| wa_why_t | wa_fetch_gate (bool armed, bool supply, bool run, bool coproc, bool installing) |
| wa_why_t | wa_fetch_start_gate (wa_why_t gate, bool taken, bool task_alive, bool other) |
| The gate a job's start takes, past the bench's own. | |
| bool | wa_fetch_busy (const wa_fetch_t *f) |
| bool | wa_fetch_stale (const wa_fetch_t *f, wa_channel_t now) |
| bool | wa_fetch_offers (const wa_fetch_t *f, wa_channel_t now) |
| static uint32_t | budget (const wa_fetch_t *f) |
| static void | end (wa_fetch_t *f, wa_got_t got, wa_why_t why) |
| wa_got_t | wa_fetch_start (wa_fetch_t *f, wa_job_t job, fw_version_t want, wa_channel_t ch, bool have_net, wa_why_t gate, uint32_t now_ms) |
| uint32_t | wa_fetch_left (const wa_fetch_t *f, uint32_t now_ms) |
| void | wa_fetch_abort (wa_fetch_t *f, wa_why_t why) |
| static void | session_off (wa_fetch_t *f, const wa_t *w) |
| void | wa_fetch_tick (wa_fetch_t *f, uint32_t now_ms, wa_why_t abort, const wa_t *w) |
| bool | wa_fetch_take_off (wa_fetch_t *f) |
| bool | wa_fetch_take_run (wa_fetch_t *f) |
| static bool | mine (const wa_fetch_t *f, uint32_t gen) |
| void | wa_fetch_on_phase (wa_fetch_t *f, uint32_t gen, wa_phase_t ph) |
| void | wa_fetch_on_bytes (wa_fetch_t *f, uint32_t gen, uint32_t done, uint32_t total) |
| static bool | got_found (wa_got_t got) |
| Whether a CHECK's result names the release it found. | |
| bool | wa_fetch_has_found (const wa_fetch_t *f) |
| Whether the last job names a release in wa_fetch_t.found. | |
| void | wa_fetch_on_end (wa_fetch_t *f, uint32_t gen, const wa_fetch_res_t *r) |
| static uint32_t | run_left (const wa_run_t *r) |
| static uint32_t | op_ms (uint32_t left) |
| static void | report (const wa_run_t *r, wa_phase_t ph, uint32_t done, uint32_t total) |
| static void | res (wa_fetch_res_t *out, wa_got_t got, fw_rel_err_t rel) |
| static void | failed (const wa_run_t *r, wa_fetch_res_t *out, wa_got_t got, fw_rel_err_t rel) |
| static bool | fetch (const wa_run_t *r, const sink_t *k, wa_fetch_res_t *out) |
| static void | found (const wa_run_t *r, wa_fetch_res_t *out, fw_version_t v) |
The result of a check that found release v, offered or not. | |
| static bool | api_scan (const wa_run_t *r, uint32_t left, wa_fetch_res_t *out, fw_version_t *v, bool *have_line, fw_version_t *line) |
| One request of FW_REL_API_URL, its answer read a piece at a time into the scan until it ends. | |
| static void | check_api (const wa_run_t *r, uint32_t left, wa_fetch_res_t *out) |
| TESTING: the 10 newest releases by date, their highest offered, or in its place the highest of the panel's release line when that one is offered. | |
| void | wa_run_check (const wa_run_t *r, wa_fetch_res_t *out) |
| static bool | sums_begin (const wa_run_t *r, void *ctx, uint32_t bytes, wa_fetch_res_t *out) |
| static void | sums_add (const wa_run_t *r, void *ctx, const uint8_t *d, uint32_t n, uint32_t done, uint32_t total) |
| static bool | image_begin (const wa_run_t *r, void *ctx, uint32_t bytes, wa_fetch_res_t *out) |
| static void | image_add (const wa_run_t *r, void *ctx, const uint8_t *d, uint32_t n, uint32_t done, uint32_t total) |
| void | wa_run_download (const wa_run_t *r, fw_version_t v, wa_fetch_res_t *out) |
wa_fetch.h says what the jobs do; fw_release.h how strictly answers are read.
SPDX-License-Identifier: MIT
|
static |
One request of FW_REL_API_URL, its answer read a piece at a time into the scan until it ends.
The bytes after the 10th release are not read: the connection closes. A chunked answer has no length to hold it to: it is read until the scan ends, its last chunk, or FW_REL_SCAN_MAX bytes.
| r | the run |
| left | ms of the budget left |
| out | why it failed, on false |
| v | the highest no-draft release, on true |
| have_line | set on true: a no-draft release of the line was read |
| line | the highest of them, when have_line |
|
static |
TESTING: the 10 newest releases by date, their highest offered, or in its place the highest of the panel's release line when that one is offered.
| r | the run |
| left | ms of the budget left |
| out | the result |
|
static |
The result of a check that found release v, offered or not.
One of the panel's release line newer than the running build is NEWER; a newer one past the line is PAST_LINE; an older or equal one is CURRENT; any with a running version that did not parse is UNVERSIONED.
| r | the run: the running version |
| out | the result, with v as its found |
| v | the release the check found |
|
static |
Whether a CHECK's result names the release it found.
| got | the result |
| void wa_fetch_abort | ( | wa_fetch_t * | f, |
| wa_why_t | why ) |
End the job now for why; nothing when none runs.
| bool wa_fetch_busy | ( | const wa_fetch_t * | f | ) |
Whether a job runs: joining to checking.
| wa_why_t wa_fetch_gate | ( | bool | armed, |
| bool | supply, | ||
| bool | run, | ||
| bool | coproc, | ||
| bool | installing ) |
The gate as wa_gate() takes it, plus the panel's own two.
| bool wa_fetch_has_found | ( | const wa_fetch_t * | f | ) |
Whether the last job names a release in wa_fetch_t.found.
| f | the job; NULL reads as none |
| void wa_fetch_init | ( | wa_fetch_t * | f, |
| fw_version_t | running ) |
No job; running is the build that runs.
| uint32_t wa_fetch_left | ( | const wa_fetch_t * | f, |
| uint32_t | now_ms ) |
ms of the budget left at now_ms for the phase under way; 0 when it is spent or no job runs.
| bool wa_fetch_offers | ( | const wa_fetch_t * | f, |
| wa_channel_t | now ) |
Whether the last job is a CHECK that found a release to offer on channel now: ended NEWER, and run on now. A check on the other channel offers nothing: RELEASES changed after it.
| bool wa_fetch_stale | ( | const wa_fetch_t * | f, |
| wa_channel_t | now ) |
Whether the last job is a CHECK that ended on another channel than now: its result is not shown, as if no check had run.
| wa_got_t wa_fetch_start | ( | wa_fetch_t * | f, |
| wa_job_t | job, | ||
| fw_version_t | want, | ||
| wa_channel_t | ch, | ||
| bool | have_net, | ||
| wa_why_t | gate, | ||
| uint32_t | now_ms ) |
Start job at now_ms for release want (DOWNLOAD; ignored by CHECK) on channel ch (CHECK; kept by DOWNLOAD too). WA_GOT_NONE and JOINING: the platform starts the radio in WA_MODE_FETCH. Otherwise the job has ended at once: NO_NET without have_net, BLOCKED for gate or for a job already running (why).
The gate a job's start takes, past the bench's own.
The radio goes off without waiting for the last job's task: a name lookup under way when the radio goes ends only when lwIP gives up on it, up to about 7s per DNS (Domain Name System) server. Until that task has ended no job starts, so it never runs beside the next job's; a session (WI-FI) starts without waiting for it.
| gate | the bench's gate (wa_fetch_gate()), or WA_WHY_NONE |
| taken | an image is taken for the install |
| task_alive | the last job's task has not ended |
| other | a session other than WA_MODE_FETCH asks for the radio |
gate when it is set; WA_WHY_BUSY for any of the other three; WA_WHY_NONE otherwise | bool wa_fetch_take_off | ( | wa_fetch_t * | f | ) |
True once after the job ended: the radio goes off.
| bool wa_fetch_take_run | ( | wa_fetch_t * | f | ) |
True once after the join: the runner starts.
| void wa_fetch_tick | ( | wa_fetch_t * | f, |
| uint32_t | now_ms, | ||
| wa_why_t | abort, | ||
| const wa_t * | w ) |
Once a frame, after wa_tick(): abort as the UI loop sees it now (WA_WHY_NONE for none), w the session. Ends the job for an abort, for the session going off under it and for the budget; moves JOINING on once the session has its address. The platform reads owe_off and owe_run after it.
| void wa_run_check | ( | const wa_run_t * | r, |
| wa_fetch_res_t * | out ) |
CHECK, from the join on. NEWER, CURRENT, UNVERSIONED, or why not.
| void wa_run_download | ( | const wa_run_t * | r, |
| fw_version_t | v, | ||
| wa_fetch_res_t * | out ) |
DOWNLOAD of release v, from the join on. STAGED with the image in r->up, or why not with r->up not staged.