Commit 62db601e authored by Ian Craggs's avatar Ian Craggs

MQTT Version selection fix

Bug: 438176
parent 8a0dabbb
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* Ian Craggs - fix for bug 420851 * Ian Craggs - fix for bug 420851
* Ian Craggs - fix for bug 432903 - queue persistence * Ian Craggs - fix for bug 432903 - queue persistence
* Ian Craggs - MQTT 3.1.1 support * Ian Craggs - MQTT 3.1.1 support
* Ian Craggs - fix for bug 438176 - MQTT version selection
*******************************************************************************/ *******************************************************************************/
/** /**
...@@ -1023,14 +1024,14 @@ int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* options, ...@@ -1023,14 +1024,14 @@ int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* options,
m->c->password = options->password; m->c->password = options->password;
m->c->retryInterval = options->retryInterval; m->c->retryInterval = options->retryInterval;
if (options->struct_version == 3) if (options->struct_version >= 3)
MQTTVersion = options->MQTTVersion; MQTTVersion = options->MQTTVersion;
else else
MQTTVersion = MQTTVERSION_DEFAULT; MQTTVersion = MQTTVERSION_DEFAULT;
if (MQTTVersion == MQTTVERSION_DEFAULT) if (MQTTVersion == MQTTVERSION_DEFAULT)
{ {
if ((rc = MQTTClient_connectURIVersion(handle, options, serverURI, 4 , start, millisecsTimeout)) != MQTTCLIENT_SUCCESS) if ((rc = MQTTClient_connectURIVersion(handle, options, serverURI, 4, start, millisecsTimeout)) != MQTTCLIENT_SUCCESS)
rc = MQTTClient_connectURIVersion(handle, options, serverURI, 3, start, millisecsTimeout); rc = MQTTClient_connectURIVersion(handle, options, serverURI, 3, start, millisecsTimeout);
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment