]> www.average.org Git - loctrkd.git/blobdiff - gps303/termconfig.py
WIP on websocket gateway
[loctrkd.git] / gps303 / termconfig.py
index 1ab65ce937004f8bfeb5c2c99feef2934b190d76..771f988f038dc6785d7d34a5ff1b1164db476beb 100644 (file)
@@ -18,11 +18,7 @@ def runserver(conf):
     zsub = zctx.socket(zmq.SUB)
     zsub.connect(conf.get("collector", "publishurl"))
     for protoname in (
-        "SUPERVISION",
         "STATUS",
-        "RESET",
-        "WHITELIST_TOTAL",
-        "PROHIBIT_LBS",
         "SETUP",
         "POSITION_UPLOAD_INTERVAL",
     ):
@@ -42,6 +38,10 @@ def runserver(conf):
                 datetime.fromtimestamp(zmsg.when).astimezone(tz=timezone.utc),
                 msg,
             )
+            if msg.RESPOND is not Respond.EXT:
+                log.error(
+                    "%s does not expect externally provided response", msg
+                )
             kwargs = {}
             if isinstance(msg, STATUS):
                 kwargs = {
@@ -63,7 +63,7 @@ def runserver(conf):
                 ):
                     if key in termconfig:
                         kwargs[key] = termconfig[key]
-            resp = Resp(imei=zmsg.imei, packet=msg.response(**kwargs))
+            resp = Resp(imei=zmsg.imei, packet=msg.Out(**kwargs).packed)
             log.debug("Response: %s", resp)
             zpush.send(resp.packed)