Cruz
5th February 2009, 09:40
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);
port->open(QIODevice::ReadWrite);
sendSomething();
if (port->waitForReadyRead(1000))
{
// Device replied within 1 second
}
else
{
// Device didn't reply.
}
}
The waitForReadyRead call returns immidiately with false, without waiting for 1 second.
Any ideas?
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.
}
}
The waitForReadyRead call returns immidiately with false, without waiting for 1 second.
Any ideas?