Stabelized OTA Update with Retries
This commit is contained in:
+10
-2
@@ -28,6 +28,8 @@ typedef enum {
|
||||
typedef enum {
|
||||
OTA_FEED_OK = 0,
|
||||
OTA_FEED_BLOCK_WRITTEN,
|
||||
OTA_FEED_SEQ_DUP,
|
||||
OTA_FEED_SEQ_GAP,
|
||||
OTA_FEED_ERROR,
|
||||
} ota_feed_result_t;
|
||||
|
||||
@@ -41,8 +43,14 @@ int ota_uart_prepare(uint32_t total_size);
|
||||
|
||||
void ota_uart_abort(void);
|
||||
|
||||
/** Append up to 200 bytes; flushes 4 KiB blocks to flash when full. */
|
||||
ota_feed_result_t ota_uart_feed(const uint8_t *data, size_t len);
|
||||
/**
|
||||
* Append up to 200 bytes with strict seq checking (0, 1, 2, …).
|
||||
* Duplicates (seq < expected) return OTA_FEED_SEQ_DUP; gaps return OTA_FEED_SEQ_GAP.
|
||||
*/
|
||||
ota_feed_result_t ota_uart_feed_chunk(uint32_t seq, const uint8_t *data, size_t len);
|
||||
|
||||
/** True when a full 4 KiB block is in flash (used to re-ACK host block retries). */
|
||||
bool ota_uart_block_ready_for_reack(void);
|
||||
|
||||
uint32_t ota_uart_bytes_written(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user