X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=gps303%2Fopencellid.py;h=436d559bd6ca4699e2fa97d041410d4318f9ae8d;hb=3b94b72763b7db9e9665d60c3dd26812bd134a8d;hp=192409a5952786397ba8876865b674307694afac;hpb=cd38837268d9df3de523be7d42d0ba358c95fbbb;p=loctrkd.git diff --git a/gps303/opencellid.py b/gps303/opencellid.py index 192409a..436d559 100644 --- a/gps303/opencellid.py +++ b/gps303/opencellid.py @@ -58,17 +58,17 @@ def qry_cell(dbname, mcc, gsm_cells): if __name__.endswith("__main__"): from datetime import datetime, timezone import sys - from .GT06mod import * + from .gps303proto import * db = connect(sys.argv[1]) c = db.cursor() c.execute( - """select timestamp, imei, clntaddr, length, proto, payload from events + """select select tstamp, packet from events where proto in (?, ?)""", (WIFI_POSITIONING.PROTO, WIFI_OFFLINE_POSITIONING.PROTO), ) - for timestamp, imei, clntaddr, length, proto, payload in c: - obj = make_object(length, proto, payload) + for timestamp, imei, clntaddr, proto, payload in c: + obj = parse_message(packet) avlat, avlon = qry_cell(sys.argv[2], obj.mcc, obj.gsm_cells) print( "{} {:+#010.8g},{:+#010.8g}".format(