How do you find how many bytes are currently waiting in the transmit buffer?
I'm trying to diagnose a weird serial disconnection problem with an Arduino Uno and a rosserial node. It works fine for 10-20 minutes, and then mysteriously losing connection. At first, I thought the Arduino was running out of memory, but I'm able to use the MemoryFree library to log available memory, and it never drops below 9051 bytes.
I now want to make sure the problem isn't because the serial buffer is overflowing, from the Arduino trying to send too much data.