|
|
|
@ -737,10 +737,10 @@ def gen_unsubscribe(mid, topic, cmd=162, proto_ver=4, properties=b""):
|
|
|
|
|
else:
|
|
|
|
|
properties = mqtt5_props.prop_finalise(properties)
|
|
|
|
|
packet = struct.pack("!B", cmd)
|
|
|
|
|
l = 2+2+len(topic)+1+len(properties)
|
|
|
|
|
l = 2+2+len(topic)+len(properties)
|
|
|
|
|
packet += pack_remaining_length(l)
|
|
|
|
|
pack_format = "!HB"+str(len(properties))+"sH"+str(len(topic))+"s"
|
|
|
|
|
packet += struct.pack(pack_format, mid, len(properties), properties, len(topic), topic)
|
|
|
|
|
pack_format = "!H"+str(len(properties))+"sH"+str(len(topic))+"s"
|
|
|
|
|
packet += struct.pack(pack_format, mid, properties, len(topic), topic)
|
|
|
|
|
return packet
|
|
|
|
|
else:
|
|
|
|
|
pack_format = "!BBHH"+str(len(topic))+"s"
|
|
|
|
|