From: Roger A. Light Date: Fri, 12 Sep 2014 21:39:24 +0000 (+0100) Subject: [440169] Add information on "protocol" argument. X-Git-Tag: v1.1~7 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5b69c1100b105644210c66f8bceabba8a357884c;p=packages%2Fp%2Fpaho-mqtt.git [440169] Add information on "protocol" argument. Document the "protocol" argument to the client constructor. Closes #440169. Thanks to Andy Piper. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440169 Change-Id: I46467156237235adff41eda0bf98c26bfba083bf --- diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 3a95509..264f782 100755 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -407,6 +407,13 @@ class Client(object): userdata is user defined data of any type that is passed as the "userdata" parameter to callbacks. It may be updated at a later point with the user_data_set() function. + + The protocol argument allows explicit setting of the MQTT version to + use for this client. Can be paho.mqtt.client.MQTTv311 (v3.1.1) or + paho.mqtt.client.MQTTv31 (v3.1), with the default being v3.1.1. If the + broker reports that the client connected with an invalid protocol + version, the client will automatically attempt to reconnect using v3.1 + instead. """ if not clean_session and (client_id == "" or client_id is None): raise ValueError('A client id must be provided if clean session is False.')