]> www.average.org Git - loctrkd.git/blobdiff - gps303/watch.py
WIP retoure messaging
[loctrkd.git] / gps303 / watch.py
index ed51ad19ebea040062d3e3cca1ead844bfb9e5af..2e5b412fb89c87c98d0338ff3069f934f3132896 100644 (file)
@@ -5,6 +5,7 @@ from logging import getLogger
 import zmq
 
 from . import common
+from .gps303proto import parse_message
 from .zmsg import Bcast
 
 log = getLogger("gps303/watch")
@@ -19,8 +20,8 @@ def runserver(conf):
     try:
         while True:
             zmsg = Bcast(zsub.recv())
-            msg = parse_message(zmsg.packet)
-            print(zmsg.imei, msg)
+            msg = parse_message(zmsg.packet, zmsg.is_incoming)
+            print("I" if zmsg.is_incoming else "O", zmsg.imei, msg)
     except KeyboardInterrupt:
         pass