Skip to content

Commit b2dd3bb

Browse files
committed
[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.
1 parent 651c4ee commit b2dd3bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hardware_integration/src/can_hardware_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ namespace isobus
314314
return false;
315315
}
316316

317-
if (channel->frameHandler->get_is_valid())
317+
if ((channel->frameHandler->get_is_valid()) &&
318+
(channel->messagesToBeTransmittedQueue.push(frame)))
318319
{
319-
channel->messagesToBeTransmittedQueue.push(frame);
320320
#if !defined CAN_STACK_DISABLE_THREADS && !defined ARDUINO
321321
updateThreadWakeupCondition.notify_all();
322322
#endif

0 commit comments

Comments
 (0)