52#ifndef RCBENCH_WA_FETCH_H
53#define RCBENCH_WA_FETCH_H
69#define WA_FETCH_CHECK_MS 30000u
71#define WA_FETCH_JOIN_MS 30000u
73#define WA_FETCH_DOWNLOAD_MS 180000u
76#define WA_FETCH_OP_MS 10000u
266void wa_fetch_on_bytes(
wa_fetch_t *f, uint32_t gen, uint32_t done,
296 bool (*
open)(
void *ctx,
const char *url, uint32_t timeout_ms,
302 int32_t (*
read)(
void *ctx, uint8_t *dst, uint32_t n,
303 uint32_t timeout_ms);
304 void (*close)(
void *ctx);
310 uint32_t (*now)(
void *ctx);
318 uint8_t *(*alloc)(
void *ctx, uint32_t bytes);
The panel's application image, read from memory: what it is, whether it is whole, and whether it is o...
fw_err_t
Definition fw_image.h:61
What GitHub says about the panel's releases, read strictly.
fw_rel_err_t
Definition fw_release.h:140
Receiving a panel image into memory, as a source hands it over.
An upload into a buffer the caller owns.
Definition fw_upload.h:47
Definition wa_fetch.h:254
Definition wa_fetch.h:145
wa_channel_t channel
Definition wa_fetch.h:147
fw_err_t img
Definition wa_fetch.h:153
fw_version_t found
Definition wa_fetch.h:158
uint32_t done
Definition wa_fetch.h:161
bool owe_off
Definition wa_fetch.h:164
bool owe_run
Definition wa_fetch.h:165
uint32_t budget_ms
Definition wa_fetch.h:163
fw_rel_err_t rel
Definition wa_fetch.h:152
wa_why_t why
Definition wa_fetch.h:150
wa_join_err_t join
Definition wa_fetch.h:151
uint32_t gen
Definition wa_fetch.h:155
int status
Definition wa_fetch.h:154
uint32_t total
Definition wa_fetch.h:162
Definition wa_fetch.h:279
int64_t length
Definition wa_fetch.h:281
int status
Definition wa_fetch.h:280
size_t loc_n
Definition wa_fetch.h:283
bool chunked
Definition wa_fetch.h:282
bool loc_cut
Definition wa_fetch.h:284
Definition wa_fetch.h:288
int32_t(*) read(void *ctx, uint8_t *dst, uint32_t n, uint32_t timeout_ms)
Definition wa_fetch.h:302
bool(*) open(void *ctx, const char *url, uint32_t timeout_ms, bool api, wa_http_head_t *head, char *loc, size_t loc_cap)
Definition wa_fetch.h:296
Definition wa_fetch.h:308
bool(*) stopped(void *ctx)
Definition wa_fetch.h:312
uint32_t slot
Definition wa_fetch.h:323
fw_upload_t * up
Definition wa_fetch.h:334
char * url
Definition wa_fetch.h:329
uint8_t * io
Definition wa_fetch.h:331
bool running_ok
Definition wa_fetch.h:325
uint32_t start_ms
Definition wa_fetch.h:321
wa_channel_t channel
Definition wa_fetch.h:326
void(*) report(void *ctx, wa_phase_t ph, uint32_t done, uint32_t total)
Definition wa_fetch.h:314
char * sums
Definition wa_fetch.h:333
uint32_t budget_ms
Definition wa_fetch.h:322
char * loc
Definition wa_fetch.h:330
A session: what the radio should do, and where it is.
Definition wa_session.h:394
wa_channel_t
Definition wa_fetch.h:84
@ WA_CH_STABLE
Definition wa_fetch.h:85
@ WA_CH_TESTING
Definition wa_fetch.h:86
void wa_fetch_tick(wa_fetch_t *f, uint32_t now_ms, wa_why_t abort, const wa_t *w)
Definition wa_fetch.c:159
void wa_run_check(const wa_run_t *r, wa_fetch_res_t *out)
Definition wa_fetch.c:563
wa_why_t
Definition wa_fetch.h:130
@ WA_WHY_FILES
Definition wa_fetch.h:136
@ WA_WHY_DRAWING
Definition wa_fetch.h:141
@ WA_WHY_COPROC
Definition wa_fetch.h:137
@ WA_WHY_RUN
Definition wa_fetch.h:134
@ WA_WHY_BUSY
Definition wa_fetch.h:140
@ WA_WHY_ARMED
Definition wa_fetch.h:132
@ WA_WHY_SUPPLY
Definition wa_fetch.h:133
@ WA_WHY_INSTALL
Definition wa_fetch.h:138
@ WA_WHY_CANCEL
Definition wa_fetch.h:139
bool wa_fetch_offers(const wa_fetch_t *f, wa_channel_t now)
Definition wa_fetch.c:61
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)
Definition wa_fetch.c:88
void wa_run_download(const wa_run_t *r, fw_version_t v, wa_fetch_res_t *out)
Definition wa_fetch.c:679
bool wa_fetch_has_found(const wa_fetch_t *f)
Whether the last job names a release in wa_fetch_t.found.
Definition wa_fetch.c:236
bool wa_fetch_stale(const wa_fetch_t *f, wa_channel_t now)
Definition wa_fetch.c:55
bool wa_fetch_busy(const wa_fetch_t *f)
Definition wa_fetch.c:50
bool wa_fetch_take_off(wa_fetch_t *f)
Definition wa_fetch.c:190
wa_got_t
Definition wa_fetch.h:100
@ WA_GOT_RADIO
Definition wa_fetch.h:109
@ WA_GOT_STAGED
Definition wa_fetch.h:104
@ WA_GOT_UNVERSIONED
Definition wa_fetch.h:121
@ WA_GOT_TIMEOUT
Definition wa_fetch.h:110
@ WA_GOT_NO_NET
Definition wa_fetch.h:105
@ WA_GOT_NEWER
Definition wa_fetch.h:102
@ WA_GOT_SUMS
Definition wa_fetch.h:114
@ WA_GOT_CURRENT
Definition wa_fetch.h:103
@ WA_GOT_BLOCKED
Definition wa_fetch.h:106
@ WA_GOT_MEMORY
Definition wa_fetch.h:118
@ WA_GOT_UNEXPECTED
Definition wa_fetch.h:113
@ WA_GOT_PAST_LINE
Definition wa_fetch.h:123
@ WA_GOT_IMAGE
Definition wa_fetch.h:117
@ WA_GOT_HASH
Definition wa_fetch.h:116
@ WA_GOT_CONNECT
Definition wa_fetch.h:111
@ WA_GOT_ABORTED
Definition wa_fetch.h:107
@ WA_GOT_JOIN
Definition wa_fetch.h:108
@ WA_GOT_REFUSED
Definition wa_fetch.h:112
@ WA_GOT_LIMIT
Definition wa_fetch.h:119
@ WA_GOT_NONE
Definition wa_fetch.h:101
wa_phase_t
Definition wa_fetch.h:89
@ WA_PH_ASKING
Definition wa_fetch.h:92
@ WA_PH_ENDED
Definition wa_fetch.h:96
@ WA_PH_CHECKING
Definition wa_fetch.h:95
@ WA_PH_SUMS
Definition wa_fetch.h:93
@ WA_PH_JOINING
Definition wa_fetch.h:91
@ WA_PH_IMAGE
Definition wa_fetch.h:94
@ WA_PH_IDLE
Definition wa_fetch.h:90
uint32_t wa_fetch_left(const wa_fetch_t *f, uint32_t now_ms)
Definition wa_fetch.c:120
void wa_fetch_init(wa_fetch_t *f, fw_version_t running)
Definition wa_fetch.c:17
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.
Definition wa_fetch.c:41
void wa_fetch_abort(wa_fetch_t *f, wa_why_t why)
Definition wa_fetch.c:130
wa_why_t wa_fetch_gate(bool armed, bool supply, bool run, bool coproc, bool installing)
Definition wa_fetch.c:23
bool wa_fetch_take_run(wa_fetch_t *f)
Definition wa_fetch.c:197
Wi-Fi access: when the panel's radio runs, under which name, and who the page answers.
wa_join_err_t
Why a join failed.
Definition wa_session.h:385