X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=blobdiff_plain;f=gps303%2Fwsgateway.py;h=d66070e2f57a7781fe76a8249ac176536e3192d4;hp=2f6811e45225e6b478a9dcf8796ec4c63b9e68d0;hb=0c28fa6306f252934fe7e2c04522e8540c414387;hpb=fc32607043c038d5d0f358b7fadadacd4a707ce0 diff --git a/gps303/wsgateway.py b/gps303/wsgateway.py index 2f6811e..d66070e 100644 --- a/gps303/wsgateway.py +++ b/gps303/wsgateway.py @@ -287,28 +287,18 @@ def runserver(conf): zmsg = Bcast(zsub.recv(zmq.NOBLOCK)) msg = parse_message(zmsg.packet, zmsg.is_incoming) log.debug("Got %s with %s", zmsg, msg) - if isinstance(msg, GPS_POSITIONING): - tosend.append( - { - "imei": zmsg.imei, - "timestamp": str(msg.devtime), - "longitude": msg.longitude, - "latitude": msg.latitude, - } - ) - elif isinstance(msg, WIFI_POSITIONING): - tosend.append( - { - "imei": zmsg.imei, - "timestamp": str( - datetime.fromtimestamp( - zmsg.when - ).astimezone(tz=timezone.utc) - ), - "longitude": msg.longitude, - "latitude": msg.latitude, - } - ) + tosend.append( + { + "imei": zmsg.imei, + "timestamp": str( + datetime.fromtimestamp( + zmsg.when + ).astimezone(tz=timezone.utc) + ), + "longitude": msg.longitude, + "latitude": msg.latitude, + } + ) except zmq.Again: break elif sk == tcpfd: