Hi.
I need to write application that will communicate with electronic device via serial port. I was thinking to use QExtSerialPort library but I have some doubts.
In QExtSerialPort library port is being read after signal readyRead(). In my application computer will ask electronic device about his status in loop. And then base of status send to device next commands. I need to have something like this:
while(keepAsking)
{
if(status == something[]) //<- this is only example i know it's wrong :)
{
serialPort->DoA();
}
if(status == something2[])
{
serialPort->DoB();
}
}
while(keepAsking)
{
QByteArray status = serialPort->checkStatus();
if(status == something[]) //<- this is only example i know it's wrong :)
{
serialPort->DoA();
}
if(status == something2[])
{
serialPort->DoB();
}
}
To copy to clipboard, switch view to plain text mode
What is best approach for this logic? I thing QExtSerialPort with read port on signal will not work in this situation. How would you solve this issue?
Bookmarks