CBOR encode/decode routines for AWS IoT Over-the-Air updates. More...
Macros | |
#define | OTA_CBOR_GETSTREAMREQUEST_ITEM_COUNT 6 |
Number of keys in cbor get stream request message. | |
Functions | |
static CborError | checkDataType (CborType expectedType, CborValue *cborValue) |
Helper function to verify the data type of the value in map. More... | |
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... | |
CBOR encode/decode routines for AWS IoT Over-the-Air updates.
|
static |
Helper function to verify the data type of the value in map.
[in] | expectedType | Data type expected. |
[in] | cborValue | Value to check. |
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.
[in] | pMessageBuffer | message to decode. |
[in] | messageSize | size of the message to decode. |
[out] | pFileId | Decoded file id value. |
[out] | pBlockId | Decoded block id value. |
[out] | pBlockSize | Decoded block size value. |
[out] | pPayload | Buffer for the decoded payload. |
[in,out] | pPayloadSize | maximum size of the buffer as in and actual payload size for the decoded payload as out. |
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.
[in,out] | pMessageBuffer | Buffer to store the encoded message. |
[in] | messageBufferSize | Size of the buffer to store the encoded message. |
[out] | pEncodedMessageSize | Size of the final encoded message. |
[in] | pClientToken | Client token in the encoded message. |
[in] | fileId | Value of file id in the encoded message. |
[in] | blockSize | Value of block size in the encoded message. |
[in] | blockOffset | Value of block offset in the encoded message. |
[in] | pBlockBitmap | bitmap in the encoded message. |
[in] | blockBitmapSize | Size of the provided bitmap buffer. |
[in] | numOfBlocksRequested | number of blocks to request in the encoded message. |