convert to set

This commit is contained in:
Shane Smiskol 2023-10-31 16:56:14 -07:00
parent b3a611e17d
commit 85863c37a7
2 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@ import abc
import unittest import unittest
import importlib import importlib
import numpy as np import numpy as np
from typing import Callable, Dict, List, Optional from typing import Callable, Dict, List, Optional, Set, Tuple
from opendbc.can.packer import CANPacker # pylint: disable=import-error from opendbc.can.packer import CANPacker # pylint: disable=import-error
from panda import ALTERNATIVE_EXPERIENCE from panda import ALTERNATIVE_EXPERIENCE
@ -751,7 +751,7 @@ class AngleSteeringSafetyTest(PandaSafetyTestBase):
@add_regen_tests @add_regen_tests
class PandaSafetyTest(PandaSafetyTestBase): class PandaSafetyTest(PandaSafetyTestBase):
TX_MSGS: Optional[List[List[int]]] = None TX_MSGS: Optional[Set[Tuple[int, int]]] = None
SCANNED_ADDRS = [*range(0x800), # Entire 11-bit CAN address space SCANNED_ADDRS = [*range(0x800), # Entire 11-bit CAN address space
*range(0x18DA00F1, 0x18DB00F1, 0x100), # 29-bit UDS physical addressing *range(0x18DA00F1, 0x18DB00F1, 0x100), # 29-bit UDS physical addressing
*range(0x18DB00F1, 0x18DC00F1, 0x100), # 29-bit UDS functional addressing *range(0x18DB00F1, 0x18DC00F1, 0x100), # 29-bit UDS functional addressing

View File

@ -11,7 +11,7 @@ from panda.tests.safety.hyundai_common import HyundaiButtonBase, HyundaiLongitud
class TestHyundaiCanfdBase(HyundaiButtonBase, common.PandaSafetyTest, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest): class TestHyundaiCanfdBase(HyundaiButtonBase, common.PandaSafetyTest, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest):
TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] TX_MSGS = {(0x50, 0), (0x1CF, 1), (0x2A4, 0)}
STANDSTILL_THRESHOLD = 12 # 0.375 kph STANDSTILL_THRESHOLD = 12 # 0.375 kph
RELAY_MALFUNCTION_ADDR = 0x50 RELAY_MALFUNCTION_ADDR = 0x50
RELAY_MALFUNCTION_BUS = 0 RELAY_MALFUNCTION_BUS = 0
@ -84,7 +84,7 @@ class TestHyundaiCanfdBase(HyundaiButtonBase, common.PandaSafetyTest, common.Dri
class TestHyundaiCanfdHDA1Base(TestHyundaiCanfdBase): class TestHyundaiCanfdHDA1Base(TestHyundaiCanfdBase):
TX_MSGS = [[0x12A, 0], [0x1A0, 1], [0x1CF, 0], [0x1E0, 0]] TX_MSGS = {(0x12A, 0), (0x1A0, 1), (0x1CF, 0), (0x1E0, 0)}
RELAY_MALFUNCTION_ADDR = 0x12A RELAY_MALFUNCTION_ADDR = 0x12A
RELAY_MALFUNCTION_BUS = 0 RELAY_MALFUNCTION_BUS = 0
FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]} FWD_BLACKLISTED_ADDRS = {2: [0x12A, 0x1E0]}
@ -162,7 +162,7 @@ class TestHyundaiCanfdHDA1AltButtons(TestHyundaiCanfdHDA1Base):
class TestHyundaiCanfdHDA2EV(TestHyundaiCanfdBase): class TestHyundaiCanfdHDA2EV(TestHyundaiCanfdBase):
TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0]] TX_MSGS = {(0x50, 0), (0x1CF, 1), (0x2A4, 0)}
RELAY_MALFUNCTION_ADDR = 0x50 RELAY_MALFUNCTION_ADDR = 0x50
RELAY_MALFUNCTION_BUS = 0 RELAY_MALFUNCTION_BUS = 0
FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]} FWD_BLACKLISTED_ADDRS = {2: [0x50, 0x2a4]}
@ -183,7 +183,7 @@ class TestHyundaiCanfdHDA2EV(TestHyundaiCanfdBase):
# TODO: Handle ICE and HEV configurations once we see cars that use the new messages # TODO: Handle ICE and HEV configurations once we see cars that use the new messages
class TestHyundaiCanfdHDA2EVAltSteering(TestHyundaiCanfdBase): class TestHyundaiCanfdHDA2EVAltSteering(TestHyundaiCanfdBase):
TX_MSGS = [[0x110, 0], [0x1CF, 1], [0x362, 0]] TX_MSGS = {(0x110, 0), (0x1CF, 1), (0x362, 0)}
RELAY_MALFUNCTION_ADDR = 0x110 RELAY_MALFUNCTION_ADDR = 0x110
RELAY_MALFUNCTION_BUS = 0 RELAY_MALFUNCTION_BUS = 0
FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]} FWD_BLACKLISTED_ADDRS = {2: [0x110, 0x362]}
@ -204,8 +204,8 @@ class TestHyundaiCanfdHDA2EVAltSteering(TestHyundaiCanfdBase):
class TestHyundaiCanfdHDA2LongEV(HyundaiLongitudinalBase, TestHyundaiCanfdHDA2EV): class TestHyundaiCanfdHDA2LongEV(HyundaiLongitudinalBase, TestHyundaiCanfdHDA2EV):
TX_MSGS = [[0x50, 0], [0x1CF, 1], [0x2A4, 0], [0x51, 0], [0x730, 1], [0x12a, 1], [0x160, 1], TX_MSGS = {(0x50, 0), (0x1CF, 1), (0x2A4, 0), (0x51, 0), (0x730, 1), (0x12a, 1), (0x160, 1),
[0x1e0, 1], [0x1a0, 1], [0x1ea, 1], [0x200, 1], [0x345, 1], [0x1da, 1]] (0x1e0, 1), (0x1a0, 1), (0x1ea, 1), (0x200, 1), (0x345, 1), (0x1da, 1)}
DISABLED_ECU_UDS_MSG = (0x730, 1) DISABLED_ECU_UDS_MSG = (0x730, 1)
DISABLED_ECU_ACTUATION_MSG = (0x1a0, 1) DISABLED_ECU_ACTUATION_MSG = (0x1a0, 1)