From d9805b23bb01418a17b8c46c2e6053b18efe5dd4 Mon Sep 17 00:00:00 2001 From: boc Date: Wed, 27 Dec 2017 21:33:26 -0500 Subject: [PATCH 1/2] Change payload guard to check for None. Zero is a valid payload --- bin/btmon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/btmon.py b/bin/btmon.py index 7b1b735..d45c452 100755 --- a/bin/btmon.py +++ b/bin/btmon.py @@ -4117,7 +4117,7 @@ def setup(self): sys.exit(1) def _add_msg(self, packet, channel, payload): - if not payload: + if payload is None: return key = mklabel(packet['serial'], channel) if key in self.map: From acb6be4228f98ee9442b1cf26709e45bb1d90e9e Mon Sep 17 00:00:00 2001 From: boc Date: Wed, 27 Dec 2017 21:39:44 -0500 Subject: [PATCH 2/2] Added log message for MQTT when payload is None type. --- bin/btmon.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/btmon.py b/bin/btmon.py index d45c452..257f474 100755 --- a/bin/btmon.py +++ b/bin/btmon.py @@ -4118,6 +4118,7 @@ def setup(self): def _add_msg(self, packet, channel, payload): if payload is None: + dbgmsg('MQTT: Payload(%s) for channel(%s) is None. Message not added' % (payload, channel)) return key = mklabel(packet['serial'], channel) if key in self.map: