Rawgpsd: cleanup init (#28890)
* Rawgpsd: cleanup init * back to default * Fix injection time check * add quotes * change to 12 hrs * Fixes old-commit-hash: 80eff1b6ce6600c8b93846ac6e096cf38f9ec695
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user