I am stumbling about how to clear the SocketCAN transmit buffer (clear, not flush ). This is what happens:
- Run a normal communication (in my case its CANopen) where the linux node is actively sending (like for example a heartbeat)
- Unplug the CAN cable at the transceiver of the linux node
- You can observe the Transmit error counter going up till it reaches Error_Passive
- Due to the missing ACK we will never reach Bus_Off
- Plug in the CAN cable again, transmitting is possible again
- Now the old buffered content of the transmit buffer is send all at once
This is problematic as it may contain old and no longer up-to date status information.
Therefore my question is how can I clear this transmit buffer manually?
What works is closing/reopening the socket, as well as recovering from Bus_Off includes a clear, but above case is a special condition.
Your support is appreciated :-)
Thanks and regards,