Functions required for implementing the component update feature. More...
Go to the source code of this file.
Data Structures | |
| struct | fota_component_desc_info_t |
Typedefs | |
| typedef int(* | fota_component_curr_fw_read) (uint8_t *buf, size_t offset, size_t size, size_t *num_read) |
| typedef int(* | fota_component_curr_fw_get_digest) (uint8_t *buf) |
| typedef int(* | fota_component_verify_install_handler_t) (const char *comp_name, const fota_header_info_t *expected_header_info) |
Functions | |
| int | fota_component_add (const fota_component_desc_info_t *comp_desc, const char *comp_name, const char *comp_semver) |
| int | fota_component_version_int_to_semver (fota_component_version_t version, char *sem_ver) |
Functions required for implementing the component update feature.
| typedef int(* fota_component_curr_fw_get_digest) (uint8_t *buf) |
A callback function to get the current firmware digest. Required only if delta update is supported for this component.
| [out] | buf | A buffer with the current firmware digest. Make sure the size of the buffer is sufficient to hold the digest. |
| typedef int(* fota_component_curr_fw_read) (uint8_t *buf, size_t offset, size_t size, size_t *num_read) |
A callback function to read the current firmware. Required only if delta update is supported for this component.
| [out] | buf | Buffer with data about the current firmware. |
| [in] | offset | Offset from which to read. |
| [in] | size | Output buffer size. |
| [in] | num_read | Actual size read. |
| typedef int(* fota_component_verify_install_handler_t) (const char *comp_name, const fota_header_info_t *expected_header_info) |
A callback function to verify component installation success. Executed after component installation.
| [in] | component_name | Name of the installed component. The same name that was specified as an argument to fota_component_add(). |
| [in] | expected_header_info | Header with expected values for installed components. |
| int fota_component_add | ( | const fota_component_desc_info_t * | comp_desc, |
| const char * | comp_name, | ||
| const char * | comp_semver | ||
| ) |
Component registration. Adds the component to the component database. The function should be called from the ::fota_platform_init_hook() function. The component description should reside in the stack to prevent unnecessary allocations and memory copies.
| [in] | comp_desc | Component description with required information. |
| [in] | comp_name | A string value representing the component name to add. Maximum length is ::FOTA_COMPONENT_MAX_NAME_SIZE including NULL termination. Must not start with "%". |
| [in] | comp_semver | A string value representing the Semantic Version of the component firmware installed at the factory. |
| int fota_component_version_int_to_semver | ( | fota_component_version_t | version, |
| char * | sem_ver | ||
| ) |
Convert internal FOTA library semantic version representation to a human-readable string.
The version in the internal FOTA library representation passed to fota_app_on_download_authorization() and candidate callback APIs.
| [in] | version | Internal version representation. Component description with required information. |
| [in] | sem_ver |