@@ -13,7 +13,7 @@ def checksum(msg):
1313 addr , t , dat , bus = msg
1414
1515 chksum = 0
16- if addr == 902 :
16+ if addr == 0x386 :
1717 for i , b in enumerate (dat ):
1818 for j in range (8 ):
1919 # exclude checksum and counter bits
@@ -28,26 +28,26 @@ def checksum(msg):
2828 ret [7 ] |= (chksum & 0xc ) << 4
2929 else :
3030 for i , b in enumerate (dat ):
31- if addr in [608 , 1057 ] and i == 7 :
32- b &= 0x0F if addr == 1057 else 0xF0
33- elif addr == 916 and i == 6 :
31+ if addr in [0x260 , 0x421 ] and i == 7 :
32+ b &= 0x0F if addr == 0x421 else 0xF0
33+ elif addr == 0x394 and i == 6 :
3434 b &= 0xF0
35- elif addr == 916 and i == 7 :
35+ elif addr == 0x394 and i == 7 :
3636 continue
3737 chksum += sum (divmod (b , 16 ))
3838 chksum = (16 - chksum ) % 16
3939 ret = bytearray (dat )
40- ret [6 if addr == 916 else 7 ] |= chksum << (4 if addr == 1057 else 0 )
40+ ret [6 if addr == 0x394 else 7 ] |= chksum << (4 if addr == 0x421 else 0 )
4141
4242 return addr , t , ret , bus
4343
4444
4545class TestHyundaiSafety (HyundaiButtonBase , common .PandaSafetyTest , common .DriverTorqueSteeringSafetyTest ):
46- TX_MSGS = [[832 , 0 ], [1265 , 0 ], [1157 , 0 ]]
46+ TX_MSGS = [[0x340 , 0 ], [0x4F1 , 0 ], [0x485 , 0 ]]
4747 STANDSTILL_THRESHOLD = 12 # 0.375 kph
48- RELAY_MALFUNCTION_ADDR = 832
48+ RELAY_MALFUNCTION_ADDR = 0x340
4949 RELAY_MALFUNCTION_BUS = 0
50- FWD_BLACKLISTED_ADDRS = {2 : [832 , 1157 ]}
50+ FWD_BLACKLISTED_ADDRS = {2 : [0x340 , 0x485 ]}
5151 FWD_BUS_LOOKUP = {0 : 2 , 2 : 0 }
5252
5353 MAX_RATE_UP = 3
@@ -168,11 +168,10 @@ def _user_gas_msg(self, gas):
168168 return self .packer .make_can_msg_panda ("E_EMS11" , 0 , values , fix_checksum = checksum )
169169
170170class TestHyundaiLongitudinalSafety (HyundaiLongitudinalBase , TestHyundaiSafety ):
171- TX_MSGS = [[832 , 0 ], [1265 , 0 ], [1157 , 0 ], [1056 , 0 ], [1057 , 0 ], [1290 , 0 ], [905 , 0 ], [1186 , 0 ], [909 , 0 ], [1155 , 0 ], [2000 , 0 ]]
171+ TX_MSGS = [[0x340 , 0 ], [0x4F1 , 0 ], [0x485 , 0 ], [0x420 , 0 ], [0x421 , 0 ], [0x50A , 0 ], [0x389 , 0 ], [0x4A2 , 0 ], [0x38D , 0 ], [0x483 , 0 ], [0x7D0 , 0 ]]
172172
173-
174- DISABLED_ECU_UDS_MSG = (2000 , 0 )
175- DISABLED_ECU_ACTUATION_MSG = (1057 , 0 )
173+ DISABLED_ECU_UDS_MSG = (0x7D0 , 0 )
174+ DISABLED_ECU_ACTUATION_MSG = (0x421 , 0 )
176175
177176 def setUp (self ):
178177 self .packer = CANPackerPanda ("hyundai_kia_generic" )
0 commit comments