Is there a way to get notified when my serial device is ready to receive more data?
I am implementing a program that passes commands to a servo controller through a serial port using the asynchronous QSerialPort API . The program works, but it seems like I'm experiencing congestion.
In my application, I keep a registry of the most updated servo position, which I want to synchronize with the controller with as little delay as possible. My attempt to push new data to the serial port as fast as time allows me to lead to what, in my opinion, is a buildup of data that completely breaks the connection.
My question is: can I get a notification when the serial interface is ready to somehow receive new data when used QSerialPortin asynchronous mode?
The only other option that I see is to use synchronous mode and call waitForBytesWritten () but I really don't want to do this.
NOTE. I carefully studied the serial port examples in the Qt5 documentation , but for asynchronous recording it does not provide the information I need, since it performs a one-time transfer before exiting.
source
share