Contains function definitions of routines for OTA download and control using MQTT data plane. More...
Go to the source code of this file.
Functions | |
OtaErr_t | requestJob_Mqtt (OtaAgentContext_t *pAgentCtx) |
Check for available OTA job over MQTT. More... | |
OtaErr_t | initFileTransfer_Mqtt (OtaAgentContext_t *pAgentCtx) |
Initialize file transfer over MQTT. More... | |
OtaErr_t | requestFileBlock_Mqtt (OtaAgentContext_t *pAgentCtx) |
Request File block over MQTT. More... | |
OtaErr_t | decodeFileBlock_Mqtt (const uint8_t *pMessageBuffer, size_t messageSize, int32_t *pFileId, int32_t *pBlockId, int32_t *pBlockSize, uint8_t **pPayload, size_t *pPayloadSize) |
Decode a cbor encoded fileblock. More... | |
OtaErr_t | cleanupControl_Mqtt (const OtaAgentContext_t *pAgentCtx) |
Cleanup related to OTA control plane over MQTT. More... | |
OtaErr_t | cleanupData_Mqtt (const OtaAgentContext_t *pAgentCtx) |
Cleanup related to OTA data plane over MQTT. More... | |
OtaErr_t | updateJobStatus_Mqtt (OtaAgentContext_t *pAgentCtx, OtaJobStatus_t status, int32_t reason, int32_t subReason) |
Update job status over MQTT. More... | |
const char * | OTA_MQTT_strerror (OtaMqttStatus_t status) |
Status to string conversion for OTA MQTT interface status. More... | |
Contains function definitions of routines for OTA download and control using MQTT data plane.
OtaErr_t requestJob_Mqtt | ( | OtaAgentContext_t * | pAgentCtx | ) |
Check for available OTA job over MQTT.
This function Request for the next available OTA job from the job service by publishing a "get next job" message to the job service.
[in] | pAgentCtx | The OTA agent context. |
OtaErr_t initFileTransfer_Mqtt | ( | OtaAgentContext_t * | pAgentCtx | ) |
Initialize file transfer over MQTT.
This function initializes the file transfer after the OTA job is parsed and accepted by subscribing to the data streaming topics.
[in] | pAgentCtx | The OTA agent context. |
< Buffer to store the topic generated for requesting data stream.
OtaErr_t requestFileBlock_Mqtt | ( | OtaAgentContext_t * | pAgentCtx | ) |
Request File block over MQTT.
This function is used for requesting a file block over MQTT using the file context.
[in] | pAgentCtx | The OTA agent context. |
OtaErr_t decodeFileBlock_Mqtt | ( | const uint8_t * | pMessageBuffer, |
size_t | messageSize, | ||
int32_t * | pFileId, | ||
int32_t * | pBlockId, | ||
int32_t * | pBlockSize, | ||
uint8_t ** | pPayload, | ||
size_t * | pPayloadSize | ||
) |
Decode a cbor encoded fileblock.
This function is used for decoding a file block received over MQTT & encoded in cbor.
[in] | pMessageBuffer | The message to be decoded. |
[in] | messageSize | The size of the message in bytes. |
[out] | pFileId | The server file ID. |
[out] | pBlockId | The file block ID. |
[out] | pBlockSize | The file block size. |
[out] | pPayload | The payload. |
[out] | pPayloadSize | The payload size. |
OtaErr_t cleanupControl_Mqtt | ( | const OtaAgentContext_t * | pAgentCtx | ) |
Cleanup related to OTA control plane over MQTT.
This function cleanup by unsubscribing from any topics that were subscribed for performing OTA over MQTT.
[in] | pAgentCtx | The OTA agent context. |
OtaErr_t cleanupData_Mqtt | ( | const OtaAgentContext_t * | pAgentCtx | ) |
Cleanup related to OTA data plane over MQTT.
This function performs cleanup by unsubscribing from any topics that were subscribed for performing OTA data over MQTT.
[in] | pAgentCtx | The OTA agent context. |
OtaErr_t updateJobStatus_Mqtt | ( | OtaAgentContext_t * | pAgentCtx, |
OtaJobStatus_t | status, | ||
int32_t | reason, | ||
int32_t | subReason | ||
) |
Update job status over MQTT.
This function updates the OTA job status over MQTT with information like in progress, completion or failure.
[in] | pAgentCtx | The OTA agent context. |
[in] | status | The OTA job status which should be updated. |
[in] | reason | The major reason for the status update. |
[in] | subReason | The platform specific reason. |
const char * OTA_MQTT_strerror | ( | OtaMqttStatus_t | status | ) |
Status to string conversion for OTA MQTT interface status.
[in] | status | The status to convert to a string. |