startup alert for no fw returned (#21177)
parent
29ac94b719
commit
d4ab1f1e27
2
cereal
2
cereal
|
@ -1 +1 @@
|
|||
Subproject commit 85e1e2f79cffc4df307e29b118a76adc4226b52f
|
||||
Subproject commit cde8667d3bacb71d324b06b3d803c8fd7c59d2db
|
|
@ -13,14 +13,17 @@ from cereal import car
|
|||
EventName = car.CarEvent.EventName
|
||||
|
||||
|
||||
def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint):
|
||||
def get_startup_event(car_recognized, controller_available, fuzzy_fingerprint, fw_seen):
|
||||
if comma_remote and tested_branch:
|
||||
event = EventName.startup
|
||||
else:
|
||||
event = EventName.startupMaster
|
||||
|
||||
if not car_recognized:
|
||||
event = EventName.startupNoCar
|
||||
if fw_seen:
|
||||
event = EventName.startupNoCar
|
||||
else:
|
||||
event = EventName.startupNoFw
|
||||
elif car_recognized and not controller_available:
|
||||
event = EventName.startupNoControl
|
||||
elif car_recognized and fuzzy_fingerprint:
|
||||
|
|
|
@ -145,7 +145,8 @@ class Controls:
|
|||
# TODO: no longer necessary, aside from process replay
|
||||
self.sm['liveParameters'].valid = True
|
||||
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint)
|
||||
self.startup_event = get_startup_event(car_recognized, controller_available, self.CP.fuzzyFingerprint,
|
||||
len(self.CP.carFw) > 0)
|
||||
|
||||
if not sounds_available:
|
||||
self.events.add(EventName.soundsUnavailable, static=True)
|
||||
|
|
|
@ -268,6 +268,14 @@ EVENTS: Dict[int, Dict[str, Union[Alert, Callable[[Any, messaging.SubMaster, boo
|
|||
ET.PERMANENT: startup_fuzzy_fingerprint_alert,
|
||||
},
|
||||
|
||||
EventName.startupNoFw: {
|
||||
ET.PERMANENT: Alert(
|
||||
"Car Unrecognized",
|
||||
"Check All Connections",
|
||||
AlertStatus.userPrompt, AlertSize.mid,
|
||||
Priority.LOWER, VisualAlert.none, AudibleAlert.none, 0., 0., 15.),
|
||||
},
|
||||
|
||||
EventName.dashcamMode: {
|
||||
ET.PERMANENT: Alert(
|
||||
"Dashcam Mode",
|
||||
|
|
|
@ -58,9 +58,13 @@ class TestStartup(unittest.TestCase):
|
|||
(EventName.startupNoControl, MAZDA.CX5, True, CX5_FW_VERSIONS),
|
||||
(EventName.startupNoControl, MAZDA.CX5, False, CX5_FW_VERSIONS),
|
||||
|
||||
# unrecognized car with no fw
|
||||
(EventName.startupNoFw, None, True, None),
|
||||
(EventName.startupNoFw, None, False, None),
|
||||
|
||||
# unrecognized car
|
||||
(EventName.startupNoCar, None, True, None),
|
||||
(EventName.startupNoCar, None, False, None),
|
||||
(EventName.startupNoCar, None, True, COROLLA_FW_VERSIONS[:1]),
|
||||
(EventName.startupNoCar, None, False, COROLLA_FW_VERSIONS[:1]),
|
||||
|
||||
# fuzzy match
|
||||
(EventName.startupFuzzyFingerprint, TOYOTA.COROLLA, True, COROLLA_FW_VERSIONS_FUZZY),
|
||||
|
|
Loading…
Reference in New Issue