71#ifndef RCBENCH_FW_RELEASE_H
72#define RCBENCH_FW_RELEASE_H
84#define FW_REL_REPO "subtilitas/rcbench"
85#define FW_REL_LATEST_URL "https://github.com/" FW_REL_REPO "/releases/latest"
86#define FW_REL_TAG_PREFIX "https://github.com/" FW_REL_REPO "/releases/tag/"
87#define FW_REL_DL_PREFIX "https://github.com/" FW_REL_REPO "/releases/download/"
88#define FW_REL_SUMS_NAME "SHA256SUMS"
90#define FW_REL_API_URL "https://api.github.com/repos/" FW_REL_REPO \
91 "/releases?per_page=10"
93#define FW_REL_API_ACCEPT "application/vnd.github+json"
94#define FW_REL_API_VERSION "2022-11-28"
102#define FW_REL_LINE_MAJOR 0u
103#define FW_REL_LINE_MINOR 22u
111#ifndef FW_REL_LINE_CAPPED
112#define FW_REL_LINE_CAPPED 0
116#define FW_REL_TAG_MAX 18u
118#define FW_REL_VER_TEXT 18u
120#define FW_REL_NAME_MAX 40u
122#define FW_REL_URL_MAX 2048u
124#define FW_REL_HOPS_MAX 3u
126#define FW_REL_SUMS_MAX 4096u
128#define FW_REL_API_RELEASES 10u
132#define FW_REL_API_MAX 262144u
135#define FW_REL_SCAN_MAX FW_REL_API_MAX
137#define FW_REL_SCAN_DEPTH 32u
221 uint8_t out[FW_SHA256_BYTES]);
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
The panel's application image, read from memory: what it is, whether it is whole, and whether it is o...
bool fw_release_scan_line(const fw_rel_scan_t *s, fw_version_t *out)
The highest no-draft release of the panel's release line among those the scan read.
Definition fw_release.c:707
bool fw_release_parse_version(const char *s, size_t n, fw_version_t *out)
Definition fw_release.c:60
bool fw_release_url(fw_version_t v, const char *file, char *out, size_t cap)
Definition fw_release.c:756
const char * fw_rel_err_str(fw_rel_err_t e)
Definition fw_release.c:20
bool fw_release_offered(fw_version_t found, fw_version_t running, bool running_ok)
Whether a release is offered to the panel.
Definition fw_release.c:737
fw_rel_err_t fw_release_length(int64_t length, bool chunked, uint32_t cap)
Definition fw_release.c:178
fw_rel_err_t fw_release_redirect(const char *loc, size_t n, bool cut, unsigned hops)
Definition fw_release.c:142
bool fw_release_in_line(fw_version_t v)
Whether a version is of the panel's release line.
Definition fw_release.c:731
void fw_release_image_name(fw_version_t v, char out[FW_REL_NAME_MAX])
The file name of a release's panel image.
Definition fw_release.c:750
fw_rel_err_t fw_release_parse_sums(const char *text, size_t n, const char *name, uint8_t out[FW_SHA256_BYTES])
Definition fw_release.c:206
bool fw_release_scan_feed(fw_rel_scan_t *s, const uint8_t *d, size_t n)
Definition fw_release.c:677
void fw_release_set_line_capped(bool capped)
Caps the panel's release line at FW_REL_LINE_MAJOR.FW_REL_LINE_MINOR, or lifts the cap....
Definition fw_release.c:726
void fw_release_version_text(fw_version_t v, char out[FW_REL_VER_TEXT])
Definition fw_release.c:744
bool fw_release_line_capped(void)
Whether the panel's release line is capped at FW_REL_LINE_MAJOR.FW_REL_LINE_MINOR.
Definition fw_release.c:721
fw_rel_err_t fw_release_scan_end(const fw_rel_scan_t *s, fw_version_t *out)
Definition fw_release.c:696
const char *const FW_REL_HOSTS[]
Definition fw_release.c:13
fw_rel_err_t fw_release_parse_tag(const char *loc, size_t n, bool cut, fw_version_t *out)
Definition fw_release.c:99
#define FW_REL_TAG_MAX
The longest tag, "v65535.65535.65535", in bytes.
Definition fw_release.h:116
#define FW_REL_VER_TEXT
The longest version text, "65535.65535.65535", with its terminator.
Definition fw_release.h:118
#define FW_REL_NAME_MAX
The longest asset name, "rcbench-panel-p4-v65535.65535.65535.bin", with its terminator.
Definition fw_release.h:120
fw_rel_status_t
Definition fw_release.h:188
@ FW_REL_BODY
Definition fw_release.h:189
@ FW_REL_REFUSED
Definition fw_release.h:191
@ FW_REL_REDIRECT
Definition fw_release.h:190
fw_rel_err_t
Definition fw_release.h:140
@ FW_REL_NO_LENGTH
Definition fw_release.h:150
@ FW_REL_EMPTY
Definition fw_release.h:152
@ FW_REL_SUMS_NONE
Definition fw_release.h:158
@ FW_REL_SHORT
Definition fw_release.h:155
@ FW_REL_SUMS_BAD
Definition fw_release.h:157
@ FW_REL_PLACE
Definition fw_release.h:145
@ FW_REL_HOPS
Definition fw_release.h:148
@ FW_REL_OVERRUN
Definition fw_release.h:156
@ FW_REL_MISSING
Definition fw_release.h:142
@ FW_REL_HOST
Definition fw_release.h:149
@ FW_REL_TOO_BIG
Definition fw_release.h:154
@ FW_REL_SUMS_TWICE
Definition fw_release.h:159
@ FW_REL_STATUS
Definition fw_release.h:147
@ FW_REL_TAG_LONG
Definition fw_release.h:162
@ FW_REL_SCAN_LONG
Definition fw_release.h:165
@ FW_REL_LONG
Definition fw_release.h:143
@ FW_REL_VERSION
Definition fw_release.h:146
@ FW_REL_TAG_FORM
Definition fw_release.h:163
@ FW_REL_CHAR
Definition fw_release.h:144
@ FW_REL_TAG_NONE
Definition fw_release.h:160
The scan of the API's answer for the highest release.
Definition fw_release.h:230
uint8_t kn
Definition fw_release.h:236
bool ended
Definition fw_release.h:239
uint8_t st
Definition fw_release.h:234
char dval[5]
Definition fw_release.h:243
fw_version_t cur
Definition fw_release.h:249
bool have_draft
Definition fw_release.h:245
bool draft
Definition fw_release.h:246
bool have_line
Definition fw_release.h:251
uint8_t releases
Definition fw_release.h:248
uint32_t seen
Definition fw_release.h:231
char key[8]
Definition fw_release.h:237
uint32_t arrays
Definition fw_release.h:232
fw_version_t best
Definition fw_release.h:250
bool have_tag
Definition fw_release.h:244
fw_version_t found
Definition fw_release.h:254
fw_rel_err_t err
Definition fw_release.h:253
uint8_t want
Definition fw_release.h:235
uint8_t depth
Definition fw_release.h:233
uint8_t dn
Definition fw_release.h:242
uint8_t tn
Definition fw_release.h:240
char tag[FW_REL_TAG_MAX]
Definition fw_release.h:241
bool have_best
Definition fw_release.h:247
fw_version_t line
Definition fw_release.h:252
bool klong
Definition fw_release.h:238