AWS IoT Over-the-air Update v3.3.0
Client library for AWS IoT OTA
ota_cbor_private.h File Reference

Function declarations and field declarations for ota_cbor.c. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OTA_CBOR_CLIENTTOKEN_KEY   "c"
 
#define OTA_CBOR_FILEID_KEY   "f"
 
#define OTA_CBOR_BLOCKSIZE_KEY   "l"
 
#define OTA_CBOR_BLOCKOFFSET_KEY   "o"
 
#define OTA_CBOR_BLOCKBITMAP_KEY   "b"
 
#define OTA_CBOR_STREAMDESCRIPTION_KEY   "d"
 
#define OTA_CBOR_STREAMFILES_KEY   "r"
 
#define OTA_CBOR_FILESIZE_KEY   "z"
 
#define OTA_CBOR_BLOCKID_KEY   "i"
 
#define OTA_CBOR_BLOCKPAYLOAD_KEY   "p"
 
#define OTA_CBOR_NUMBEROFBLOCKS_KEY   "n"
 

Functions

bool OTA_CBOR_Decode_GetStreamResponseMessage (const uint8_t *pMessageBuffer, size_t messageSize, int32_t *pFileId, int32_t *pBlockId, int32_t *pBlockSize, uint8_t **pPayload, size_t *pPayloadSize)
 Decode a Get Stream response message from AWS IoT OTA. More...
 
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, 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 count or block bitmap to be requested, but not both. More...
 

Detailed Description

Function declarations and field declarations for ota_cbor.c.

Macro Definition Documentation

◆ OTA_CBOR_CLIENTTOKEN_KEY

#define OTA_CBOR_CLIENTTOKEN_KEY   "c"

Message field definitions, per the server specification. These are not part of the library interface but are included here for testability. Key for client id.

◆ OTA_CBOR_FILEID_KEY

#define OTA_CBOR_FILEID_KEY   "f"

Key for file id.

◆ OTA_CBOR_BLOCKSIZE_KEY

#define OTA_CBOR_BLOCKSIZE_KEY   "l"

Key for file block size.

◆ OTA_CBOR_BLOCKOFFSET_KEY

#define OTA_CBOR_BLOCKOFFSET_KEY   "o"

Key for file block offset.

◆ OTA_CBOR_BLOCKBITMAP_KEY

#define OTA_CBOR_BLOCKBITMAP_KEY   "b"

Key for bitmap.

◆ OTA_CBOR_STREAMDESCRIPTION_KEY

#define OTA_CBOR_STREAMDESCRIPTION_KEY   "d"

Key for stream name.

◆ OTA_CBOR_STREAMFILES_KEY

#define OTA_CBOR_STREAMFILES_KEY   "r"

Key for file attributes.

◆ OTA_CBOR_FILESIZE_KEY

#define OTA_CBOR_FILESIZE_KEY   "z"

Key for file size.

◆ OTA_CBOR_BLOCKID_KEY

#define OTA_CBOR_BLOCKID_KEY   "i"

Key for block id.

◆ OTA_CBOR_BLOCKPAYLOAD_KEY

#define OTA_CBOR_BLOCKPAYLOAD_KEY   "p"

Key for payload of a block.

◆ OTA_CBOR_NUMBEROFBLOCKS_KEY

#define OTA_CBOR_NUMBEROFBLOCKS_KEY   "n"

Key for number of blocks.

Function Documentation

◆ OTA_CBOR_Decode_GetStreamResponseMessage()

bool OTA_CBOR_Decode_GetStreamResponseMessage ( const uint8_t *  pMessageBuffer,
size_t  messageSize,
int32_t *  pFileId,
int32_t *  pBlockId,
int32_t *  pBlockSize,
uint8_t **  pPayload,
size_t *  pPayloadSize 
)

Decode a Get Stream response message from AWS IoT OTA.

Parameters
[in]pMessageBuffermessage to decode.
[in]messageSizesize of the message to decode.
[out]pFileIdDecoded file id value.
[out]pBlockIdDecoded block id value.
[out]pBlockSizeDecoded block size value.
[out]pPayloadBuffer for the decoded payload.
[in,out]pPayloadSizemaximum size of the buffer as in and actual payload size for the decoded payload as out.
Returns
TRUE when success, otherwise FALSE.

◆ OTA_CBOR_Encode_GetStreamRequestMessage()

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,
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 count or block bitmap to be requested, but not both.

Parameters
[in,out]pMessageBufferBuffer to store the encoded message.
[in]messageBufferSizeSize of the buffer to store the encoded message.
[out]pEncodedMessageSizeSize of the final encoded message.
[in]pClientTokenClient token in the encoded message.
[in]fileIdValue of file id in the encoded message.
[in]blockSizeValue of block size in the encoded message.
[in]blockOffsetValue of block offset in the encoded message.
[in]pBlockBitmapbitmap in the encoded message.
[in]blockBitmapSizeSize of the provided bitmap buffer.
[in]numOfBlocksRequestednumber of blocks to request in the encoded message.
Returns
TRUE when success, otherwise FALSE.