Skip to content

Commit

Permalink
[HW]: Fixed possibly dropping messages on Tx when Tx buffer is full
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ad3154 committed Jun 18, 2024
1 parent 651c4ee commit b2dd3bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hardware_integration/src/can_hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2dd3bb

Please sign in to comment.