Skip to content

Commit

Permalink
use MQTT_PUBLISH instead of literal
Browse files Browse the repository at this point in the history
  • Loading branch information
vladak committed Dec 5, 2022
1 parent 29e60e9 commit b76d6bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adafruit_minimqtt/adafruit_minimqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def publish(self, topic, msg, retain=False, qos=0):
), "Quality of Service Level 2 is unsupported by this library."

# fixed header. [3.3.1.2], [3.3.1.3]
pub_hdr_fixed = bytearray([0x30 | retain | qos << 1])
pub_hdr_fixed = bytearray([MQTT_PUBLISH | retain | qos << 1])

# variable header = 2-byte Topic length (big endian)
pub_hdr_var = bytearray(struct.pack(">H", len(topic.encode("utf-8"))))
Expand Down

0 comments on commit b76d6bb

Please sign in to comment.