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:
ID | Name | Set Function | Valid Values | Disable Value |
---|---|---|---|---|
17 | Session Expiry Interval | WDRV_WINC_MQTTConnPropSessionExpirySet | > 0 | 0 |
33 | Receive Maximum | WDRV_WINC_MQTTConnPropReceiveMaxSet | > 0 | 0 |
34 | Topic Alias Maximum | WDRV_WINC_MQTTConnPropTopicAliasMaxSet | > 0 | 0 |
39 | Maximum Packet Size | WDRV_WINC_MQTTConnPropMaxPacketSet | > 0 | 0 |
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);