CAN-FD HKG: query FW versions from camera (#26063)
* add adas essential ecus
* add adas ecu and query
* add queries
* add name
* after
* presence of adas ecu
* Revert "presence of adas ecu" (POC)
This reverts commit ab88a7e7df
.
* no whitelist for debugging
* Apply suggestions from code review
* add adas response
* remove adas version
* temp
* read pandaStates
* works in debug script
* only fwdCamera on tucson
* fix pandaStates reading
* fix test_startup
* fix
* simpler
* use existing socket
* pass in number of pandas
* need to create sm using outcome of fingerprinting, which uses sm
fix
* move default argument
* use sock
* always ignore
always ignore
* add canfd fingerprint test
* Update selfdrive/car/hyundai/tests/test_hyundai.py
* set
pull/26128/head^2
parent
dcd804e2bf
commit
7bf70bf7d8
6 changed files with 74 additions and 52 deletions
@ -0,0 +1,29 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
import unittest |
||||||
|
|
||||||
|
from cereal import car |
||||||
|
from selfdrive.car.car_helpers import get_interface_attr |
||||||
|
from selfdrive.car.fw_versions import FW_QUERY_CONFIGS |
||||||
|
from selfdrive.car.hyundai.values import CANFD_CAR |
||||||
|
|
||||||
|
Ecu = car.CarParams.Ecu |
||||||
|
|
||||||
|
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()} |
||||||
|
VERSIONS = get_interface_attr("FW_VERSIONS", ignore_none=True) |
||||||
|
|
||||||
|
|
||||||
|
class TestHyundaiFingerprint(unittest.TestCase): |
||||||
|
def test_auxiliary_request_ecu_whitelist(self): |
||||||
|
# Asserts only auxiliary Ecus can exist in database for CAN-FD cars |
||||||
|
config = FW_QUERY_CONFIGS['hyundai'] |
||||||
|
whitelisted_ecus = {ecu for r in config.requests for ecu in r.whitelist_ecus if r.bus > 3} |
||||||
|
|
||||||
|
for car_model in CANFD_CAR: |
||||||
|
ecus = {fw[0] for fw in VERSIONS['hyundai'][car_model].keys()} |
||||||
|
ecus_not_in_whitelist = ecus - whitelisted_ecus |
||||||
|
ecu_strings = ", ".join([f'Ecu.{ECU_NAME[ecu]}' for ecu in ecus_not_in_whitelist]) |
||||||
|
self.assertEqual(len(ecus_not_in_whitelist), 0, f'{car_model}: Car model has ECUs not in auxiliary request whitelists: {ecu_strings}') |
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
unittest.main() |
Loading…
Reference in new issue