From e2c076cab86d2690bfd0e1f449a84eefa1a72e36 Mon Sep 17 00:00:00 2001 From: Lukas <61192133+lukasloetkolben@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:24:22 -0700 Subject: [PATCH] Remove retry can_send_many loop (#2060) * remove retry loop from can_send_many * while condition --- python/__init__.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/python/__init__.py b/python/__init__.py index 7da3648e2..0cbf1ef94 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -831,18 +831,10 @@ class Panda: @ensure_can_packet_version def can_send_many(self, arr, timeout=CAN_SEND_TIMEOUT_MS): snds = pack_can_buffer(arr) - while True: - try: - for tx in snds: - while True: - bs = self._handle.bulkWrite(3, tx, timeout=timeout) - tx = tx[bs:] - if len(tx) == 0: - break - logger.error("CAN: PARTIAL SEND MANY, RETRYING") - break - except (usb1.USBErrorIO, usb1.USBErrorOverflow): - logger.error("CAN: BAD SEND MANY, RETRYING") + for tx in snds: + while len(tx) > 0: + bs = self._handle.bulkWrite(3, tx, timeout=timeout) + tx = tx[bs:] def can_send(self, addr, dat, bus, timeout=CAN_SEND_TIMEOUT_MS): self.can_send_many([[addr, dat, bus]], timeout=timeout)