Populate the topic string for a Fleet Provisioning RegisterThing topic.
uint16_t bufferLength,
const char * pTemplateName,
uint16_t templateNameLength,
uint16_t * pOutLength );
- Parameters
-
[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. |
- Returns
- FleetProvisioningSuccess if the topic string is written to the buffer; FleetProvisioningBadParameter if invalid parameters, such as non-RegisterThing topics, are passed; FleetProvisioningBufferTooSmall if the buffer cannot hold the full topic string.
example
#define TOPIC_BUFFER_LENGTH ( 256u )
#define TEMPLATE_NAME "template_name"
#define TEMPLATE_NAME_LENGTH ( ( uint16_t ) ( sizeof( TEMPLATE_NAME ) - 1U )
char pTopicbuffer[ TOPIC_BUFFER_LENGTH ] = { 0 };
uint16_t topicLength = 0;
TOPIC_BUFFER_LENGTH,
FleetProvisioningJson,
FleetProvisioningAccepted,
TEMPLATE_NAME,
TEMPLATE_NAME_LENGTH,
&( topiclength ) );
if( status == FleetProvisioningSuccess )
{
}