mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 01:33:52 +08:00
deprecate busTime (#1989)
* deprecate busTime * fix test_comms.py * update opendbc * way more than i thought * and here * oops
This commit is contained in:
@@ -37,7 +37,7 @@ def calculate_checksum(data):
|
||||
|
||||
def pack_can_buffer(arr):
|
||||
snds = [b'']
|
||||
for address, _, dat, bus in arr:
|
||||
for address, dat, bus in arr:
|
||||
assert len(dat) in LEN_TO_DLC
|
||||
#logging.debug(" W 0x%x: 0x%s", address, dat.hex())
|
||||
|
||||
@@ -85,7 +85,7 @@ def unpack_can_buffer(dat):
|
||||
data = dat[CANPACKET_HEAD_SIZE:(CANPACKET_HEAD_SIZE+data_len)]
|
||||
dat = dat[(CANPACKET_HEAD_SIZE+data_len):]
|
||||
|
||||
ret.append((address, 0, data, bus))
|
||||
ret.append((address, data, bus))
|
||||
|
||||
return (ret, dat)
|
||||
|
||||
@@ -812,7 +812,7 @@ class Panda:
|
||||
logging.error("CAN: BAD SEND MANY, RETRYING")
|
||||
|
||||
def can_send(self, addr, dat, bus, timeout=CAN_SEND_TIMEOUT_MS):
|
||||
self.can_send_many([[addr, None, dat, bus]], timeout=timeout)
|
||||
self.can_send_many([[addr, dat, bus]], timeout=timeout)
|
||||
|
||||
@ensure_can_packet_version
|
||||
def can_recv(self):
|
||||
|
||||
@@ -99,7 +99,7 @@ class CcpClient():
|
||||
msgs = self._panda.can_recv() or []
|
||||
if len(msgs) >= 256:
|
||||
print("CAN RX buffer overflow!!!", file=sys.stderr)
|
||||
for rx_addr, _, rx_data_bytearray, rx_bus in msgs:
|
||||
for rx_addr, rx_data_bytearray, rx_bus in msgs:
|
||||
if rx_bus == self.can_bus and rx_addr == self.rx_addr:
|
||||
rx_data = bytes(rx_data_bytearray)
|
||||
if self.debug:
|
||||
|
||||
@@ -18,12 +18,12 @@ def recv(panda, cnt, addr, nbus):
|
||||
while len(ret) < cnt:
|
||||
kmsgs += panda.can_recv()
|
||||
nmsgs = []
|
||||
for ids, ts, dat, bus in kmsgs:
|
||||
for ids, dat, bus in kmsgs:
|
||||
if ids == addr and bus == nbus and len(ret) < cnt:
|
||||
ret.append(dat)
|
||||
else:
|
||||
# leave around
|
||||
nmsgs.append((ids, ts, dat, bus))
|
||||
nmsgs.append((ids, dat, bus))
|
||||
kmsgs = nmsgs[-256:]
|
||||
return ret
|
||||
|
||||
@@ -96,7 +96,7 @@ def isotp_send(panda, x, addr, bus=0, recvaddr=None, subaddr=None, rate=None):
|
||||
panda.can_send(addr, sends[-1], 0)
|
||||
else:
|
||||
if rate is None:
|
||||
panda.can_send_many([(addr, None, s, bus) for s in sends])
|
||||
panda.can_send_many([(addr, s, bus) for s in sends])
|
||||
else:
|
||||
for dat in sends:
|
||||
panda.can_send(addr, dat, bus)
|
||||
|
||||
@@ -145,7 +145,7 @@ class XcpClient():
|
||||
msgs = self._panda.can_recv() or []
|
||||
if len(msgs) >= 256:
|
||||
print("CAN RX buffer overflow!!!", file=sys.stderr)
|
||||
for rx_addr, _, rx_data, rx_bus in msgs:
|
||||
for rx_addr, rx_data, rx_bus in msgs:
|
||||
if rx_bus == self.can_bus and rx_addr == self.rx_addr:
|
||||
rx_data = bytes(rx_data) # convert bytearray to bytes
|
||||
if self.debug:
|
||||
|
||||
Reference in New Issue
Block a user