|
|
@ -57,6 +57,10 @@ def main(): |
|
|
|
# TODO: read from streaming AT port instead of polling |
|
|
|
# TODO: read from streaming AT port instead of polling |
|
|
|
out = at_cmd("AT+CGPS?") |
|
|
|
out = at_cmd("AT+CGPS?") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if '+CGPS: 1' not in out: |
|
|
|
|
|
|
|
for c in cmds: |
|
|
|
|
|
|
|
at_cmd(c) |
|
|
|
|
|
|
|
|
|
|
|
sentences = out.split("'")[1].splitlines() |
|
|
|
sentences = out.split("'")[1].splitlines() |
|
|
|
new = {l.split(',')[0]: l.split(',') for l in sentences if l.startswith('$G')} |
|
|
|
new = {l.split(',')[0]: l.split(',') for l in sentences if l.startswith('$G')} |
|
|
|
nmea.update(new) |
|
|
|
nmea.update(new) |
|
|
@ -85,8 +89,7 @@ def main(): |
|
|
|
|
|
|
|
|
|
|
|
gps.hasFix = gnrmc[1] == 'A' |
|
|
|
gps.hasFix = gnrmc[1] == 'A' |
|
|
|
|
|
|
|
|
|
|
|
# TODO: make our own source |
|
|
|
gps.source = log.GpsLocationData.SensorSource.unicore |
|
|
|
gps.source = log.GpsLocationData.SensorSource.qcomdiag |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gps.speed = sfloat(gnrmc[7]) |
|
|
|
gps.speed = sfloat(gnrmc[7]) |
|
|
|
gps.bearingDeg = sfloat(gnrmc[8]) |
|
|
|
gps.bearingDeg = sfloat(gnrmc[8]) |
|
|
|