Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Give function a deadline?
wost last edited by
I'm working on some communication with a RS232-port and I'm using QSerialPort to communicate between the client and the emulator I'm running. Everything is working fine, data is flowing nicely between the two.
My problem, however, is that I want to make sure that the process of reading data from the emulator should take 100ms or less; or else return a NAK. Currently I write, flush and then wait for readyRead to get all the data and then I manipulate that data as I see fit and then I return an ACK back to the emulator, but I need that timeout operation. How can I achieve this?
In advance, thanks!
A Former User last edited by
bool QSerialPort::waitForReadyRead(int msecs = 30000)has a built-in timeout. Or do you mean something else?
wost last edited by wost
Hm, I'll try that out. Thanks! :)