-class Bcast:
- """Zmq message to broadcast what was received from the terminal"""
-
- def __init__(self, imei, msg):
- self.as_bytes = (
- pack("B", proto_of_message(msg))
- + ("0000000000000000" if imei is None else imei).encode()
- + msg
- )
-
-
-class Resp:
- """Zmq message received from a third party to send to the terminal"""
-
- def __init__(self, *args, **kwargs):
- if not kwargs and len(args) == 1 and isinstance(args[0], bytes):
- self.imei = msg[:16].decode()
- self.payload = msg[16:]
- elif len(args) == 0:
- self.imei = kwargs["imei"]
- self.payload = kwargs["payload"]
-
-