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 f0907a4 commit ea96633Copy full SHA for ea96633
adafruit_minimqtt/adafruit_minimqtt.py
@@ -890,6 +890,7 @@ def _wait_for_msg(self, timeout=0.1):
890
self._recv_into(topic, topic_len)
891
topic = str(topic, "utf-8")
892
sz -= topic_len + 2
893
+ pid = 0
894
if res[0] & 0x06:
895
pid = bytearray(2)
896
self._recv_into(pid, 2)
@@ -918,13 +919,14 @@ def _wait_for_msg(self, timeout=0.1):
918
919
920
921
def _recv_len(self):
922
+ """Unpack MQTT message length."""
923
n = 0
924
sh = 0
925
b = bytearray(1)
926
while True:
- self._recv_into(b, 1)
- n |= (b[0] & 0x7F) << sh
927
- if not b[0] & 0x80:
+ b = self._sock_exact_recv(1)[0]
928
+ n |= (b & 0x7F) << sh
929
+ if not b & 0x80:
930
return n
931
sh += 7
932
0 commit comments