OTA Storage Common#
API and Callbacks for the OTA Storage Common Component.
Common code for any storage module implementing an Over-the-Air bootload cluster. It is used by either the Zigbee or legacy Ember Standalone bootloader implementations.
Modules#
API#
A call to check if the OTA Image ID is valid.
Macros#
Defines the minimum header length for the OTA file.
Defines the maximum header length for the OTA file.
Tag Overhead. 2 bytes for the Tag ID and 4 bytes for the length.
Check if the header version is valid.
Check if the header has security credentials present.
Check if the header has an upgrade file destination.
Check if the header has the hardware version present.
Default to using storage slot 0.
API Documentation#
sl_zigbee_af_is_ota_image_id_valid#
bool sl_zigbee_af_is_ota_image_id_valid (const sl_zigbee_af_ota_image_id_t * idToCompare)
A call to check if the OTA Image ID is valid.
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| const sl_zigbee_af_ota_image_id_t * | [in] | idToCompare | a pointer of type: sl_zigbee_af_ota_image_id_t referring to the OTA image ID |
Returns
A ::bool value returning true if the OTA Id is valid
Macro Definition Documentation#
OTA_MINIMUM_HEADER_LENGTH#
#define OTA_MINIMUM_HEADER_LENGTHValue:
(20 + 32 + 4)
Defines the minimum header length for the OTA file.
The total length (in bytes) was calulated from the following fields:
4 bytes: OTA upgrade file identifier
2 bytes: Unsigned 16-bit integer OTA Header version
2 bytes: Unsigned 16-bit integer OTA Header length
2 bytes: Unsigned 16-bit integer OTA Header Field control
2 bytes: Unsigned 16-bit integer Manufacturer code
2 bytes: Unsigned 16-bit integer Image type
4 bytes: Unsigned 32-bit integer File version
2 bytes: Unsigned 16-bit integer ZigBee Stack version
32 bytes: Character string OTA Header string
4 bytes: Unsigned 32-bit integer Total Image size (including header)
OTA_MAXIMUM_HEADER_LENGTH#
#define OTA_MAXIMUM_HEADER_LENGTHValue:
(OTA_MINIMUM_HEADER_LENGTH + 1 + 8 + 4)
Defines the maximum header length for the OTA file.
The total length (in bytes) was calulated from the following fields:
1 byte: Unsigned 8-bit integer Security credential version
8 bytes: IEEE Address Upgrade file destination
2 bytes: Unsigned 16-bit integer Minimum hardware version
2 bytes: Unsigned 16-bit integer
OTA_MAXIMUM_HEADER_LENGTH_2_BYTE_ALIGNED#
#define OTA_MAXIMUM_HEADER_LENGTH_2_BYTE_ALIGNEDValue:
(OTA_MAXIMUM_HEADER_LENGTH + 1)
OTA_MAXIMUM_HEADER_LENGTH_4_BYTE_ALIGNED#
#define OTA_MAXIMUM_HEADER_LENGTH_4_BYTE_ALIGNEDValue:
(OTA_MAXIMUM_HEADER_LENGTH + 3)
TAG_OVERHEAD#
#define TAG_OVERHEADValue:
(2 + 4)
Tag Overhead. 2 bytes for the Tag ID and 4 bytes for the length.
isValidHeaderVersion#
#define isValidHeaderVersionValue:
(headerVersion)
Check if the header version is valid.
SECURITY_CREDENTIAL_VERSION_FIELD_PRESENT_MASK#
#define SECURITY_CREDENTIAL_VERSION_FIELD_PRESENT_MASKValue:
0x0001
headerHasSecurityCredentials#
#define headerHasSecurityCredentialsValue:
(header)
Check if the header has security credentials present.
headerHasUpgradeFileDest#
#define headerHasUpgradeFileDestValue:
(header)
Check if the header has an upgrade file destination.
headerHasHardwareVersions#
#define headerHasHardwareVersionsValue:
(header)
Check if the header has the hardware version present.
SIGNATURE_TAG_DATA_SIZE#
#define SIGNATURE_TAG_DATA_SIZEValue:
(EUI64_SIZE + SL_ZIGBEE_SIGNATURE_SIZE)
SIGNATURE_283K1_TAG_DATA_SIZE#
#define SIGNATURE_283K1_TAG_DATA_SIZEValue:
(EUI64_SIZE + SL_ZIGBEE_SIGNATURE_283K1_SIZE)
INVALID_OTA_IMAGE_ID#
#define INVALID_OTA_IMAGE_IDValue: