- if not isinstance(msg, WIFI_POSITIONING):
- log.error(
- "IMEI %s from %s at %s: %s",
- zmsg.imei,
- zmsg.peeraddr,
- datetime.fromtimestamp(zmsg.when).astimezone(
- tz=timezone.utc
- ),
- msg,
- )
- continue
- lat, lon = qry_cell(
- conf["opencellid"]["dbfn"], msg.mcc, msg.gsm_cells
+ lat, lon = qry.lookup(msg.mcc, msg.gsm_cells, msg.wifi_aps)
+ resp = Resp(
+ imei=zmsg.imei,
+ when=zmsg.when, # not the current time, but the original!
+ packet=msg.Out(latitude=lat, longitude=lon).packed,