I have written a simple program that writes into the serial port (blockingly) and measures the time it takes. writing 104 Bytes of data @ 19200 takes 58/59 msec.
Reading the same amount of data takes only 54 msec (making a simple math shows that 54 msec is the correct number).
How can i reduce the latency of writing into the serialport?? By the way my hardware is a Beagle Bone Black. My code follows:
QTime t;t.start();
int bytes_written = write(m_serialport_fd, data, data_size);
if(bytes_written != data_size)
//handle error
tcdrain(m_serialport_fd);
qDebug()<<"Writing into serialport took" << t.elapsed();
Any hints is appreciated.