X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=blobdiff_plain;f=gps303%2Fopencellid.py;h=436d559bd6ca4699e2fa97d041410d4318f9ae8d;hp=843e595e78003fd3b228154b4297d93045dddb76;hb=ac0ca5aab2dbc4ce035cfc0e0f7175110ea180a5;hpb=0a3288ad7ed56d995f9e0c15527f1a3af9a6d757 diff --git a/gps303/opencellid.py b/gps303/opencellid.py index 843e595..436d559 100644 --- a/gps303/opencellid.py +++ b/gps303/opencellid.py @@ -63,12 +63,12 @@ if __name__.endswith("__main__"): 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(