Appearance
Per-HW firmware-update tracking
Hooks libcoldwave into the coldwave-os OTA target callbacks so it can publish per-slot FU-state on the device service. Slot 0 is always libcoldwave's own SW-OTA — slots 1..(COLDWAVE_HW_SLOTS_MAX-1) are subprocessor targets that the integrator wires up. If libcoldwave is not registered for a slot, the application is free to call ota_register_target_handler itself for that slot.
Types
| Name | |
|---|---|
| struct | cw_hw_ota_target_t |
| typedef int(*)(void *ctx) | cw_hw_ota_begin_t |
| typedef int(*)(void *ctx, const uint8_t *data, size_t size) | cw_hw_ota_append_t |
| typedef int(*)(void *ctx) | cw_hw_ota_finalize_t |
| typedef int(*)(void *ctx) | cw_hw_ota_abort_t |
Functions Overview
| Name | |
|---|---|
| int | coldwave_register_hw_ota_target(const cw_hw_ota_target_t * t) |
Types Documentation
typedef cw_hw_ota_begin_t
cpp
typedef int(* cw_hw_ota_begin_t) (void *ctx);Append callback signature mirrors ota_append_t from <ota/ota.h> but is kept stand-alone here to avoid leaking the ota.h types into coldwave.h.
typedef cw_hw_ota_append_t
cpp
typedef int(* cw_hw_ota_append_t) (void *ctx, const uint8_t *data, size_t size);typedef cw_hw_ota_finalize_t
cpp
typedef int(* cw_hw_ota_finalize_t) (void *ctx);typedef cw_hw_ota_abort_t
cpp
typedef int(* cw_hw_ota_abort_t) (void *ctx);Function Details
function coldwave_register_hw_ota_target
cpp
int coldwave_register_hw_ota_target(
const cw_hw_ota_target_t * t
)Return: CW_OK on success, CW_ERR_INVALID_ARG for bad slot/target, CW_ERR_NOT_INITIALIZED if libcoldwave is not yet initialized.
Registers a wrapping target handler with the OS so libcoldwave observes state transitions (DOWNLOADING/INSTALLING/SUCCESS/FAILED) for the given slot. The integrator's callbacks in t are invoked verbatim — libcoldwave only sniffs the lifecycle around them. Calling this for slot 0 is rejected with CW_ERR_INVALID_ARG.