AWS IoT Over-the-air Update v3.3.0
Client library for AWS IoT OTA
Constants

Constants defined in the OTA library. More...

Macros

#define LOG2_BITS_PER_BYTE   3U
 Log base 2 of bits per byte.
 
#define BITS_PER_BYTE   ( ( uint32_t ) 1U << LOG2_BITS_PER_BYTE )
 Number of bits in a byte. This is used by the block bitmap implementation.
 
#define OTA_FILE_BLOCK_SIZE   ( ( uint32_t ) 1U << otaconfigLOG2_FILE_BLOCK_SIZE )
 Data section size of the file data block message (excludes the header).
 
#define OTA_MAX_FILES   1U
 [MUST REMAIN 1! Future support.] Maximum number of concurrent OTA files.
 
#define OTA_MAX_BLOCK_BITMAP_SIZE   128U
 Max allowed number of bytes to track all blocks of an OTA file. Adjust block size if more range is needed.
 
#define OTA_REQUEST_MSG_MAX_SIZE   ( 3U * OTA_MAX_BLOCK_BITMAP_SIZE )
 Maximum size of the message.
 
#define OTA_REQUEST_URL_MAX_SIZE   ( 1500 )
 Maximum size of the S3 presigned URL.
 
#define OTA_ERASED_BLOCKS_VAL   0xffU
 The starting state of a group of erased blocks in the Rx block bitmap.
 
#define OTA_MAX_FILE_SIZE   UINT32_MAX - OTA_FILE_BLOCK_SIZE + 1
 The maximum file size supported by the library.
 
#define OTA_MAX_JSON_TOKENS   64U
 Number of JSON tokens supported in a single parser call.
 
#define OTA_MAX_JSON_STR_LEN   256U
 Limit our JSON string compares to something small to avoid going into the weeds.
 
#define OTA_DOC_MODEL_MAX_PARAMS   32U
 The parameter list is backed by a 32 bit longword bitmap by design.
 
#define OTA_JOB_PARAM_REQUIRED   ( bool ) true
 Used to denote a required document model parameter.
 
#define OTA_JOB_PARAM_OPTIONAL   ( bool ) false
 Used to denote an optional document model parameter.
 
#define OTA_DONT_STORE_PARAM   0xffff
 If destOffset in the model is 0xffffffff, do not store the value.
 
#define OTA_STORE_NESTED_JSON   0x1fffU
 Store the reference to a nested JSON in a separate pointer.
 
#define OTA_DATA_BLOCK_SIZE   ( ( 1U << otaconfigLOG2_FILE_BLOCK_SIZE ) + OTA_REQUEST_URL_MAX_SIZE + 30 )
 Header is 19 bytes.
 
#define OTA_EVT_MASK_JOB_MSG_READY   0x00000001UL
 
#define OTA_EVT_MASK_DATA_MSG_READY   0x00000002UL
 
#define OTA_EVT_MASK_SHUTDOWN   0x00000004UL
 
#define OTA_EVT_MASK_REQ_TIMEOUT   0x00000008UL
 
#define OTA_EVT_MASK_USER_ABORT   0x000000016UL
 
#define OTA_EVT_MASK_ALL_EVENTS   ( OTA_EVT_MASK_JOB_MSG_READY | OTA_EVT_MASK_DATA_MSG_READY | OTA_EVT_MASK_SHUTDOWN | OTA_EVT_MASK_REQ_TIMEOUT | OTA_EVT_MASK_USER_ABORT )
 
#define kOTA_MaxSignatureSize   256 /* Max bytes supported for a file signature (2048 bit RSA is 256 bytes). */
 A composite cryptographic signature structure able to hold our largest supported signature.
 
#define OTA_JSON_SEPARATOR   "."
 Separator used to define nested keys.
 
#define OTA_JSON_CLIENT_TOKEN_KEY   "clientToken"
 Client token.
 
#define OTA_JSON_TIMESTAMP_KEY   "timestamp"
 Used to calculate timeout and time spent on the operation.
 
#define OTA_JSON_EXECUTION_KEY   "execution"
 Contains job execution parameters .
 
#define OTA_JSON_JOB_ID_KEY   OTA_JSON_EXECUTION_KEY OTA_JSON_SEPARATOR "jobId"
 Name of the job.
 
#define OTA_JSON_STATUS_DETAILS_KEY   OTA_JSON_EXECUTION_KEY OTA_JSON_SEPARATOR "statusDetails"
 Current status of the job.
 
#define OTA_JSON_SELF_TEST_KEY   OTA_JSON_STATUS_DETAILS_KEY OTA_JSON_SEPARATOR "self_test"
 Specifies if the platform and service is is selftest.
 
#define OTA_JSON_UPDATED_BY_KEY   OTA_JSON_STATUS_DETAILS_KEY OTA_JSON_SEPARATOR "updatedBy"
 Parameter to specify update status.
 
#define OTA_JSON_UPDATED_BY_KEY_ONLY   "updatedBy"
 Specifies if the platform and service is is selftest. Not searched in sub fields.
 
#define OTA_JSON_SELF_TEST_KEY_ONLY   "self_test"
 Parameter to specify update status. Not searched in sub fields.
 
#define OTA_JSON_JOB_DOC_KEY   OTA_JSON_EXECUTION_KEY OTA_JSON_SEPARATOR "jobDocument"
 Parameters that specify the nature of the job.
 
#define OTA_JSON_OTA_UNIT_KEY   OTA_JSON_JOB_DOC_KEY OTA_JSON_SEPARATOR "afr_ota"
 afr-ota.
 
#define OTA_JSON_PROTOCOLS_KEY   OTA_JSON_OTA_UNIT_KEY OTA_JSON_SEPARATOR "protocols"
 Protocols over which the download can take place.
 
#define OTA_JSON_FILE_GROUP_KEY   OTA_JSON_OTA_UNIT_KEY OTA_JSON_SEPARATOR "files"
 Parameters for specifying file configurations.
 
#define OTA_JSON_STREAM_NAME_KEY   OTA_JSON_OTA_UNIT_KEY OTA_JSON_SEPARATOR "streamname"
 Name of the stream used for download.
 
#define OTA_JSON_FILE_PATH_KEY   "filepath"
 Path to store the image on the device.
 
#define OTA_JSON_FILE_SIZE_KEY   "filesize"
 Size of the file to be downloaded.
 
#define OTA_JSON_FILE_ID_KEY   "fileid"
 Used to identify the file in case of multiple file downloads.
 
#define OTA_JSON_FILE_ATTRIBUTE_KEY   "attr"
 Additional file attributes.
 
#define OTA_JSON_FILE_CERT_NAME_KEY   "certfile"
 Location of the certificate on the device to find code signing.
 
#define OTA_JSON_UPDATE_DATA_URL_KEY   "update_data_url"
 S3 bucket presigned url to fetch the image from .
 
#define OTA_JSON_AUTH_SCHEME_KEY   "auth_scheme"
 Authentication scheme for downloading a the image over HTTP.
 
#define OTA_JSON_FILETYPE_KEY   "fileType"
 Used to identify the file in case of multi file type support.
 

Detailed Description

Constants defined in the OTA library.

Keys in OTA job doc.

The OTA job document contains parameters that are required for us to build the stream request message and manage the OTA process. Including info like file name, size, attributes, etc. The following value specifies the number of parameters that are included in the job document model although some may be optional.

Macro Definition Documentation

◆ OTA_EVT_MASK_JOB_MSG_READY

#define OTA_EVT_MASK_JOB_MSG_READY   0x00000001UL

Event flag for OTA Job message ready.

◆ OTA_EVT_MASK_DATA_MSG_READY

#define OTA_EVT_MASK_DATA_MSG_READY   0x00000002UL

Event flag for OTA Data message ready.

◆ OTA_EVT_MASK_SHUTDOWN

#define OTA_EVT_MASK_SHUTDOWN   0x00000004UL

Event flag to request OTA shutdown.

◆ OTA_EVT_MASK_REQ_TIMEOUT

#define OTA_EVT_MASK_REQ_TIMEOUT   0x00000008UL

Event flag indicating the request timer has timed out.

◆ OTA_EVT_MASK_USER_ABORT

#define OTA_EVT_MASK_USER_ABORT   0x000000016UL

Event flag to indicate user initiated OTA abort.

◆ OTA_EVT_MASK_ALL_EVENTS

Event flag to mask indicate all events.