Interface for the AWS IoT Fleet Provisioning Library. More...
#include <stdint.h>
#include "fleet_provisioning_config.h"
#include "fleet_provisioning_config_defaults.h"
Go to the source code of this file.
Macros | |
#define | FP_TEMPLATENAME_MAX_LENGTH 36U |
Maximum length of a thing's name as permitted by AWS IoT Core. | |
#define | FP_JSON_CREATE_CERT_PUBLISH_TOPIC |
Topic string for publishing a JSON CreateCertificateFromCSR request. | |
#define | FP_JSON_CREATE_CERT_ACCEPTED_TOPIC |
Topic string for getting a JSON CreateCertificateFromCSR accepted response. | |
#define | FP_JSON_CREATE_CERT_REJECTED_TOPIC |
Topic string for getting a JSON CreateCertificateFromCSR error response. | |
#define | FP_CBOR_CREATE_CERT_PUBLISH_TOPIC |
Topic string for publishing a CBOR CreateCertificateFromCSR request. | |
#define | FP_CBOR_CREATE_CERT_ACCEPTED_TOPIC |
Topic string for getting a CBOR CreateCertificateFromCSR accepted response. | |
#define | FP_CBOR_CREATE_CERT_REJECTED_TOPIC |
Topic string for getting a CBOR CreateCertificateFromCSR error response. | |
#define | FP_JSON_CREATE_CERT_PUBLISH_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_CERT_PUBLISH_TOPIC ) - 1U ) ) |
Length of topic string for publishing a JSON CreateCertificateFromCSR request. | |
#define | FP_JSON_CREATE_CERT_ACCEPTED_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_CERT_ACCEPTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a JSON CreateCertificateFromCSR accepted response. | |
#define | FP_JSON_CREATE_CERT_REJECTED_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_CERT_REJECTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a JSON CreateCertificateFromCSR error response. | |
#define | FP_CBOR_CREATE_CERT_PUBLISH_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_CERT_PUBLISH_TOPIC ) - 1U ) ) |
Length of topic string for publishing a CBOR CreateCertificateFromCSR request. | |
#define | FP_CBOR_CREATE_CERT_ACCEPTED_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_CERT_ACCEPTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a CBOR CreateCertificateFromCSR accepted response. | |
#define | FP_CBOR_CREATE_CERT_REJECTED_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_CERT_REJECTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a CBOR CreateCertificateFromCSR error response. | |
#define | FP_JSON_CREATE_KEYS_PUBLISH_TOPIC |
Topic string for publishing a JSON CreateKeysAndCertificate request. | |
#define | FP_JSON_CREATE_KEYS_ACCEPTED_TOPIC |
Topic string for getting a JSON CreateKeysAndCertificate accepted response. | |
#define | FP_JSON_CREATE_KEYS_REJECTED_TOPIC |
Topic string for getting a JSON CreateKeysAndCertificate error response. | |
#define | FP_CBOR_CREATE_KEYS_PUBLISH_TOPIC |
Topic string for publishing a CBOR CreateKeysAndCertificate request. | |
#define | FP_CBOR_CREATE_KEYS_ACCEPTED_TOPIC |
Topic string for getting a CBOR CreateKeysAndCertificate accepted response. | |
#define | FP_CBOR_CREATE_KEYS_REJECTED_TOPIC |
Topic string for getting a CBOR CreateKeysAndCertificate error response. | |
#define | FP_JSON_CREATE_KEYS_PUBLISH_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_KEYS_PUBLISH_TOPIC ) - 1U ) ) |
Length of topic string for publishing a JSON CreateKeysAndCertificate request. | |
#define | FP_JSON_CREATE_KEYS_ACCEPTED_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_KEYS_ACCEPTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a JSON CreateKeysAndCertificate accepted response. | |
#define | FP_JSON_CREATE_KEYS_REJECTED_LENGTH ( ( uint16_t ) ( sizeof( FP_JSON_CREATE_KEYS_REJECTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a JSON CreateKeysAndCertificate error response. | |
#define | FP_CBOR_CREATE_KEYS_PUBLISH_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_KEYS_PUBLISH_TOPIC ) - 1U ) ) |
Length of topic string for publishing a CBOR CreateKeysAndCertificate request. | |
#define | FP_CBOR_CREATE_KEYS_ACCEPTED_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_KEYS_ACCEPTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a CBOR CreateKeysAndCertificate accepted response. | |
#define | FP_CBOR_CREATE_KEYS_REJECTED_LENGTH ( ( uint16_t ) ( sizeof( FP_CBOR_CREATE_KEYS_REJECTED_TOPIC ) - 1U ) ) |
Length of topic string for getting a CBOR CreateKeysAndCertificate error response. | |
#define | FP_JSON_REGISTER_PUBLISH_TOPIC(templateName) |
Topic string for publishing a JSON RegisterThing request. | |
#define | FP_JSON_REGISTER_ACCEPTED_TOPIC(templateName) |
Topic string for getting a JSON RegisterThing accepted response. | |
#define | FP_JSON_REGISTER_REJECTED_TOPIC(templateName) |
Topic string for getting a JSON RegisterThing error response. | |
#define | FP_CBOR_REGISTER_PUBLISH_TOPIC(templateName) |
Topic string for publishing a CBOR RegisterThing request. | |
#define | FP_CBOR_REGISTER_ACCEPTED_TOPIC(templateName) |
Topic string for getting a CBOR RegisterThing accepted response. | |
#define | FP_CBOR_REGISTER_REJECTED_TOPIC(templateName) |
Topic string for getting a CBOR RegisterThing error response. | |
#define | FP_JSON_REGISTER_PUBLISH_LENGTH(templateNameLength) |
Length of topic string for publishing a JSON RegisterThing request. | |
#define | FP_JSON_REGISTER_ACCEPTED_LENGTH(templateNameLength) |
Length of topic string for getting a JSON RegisterThing accepted response. | |
#define | FP_JSON_REGISTER_REJECTED_LENGTH(templateNameLength) |
Length of topic string for getting a JSON RegisterThing error response. | |
#define | FP_CBOR_REGISTER_PUBLISH_LENGTH(templateNameLength) |
Length of topic string for publishing a CBOR RegisterThing request. | |
#define | FP_CBOR_REGISTER_ACCEPTED_LENGTH(templateNameLength) |
Length of topic string for getting a CBOR RegisterThing accepted response. | |
#define | FP_CBOR_REGISTER_REJECTED_LENGTH(templateNameLength) |
Length of topic string for getting a CBOR RegisterThing error response. | |
#define | FP_API_CSR_KEY "certificateSigningRequest" |
Key for the PEM-encoded certificate signing request in the CreateCertificateFromCSR request payload. | |
#define | FP_API_OWNERSHIP_TOKEN_KEY "certificateOwnershipToken" |
Key for the certificate ownership token in the CreateCertificateFromCSR and CreateKeysAndCertificate response payloads, and the RegisterThing request payload. | |
#define | FP_API_CERTIFICATE_ID_KEY "certificateId" |
Key for the certificate ID in the CreateCertificateFromCSR and CreateKeysAndCertificate response payloads. | |
#define | FP_API_CERTIFICATE_PEM_KEY "certificatePem" |
Key for the PEM-encoded certificate in the CreateCertificateFromCSR and CreateKeysAndCertificate response payloads. | |
#define | FP_API_PRIVATE_KEY_KEY "privateKey" |
Key for the private key in the CreateKeysAndCertificate response payload. | |
#define | FP_API_PARAMETERS_KEY "parameters" |
Key for the optional parameters in the RegisterThing request payload. | |
#define | FP_API_DEVICE_CONFIG_KEY "deviceConfiguration" |
Key for the template-defined device configuration in the RegisterThing response payload. | |
#define | FP_API_THING_NAME_KEY "thingName" |
Key for the name of the created AWS IoT Thing in the RegisterThing response payload. | |
#define | FP_API_STATUS_CODE_KEY "statusCode" |
Key for the status code in Fleet Provisioning error response payloads. | |
#define | FP_API_ERROR_CODE_KEY "errorCode" |
Key for the error code in Fleet Provisioning error response payloads. | |
#define | FP_API_ERROR_MESSAGE_KEY "errorMessage" |
Key for the error message in Fleet Provisioning error response payloads. | |
Enumerations | |
enum | FleetProvisioningStatus_t { FleetProvisioningError = 0 , FleetProvisioningSuccess , FleetProvisioningNoMatch , FleetProvisioningBadParameter , FleetProvisioningBufferTooSmall } |
Return codes for Fleet Provisioning APIs. | |
enum | FleetProvisioningTopic_t { FleetProvisioningInvalidTopic = 0 , FleetProvJsonCreateCertFromCsrPublish , FleetProvJsonCreateCertFromCsrAccepted , FleetProvJsonCreateCertFromCsrRejected , FleetProvJsonCreateKeysAndCertPublish , FleetProvJsonCreateKeysAndCertAccepted , FleetProvJsonCreateKeysAndCertRejected , FleetProvJsonRegisterThingPublish , FleetProvJsonRegisterThingAccepted , FleetProvJsonRegisterThingRejected , FleetProvCborCreateCertFromCsrPublish , FleetProvCborCreateCertFromCsrAccepted , FleetProvCborCreateCertFromCsrRejected , FleetProvCborCreateKeysAndCertPublish , FleetProvCborCreateKeysAndCertAccepted , FleetProvCborCreateKeysAndCertRejected , FleetProvCborRegisterThingPublish , FleetProvCborRegisterThingAccepted , FleetProvCborRegisterThingRejected } |
Fleet Provisioning topic values. | |
enum | FleetProvisioningApiTopics_t { FleetProvisioningPublish , FleetProvisioningAccepted , FleetProvisioningRejected } |
Topics for each Fleet Provisioning APIs. | |
enum | FleetProvisioningFormat_t { FleetProvisioningJson , FleetProvisioningCbor } |
Message format for Fleet Provisioning APIs. | |
Functions | |
FleetProvisioningStatus_t | FleetProvisioning_GetRegisterThingTopic (char *pTopicBuffer, uint16_t bufferLength, FleetProvisioningFormat_t format, FleetProvisioningApiTopics_t topic, const char *pTemplateName, uint16_t templateNameLength, uint16_t *pOutLength) |
Populate the topic string for a Fleet Provisioning RegisterThing topic. | |
FleetProvisioningStatus_t | FleetProvisioning_MatchTopic (const char *pTopic, uint16_t topicLength, FleetProvisioningTopic_t *pOutApi) |
Check if the given topic is one of the Fleet Provisioning topics. | |
Interface for the AWS IoT Fleet Provisioning Library.
#define FP_JSON_CREATE_CERT_PUBLISH_TOPIC |
Topic string for publishing a JSON CreateCertificateFromCSR request.
#define FP_JSON_CREATE_CERT_ACCEPTED_TOPIC |
Topic string for getting a JSON CreateCertificateFromCSR accepted response.
#define FP_JSON_CREATE_CERT_REJECTED_TOPIC |
Topic string for getting a JSON CreateCertificateFromCSR error response.
#define FP_CBOR_CREATE_CERT_PUBLISH_TOPIC |
Topic string for publishing a CBOR CreateCertificateFromCSR request.
#define FP_CBOR_CREATE_CERT_ACCEPTED_TOPIC |
Topic string for getting a CBOR CreateCertificateFromCSR accepted response.
#define FP_CBOR_CREATE_CERT_REJECTED_TOPIC |
Topic string for getting a CBOR CreateCertificateFromCSR error response.
#define FP_JSON_CREATE_KEYS_PUBLISH_TOPIC |
Topic string for publishing a JSON CreateKeysAndCertificate request.
#define FP_JSON_CREATE_KEYS_ACCEPTED_TOPIC |
Topic string for getting a JSON CreateKeysAndCertificate accepted response.
#define FP_JSON_CREATE_KEYS_REJECTED_TOPIC |
Topic string for getting a JSON CreateKeysAndCertificate error response.
#define FP_CBOR_CREATE_KEYS_PUBLISH_TOPIC |
Topic string for publishing a CBOR CreateKeysAndCertificate request.
#define FP_CBOR_CREATE_KEYS_ACCEPTED_TOPIC |
Topic string for getting a CBOR CreateKeysAndCertificate accepted response.
#define FP_CBOR_CREATE_KEYS_REJECTED_TOPIC |
Topic string for getting a CBOR CreateKeysAndCertificate error response.
#define FP_JSON_REGISTER_PUBLISH_TOPIC | ( | templateName | ) |
Topic string for publishing a JSON RegisterThing request.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_JSON_REGISTER_ACCEPTED_TOPIC | ( | templateName | ) |
Topic string for getting a JSON RegisterThing accepted response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_JSON_REGISTER_REJECTED_TOPIC | ( | templateName | ) |
Topic string for getting a JSON RegisterThing error response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_CBOR_REGISTER_PUBLISH_TOPIC | ( | templateName | ) |
Topic string for publishing a CBOR RegisterThing request.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_CBOR_REGISTER_ACCEPTED_TOPIC | ( | templateName | ) |
Topic string for getting a CBOR RegisterThing accepted response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_CBOR_REGISTER_REJECTED_TOPIC | ( | templateName | ) |
Topic string for getting a CBOR RegisterThing error response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateName | The name of the provisioning template to use. |
#define FP_JSON_REGISTER_PUBLISH_LENGTH | ( | templateNameLength | ) |
Length of topic string for publishing a JSON RegisterThing request.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
#define FP_JSON_REGISTER_ACCEPTED_LENGTH | ( | templateNameLength | ) |
Length of topic string for getting a JSON RegisterThing accepted response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
#define FP_JSON_REGISTER_REJECTED_LENGTH | ( | templateNameLength | ) |
Length of topic string for getting a JSON RegisterThing error response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
#define FP_CBOR_REGISTER_PUBLISH_LENGTH | ( | templateNameLength | ) |
Length of topic string for publishing a CBOR RegisterThing request.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
#define FP_CBOR_REGISTER_ACCEPTED_LENGTH | ( | templateNameLength | ) |
Length of topic string for getting a CBOR RegisterThing accepted response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
#define FP_CBOR_REGISTER_REJECTED_LENGTH | ( | templateNameLength | ) |
Length of topic string for getting a CBOR RegisterThing error response.
This macro should be used when the provisioning template name is known at compile time. If the provisioning template name is not known at compile time, the FleetProvisioning_GetRegisterThingTopic API should be used instead.
templateNameLength | The length of the provisioning template name. |
FleetProvisioningStatus_t FleetProvisioning_GetRegisterThingTopic | ( | char * | pTopicBuffer, |
uint16_t | bufferLength, | ||
FleetProvisioningFormat_t | format, | ||
FleetProvisioningApiTopics_t | topic, | ||
const char * | pTemplateName, | ||
uint16_t | templateNameLength, | ||
uint16_t * | pOutLength | ||
) |
Populate the topic string for a Fleet Provisioning RegisterThing topic.
[out] | pTopicBuffer | The buffer to write the topic string into. |
[in] | bufferLength | The length of pTopicBuffer . |
[in] | format | The desired RegisterThing format. |
[in] | topic | The desired RegisterThing topic. |
[in] | pTemplateName | The name of the provisioning template configured with AWS IoT. |
[in] | templateNameLength | The length of the provisioning template name. |
[out] | pOutLength | The length of the topic string written to the buffer. |
example
FleetProvisioningStatus_t FleetProvisioning_MatchTopic | ( | const char * | pTopic, |
uint16_t | topicLength, | ||
FleetProvisioningTopic_t * | pOutApi | ||
) |
Check if the given topic is one of the Fleet Provisioning topics.
The function outputs which API the topic is for.
[in] | pTopic | The topic string to check. |
[in] | topicLength | The length of the topic string. |
[out] | pOutApi | The Fleet Provisioning topic API value. |
Example