tsOTA_CallBackMessage
For an OTA event, the eEventType field of the tsZCL_CallBackEvent structure is set to E_ZCL_CBET_CLUSTER_CUSTOM. This event structure also contains an element sClusterCustomMessage, which is itself a structure containing a field pvCustomData. This field is a pointer to the following tsOTA_CallBackMessage structure:
typedef struct
{
teOTA_UpgradeClusterEvents eEventId;
#ifdef OTA_CLIENT
tsOTA_PersistedData sPersistedData;
uint8 au8ReadOTAData[OTA_MAX_BLOCK_SIZE];
uint8 u8NextFreeImageLocation;
uint8 u8CurrentActiveImageLocation;
#endif
#ifdef OTA_SERVER
tsCLD_PR_Ota aServerPrams[OTA_MAX_IMAGES_PER_ENDPOINT+OTA_MAX_CO_PROCESSOR_IMAGES];
tsOTA_AuthorisationStruct sAuthStruct;
uint8 u8ServerImageStartSector;
bool bIsOTAHeaderCopied;
uint8 au8ServerOTAHeader[OTA_MAX_HEADER_SIZE+OTA_TAG_HEADER_SIZE];
tsOTA_WaitForDataParams sWaitForDataParams;
#ifdef OTA_PAGE_REQUEST_SUPPORT
tsOTA_PageReqServerParams sPageReqServerParams;
#endif
#endif
uint8 u8ImageStartSector[OTA_MAX_IMAGES_PER_ENDPOINT];
uint8 au8CAPublicKey[22];
uint8 u8MaxNumberOfSectors;
union
{
tsOTA_ImageNotifyCommand sImageNotifyPayload;
tsOTA_QueryImageRequest sQueryImagePayload;
tsOTA_QueryImageResponse sQueryImageResponsePayload;
tsOTA_BlockRequest sBlockRequestPayload;
tsOTA_ImagePageRequest sImagePageRequestPayload;
tsOTA_ImageBlockResponsePayload sImageBlockResponsePayload;
tsOTA_UpgradeEndRequestPayload sUpgradeEndRequestPayload;
tsOTA_UpgradeEndResponsePayload sUpgradeResponsePayload;
tsOTA_QuerySpecificFileRequestPayload sQuerySpFileRequestPayload;
tsOTA_QuerySpecificFileResponsePayload
sQuerySpFileResponsePayload;
teZCL_Status eQueryNextImgRspErrStatus;
tsOTA_SignerMacVerify sSignerMacVerify;
tsOTA_ImageVersionVerify sImageVersionVerify;
tsOTA_UpgradeDowngradeVerify sUpgradeDowngradeVerify;
}uMessage;
}tsOTA_CallBackMessage;
where:
eEventIdis the OTA event type (enumerations are detailed in Section49.12.2)sPersistedDatais the structure (see Section 49.11.18) which contains the persisted data that is stored in Flash memory using the NVM module on the clientau8ReadOTADatais an array containing the payload data from an Image Block Responseu8NextFreeImageLocationidentifies the next free image location where a new upgrade image can be storedu8CurrentActiveImageLocationidentifies the location of the currently active image on the clientaServerPramsis an array containing the server data for each image which can be updated by applicationsAuthStructis a structure which stores the authorisation state and list of client devices that are authorised for OTA upgradeu8ServerImageStartSectoridentifies the server self-image start-sectorbIsOTAHeaderCopiedspecifies whether the new OTA header is copied (TRUE) or not (FALSE)au8ServerOTAHeaderspecifies the current server OTA headersWaitForDataParamsis a structure containing time information that may need to be modified by the server for inclusion in an Image Block Response (for more information, refer to Section 49.11.15)sPageReqServerParamsis a structure containing page request information that may need to be modified by the serveru8ImageStartSectoris used to store the image start-sector for each image which is stored or will be stored in the devices internal Flash memory - note that this variable assumes a 32-Kbyte sector size and so, for example, if64-Kbyte sectors are used, its value will be twice the actual start-sector value
au8CAPublicKeyspecifies the CA public keyu8MaxNumberOfSectorsspecifies the maximum number of sectors to be used per imageuMessageis a union containing the command payload in one of the following forms (depending on the command specified byeEventId):sImageNotifyPayloadis a structure containing the payload of an Image Notify commandsQueryImagePayloadis a structure containing the payload of a Query Next Image RequestsQueryImageResponsePayloadis a structure containing the payload of a Query Next Image ResponsesBlockRequestPayloadis a structure containing the payload of an Image Block RequestsImagePageRequestPayloadis a structure containing the payload of an Image Page RequestsImageBlockResponsePayloadis a structure containing the payload of an Image Block ResponsesUpgradeEndRequestPayloadis a structure containing the payload of an Upgrade End RequestsUpgradeResponsePayloadis a structure containing the payload of an Upgrade End ResponsesQuerySpFileRequestPayloadis a structure containing the payload of a Query Specific File RequestsQuerySpFileResponsePayloadis a structure containing the payload of a Query Specific File ResponseeQueryNextImgRspErrStatusis the status returned from the query image response command handler and can be passed up to the application when there is an error via the callback event E_CLD_OTA_COMMAND_QUERY_NEXT_IMAGE_RESPONSE_ERROR. The returned status value will be either E_ZCL_ERR_INVALID_IMAGE_SIZE or E_ZCL_ERR_INVALID_IMAGE_VERSION
sSignerMacVerifyis a structure containing the signer’s IEEE/MAC address from a new upgrade image and a status field (which is set by the application after verifying the signer’s address)sImageVersionVerifyis a structure containing the image version received in the query next image response and status field (which is set by the application after verifying the image version)sUpgradeDowngradeVerifyis a structure containing the image version received in the upgrade end response and a status field (which is set by the application after verifying the image version)
Parent topic:Structures