Simple question: In the Serial library I don't see any way of determining if the serial port is ready to transmit. Is there a way of testing this?
I gather the library uses a buffer on the transmit side so I suppose what I need to do is test if the buffer is full and therefore cannot accept any more bytes for transmission. Even at the highest baud rates if I write a program that continuously transmits to the serial port the buffer will eventually fill up as the serial hardware will be unable to pull bytes out of the buffer and transmit them quickly enough. What happens then? Do the last bytes stored in the buffer get thrown away?
I could just insert delays between my transmissions but I would rather not. I want to get the maximum performance from the serial port and send more bytes as soon as there is room for them.
I'm using an Arduino Uno by the way.