--- a/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.MqttMonitor.MqttClient.html Sun Sep 09 18:27:24 2018 +0200 +++ b/MqttMonitor/Documentation/source/Plugin_Mqtt_Monitor.MqttMonitor.MqttClient.html Sun Sep 09 18:31:38 2018 +0200 @@ -38,10 +38,13 @@ <table> <tr> <td><a href="#mqttConnackMessage">mqttConnackMessage</a></td> -<td>Public method to get the string associated with a CONNACK result.</td> +<td>Module function to get the string associated with a CONNACK result.</td> </tr><tr> <td><a href="#mqttErrorMessage">mqttErrorMessage</a></td> -<td>Public method to get the error string associated with an MQTT error number.</td> +<td>Module function to get the error string associated with an MQTT error number.</td> +</tr><tr> +<td><a href="#mqttLogLevelString">mqttLogLevelString</a></td> +<td>Module function to get the log level string associated with a log level.</td> </tr> </table> <hr /><hr /> @@ -59,6 +62,9 @@ <dd> emitted after the client has disconnected from the broker +</dd><dt>onLog(level, message)</dt> +<dd> +emitted to send client log data </dd><dt>onMessage(topic, payload, qos, retain)</dt> <dd> emitted after a message has @@ -80,7 +86,7 @@ QObject <h3>Class Attributes</h3> <table> -<tr><td>None</td></tr> +<tr><td>DefaultConnectTimeout</td></tr><tr><td>LogDebug</td></tr><tr><td>LogError</td></tr><tr><td>LogInfo</td></tr><tr><td>LogLevelMap</td></tr><tr><td>LogNotice</td></tr><tr><td>LogWarning</td></tr> </table> <h3>Class Methods</h3> <table> @@ -92,9 +98,15 @@ <td><a href="#MqttClient.__init__">MqttClient</a></td> <td>Constructor</td> </tr><tr> +<td><a href="#MqttClient.__connectTimeout">__connectTimeout</a></td> +<td>Privat slot handling a failed connection attempt.</td> +</tr><tr> <td><a href="#MqttClient.__initCallbacks">__initCallbacks</a></td> <td>Private method to initialize the MQTT callback methods.</td> </tr><tr> +<td><a href="#MqttClient.clearLastWill">clearLastWill</a></td> +<td>Public method to remove a will that was previously configured with setLastWill().</td> +</tr><tr> <td><a href="#MqttClient.connectToServer">connectToServer</a></td> <td>Public method to connect to a remote MQTT broker.</td> </tr><tr> @@ -116,6 +128,9 @@ <td><a href="#MqttClient.reinitialise">reinitialise</a></td> <td>Public method to reinitialize the client with given data.</td> </tr><tr> +<td><a href="#MqttClient.setConnectionTimeout">setConnectionTimeout</a></td> +<td>Public method to set the connection timeout value.</td> +</tr><tr> <td><a href="#MqttClient.setLastWill">setLastWill</a></td> <td>Public method to set the last will of the client.</td> </tr><tr> @@ -125,6 +140,9 @@ <td><a href="#MqttClient.setMaxQueuedMessages">setMaxQueuedMessages</a></td> <td>Public method to set the maximum number of messages with QoS > 0 that can be pending in the outgoing message queue.</td> </tr><tr> +<td><a href="#MqttClient.setTLS">setTLS</a></td> +<td>Public method to enable secure connections and set the TLS parameters.</td> +</tr><tr> <td><a href="#MqttClient.setUserCredentials">setUserCredentials</a></td> <td>Public method to set the user name and optionally the password.</td> </tr><tr> @@ -173,14 +191,25 @@ <dd> reference to the parent object </dd> -</dl><a NAME="MqttClient.__initCallbacks" ID="MqttClient.__initCallbacks"></a> +</dl><a NAME="MqttClient.__connectTimeout" ID="MqttClient.__connectTimeout"></a> +<h4>MqttClient.__connectTimeout</h4> +<b>__connectTimeout</b>(<i></i>) +<p> + Privat slot handling a failed connection attempt. +</p><a NAME="MqttClient.__initCallbacks" ID="MqttClient.__initCallbacks"></a> <h4>MqttClient.__initCallbacks</h4> <b>__initCallbacks</b>(<i></i>) <p> Private method to initialize the MQTT callback methods. +</p><a NAME="MqttClient.clearLastWill" ID="MqttClient.clearLastWill"></a> +<h4>MqttClient.clearLastWill</h4> +<b>clearLastWill</b>(<i></i>) +<p> + Public method to remove a will that was previously configured with + setLastWill(). </p><a NAME="MqttClient.connectToServer" ID="MqttClient.connectToServer"></a> <h4>MqttClient.connectToServer</h4> -<b>connectToServer</b>(<i>host, port=1883, keepalive=60, bindAddress=""</i>) +<b>connectToServer</b>(<i>host, port=1883, keepalive=60, bindAddress="", reinit=True</i>) <p> Public method to connect to a remote MQTT broker. </p><dl> @@ -222,7 +251,8 @@ dictionary containing the connection options. This dictionary should contain the keys "ClientId", "Keepalive", "CleanSession", "Username", "Password", "WillTopic", "WillMessage", - "WillQos", "WillRetain" + "WillQos", "WillRetain", "TlsEnable", "TlsCaCert", "TlsClientCert", + "TlsClientKey", "ConnectionTimeout" </dd> </dl><a NAME="MqttClient.defaultConnectionOptions" ID="MqttClient.defaultConnectionOptions"></a> <h4>MqttClient.defaultConnectionOptions</h4> @@ -235,7 +265,9 @@ <dd> dictionary containing the default connection options. It has the keys "ClientId", "Keepalive", "CleanSession", "Username", - "Password", "WillTopic", "WillMessage", "WillQos", "WillRetain" + "Password", "WillTopic", "WillMessage", "WillQos", "WillRetain", + "TlsEnable", "TlsCaCert", "TlsClientCert", "TlsClientKey", + "ConnectionTimeout". </dd> </dl><dl> <dt>Return Type:</dt> @@ -298,6 +330,16 @@ <dd> user data </dd> +</dl><a NAME="MqttClient.setConnectionTimeout" ID="MqttClient.setConnectionTimeout"></a> +<h4>MqttClient.setConnectionTimeout</h4> +<b>setConnectionTimeout</b>(<i>timeout</i>) +<p> + Public method to set the connection timeout value. +</p><dl> +<dt><i>timeout</i> (int)</dt> +<dd> +timeout value to be set in seconds +</dd> </dl><a NAME="MqttClient.setLastWill" ID="MqttClient.setLastWill"></a> <h4>MqttClient.setLastWill</h4> <b>setLastWill</b>(<i>topic, payload=None, qos=0, retain=False</i>) @@ -340,6 +382,33 @@ <dd> maximum number of queued messages (0 = unlimited) </dd> +</dl><a NAME="MqttClient.setTLS" ID="MqttClient.setTLS"></a> +<h4>MqttClient.setTLS</h4> +<b>setTLS</b>(<i>caCerts=None, certFile=None, keyFile=None</i>) +<p> + Public method to enable secure connections and set the TLS parameters. +</p><dl> +<dt><i>caCerts</i> (str)</dt> +<dd> +path to the Certificate Authority certificates file +</dd><dt><i>certFile</i> (str)</dt> +<dd> +PEM encoded client certificate file +</dd><dt><i>keyFile</i> (str)</dt> +<dd> +PEM encoded private key file +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +tuple containing a success flag and the error string of the + paho-mqtt library +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, str) +</dd> </dl><a NAME="MqttClient.setUserCredentials" ID="MqttClient.setUserCredentials"></a> <h4>MqttClient.setUserCredentials</h4> <b>setUserCredentials</b>(<i>username, password=None</i>) @@ -424,7 +493,7 @@ <h2>mqttConnackMessage</h2> <b>mqttConnackMessage</b>(<i>connackCode</i>) <p> - Public method to get the string associated with a CONNACK result. + Module function to get the string associated with a CONNACK result. </p><dl> <dt><i>connackCode</i> (int)</dt> <dd> @@ -447,7 +516,7 @@ <h2>mqttErrorMessage</h2> <b>mqttErrorMessage</b>(<i>mqttErrno</i>) <p> - Public method to get the error string associated with an MQTT error + Module function to get the error string associated with an MQTT error number. </p><dl> <dt><i>mqttErrno</i> (int)</dt> @@ -466,5 +535,32 @@ </dd> </dl> <div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="mqttLogLevelString" ID="mqttLogLevelString"></a> +<h2>mqttLogLevelString</h2> +<b>mqttLogLevelString</b>(<i>mqttLogLevel, isMqttLogLevel=True</i>) +<p> + Module function to get the log level string associated with a log level. +</p><dl> +<dt><i>mqttLogLevel</i> (int)</dt> +<dd> +log level of the paho-mqtt client +</dd><dt><i>isMqttLogLevel</i> (bool)</dt> +<dd> +flag indicating a MQTT log level is given (if + False it is the MqttClient variant, i.e. Debug being lowest) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +textual representation of the log level +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file