AWS IoT Over-the-air Update  v3.1.0
Client library for AWS IoT OTA
ota_mqtt_private.h
Go to the documentation of this file.
1 /*
2  * AWS IoT Over-the-air Update v3.1.0
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
28 #ifndef OTA_MQTT_H
29 #define OTA_MQTT_H
30 
31 /* *INDENT-OFF* */
32 #ifdef __cplusplus
33  extern "C" {
34 #endif
35 /* *INDENT-ON* */
36 
37 /* OTA includes. */
38 #include "ota.h"
39 #include "ota_private.h"
40 
53 
66 
80 
98 OtaErr_t decodeFileBlock_Mqtt( const uint8_t * pMessageBuffer,
99  size_t messageSize,
100  int32_t * pFileId,
101  int32_t * pBlockId,
102  int32_t * pBlockSize,
103  uint8_t ** pPayload,
104  size_t * pPayloadSize );
105 
117 OtaErr_t cleanupControl_Mqtt( const OtaAgentContext_t * pAgentCtx );
118 
130 OtaErr_t cleanupData_Mqtt( const OtaAgentContext_t * pAgentCtx );
131 
150  OtaJobStatus_t status,
151  int32_t reason,
152  int32_t subReason );
153 
161 const char * OTA_MQTT_strerror( OtaMqttStatus_t status );
162 
163 /* *INDENT-OFF* */
164 #ifdef __cplusplus
165  }
166 #endif
167 /* *INDENT-ON* */
168 
169 #endif /* ifndef OTA_MQTT_H */
decodeFileBlock_Mqtt
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.
Definition: ota_mqtt.c:1161
ota.h
OTA Agent Interface.
OtaErr_t
OtaErr_t
The OTA API return status. OTA agent error codes are in the upper 8 bits of the 32 bit OTA error word...
Definition: ota.h:79
cleanupControl_Mqtt
OtaErr_t cleanupControl_Mqtt(const OtaAgentContext_t *pAgentCtx)
Cleanup related to OTA control plane over MQTT.
Definition: ota_mqtt.c:1200
OtaMqttStatus_t
OtaMqttStatus_t
The OTA MQTT interface return status.
Definition: ota_mqtt_interface.h:88
OtaAgentContext_t
The OTA agent is a singleton today. The structure keeps it nice and organized.
Definition: ota.h:294
ota_private.h
Macros, enums, variables, and definitions internal to the OTA Agent module and shared by other OTA mo...
updateJobStatus_Mqtt
OtaErr_t updateJobStatus_Mqtt(OtaAgentContext_t *pAgentCtx, OtaJobStatus_t status, int32_t reason, int32_t subReason)
Update job status over MQTT.
Definition: ota_mqtt.c:928
OtaJobStatus_t
OtaJobStatus_t
Gives the status of the job operation.
Definition: ota.h:183
requestFileBlock_Mqtt
OtaErr_t requestFileBlock_Mqtt(OtaAgentContext_t *pAgentCtx)
Request File block over MQTT.
Definition: ota_mqtt.c:1059
OTA_MQTT_strerror
const char * OTA_MQTT_strerror(OtaMqttStatus_t status)
Status to string conversion for OTA MQTT interface status.
Definition: ota_mqtt.c:1253
cleanupData_Mqtt
OtaErr_t cleanupData_Mqtt(const OtaAgentContext_t *pAgentCtx)
Cleanup related to OTA data plane over MQTT.
Definition: ota_mqtt.c:1228
initFileTransfer_Mqtt
OtaErr_t initFileTransfer_Mqtt(OtaAgentContext_t *pAgentCtx)
Initialize file transfer over MQTT.
Definition: ota_mqtt.c:996
requestJob_Mqtt
OtaErr_t requestJob_Mqtt(OtaAgentContext_t *pAgentCtx)
Check for available OTA job over MQTT.
Definition: ota_mqtt.c:832