AWS IoT Over-the-air Update v3.4.0
Client library for AWS IoT OTA
 
Loading...
Searching...
No Matches
ota_http_private.h File Reference

Contains definitions of routines for OTA download using HTTP data plane. More...

#include "ota.h"
#include "ota_private.h"
Include dependency graph for ota_http_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

OtaErr_t initFileTransfer_Http (const OtaAgentContext_t *pAgentCtx)
 Initialize file transfer over HTTP.
 
OtaErr_t requestDataBlock_Http (OtaAgentContext_t *pAgentCtx)
 Request File block over HTTP.
 
OtaErr_t decodeFileBlock_Http (const uint8_t *pMessageBuffer, size_t messageSize, int32_t *pFileId, int32_t *pBlockId, int32_t *pBlockSize, uint8_t *const *pPayload, size_t *pPayloadSize)
 Stub for decoding the file block.
 
OtaErr_t cleanupData_Http (const OtaAgentContext_t *pAgentCtx)
 Cleanup related to OTA data plane over HTTP.
 
const char * OTA_HTTP_strerror (OtaHttpStatus_t status)
 Status to string conversion for OTA HTTP interface status.
 

Detailed Description

Contains definitions of routines for OTA download using HTTP data plane.

Function Documentation

◆ initFileTransfer_Http()

OtaErr_t initFileTransfer_Http ( const OtaAgentContext_t pAgentCtx)

Initialize file transfer over HTTP.

This function initializes the file transfer after the OTA job is parsed and accepted by initializing the http component with pre-signed url.

Parameters
[in]pAgentCtxThe OTA agent context.
Returns
The OTA error code. See OTA Agent error codes information in ota.h.

◆ requestDataBlock_Http()

OtaErr_t requestDataBlock_Http ( OtaAgentContext_t pAgentCtx)

Request File block over HTTP.

This function is used for requesting a file block over HTTP using the file context.

Parameters
[in]pAgentCtxThe OTA agent context.
Returns
The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent error codes information in ota.h.

◆ decodeFileBlock_Http()

OtaErr_t decodeFileBlock_Http ( const uint8_t *  pMessageBuffer,
size_t  messageSize,
int32_t *  pFileId,
int32_t *  pBlockId,
int32_t *  pBlockSize,
uint8_t *const *  pPayload,
size_t *  pPayloadSize 
)

Stub for decoding the file block.

File block received over HTTP does not require decoding, only increment the number of blocks received.

Parameters
[in]pMessageBufferThe message to be decoded.
[in]messageSizeThe size of the message in bytes.
[out]pFileIdThe server file ID.
[out]pBlockIdThe file block ID.
[out]pBlockSizeThe file block size.
[out]pPayloadThe payload.
[out]pPayloadSizeThe payload size.
Returns
The OTA PAL layer error code combined with the MCU specific error code. See OTA Agent error codes information in ota.h.

◆ cleanupData_Http()

OtaErr_t cleanupData_Http ( const OtaAgentContext_t pAgentCtx)

Cleanup related to OTA data plane over HTTP.

This function performs cleanup by resetting the number of blocks received and deinit the http component.

Parameters
[in]pAgentCtxThe OTA agent context.
Returns
The OTA error code. See OTA Agent error codes information in ota.h.

◆ OTA_HTTP_strerror()

const char * OTA_HTTP_strerror ( OtaHttpStatus_t  status)

Status to string conversion for OTA HTTP interface status.

Parameters
[in]statusThe status to convert to a string.
Returns
The string representation of the status.