AWS IoT Device SDK C: Fleet Provisioning
AWS IoT Fleet Provisioning
Return to main page ↑
aws_iot_provisioning_internal.h File Reference

Internal header of Provisioning library. This header should not be included in typical application code. More...

#include "iot_config.h"
#include "aws_iot.h"
#include "aws_iot_provisioning.h"
#include "iot_serializer.h"
#include "iot_logging_setup.h"
#include "iot_static_memory.h"

Go to the source code of this file.

Data Structures

union  _provisioningCallbackInfo_t
 Union representing either of the 2 Provisioning operation APIs' callbacks. More...
 
struct  _provisioningOperationInfo_t
 Internal structure representing the data of an Provisioning operation. More...
 
struct  _provisioningOperation_t
 Internal structure representing a single Provisioning operation. More...
 

Macros

#define AwsIotProvisioning_Assert(expression)
 Assertion macro for the Provisioning library. More...
 
#define AWS_IOT_PROVISIONING_FORMAT   AWS_IOT_PROVISIONING_FORMAT_CBOR
 Default format for communication payload with AWS IoT Core service for Fleet Provisioning feature. More...
 
#define PROVISIONING_FORMAT   "cbor"
 
#define AwsIotProvisioning_MallocPayload   Iot_MallocMessageBuffer
 Allocate buffer for the payload of an MQTT publish operation. This function should have the same signature as malloc.
 
#define AwsIotProvisioning_FreePayload   Iot_FreeMessageBuffer
 Free an MQTT publish payload buffer. This function should have the same signature as free.
 
#define AwsIotProvisioning_MallocString   Iot_MallocMessageBuffer
 Allocate a buffer for a short string, which is used for temporarily storing the "parameter" name during serialization of the publish payload of a registerthing request operation. This function should have the same signature as malloc.
 
#define AwsIotProvisioning_FreeString   Iot_FreeMessageBuffer
 Free a string. This function should have the same signature as free.
 
#define AwsIotProvisioning_MallocDeviceConfigurationList   Iot_MallocMessageBuffer
 Allocate a list of AwsIotProvisioningResponseDeviceConfigurationEntry_t. This function should have the same signature as malloc.
 
#define AwsIotProvisioning_FreeDeviceConfigurationList   Iot_FreeMessageBuffer
 Free a list of AwsIotProvisioningResponseDeviceConfigurationEntry_t. This function should have the same signature as free.
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER   "$aws/certificates/create/"PROVISIONING_FORMAT
 The MQTT response topic filter for the Provisioning CreateKeysAndCertificate service API. More...
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER ) - 1 ) )
 Length of the MQTT response topic filter for the Provisioning CreateKeysAndCertificate service API.
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_MAX_TOPIC_LENGTH   ( PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER_LENGTH + sizeof( AWS_IOT_REJECTED_SUFFIX ) )
 The length of the longest MQTT response topic of the Provisioning CreateKeysAndCertificate service API. Out of the two response topics, the "rejected" has the longest length.
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_REQUEST_TOPIC   "$aws/certificates/create/"PROVISIONING_FORMAT
 The MQTT request topic for the Provisioning CreateKeysAndCertificate service API. More...
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_REQUEST_TOPIC_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_REQUEST_TOPIC ) - 1 ) )
 The length of the MQTT request topic for the Provisioning CreateKeysAndCertificate service API.
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER   "$aws/certificates/create-from-csr/"PROVISIONING_FORMAT
 The response topic filter for the MQTT CreateCertificateFromCsr service API. More...
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER ) - 1 ) )
 Length of the response topic filter for the MQTT CreateCertificateFromCsr service API.
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_MAX_TOPIC_LENGTH   ( PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER_LENGTH + sizeof( AWS_IOT_REJECTED_SUFFIX ) )
 The length of the longest response topic of the MQTT CreateCertificateFromCsr service API. Out of the two response topics, the "rejected" has the longest length.
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_TOPIC   "$aws/certificates/create-from-csr/"PROVISIONING_FORMAT
 The request topic for the MQTT CreateCertificateFromCsr service API. More...
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_TOPIC_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_TOPIC ) - 1 ) )
 The length of the request topic for the MQTT CreateCertificateFromCsr service API.
 
#define PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_PAYLOAD_PEM_STRING   "certificateSigningRequest"
 The key string for Certificate-Singing Request value in the request payload to the MQTT CreateCertificateFromCsr service API.
 
#define PROVISIONING_SERVER_RESPONSE_PAYLOAD_CERTIFICATE_PEM_STRING   "certificatePem"
 The key for the certificate PEM data in the response payloads of the MQTT Fleet Provisioning APIs.
 
#define PROVISIONING_SERVER_RESPONSE_PAYLOAD_CERTIFICATE_ID_STRING   "certificateId"
 The key for the certificate Id data in the response payload of the MQTT Fleet Provisioning APIs.
 
#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_PAYLOAD_PRIVATE_KEY_STRING   "privateKey"
 The key for the private key data in the response payload of the MQTT CreateKeysAndCertificate service API of Fleet Provisioning.
 
#define PROVISIONING_SERVER_RESPONSE_PAYLOAD_CERTIFICATE_TOKEN_KEY_STRING   "certificateOwnershipToken"
 The key for the token key data in the response payload of the MQTT Fleet Provisioning APIs.
 
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_PREFIX   "$aws/provisioning-templates/"
 The common path in the request and response MQTT topics of the Provisioning RegisterThing service API.
 
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_PREFIX_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_REGISTER_THING_TOPICS_COMMON_PREFIX ) - 1 ) )
 The length of the common path in the request and response MQTT topics of the Provisioning RegisterThing service API.
 
#define PROVISIONING_MAX_TEMPLATE_NAME_LENGTH   ( 36 )
 The maximum length of the Template name that can be used for provisioning the device. More...
 
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_SUFFIX   "/provision/"PROVISIONING_FORMAT
 The common suffix in the request and response MQTT topics of the Provisioning RegisterThing service API.
 
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_SUFFIX_LENGTH   ( ( uint16_t ) ( sizeof( PROVISIONING_REGISTER_THING_TOPICS_COMMON_SUFFIX ) - 1 ) )
 The length of the common suffix in the MQTT topics of the Provisioning RegisterThing service API.
 
#define PROVISIONING_REGISTER_THING_REQUEST_TOPIC_LENGTH
 The length of the complete MQTT request topic of the Provisioning RegisterThing service API. More...
 
#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_ID_STRING   "certificateId"
 The key for the certificate ID's entry to be inserted in the request payload for the Provisioning RegisterThing service API. More...
 
#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_TOKEN_STRING   "certificateOwnershipToken"
 The key for the certificate ownership token's entry to be inserted in the request payload for the provisioning the device. More...
 
#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_PARAMETERS_STRING   "parameters"
 The key for the device context data's entry to be inserted in the request payload for the RegisterThing service API. More...
 
#define PROVISIONING_REGISTER_THING_RESPONSE_TOPIC_FILTER_LENGTH
 The length of the MQTT request topic filter of the Provisioning RegisterThing service API. More...
 
#define PROVISIONING_REGISTER_THING_RESPONSE_MAX_TOPIC_LENGTH   ( PROVISIONING_REGISTER_THING_RESPONSE_TOPIC_FILTER_LENGTH + sizeof( AWS_IOT_REJECTED_SUFFIX ) )
 The length of the longest MQTT response topic of the Provisioning RegisterThing service API. Out of the two response topics, the "rejected" has the longest length.
 
#define PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_DEVICE_CONFIGURATION_STRING   "deviceConfiguration"
 The key for the device configuration data's entry in the response payload of the Provisioning RegisterThing service API. More...
 
#define PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_THING_NAME_STRING   "thingName"
 The key for the Thing resource name's entry in the response payload of the Provisioning RegisterThing service API. More...
 
#define PROVISIONING_REJECTED_RESPONSE_STATUS_CODE_STRING   "statusCode"
 The key for the status code entry in the "rejected" response payload from the server. More...
 
#define PROVISIONING_REJECTED_RESPONSE_ERROR_CODE_STRING   "errorCode"
 The key for the error code entry in the "rejected" response payload from the server. More...
 
#define PROVISIONING_REJECTED_RESPONSE_ERROR_MESSAGE_STRING   "errorMessage"
 The key for the status message entry in the "rejected" response payload from the server. More...
 
#define CREATE_KEYS_AND_CERTIFICATE_OPERATION_LOG   "CREATE KEYS AND CERTIFICATE"
 Printable names for each of the Provisioning operations.
 
#define CREATE_CERT_FROM_CSR_OPERATION_LOG   "CREATE CERTIFICATE FROM CSR"
 
#define REGISTER_THING_OPERATION_LOG   "REGISTER DEVICE"
 

Typedefs

typedef AwsIotProvisioningError_t(* _provisioningServerResponseParser) (AwsIotStatus_t responseType, const uint8_t *responsePayload, size_t responsePayloadLength, const _provisioningCallbackInfo_t *userCallback)
 Functor for parsing response payload received from AWS IoT Core. Parser that will de-serialize the server response, allocate memory for representing parsed data (if required), and invoke the user callback passed to it. More...
 

Enumerations

enum  _provisioningOperationType_t { PROVISIONING_CREATE_KEYS_AND_CERTIFICATE = 0, PROVISIONING_REGISTER_THING = 1 }
 Enumerations representing each of the Provisioning library's API functions. More...
 

Functions

size_t _AwsIotProvisioning_GenerateRegisterThingTopicFilter (const char *pTemplateName, size_t templateNameLength, char *pTopicFilterBuffer)
 Utility for generating the request/response MQTT topic filter string for the ProvisioningDevice service API. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_ParseKeysAndCertificateResponse (AwsIotStatus_t responseType, const uint8_t *pResponsePayload, size_t payloadLength, const _provisioningCallbackInfo_t *userCallbackInfo)
 Parses the response received from the server for device credentials, and invokes the provided user-callback with parsed credentials, if parsing was successful. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_ParseCsrResponse (AwsIotStatus_t responseType, const uint8_t *pResponsePayload, size_t payloadLength, const _provisioningCallbackInfo_t *userCallbackInfo)
 Parses the response from the server received on a Certificate-Signing Request, and invokes the provided user-callback with the parsed response. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_ParseRegisterThingResponse (AwsIotStatus_t responseType, const uint8_t *pResponsePayload, size_t responsePayloadLength, const _provisioningCallbackInfo_t *userCallbackInfo)
 Parses the response payload received from the server for device provisioning, and invokes the provided user-callback with parsed data, if parsing was successful. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_SerializeCreateKeysAndCertificateRequestPayload (uint8_t **pSerializationBuffer, size_t *pBufferSize)
 Serializes payload data for MQTT request to the Fleet Provisioning CreateKeysAndCertificate API on AWS IoT Core. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_CalculateCertFromCsrPayloadSize (const char *pCertificateSigningRequest, size_t csrLength, size_t *pPayloadSize)
 Calculates the payload size of serializing the passed Certificate-Signing Request data for the MQTT CreateCertificateFromCsr service API. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_SerializeCreateCertFromCsrRequestPayload (const char *pCertificateSigningRequest, size_t csrLength, uint8_t *pSerializationBuffer, size_t pBufferSize)
 Serializes payload data for the request to the MQTT CreateCertificateFromCsr service API, in the passed buffer. More...
 
AwsIotProvisioningError_t _AwsIotProvisioning_SerializeRegisterThingRequestPayload (const AwsIotProvisioningRegisterThingRequestInfo_t *pRequestData, uint8_t **pSerializationBuffer, size_t *pBufferSize)
 Serializes payload data for MQTT request to the Provisioning RegisterThing service API. More...
 

Variables

uint32_t _AwsIotProvisioningMqttTimeoutMs
 Timeout for MQTT operations that will be used for communicating with the fleet provisioning APIs of the AWS IoT Core server.
 
const IotSerializerEncodeInterface_t * _pAwsIotProvisioningEncoder
 Pointer to the encoder utility that will be used for serialization of payload data in the library.
 
const IotSerializerDecodeInterface_t * _pAwsIotProvisioningDecoder
 Pointer to the decoder utility that will be used for de-serialization of payload data in the library.
 

Detailed Description

Internal header of Provisioning library. This header should not be included in typical application code.

Macro Definition Documentation

◆ AwsIotProvisioning_Assert

#define AwsIotProvisioning_Assert (   expression)

Assertion macro for the Provisioning library.

Set AWS_IOT_PROVISIONING_ENABLE_ASSERTS to 1 to enable assertions in the Provisioning library.

Parameters
[in]expressionExpression to be evaluated.

◆ AWS_IOT_PROVISIONING_FORMAT

#define AWS_IOT_PROVISIONING_FORMAT   AWS_IOT_PROVISIONING_FORMAT_CBOR

Default format for communication payload with AWS IoT Core service for Fleet Provisioning feature.

Possible values: AWS_IOT_PROVISIONING_FORMAT_CBOR (JSON is not supported for now by the library)
Recommended values: Cbor is more compact than Json, thus more efficient.
Default value (if undefined): AWS_IOT_PROVISIONING_FORMAT_CBOR

◆ PROVISIONING_FORMAT

#define PROVISIONING_FORMAT   "cbor"

Define encoder/decoder based on configuration AWS_IOT_PROVISIONING_FORMAT.

◆ PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER

#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_RESPONSE_TOPIC_FILTER   "$aws/certificates/create/"PROVISIONING_FORMAT

The MQTT response topic filter for the Provisioning CreateKeysAndCertificate service API.

Note
The complete response topics are suffixed with AWS_IOT_ACCEPTED_SUFFIX or AWS_IOT_REJECTED_SUFFIX strings. It should be utilized in the AwsIotProvisioning_RegisterThing API function.

◆ PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_REQUEST_TOPIC

#define PROVISIONING_CREATE_KEYS_AND_CERTIFICATE_REQUEST_TOPIC   "$aws/certificates/create/"PROVISIONING_FORMAT

The MQTT request topic for the Provisioning CreateKeysAndCertificate service API.

Note
It should be utilized in the AwsIotProvisioning_RegisterThing API function.

◆ PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER

#define PROVISIONING_CREATE_CERT_FROM_CSR_RESPONSE_TOPIC_FILTER   "$aws/certificates/create-from-csr/"PROVISIONING_FORMAT

The response topic filter for the MQTT CreateCertificateFromCsr service API.

Note
The complete response topics are suffixed with AWS_IOT_ACCEPTED_SUFFIX or AWS_IOT_REJECTED_SUFFIX strings. It should be utilized in the AwsIotProvisioning_RegisterThing API function.

◆ PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_TOPIC

#define PROVISIONING_CREATE_CERT_FROM_CSR_REQUEST_TOPIC   "$aws/certificates/create-from-csr/"PROVISIONING_FORMAT

The request topic for the MQTT CreateCertificateFromCsr service API.

Note
It should be utilized in the AwsIotProvisioning_RegisterThing API function.

◆ PROVISIONING_MAX_TEMPLATE_NAME_LENGTH

#define PROVISIONING_MAX_TEMPLATE_NAME_LENGTH   ( 36 )

The maximum length of the Template name that can be used for provisioning the device.

Note
The template name is part of the MQTT topics of the Provisioning RegisterThing service API.

◆ PROVISIONING_REGISTER_THING_REQUEST_TOPIC_LENGTH

#define PROVISIONING_REGISTER_THING_REQUEST_TOPIC_LENGTH
Value:
PROVISIONING_REGISTER_THING_TOPICS_COMMON_SUFFIX_LENGTH )
#define PROVISIONING_MAX_TEMPLATE_NAME_LENGTH
The maximum length of the Template name that can be used for provisioning the device.
Definition: aws_iot_provisioning_internal.h:344
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_PREFIX_LENGTH
The length of the common path in the request and response MQTT topics of the Provisioning RegisterThi...
Definition: aws_iot_provisioning_internal.h:337

The length of the complete MQTT request topic of the Provisioning RegisterThing service API.

◆ PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_ID_STRING

#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_ID_STRING   "certificateId"

The key for the certificate ID's entry to be inserted in the request payload for the Provisioning RegisterThing service API.

Note
This should be used in serializing the request payload for sending to the server.

◆ PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_TOKEN_STRING

#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_CERTIFICATE_TOKEN_STRING   "certificateOwnershipToken"

The key for the certificate ownership token's entry to be inserted in the request payload for the provisioning the device.

Note
This should be used in serializing the request payload for sending to the server.

◆ PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_PARAMETERS_STRING

#define PROVISIONING_REGISTER_THING_REQUEST_PAYLOAD_PARAMETERS_STRING   "parameters"

The key for the device context data's entry to be inserted in the request payload for the RegisterThing service API.

Note
This should be used in serializing the request payload for sending to the server, only if the calling application provides valid device context data.

◆ PROVISIONING_REGISTER_THING_RESPONSE_TOPIC_FILTER_LENGTH

#define PROVISIONING_REGISTER_THING_RESPONSE_TOPIC_FILTER_LENGTH
Value:
PROVISIONING_REGISTER_THING_TOPICS_COMMON_SUFFIX_LENGTH )
#define PROVISIONING_MAX_TEMPLATE_NAME_LENGTH
The maximum length of the Template name that can be used for provisioning the device.
Definition: aws_iot_provisioning_internal.h:344
#define PROVISIONING_REGISTER_THING_TOPICS_COMMON_PREFIX_LENGTH
The length of the common path in the request and response MQTT topics of the Provisioning RegisterThi...
Definition: aws_iot_provisioning_internal.h:337

The length of the MQTT request topic filter of the Provisioning RegisterThing service API.

◆ PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_DEVICE_CONFIGURATION_STRING

#define PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_DEVICE_CONFIGURATION_STRING   "deviceConfiguration"

The key for the device configuration data's entry in the response payload of the Provisioning RegisterThing service API.

Note
This should be utilized in parsing the success case response payload received from the server.

◆ PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_THING_NAME_STRING

#define PROVISIONING_REGISTER_THING_RESPONSE_PAYLOAD_THING_NAME_STRING   "thingName"

The key for the Thing resource name's entry in the response payload of the Provisioning RegisterThing service API.

Note
This should be utilized in parsing the success case response payload received from the server.

◆ PROVISIONING_REJECTED_RESPONSE_STATUS_CODE_STRING

#define PROVISIONING_REJECTED_RESPONSE_STATUS_CODE_STRING   "statusCode"

The key for the status code entry in the "rejected" response payload from the server.

Note
This should be utilized in parsing the response payload received from the server.

◆ PROVISIONING_REJECTED_RESPONSE_ERROR_CODE_STRING

#define PROVISIONING_REJECTED_RESPONSE_ERROR_CODE_STRING   "errorCode"

The key for the error code entry in the "rejected" response payload from the server.

Note
This should be utilized in parsing the response payload received from the server.

◆ PROVISIONING_REJECTED_RESPONSE_ERROR_MESSAGE_STRING

#define PROVISIONING_REJECTED_RESPONSE_ERROR_MESSAGE_STRING   "errorMessage"

The key for the status message entry in the "rejected" response payload from the server.

Note
This should be utilized in parsing the response payload received from the server.

Typedef Documentation

◆ _provisioningServerResponseParser

typedef AwsIotProvisioningError_t( * _provisioningServerResponseParser) (AwsIotStatus_t responseType, const uint8_t *responsePayload, size_t responsePayloadLength, const _provisioningCallbackInfo_t *userCallback)

Functor for parsing response payload received from AWS IoT Core. Parser that will de-serialize the server response, allocate memory for representing parsed data (if required), and invoke the user callback passed to it.

Parameters
[in]responseTypeThe type of response, "accepted" or "rejected" received from the server for the operation.
[in]responsePayloadThe response payload to parse.
[in]responsePayloadLengthThe length of the response payload.
[in]usercallbackThe user-provided callback to invoke on successful parsing of device credentials.

Enumeration Type Documentation

◆ _provisioningOperationType_t

Enumerations representing each of the Provisioning library's API functions.

Enumerator
PROVISIONING_CREATE_KEYS_AND_CERTIFICATE 

AwsIotProvisioning_RegisterThing

PROVISIONING_REGISTER_THING 

AwsIotProvisioning_RegisterThing

Function Documentation

◆ _AwsIotProvisioning_GenerateRegisterThingTopicFilter()

size_t _AwsIotProvisioning_GenerateRegisterThingTopicFilter ( const char *  pTemplateName,
size_t  templateNameLength,
char *  pTopicFilterBuffer 
)

Utility for generating the request/response MQTT topic filter string for the ProvisioningDevice service API.

Parameters
[in]pTemplateNameThe template ID string for inserting in the topic filter string.
[in]templateNameLengthThe length of the template ID string.
[out]pTopicFilterBufferThe pre-allocated buffer for storing the generated topic filter. The buffer should have the required minimum size for storing the MQTT topic filter for the Provisioning RegisterThing API.
Returns
Returns the size of the generated topic filter.

◆ _AwsIotProvisioning_ParseKeysAndCertificateResponse()

AwsIotProvisioningError_t _AwsIotProvisioning_ParseKeysAndCertificateResponse ( AwsIotStatus_t  responseType,
const uint8_t *  pResponsePayload,
size_t  payloadLength,
const _provisioningCallbackInfo_t userCallbackInfo 
)

Parses the response received from the server for device credentials, and invokes the provided user-callback with parsed credentials, if parsing was successful.

Parameters
[in]responseTypeThe type of response, "accepted" or "rejected" received from the server for the operation.
[in]pResponsePayloadThe response payload from the server to parse.
[in]payloadLengthThe length of the response payload.
[in]userCallbackInfoThe user-provided callback to invoke on successful parsing of response.
Returns
Returns AWS_IOT_PROVISIONING_SUCCESS when parsing is successful, otherwise the appropriate error code.

◆ _AwsIotProvisioning_ParseCsrResponse()

AwsIotProvisioningError_t _AwsIotProvisioning_ParseCsrResponse ( AwsIotStatus_t  responseType,
const uint8_t *  pResponsePayload,
size_t  payloadLength,
const _provisioningCallbackInfo_t userCallbackInfo 
)

Parses the response from the server received on a Certificate-Signing Request, and invokes the provided user-callback with the parsed response.

Note
If the server accepts the request, the received certificate information is passed to the user-callback otherwise, the error information is passed on request rejection by the server.
Parameters
[in]responseTypeThe type of response, "accepted" or "rejected" received from the server for the operation.
[in]pResponsePayloadThe response payload from the server to parse.
[in]payloadLengthThe length of the response payload.
[in]userCallbackInfoThe user-provided callback to invoke on successful parsing of response.
Returns
Returns AWS_IOT_PROVISIONING_SUCCESS when parsing is successful, otherwise the appropriate error code.

◆ _AwsIotProvisioning_ParseRegisterThingResponse()

AwsIotProvisioningError_t _AwsIotProvisioning_ParseRegisterThingResponse ( AwsIotStatus_t  responseType,
const uint8_t *  pResponsePayload,
size_t  responsePayloadLength,
const _provisioningCallbackInfo_t userCallbackInfo 
)

Parses the response payload received from the server for device provisioning, and invokes the provided user-callback with parsed data, if parsing was successful.

Parameters
[in]responseTypeThe type of response, "accepted" or "rejected" received from the server for the operation.
[in]pResponsePayloadThe response payload from the server to parse.
[in]responsePayloadLengthThe length of the response payload.
[in]userCallbackInfoThe user-provided callback to invoke on successful parsing of response.
Returns
Returns AWS_IOT_PROVISIONING_SUCCESS when parsing is successful, otherwise the appropriate error code.

The serializer library allocates memory for the iterator. It can only be released by iterating to the last element in the map containers and "stepping out" of the container Thus, we will iterate to the end of the device configuration container to invalidate the iterator.

◆ _AwsIotProvisioning_SerializeCreateKeysAndCertificateRequestPayload()

AwsIotProvisioningError_t _AwsIotProvisioning_SerializeCreateKeysAndCertificateRequestPayload ( uint8_t **  pSerializationBuffer,
size_t *  pBufferSize 
)

Serializes payload data for MQTT request to the Fleet Provisioning CreateKeysAndCertificate API on AWS IoT Core.

Parameters
[out]pSerializationBufferThis will be assigned to a buffer that will be allocated and populated with the serialized payload data.
[out]pBufferSizeThis will be populated with the size of the allocated payload data buffer.
Returns
AWS_IOT_PROVISIONING_SUCCESS if serialization is successful; otherwise AWS_IOT_PROVISIONING_INTERNAL_FAILURE for any serialization error.

◆ _AwsIotProvisioning_CalculateCertFromCsrPayloadSize()

AwsIotProvisioningError_t _AwsIotProvisioning_CalculateCertFromCsrPayloadSize ( const char *  pCertificateSigningRequest,
size_t  csrLength,
size_t *  pPayloadSize 
)

Calculates the payload size of serializing the passed Certificate-Signing Request data for the MQTT CreateCertificateFromCsr service API.

Note
This function performs a dry-run serialization of the payload data to calculate the payload size. This function should be called to determine the size of the buffer to allocate for the actual payload serialization.
Parameters
[in]pCertificateSigningRequestThe Certificate-Signing Request string which represents the data to be serialized in the payload.
[in]csrLengthThe length of the Certificate-Signing Request string.
[in]pPayloadSizeThis will be populated with the size of the serialized data.
Returns
AWS_IOT_PROVISIONING_SUCCESS if calculation of the payload size is successful; otherwise AWS_IOT_PROVISIONING_INTERNAL_FAILURE for any serialization failures.

◆ _AwsIotProvisioning_SerializeCreateCertFromCsrRequestPayload()

AwsIotProvisioningError_t _AwsIotProvisioning_SerializeCreateCertFromCsrRequestPayload ( const char *  pCertificateSigningRequest,
size_t  csrLength,
uint8_t *  pSerializationBuffer,
size_t  pBufferSize 
)

Serializes payload data for the request to the MQTT CreateCertificateFromCsr service API, in the passed buffer.

Parameters
[in]pCertificateSigningRequestThe Certificate-Signing Request string to serialize for the request.
[in]csrLengthThe length of the Certificate-Signing Request string.
[in,out]pSerializationBufferThe buffer for storing the serialized payload data.
[in]pBufferSizeTHe size of the serialization buffer.
Returns
AWS_IOT_PROVISIONING_SUCCESS if calculation of the payload size is successful; otherwise the appropriate error code.

◆ _AwsIotProvisioning_SerializeRegisterThingRequestPayload()

AwsIotProvisioningError_t _AwsIotProvisioning_SerializeRegisterThingRequestPayload ( const AwsIotProvisioningRegisterThingRequestInfo_t pRequestData,
uint8_t **  pSerializationBuffer,
size_t *  pBufferSize 
)

Serializes payload data for MQTT request to the Provisioning RegisterThing service API.

Parameters
[in]pRequestDataThe data that will be serialized for sending with the request.
[out]pSerializationBufferThis will be assigned to a buffer that will be allocated and populated with the serialized payload data.
Note
The calling code is responsible for de-allocation of the buffer memory.
Parameters
[out]pBufferSizeThis will be populated with the size of the allocated payload data buffer.
Returns
AWS_IOT_PROVISIONING_SUCCESS if serialization is successful; otherwise AWS_IOT_PROVISIONING_INTERNAL_FAILURE for any serialization error.