AWS IoT Over-the-air Update v3.4.0
Client library for AWS IoT OTA
ota_interface_private.h
Go to the documentation of this file.
1/*
2 * AWS IoT Over-the-air Update v3.4.0
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_INTERFACE_PRIVATE_H
31#define OTA_INTERFACE_PRIVATE_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
43/* General Constants. */
44
45/* OTA control protocol constants. */
46#define OTA_CONTROL_OVER_MQTT 0x00000001
48/* OTA data protocol constants. */
49#define OTA_DATA_OVER_MQTT 0x00000001
50#define OTA_DATA_OVER_HTTP 0x00000002
51#define OTA_DATA_NUM_PROTOCOLS ( 2U )
60typedef struct
61{
62 OtaErr_t ( * requestJob )( const OtaAgentContext_t * pAgentCtx );
63 OtaErr_t ( * updateJobStatus )( const OtaAgentContext_t * pAgentCtx,
64 OtaJobStatus_t status,
65 int32_t reason,
66 int32_t subReason );
67 OtaErr_t ( * cleanup )( const OtaAgentContext_t * pAgentCtx );
69
76typedef struct
77{
78 OtaErr_t ( * initFileTransfer )( const OtaAgentContext_t * pAgentCtx );
79 OtaErr_t ( * requestFileBlock )( OtaAgentContext_t * pAgentCtx );
80 OtaErr_t ( * decodeFileBlock )( const uint8_t * pMessageBuffer,
81 size_t messageSize,
82 int32_t * pFileId,
83 int32_t * pBlockId,
84 int32_t * pBlockSize,
85 uint8_t * const * pPayload,
86 size_t * pPayloadSize );
87 OtaErr_t ( * cleanup )( const OtaAgentContext_t * pAgentCtx );
89
99void setControlInterface( OtaControlInterface_t * pControlInterface );
100
117 const uint8_t * pProtocol );
118
119/* *INDENT-OFF* */
120#ifdef __cplusplus
121 }
122#endif
123/* *INDENT-ON* */
124
125#endif /* ifndef OTA_INTERFACE_PRIVATE_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
OTA Agent Interface.
OtaErr_t setDataInterface(OtaDataInterface_t *pDataInterface, const uint8_t *pProtocol)
Set the data interface used for OTA operations.
Definition: ota_interface.c:78
void setControlInterface(OtaControlInterface_t *pControlInterface)
Set control interface for OTA operations.
Definition: ota_interface.c:65
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
Represents the OTA control interface functions.
Definition: ota_interface_private.h:61
Represents the OTA data interface functions.
Definition: ota_interface_private.h:77