AWS IoT Fleet Provisioning  v1.0.0
AWS IoT Fleet Provisioning Library
FleetProvisioning_MatchTopic

Check if the given topic is one of the Fleet Provisioning topics.

uint16_t topicLength,

The function outputs which API the topic is for.

Parameters
[in]pTopicThe topic string to check.
[in]topicLengthThe length of the topic string.
[out]pOutApiThe Fleet Provisioning topic API value.
Returns
FleetProvisioningSuccess if the topic is one of the Fleet Provisioning topics; FleetProvisioningBadParameter if invalid parameters are passed; FleetProvisioningNoMatch if the topic is NOT one of the Fleet Provisioning topics (parameter pOutApi gets FleetProvisioningInvalidTopic).

Example

// The following example shows how to use the FleetProvisioning_MatchTopic
// function to check if an incoming MQTT publish message is a Fleet
// Provisioning message.
FleetProvisioningStatus_t status = FleetProvisioningError;
// pTopic and topicLength are the topic string and length of the topic on
// which the publish message is received. These are usually provided by the
// MQTT library used.
topicLength,
&( api ) );
if( status == FleetProvisioningSuccess )
{
if( api == FleetProvJsonCreateCertFromCsrAccepted )
{
// The published JSON request was accepted and completed by the AWS
// IoT Fleet Provisioning service. You can parse the response using
// your choice of JSON parser get the certificate, ID, and ownership
// token.
}
else if( api == FleetProvJsonCreateCertFromCsrRejected )
{
// The published JSON request was rejected by the AWS IoT Fleet
// Provisioning service.
}
else
{
// Unexpected response.
}
}
FleetProvisioning_MatchTopic
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.
Definition: fleet_provisioning.c:729
FleetProvisioningStatus_t
FleetProvisioningStatus_t
Return codes for Fleet Provisioning APIs.
Definition: fleet_provisioning.h:56
FleetProvisioningTopic_t
FleetProvisioningTopic_t
Fleet Provisioning topic values.
Definition: fleet_provisioning.h:69