]> www.average.org Git - loctrkd.git/blobdiff - loctrkd/zmsg.py
beesure: fix parsing broken by prefious fix
[loctrkd.git] / loctrkd / zmsg.py
index 9dae60540f46019957a72121700c6ada5df081de..da0dc77e39da6f38d7eaefe5adbdfe897f928b28 100644 (file)
@@ -4,7 +4,7 @@ import ipaddress as ip
 from struct import pack, unpack
 from typing import Any, cast, Optional, Tuple, Type, Union
 
-__all__ = "Bcast", "Resp", "topic"
+__all__ = "Bcast", "Resp", "topic", "rtopic"
 
 
 def pack_peer(  # 18 bytes
@@ -100,6 +100,10 @@ def topic(
     )
 
 
+def rtopic(imei: str) -> bytes:
+    return pack("16s", imei.encode())
+
+
 class Bcast(_Zmsg):
     """Zmq message to broadcast what was received from the terminal"""
 
@@ -168,7 +172,7 @@ class Resp(_Zmsg):
         self.packet = buffer[24:]
 
 
-class Report(_Zmsg):
+class Rept(_Zmsg):
     """Broadcast Zzmq message with "rectified" proto-agnostic json data"""
 
     KWARGS = (("imei", None), ("payload", ""))