Rawgpsd: cleanup init (#28890)

* Rawgpsd: cleanup init

* back to default

* Fix injection time check

* add quotes

* change to 12 hrs

* Fixes
pull/28905/head
Harald Schäfer 2 years ago committed by GitHub
parent f1a1456f27
commit 80eff1b6ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      system/sensord/rawgps/rawgpsd.py
  2. 7
      system/sensord/rawgps/test_rawgps.py

@ -179,7 +179,7 @@ def setup_quectel(diag: ModemDiag):
# Do internet assistance
at_cmd("AT+QGPSXTRA=1")
at_cmd("AT+QGPSSUPLURL=\"supl.google.com:7275\"")
at_cmd("AT+QGPSSUPLURL=\"NULL\"")
download_and_inject_assistance()
#at_cmd("AT+QGPSXTRADATA?")
time_str = datetime.utcnow().strftime("%Y/%m/%d,%H:%M:%S")

@ -95,11 +95,10 @@ class TestRawgpsd(unittest.TestCase):
# after loading: '+QGPSXTRADATA: 10080,"2023/06/24,19:00:00"'
out = at_cmd("AT+QGPSXTRADATA?")
out = out.split("+QGPSXTRADATA:")[1].split("'")[0].strip()
valid_duration, injected_date = out.split(",", 1)
valid_duration, injected_time_str = out.split(",", 1)
assert valid_duration == "10080" # should be max time
# TODO: time doesn't match up
assert injected_date[1:].startswith(datetime.datetime.utcnow().strftime("%Y/%m/%d"))
injected_time = datetime.datetime.strptime(injected_time_str.replace("\"", ""), "%Y/%m/%d,%H:%M:%S")
self.assertLess(abs((datetime.datetime.utcnow() - injected_time).total_seconds()), 60*60*12)
@unittest.skipIf(not GOOD_SIGNAL, "No good GPS signal")
def test_fix(self):

Loading…
Cancel
Save