I have a device connected to my PC with a usb converted serial port (FTDI). I'm using qextserialport and altogether it works great. However, waitForReadyRead() doesn't wait for data to arrive, but returns immidiately with false. I'm using it like this:
void Serial::checkForData()
{
port = new QextSerialPort("COM3");
port->setBaudRate(BAUD115200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
sendSomething();
if (port->waitForReadyRead(1000))
{
// Device replied within 1 second
}
else
{
// Device didn't reply.
}
}
void Serial::checkForData()
{
port = new QextSerialPort("COM3");
port->setBaudRate(BAUD115200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->open(QIODevice::ReadWrite);
sendSomething();
if (port->waitForReadyRead(1000))
{
// Device replied within 1 second
}
else
{
// Device didn't reply.
}
}
To copy to clipboard, switch view to plain text mode
The waitForReadyRead call returns immidiately with false, without waiting for 1 second.
Any ideas?
Bookmarks