Functions

bool emberZclOtaBootloadIsWildcard (uint8_t *bytes, size_t size)
void emberZclOtaBootloadInitFileHeaderInfo ( EmberZclOtaBootloadFileHeaderInfo_t *headerInfo)
bool emberZclOtaBootloadFileSpecsAreEqual (const EmberZclOtaBootloadFileSpec_t *s1, const EmberZclOtaBootloadFileSpec_t *s2)
size_t emberZclOtaBootloadFetchFileSpec (const uint8_t *data, EmberZclOtaBootloadFileSpec_t *fileSpec)
size_t emberZclOtaBootloadStoreFileSpec (const EmberZclOtaBootloadFileSpec_t *fileSpec, uint8_t *data)
EmberZclOtaBootloadFileStatus_t emberZclOtaBootloadFetchFileHeaderInfo (const uint8_t *data, EmberZclOtaBootloadFileHeaderInfo_t *fileHeaderInfo)
EmberZclOtaBootloadFileStatus_t emberZclOtaBootloadStoreFileHeaderInfo (uint8_t *data, EmberZclOtaBootloadFileHeaderInfo_t *fileHeaderInfo, size_t imageDataSize)
void emberZclOtaBootloadStorageGetInfo ( EmberZclOtaBootloadStorageInfo_t *info, EmberZclOtaBootloadFileSpec_t *returnedFiles, size_t returnedFilesMaxCount)
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageFind (const EmberZclOtaBootloadFileSpec_t *fileSpec, EmberZclOtaBootloadStorageFileInfo_t *fileInfo)
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageCreate (const EmberZclOtaBootloadFileSpec_t *fileSpec)
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageRead (const EmberZclOtaBootloadFileSpec_t *fileSpec, size_t offset, void *data, size_t dataLength)
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageWrite (const EmberZclOtaBootloadFileSpec_t *fileSpec, size_t offset, const void *data, size_t dataLength)
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageDelete (const EmberZclOtaBootloadFileSpec_t *fileSpec, EmberZclOtaBootloadStorageDeleteCallback callback)

Detailed Description

See OTA Bootload Client Callbacks for the application callbacks associated with the OTA Bootload Client plugin.

Function Documentation

EmberZclOtaBootloadFileStatus_t emberZclOtaBootloadFetchFileHeaderInfo ( const uint8_t * data,
EmberZclOtaBootloadFileHeaderInfo_t * fileHeaderInfo
)

This function reads an EmberZclOtaBootloadFileHeaderInfo_t from a flat buffer (little-endian).

Parameters
data Flat buffer from which to read a file header info structure
fileHeaderInfo File header info struct to be populated from a flat buffer
Returns
An EmberZclOtaBootloadFileStatus_t value describing if the data is a valid or invalid dotdot OTA data.
size_t emberZclOtaBootloadFetchFileSpec ( const uint8_t * data,
EmberZclOtaBootloadFileSpec_t * fileSpec
)

This function reads an EmberZclOtaBootloadFileSpec_t from a flat buffer (little-endian).

Parameters
data Flat buffer from which to read a file specification struct
fileSpec File specification struct to be populated from a flat buffer
Returns
The number of bytes read from the flat buffer.
bool emberZclOtaBootloadFileSpecsAreEqual ( const EmberZclOtaBootloadFileSpec_t * s1,
const EmberZclOtaBootloadFileSpec_t * s2
)

This function compares two OTA file specifications.

Parameters
s1 OTA file specification to be compared
s2 OTA file specification to be compared
Returns
true if both OTA file specifications are equal, false otherwise.
void emberZclOtaBootloadInitFileHeaderInfo ( EmberZclOtaBootloadFileHeaderInfo_t * headerInfo )

This function initializes the EmberZclOtaBootloadFileHeaderInfo_t structure.

Parameters
headerInfo Structure to be initialized
bool emberZclOtaBootloadIsWildcard ( uint8_t * bytes,
size_t size
)

This function initializes checks if all bytes are 0xFF

Parameters
bytes Array to be checked
size Length of the array
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageCreate ( const EmberZclOtaBootloadFileSpec_t * fileSpec )

This function creates a file in the storage module.

Parameters
fileSpec A file specification for the file to be created
Returns
One of the following status values.
Note
The implementation of this function must adhere to the following specifications:
  • The implementation of this function must be atomic.
  • The implementation of this function does not need to be thread-safe.

This function deletes one or all files in the storage module asynchronously.

Parameters
fileSpec A file specification for the file to be deleted, or emberZclOtaBootloadFileSpecNull for all files to be deleted
callback A callback to be called upon completion of this deletion operation
Returns
One of the following status values.
Note
The implementation of this function must adhere to the following specification:
  • The implementation of this function does not need to be thread-safe.

This function finds a file in the storage module.

Parameters
fileSpec A file specification describing the file to be found
fileInfo Returned information about the file to be found; only valid if the function returns EMBER_ZCL_OTA_BOOTLOAD_STORAGE_STATUS_SUCCESS
Returns
One of the following status values.
Note
The implementation of this function must adhere to the following specifications:
  • The implementation of this function must be safe and idempotent, i.e., contiguous calls to this function with equal fileSpec parameters (as determined by emberZclOtaBootloadFileSpecsAreEqual ) must result in the same returned information and no change in the state of the storage module.
  • The implementation of this function does not need to be thread-safe.
void emberZclOtaBootloadStorageGetInfo ( EmberZclOtaBootloadStorageInfo_t * info,
EmberZclOtaBootloadFileSpec_t * returnedFiles,
size_t returnedFilesMaxCount
)

This function gets information about the current storage module.

Parameters
info Returned information about the current storage module.
returnedFiles The returned list of files that exist in this module. This parameter can be set to NULL to be ignored by the implementation.
returnedFilesMaxCount The maximum number of entries in the provided returnedFiles parameter.
Note
The implementation of this function must adhere to the following specifications:
  • The implementation of this function must return successfully. If, for any reason, the storage module cannot successfully return the necessary information in the implementation of this function, it should raise the error by calling assert(false) .
  • The implementation of this function must be safe and idempotent, i.e., contiguous calls to this function must result in the same returned information and no change in the state of the storage module.
  • The implementation of this function does not need to be thread-safe.
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageRead ( const EmberZclOtaBootloadFileSpec_t * fileSpec,
size_t offset,
void * data,
size_t dataLength
)

This function reads contiguous bytes from a file in the storage module.

Parameters
fileSpec A file specification for the file to be read
offset The offset into the file at which to start reading bytes
data The buffer into which the bytes will be read
dataLength The number of bytes to read from the file
Returns
One of the following status values.
Note
The implementation of this function must adhere to the following specifications:
  • The implementation of this function must be atomic.
  • The implementation of this function must support random read access.
  • The implementation of this function must allow for random access reading, i.e., reading from any valid offset must be supported.
  • The implementation of this function does not need to be thread-safe.
EmberZclOtaBootloadStorageStatus_t emberZclOtaBootloadStorageWrite ( const EmberZclOtaBootloadFileSpec_t * fileSpec,
size_t offset,
const void * data,
size_t dataLength
)

This function writes contiguous bytes to a file in the storage module.

Parameters
fileSpec A file specification for the file to be written
offset The offset into the file at which to start writing bytes
data The bytes to be written
dataLength The number of bytes to written to the file
Returns
One of the following status values.
Note
The implementation of this function must adhere to the following specifications:
  • The implementation of this function must be atomic.
  • The implementation of this function must support sequential write access, but does not need to support random write access.
  • The implementation of this function does not need to be thread-safe.
EmberZclOtaBootloadFileStatus_t emberZclOtaBootloadStoreFileHeaderInfo ( uint8_t * data,
EmberZclOtaBootloadFileHeaderInfo_t * fileHeaderInfo,
size_t imageDataSize
)

This function writes an EmberZclOtaBootloadFileHeaderInfo_t to a flat buffer (little-endian). The fileHeaderInfo->headerSize and fileHeaderInfo->fileSize variables are updated to reflect the stored sizes.

Parameters
data Flat buffer to which to write a file header info structure
fileHeaderInfo File header info struct to be written
Returns
An EmberZclOtaBootloadFileStatus_t value describing if the data is a valid or invalid dotdot OTA data.
size_t emberZclOtaBootloadStoreFileSpec ( const EmberZclOtaBootloadFileSpec_t * fileSpec,
uint8_t * data
)

This function writes an EmberZclOtaBootloadFileSpec_t to a flat buffer (little-endian).

Parameters
fileSpec File specification struct to be written to a flat buffer
data Flat buffer to which the file specification struct will be written
Returns
The number of bytes written to the flat buffer.