AWS IoT Over-the-air Update v3.4.1
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.4.1
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
30#ifndef OTA_MQTT_H
31#define OTA_MQTT_H
32
33/* *INDENT-OFF* */
34#ifdef __cplusplus
35 extern "C" {
36#endif
37/* *INDENT-ON* */
38
39/* OTA includes. */
40#include "ota.h"
41#include "ota_private.h"
42
54OtaErr_t requestJob_Mqtt( const OtaAgentContext_t * pAgentCtx );
55
68
82
100OtaErr_t decodeFileBlock_Mqtt( const uint8_t * pMessageBuffer,
101 size_t messageSize,
102 int32_t * pFileId,
103 int32_t * pBlockId,
104 int32_t * pBlockSize,
105 uint8_t * const * pPayload,
106 size_t * pPayloadSize );
107
120
132OtaErr_t cleanupData_Mqtt( const OtaAgentContext_t * pAgentCtx );
133
152 OtaJobStatus_t status,
153 int32_t reason,
154 int32_t subReason );
155
163const char * OTA_MQTT_strerror( OtaMqttStatus_t status );
164
165/* *INDENT-OFF* */
166#ifdef __cplusplus
167 }
168#endif
169/* *INDENT-ON* */
170
171#endif /* ifndef OTA_MQTT_H */
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:80
OtaJobStatus_t
Gives the status of the job operation.
Definition: ota.h:186
OtaMqttStatus_t
The OTA MQTT interface return status.
Definition: ota_mqtt_interface.h:90
OTA Agent Interface.
OtaErr_t cleanupData_Mqtt(const OtaAgentContext_t *pAgentCtx)
Cleanup related to OTA data plane over MQTT.
Definition: ota_mqtt.c:1259
OtaErr_t updateJobStatus_Mqtt(const OtaAgentContext_t *pAgentCtx, OtaJobStatus_t status, int32_t reason, int32_t subReason)
Update job status over MQTT.
Definition: ota_mqtt.c:953
const char * OTA_MQTT_strerror(OtaMqttStatus_t status)
Status to string conversion for OTA MQTT interface status.
Definition: ota_mqtt.c:1284
OtaErr_t requestJob_Mqtt(const OtaAgentContext_t *pAgentCtx)
Check for available OTA job over MQTT.
Definition: ota_mqtt.c:853
OtaErr_t cleanupControl_Mqtt(const OtaAgentContext_t *pAgentCtx)
Cleanup related to OTA control plane over MQTT.
Definition: ota_mqtt.c:1231
OtaErr_t decodeFileBlock_Mqtt(const uint8_t *pMessageBuffer, size_t messageSize, int32_t *pFileId, int32_t *pBlockId, int32_t *pBlockSize, uint8_t *const *pPayload, size_t *pPayloadSize)
Decode a cbor encoded fileblock.
Definition: ota_mqtt.c:1192
OtaErr_t initFileTransfer_Mqtt(const OtaAgentContext_t *pAgentCtx)
Initialize file transfer over MQTT.
Definition: ota_mqtt.c:1021
OtaErr_t requestFileBlock_Mqtt(OtaAgentContext_t *pAgentCtx)
Request File block over MQTT.
Definition: ota_mqtt.c:1087
Macros, enums, variables, and definitions internal to the OTA Agent module and shared by other OTA mo...
The OTA agent is a singleton today. The structure keeps it nice and organized.
Definition: ota.h:339