uint16_t topicLength,
const char ** ppOutThingName,
uint16_t * pOutThingNameLength );
DefenderStatus_t Defender_MatchTopic(const char *pTopic, uint16_t topicLength, DefenderTopic_t *pOutApi, const char **ppOutThingName, uint16_t *pOutThingNameLength)
Check if the given topic is one of the Device Defender topics.
Definition: defender.c:465
DefenderStatus_t
Return codes from defender APIs.
Definition: defender.h:58
DefenderTopic_t
Topic values for subscription requests.
Definition: defender.h:71
Check if the given topic is one of the Device Defender topics.
The function outputs which API the topic is for. It also optionally outputs the starting location and length of the thing name in the given topic.
- Parameters
-
| [in] | pTopic | The topic string to check. |
| [in] | topicLength | The length of the topic string. |
| [out] | pOutApi | The defender topic API value. |
| [out] | ppOutThingName | Optional parameter to output the beginning of the thing name in the topic string. Pass NULL if not needed. |
| [out] | pOutThingNameLength | Optional parameter to output the length of the thing name in the topic string. Pass NULL if not needed. |
- Returns
- DefenderSuccess if the topic is one of the defender topics; DefenderBadParameter if invalid parameters are passed; DefenderNoMatch if the topic is NOT one of the defender topics (parameter pOutApi gets DefenderInvalidTopic).
Example
topicLength,
&( api ),
NULL,
NULL );
{
{
}
{
}
else
{
}
}
@ DefenderSuccess
Definition: defender.h:60
@ DefenderJsonReportAccepted
Definition: defender.h:74
@ DefenderJsonReportRejected
Definition: defender.h:75