Robert
Robert

Reputation: 10953

QSerialPort starts communication after to some data were transmitted

I am trying to send and receive some serial data with QSerialPort but it take a little time. So I open a Serial Terminal. (Terminal v1.93b - 20141030B) Then with it terminal I read and send data and when I tried again with my application, it starts correctly.

So why it happens after do I open the serial terminal and some data are sended the QSerialPort works fine. It looks like if I need to reset or refresh the serial buffer on my port.

Upvotes: 1

Views: 189

Answers (1)

Vladimir Bershov
Vladimir Bershov

Reputation: 2832

Try to call the function clear() after opening a serial port, or to call the function flush() after each sending data.

bool QSerialPort::clear(Directions directions = AllDirections)
bool QSerialPort::flush()

Upvotes: 0

Related Questions