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 973df68 commit 7aacbfeCopy full SHA for 7aacbfe
adafruit_minimqtt/adafruit_minimqtt.py
@@ -765,16 +765,7 @@ def publish(
765
pub_hdr_var.append(self._pid >> 8)
766
pub_hdr_var.append(self._pid & 0xFF)
767
768
- # Calculate remaining length [2.2.3]
769
- if remaining_length > 0x7F:
770
- while remaining_length > 0:
771
- encoded_byte = remaining_length % 0x80
772
- remaining_length = remaining_length // 0x80
773
- if remaining_length > 0:
774
- encoded_byte |= 0x80
775
- pub_hdr_fixed.append(encoded_byte)
776
- else:
777
- pub_hdr_fixed.append(remaining_length)
+ self.encode_remaining_length(pub_hdr_fixed, remaining_length)
778
779
self.logger.debug(
780
"Sending PUBLISH\nTopic: %s\nMsg: %s\
0 commit comments