--- a/MqttMonitor/MqttClient.py Tue Jul 20 17:48:21 2021 +0200 +++ b/MqttMonitor/MqttClient.py Tue Jul 20 18:10:55 2021 +0200 @@ -32,17 +32,17 @@ """ Class implementing a PyQt wrapper around the paho MQTT client. - @signal onConnect(flags, rc) emitted after the client has connected to the - broker - @signal onDisconnected(rc) emitted after the client has disconnected from + @signal onConnectV3(flags, rc) emitted after the client has connected to + the broker + @signal onDisconnectedV3(rc) emitted after the client has disconnected from the broker @signal onLog(level, message) emitted to send client log data - @signal onMessage(topic, payload, qos, retain) emitted after a message has - been received by the client + @signal onMessageV3(topic, payload, qos, retain) emitted after a message + has been received by the client @signal onPublish(mid) emitted after a message has been published - @signal onSubscribe(mid, grantedQos) emitted after the client has + @signal onSubscribeV3(mid, grantedQos) emitted after the client has subscribed to some topics - @signal onUnsubscribe(mid) emitted after the client has unsubscribed from + @signal onUnsubscribeV3(mid) emitted after the client has unsubscribed from some topics @signal connectTimeout() emitted to indicate, that a connection attempt timed out @@ -53,7 +53,7 @@ onDisconnectedV5 = pyqtSignal(int, int) onLog = pyqtSignal(int, str) onMessageV3 = pyqtSignal(str, bytes, int, bool) - onMessageV5 = pyqtSignal(str, bytes, int, bool) + onMessageV5 = pyqtSignal(str, bytes, int, bool, dict) onPublish = pyqtSignal(int) onSubscribeV3 = pyqtSignal(int, tuple) onSubscribeV5 = pyqtSignal(int, list) @@ -136,7 +136,7 @@ self.__mqttClient.on_disconnect = ( lambda client, userdata, rc: self.onDisconnectedV3.emit(rc) - ) + ) self.__mqttClient.on_subscribe = ( lambda client, userdata, mid, grantedQos, properties=None: self.onSubscribeV3.emit(mid, grantedQos) @@ -168,7 +168,8 @@ self.__mqttClient.on_message = ( lambda client, userdata, message: self.onMessageV5.emit(message.topic, message.payload, - message.qos, message.retain) + message.qos, message.retain, + message.properties.json()) ) self.__mqttClient.on_log = ( lambda client, userdata, level, buf: @@ -324,6 +325,9 @@ def getProtocol(self): """ Public method to get the MQTT protocol version. + + @return MQTT protocol version in use + @rtype int """ return self.__protocol