mirror of https://github.com/commaai/panda.git
parent
8c3bb0151e
commit
daa739efb7
|
@ -301,7 +301,7 @@ def get_dtc_status_names(status):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class CanClient():
|
class CanClient():
|
||||||
def __init__(self, can_send: Callable[[int, bytes, int], None], can_recv: Callable[[], list[tuple[int, int, bytes, int]]],
|
def __init__(self, can_send: Callable[[int, bytes, int], None], can_recv: Callable[[], list[tuple[int, bytes, int]]],
|
||||||
tx_addr: int, rx_addr: int, bus: int, sub_addr: int | None = None, debug: bool = False):
|
tx_addr: int, rx_addr: int, bus: int, sub_addr: int | None = None, debug: bool = False):
|
||||||
self.tx = can_send
|
self.tx = can_send
|
||||||
self.rx = can_recv
|
self.rx = can_recv
|
||||||
|
@ -339,7 +339,7 @@ class CanClient():
|
||||||
print(f"CAN-RX: drain - {len(msgs)}")
|
print(f"CAN-RX: drain - {len(msgs)}")
|
||||||
self.rx_buff.clear()
|
self.rx_buff.clear()
|
||||||
else:
|
else:
|
||||||
for rx_addr, _, rx_data, rx_bus in msgs or []:
|
for rx_addr, rx_data, rx_bus in msgs or []:
|
||||||
if self._recv_filter(rx_bus, rx_addr) and len(rx_data) > 0:
|
if self._recv_filter(rx_bus, rx_addr) and len(rx_data) > 0:
|
||||||
rx_data = bytes(rx_data) # convert bytearray to bytes
|
rx_data = bytes(rx_data) # convert bytearray to bytes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue