1.1.18.6 Subscribe Properties

Subscribe properties can be included when calling WDRV_WINC_MQTTSubscribe to subscribe to a topic.

WDRV_WINC_MQTTSubPropDefaultSet is used to initialize a WDRV_WINC_MQTT_SUB_PROP structure, then the following functions can be used to set the selected properties:

IDNameSet FunctionValid ValuesDisable Value
11Subscription IdentifierWDRV_WINC_MQTTSubPropSubscriptIDSet>00

Setting a property value to its disable value will ensure the property is not included in the subscribe message.

WDRV_WINC_MQTT_SUB_PROP subProp;

/* Initialize the subscription property structure to default values. */
WDRV_WINC_MQTTSubPropDefaultSet(&subProp);

/* Set the Subscription ID property to 10. */
WDRV_WINC_MQTTSubPropSubscriptIDSet(&subProp, 10);

/* Subscribe to the MQTT topic including subscription properties. */
WDRV_WINC_MQTTSubscribe(wdrvHandle, WINC_CONST_MQTT_QOS_QOS0, "TopicName", &subProp, mqttSubscribeCallback, 0);