1.1.18.2 Connection Properties

Connection properties can be included when calling WDRV_WINC_MQTTConnect to connect to a version 5 MQTT broker.

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

IDNameSet FunctionValid ValuesDisable Value
17Session Expiry IntervalWDRV_WINC_MQTTConnPropSessionExpirySet> 00
33Receive MaximumWDRV_WINC_MQTTConnPropReceiveMaxSet> 00
34Topic Alias MaximumWDRV_WINC_MQTTConnPropTopicAliasMaxSet> 00
39Maximum Packet SizeWDRV_WINC_MQTTConnPropMaxPacketSet> 00

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

WDRV_WINC_MQTT_CONN_PROP connProp;

/* Initialize the connection property structure to default values. */
WDRV_WINC_MQTTConnPropDefaultSet(&connProp);

/* Set the Topic Alias Maximum property to 100. */
WDRV_WINC_MQTTConnPropTopicAliasMaxSet(&connProp, 100);

/* Connect to the MQTT broker including the connection properties. */
WDRV_WINC_MQTTConnect(wdrvHandle, true, 0, protoVer, &connProp, mqttConnCallback, 0);