kopia lustrzana https://github.com/micropython/micropython-lib
umqtt.simple: publish(): Reuse existing bytearray.
rodzic
1e83b27b9d
commit
9f7b60bede
|
@ -79,9 +79,8 @@ class MQTTClient:
|
||||||
if qos > 0:
|
if qos > 0:
|
||||||
self.pid += 1
|
self.pid += 1
|
||||||
pid = self.pid
|
pid = self.pid
|
||||||
buf = bytearray(b"\0\0")
|
struct.pack_into("!H", pkt, 0, pid)
|
||||||
struct.pack_into("!H", buf, 0, pid)
|
self.sock.write(pkt, 2)
|
||||||
self.sock.write(buf)
|
|
||||||
self.sock.write(msg)
|
self.sock.write(msg)
|
||||||
if qos == 1:
|
if qos == 1:
|
||||||
while 1:
|
while 1:
|
||||||
|
|
Ładowanie…
Reference in New Issue