cgpsd: use a real source

old-commit-hash: 4d1b1001526970012364b843cbbb997bfd983842
This commit is contained in:
Adeeb Shihadeh
2024-03-09 23:33:24 -08:00
parent 6a2ddc9df2
commit 050662fdd0
2 changed files with 6 additions and 3 deletions

2
cereal

Submodule cereal updated: cf7bb3e749...93d3df3210

View File

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