mirror of https://github.com/commaai/panda.git
Fixing tests after min->MIN change
This commit is contained in:
parent
ecb9b6c01f
commit
3e9469b3ee
|
@ -1216,7 +1216,7 @@ def main():
|
||||||
operation_func = globals()[args.operation]
|
operation_func = globals()[args.operation]
|
||||||
operation_args,_,_,_ = inspect.getargspec(operation_func)
|
operation_args,_,_,_ = inspect.getargspec(operation_func)
|
||||||
if operation_args[0] == 'esp': # operation function takes an ESPROM connection object
|
if operation_args[0] == 'esp': # operation function takes an ESPROM connection object
|
||||||
initial_baud = MIN(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate
|
initial_baud = min(ESPROM.ESP_ROM_BAUD, args.baud) # don't sync faster than the default baud rate
|
||||||
esp = ESPROM(args.port, initial_baud)
|
esp = ESPROM(args.port, initial_baud)
|
||||||
esp.connect()
|
esp.connect()
|
||||||
operation_func(esp, args)
|
operation_func(esp, args)
|
||||||
|
|
|
@ -152,7 +152,7 @@ class ELMCarSimulator():
|
||||||
if len(outmsg) <= 5:
|
if len(outmsg) <= 5:
|
||||||
self._lin_send(0x10, obd_header + outmsg)
|
self._lin_send(0x10, obd_header + outmsg)
|
||||||
else:
|
else:
|
||||||
first_msg_len = MIN(4, len(outmsg)%4) or 4
|
first_msg_len = min(4, len(outmsg)%4) or 4
|
||||||
self._lin_send(0x10, obd_header + b'\x01' +
|
self._lin_send(0x10, obd_header + b'\x01' +
|
||||||
b'\x00'*(4-first_msg_len) +
|
b'\x00'*(4-first_msg_len) +
|
||||||
outmsg[:first_msg_len])
|
outmsg[:first_msg_len])
|
||||||
|
@ -229,7 +229,7 @@ class ELMCarSimulator():
|
||||||
outaddr = 0x7E8 if address == 0x7DF or address == 0x7E0 else 0x18DAF110
|
outaddr = 0x7E8 if address == 0x7DF or address == 0x7E0 else 0x18DAF110
|
||||||
msgnum = 1
|
msgnum = 1
|
||||||
while(self.__can_multipart_data):
|
while(self.__can_multipart_data):
|
||||||
datalen = MIN(7, len(self.__can_multipart_data))
|
datalen = min(7, len(self.__can_multipart_data))
|
||||||
msgpiece = struct.pack("B", 0x20 | msgnum) + self.__can_multipart_data[:datalen]
|
msgpiece = struct.pack("B", 0x20 | msgnum) + self.__can_multipart_data[:datalen]
|
||||||
self._can_send(outaddr, msgpiece)
|
self._can_send(outaddr, msgpiece)
|
||||||
self.__can_multipart_data = self.__can_multipart_data[7:]
|
self.__can_multipart_data = self.__can_multipart_data[7:]
|
||||||
|
@ -246,7 +246,7 @@ class ELMCarSimulator():
|
||||||
self._can_send(outaddr,
|
self._can_send(outaddr,
|
||||||
struct.pack("BBB", len(outmsg)+2, 0x40|data[1], pid) + outmsg)
|
struct.pack("BBB", len(outmsg)+2, 0x40|data[1], pid) + outmsg)
|
||||||
else:
|
else:
|
||||||
first_msg_len = MIN(3, len(outmsg)%7)
|
first_msg_len = min(3, len(outmsg)%7)
|
||||||
payload_len = len(outmsg)+3
|
payload_len = len(outmsg)+3
|
||||||
msgpiece = struct.pack("BBBBB", 0x10 | ((payload_len>>8)&0xF),
|
msgpiece = struct.pack("BBBBB", 0x10 | ((payload_len>>8)&0xF),
|
||||||
payload_len&0xFF,
|
payload_len&0xFF,
|
||||||
|
|
Loading…
Reference in New Issue