]> www.average.org Git - loctrkd.git/blob - gps303/lookaside.py
add lookaside module and opencellid lookup
[loctrkd.git] / gps303 / lookaside.py
1 """
2 For when responding to the terminal is not trivial
3 """
4
5 from .GT06mod import *
6 from .opencellid import qry_cell
7
8 def prepare_response(conf, msg):
9     if isinstance(msg, WIFI_POSITIONING):
10         lat, lon = qry_cell(conf["opencellid"]["dbfn"],
11                 msg.mcc, msg.gsm_cells)
12         return {"lat": lat, "lon": lon}
13     return {}