From 26b015908e5c4ff8a2a365eba176f0c27779d1a7 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Fri, 5 Feb 2016 21:22:42 +0000 Subject: [PATCH] Default to using MQTT v3.1.1. --- ChangeLog.txt | 3 +++ lib/mosquitto.c | 2 +- man/mosquitto_pub.1.xml | 4 ++-- man/mosquitto_sub.1.xml | 4 ++-- mosquitto.conf | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 9ac4da30..dc8adc89 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -25,6 +25,7 @@ Broker: - Minimum supported libwebsockets version is now 1.3. - Support for Windows XP has been dropped. - Miscellaneous fixes on Windows. +- Bridge connections now default to using MQTT v3.1.1. Client library: - Outgoing messages with QoS>1 are no longer retried after a timeout period. @@ -36,12 +37,14 @@ Client library: - Add mosquitto_subscribe_callback() This is a helper function to make processing messages from a broker very straightforward. An example of its use is in examples/subscribe_simple. +- Connections now default to using MQTT v3.1.1. Client: - Add -x to mosquitto_sub for printing the payload in hexadecimal format. - Add -U to mosquitto_sub for unsubscribing from topics. - Add --retained-only to mosquitto_sub to exit after receiving all retained messages. +- Connections now default to using MQTT v3.1.1. 1.4.7 - 20151221 diff --git a/lib/mosquitto.c b/lib/mosquitto.c index fc5d736a..e90346c7 100644 --- a/lib/mosquitto.c +++ b/lib/mosquitto.c @@ -140,7 +140,7 @@ int mosquitto_reinitialise(struct mosquitto *mosq, const char *id, bool clean_se }else{ mosq->userdata = mosq; } - mosq->protocol = mosq_p_mqtt31; + mosq->protocol = mosq_p_mqtt311; mosq->sock = INVALID_SOCKET; mosq->sockpairR = INVALID_SOCKET; mosq->sockpairW = INVALID_SOCKET; diff --git a/man/mosquitto_pub.1.xml b/man/mosquitto_pub.1.xml index c896dc33..567111d5 100644 --- a/man/mosquitto_pub.1.xml +++ b/man/mosquitto_pub.1.xml @@ -383,8 +383,8 @@ Specify which version of the MQTT protocol should be used when connecting to the rmeote broker. Can be - or . - Defaults to . + or . + Defaults to . diff --git a/man/mosquitto_sub.1.xml b/man/mosquitto_sub.1.xml index 68c716ec..7b1e5d2e 100644 --- a/man/mosquitto_sub.1.xml +++ b/man/mosquitto_sub.1.xml @@ -479,8 +479,8 @@ Specify which version of the MQTT protocol should be used when connecting to the rmeote broker. Can be - or . - Defaults to . + or . + Defaults to . diff --git a/mosquitto.conf b/mosquitto.conf index 7eed801c..4d9cdef2 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -650,8 +650,8 @@ #topic [[[out | in | both] qos-level] local-prefix remote-prefix] # Set the version of the MQTT protocol to use with for this bridge. Can be one -# of mqttv31 or mqttv311. Defaults to mqttv31. -#bridge_protocol_version mqttv31 +# of mqttv311 or mqttv11. Defaults to mqttv311. +#bridge_protocol_version mqttv311 # If a bridge has topics that have "out" direction, the default behaviour is to # send an unsubscribe request to the remote broker on that topic. This means