AWS IoT Over-the-air Update v3.4.1
Client library for AWS IoT OTA
ota_cbor_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_CBOR_H
31#define OTA_CBOR_H
32
33/* *INDENT-OFF* */
34#ifdef __cplusplus
35 extern "C" {
36#endif
37/* *INDENT-ON* */
38
44#define OTA_CBOR_CLIENTTOKEN_KEY "c"
45#define OTA_CBOR_FILEID_KEY "f"
46#define OTA_CBOR_BLOCKSIZE_KEY "l"
47#define OTA_CBOR_BLOCKOFFSET_KEY "o"
48#define OTA_CBOR_BLOCKBITMAP_KEY "b"
49#define OTA_CBOR_STREAMDESCRIPTION_KEY "d"
50#define OTA_CBOR_STREAMFILES_KEY "r"
51#define OTA_CBOR_FILESIZE_KEY "z"
52#define OTA_CBOR_BLOCKID_KEY "i"
53#define OTA_CBOR_BLOCKPAYLOAD_KEY "p"
54#define OTA_CBOR_NUMBEROFBLOCKS_KEY "n"
59bool OTA_CBOR_Decode_GetStreamResponseMessage( const uint8_t * pMessageBuffer,
60 size_t messageSize,
61 int32_t * pFileId,
62 int32_t * pBlockId,
63 int32_t * pBlockSize,
64 uint8_t * const * pPayload,
65 size_t * pPayloadSize );
66
72bool OTA_CBOR_Encode_GetStreamRequestMessage( uint8_t * pMessageBuffer,
73 size_t messageBufferSize,
74 size_t * pEncodedMessageSize,
75 const char * pClientToken,
76 int32_t fileId,
77 int32_t blockSize,
78 int32_t blockOffset,
79 const uint8_t * pBlockBitmap,
80 size_t blockBitmapSize,
81 int32_t numOfBlocksRequested );
82
83/* *INDENT-OFF* */
84#ifdef __cplusplus
85 }
86#endif
87/* *INDENT-ON* */
88
89#endif /* ifndef OTA_CBOR_H */
bool OTA_CBOR_Encode_GetStreamRequestMessage(uint8_t *pMessageBuffer, size_t messageBufferSize, size_t *pEncodedMessageSize, const char *pClientToken, int32_t fileId, int32_t blockSize, int32_t blockOffset, const uint8_t *pBlockBitmap, size_t blockBitmapSize, int32_t numOfBlocksRequested)
Create an encoded Get Stream Request message for the AWS IoT OTA service. The service allows block co...
Definition: ota_cbor.c:238
bool OTA_CBOR_Decode_GetStreamResponseMessage(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 Get Stream response message from AWS IoT OTA.
Definition: ota_cbor.c:76