]> average.org Git - loctrkd.git/blobdiff - gps303/termconfig.py
cleanup of gps303proto
[loctrkd.git] / gps303 / termconfig.py
index 4bf148bb9a6a76378947d8f70efd7b63d22d6ae8..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,10 +38,14 @@ 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 = {
-                    "upload_interval": termconf.get(
+                    "upload_interval": termconfig.get(
                         "statusintervalminutes", 25
                     )
                 }
@@ -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)