From b2dd3bb31fb3b65ab5c1a4c9de102fa3454edc8d Mon Sep 17 00:00:00 2001 From: Adrian Del Grosso <10929341+ad3154@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:12:54 -0600 Subject: [PATCH] [HW]: Fixed possibly dropping messages on Tx when Tx buffer is full Fixed an issue where we weren't checking the return value of the push into our Tx queue in our hardware interface. This could have caused some frames to be accidentally dropped. --- hardware_integration/src/can_hardware_interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware_integration/src/can_hardware_interface.cpp b/hardware_integration/src/can_hardware_interface.cpp index 17b9d2da..f01c7dda 100644 --- a/hardware_integration/src/can_hardware_interface.cpp +++ b/hardware_integration/src/can_hardware_interface.cpp @@ -314,9 +314,9 @@ namespace isobus return false; } - if (channel->frameHandler->get_is_valid()) + if ((channel->frameHandler->get_is_valid()) && + (channel->messagesToBeTransmittedQueue.push(frame))) { - channel->messagesToBeTransmittedQueue.push(frame); #if !defined CAN_STACK_DISABLE_THREADS && !defined ARDUINO updateThreadWakeupCondition.notify_all(); #endif