|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Receiving an image. See fw_upload.h. More...
Functions | |
| void | fw_upload_init (fw_upload_t *u, uint8_t *buf, uint32_t cap, uint32_t slot) |
An upload into buf of cap bytes, for a slot of slot bytes: IDLE. | |
| fw_err_t | fw_upload_begin (fw_upload_t *u, uint32_t bytes) |
A source announces bytes. | |
| static fw_err_t | refuse (fw_upload_t *u, fw_err_t e) |
FAILED with e. | |
| fw_err_t | fw_upload_add (fw_upload_t *u, const uint8_t *data, uint32_t len) |
len more bytes. | |
| fw_err_t | fw_upload_seal (fw_upload_t *u, bool whole) |
The first half of fw_upload_end(), for a check run without the caller's lock: the bytes are whole and wait for fw_image_check() over buf and bytes. | |
| fw_err_t | fw_upload_checked (fw_upload_t *u, fw_err_t e, const fw_image_info_t *info) |
| The second half: the answer of the check over a sealed upload. | |
| fw_err_t | fw_upload_end (fw_upload_t *u, bool whole) |
| The source is done; the image is checked at once. | |
| bool | fw_upload_busy (const fw_upload_t *u) |
| Whether the buffer is in use: bytes arriving, or a check under way. A caller frees the buffer of an upload that is neither this nor STAGED. | |
| void | fw_upload_discard (fw_upload_t *u) |
| Drop what is received or staged: IDLE. During a check, IDLE once fw_upload_checked() has its answer. | |
| unsigned | fw_upload_percent (const fw_upload_t *u) |
| Received of announced. | |
Receiving an image. See fw_upload.h.
SPDX-License-Identifier: MIT
| fw_err_t fw_upload_add | ( | fw_upload_t * | u, |
| const uint8_t * | data, | ||
| uint32_t | len ) |
len more bytes.
| u | the upload |
| data | the bytes |
| len | how many |
| fw_err_t fw_upload_begin | ( | fw_upload_t * | u, |
| uint32_t | bytes ) |
A source announces bytes.
| u | the upload |
| bytes | the image's bytes |
| bool fw_upload_busy | ( | const fw_upload_t * | u | ) |
Whether the buffer is in use: bytes arriving, or a check under way. A caller frees the buffer of an upload that is neither this nor STAGED.
| u | the upload |
| fw_err_t fw_upload_checked | ( | fw_upload_t * | u, |
| fw_err_t | e, | ||
| const fw_image_info_t * | info ) |
The second half: the answer of the check over a sealed upload.
| u | the upload |
| e | what fw_image_check() returned |
| info | what it filled in |
e; FW_ERR_BUSY and IDLE when the upload was discarded during the check, or was not sealed | void fw_upload_discard | ( | fw_upload_t * | u | ) |
Drop what is received or staged: IDLE. During a check, IDLE once fw_upload_checked() has its answer.
| u | the upload |
| fw_err_t fw_upload_end | ( | fw_upload_t * | u, |
| bool | whole ) |
The source is done; the image is checked at once.
| u | the upload |
| whole | false when the source broke off |
| void fw_upload_init | ( | fw_upload_t * | u, |
| uint8_t * | buf, | ||
| uint32_t | cap, | ||
| uint32_t | slot ) |
An upload into buf of cap bytes, for a slot of slot bytes: IDLE.
| u | the upload |
| buf | the buffer, or NULL |
| cap | its bytes |
| slot | the slot's bytes |
| unsigned fw_upload_percent | ( | const fw_upload_t * | u | ) |
Received of announced.
| u | the upload |
| fw_err_t fw_upload_seal | ( | fw_upload_t * | u, |
| bool | whole ) |
The first half of fw_upload_end(), for a check run without the caller's lock: the bytes are whole and wait for fw_image_check() over buf and bytes.
Between this and fw_upload_checked() the state stays RECEIVING and fw_upload_busy() is true, a fw_upload_discard() included: the buffer is the check's, and no caller frees it.
| u | the upload |
| whole | false when the source broke off |
checking set; otherwise what fw_upload_end() returns for the same call, with the same state
|
static |
FAILED with e.
| u | the upload |
| e | the reason |
e