mirror of https://github.com/commaai/openpilot.git
Subaru: ensure consistent firmware version size (#31001)
* fix copying mistakes * fix SA * remove print * ensure size is same * fix SA * not in database
This commit is contained in:
parent
a8afaf39d4
commit
94cd4c9046
|
@ -54,7 +54,7 @@ FW_VERSIONS = {
|
|||
b'\xa1 \x02\x01',
|
||||
b'\xa1 \x02\x02',
|
||||
b'\xa1 \x03\x03',
|
||||
b'\xa1\\ x04\x01',
|
||||
b'\xa1 \x04\x01',
|
||||
],
|
||||
(Ecu.eps, 0x746, None): [
|
||||
b'\x9b\xc0\x11\x00',
|
||||
|
@ -373,7 +373,6 @@ FW_VERSIONS = {
|
|||
b'\x00\x00c\xb7\x1f@\x10\x16',
|
||||
b'\x00\x00c\xd1\x1f@\x10\x17',
|
||||
b'\x00\x00c\xec\x1f@ \x04',
|
||||
b'\x00\x00c\xec7@\x04',
|
||||
],
|
||||
(Ecu.engine, 0x7e0, None): [
|
||||
b'\xa0"@\x80\x07',
|
||||
|
@ -447,9 +446,9 @@ FW_VERSIONS = {
|
|||
},
|
||||
CAR.OUTBACK: {
|
||||
(Ecu.abs, 0x7b0, None): [
|
||||
b'\xa1 \x06\x02',
|
||||
b'\xa1 \x06\x00',
|
||||
b'\xa1 \x06\x01',
|
||||
b'\xa1 \x06\x02',
|
||||
b'\xa1 \x07\x00',
|
||||
b'\xa1 \x07\x02',
|
||||
b'\xa1 \x08\x00',
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
from cereal import car
|
||||
import unittest
|
||||
from openpilot.selfdrive.car.subaru.fingerprints import FW_VERSIONS
|
||||
|
||||
Ecu = car.CarParams.Ecu
|
||||
|
||||
ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()}
|
||||
|
||||
|
||||
class TestSubaruFingerprint(unittest.TestCase):
|
||||
def test_fw_version_format(self):
|
||||
for platform, fws_per_ecu in FW_VERSIONS.items():
|
||||
for (ecu, _, _), fws in fws_per_ecu.items():
|
||||
fw_size = len(fws[0])
|
||||
for fw in fws:
|
||||
self.assertEqual(len(fw), fw_size, f"{platform} {ecu}: {len(fw)} {fw_size}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
Loading…
Reference in New Issue