We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2662ae commit c9d6b8dCopy full SHA for c9d6b8d
adafruit_minimqtt.py
@@ -533,12 +533,19 @@ def unsubscribe(self, topic):
533
self._subscribed_topics.remove(t)
534
return
535
536
+ def check_for_msg(self):
537
+ """Checks if a pending message from the server is avaliable.
538
+ If not, returns None.
539
+ """
540
+ self._sock.settimeout(0.1)
541
+ self.wait_for_msg()
542
+
543
def wait_for_msg(self):
544
"""Reads and processes network events.
545
Returns response code if successful.
546
"""
- self._sock.settimeout(30.0)
547
res = self._sock.read(1)
548
+ self._sock.settimeout(0.0)
549
if res in [None, b""]:
550
return None
551
if res == MQTT_PINGRESP:
0 commit comments