Closed GoogleCodeExporter closed 8 years ago
Can you provide your report in a chronological list of actions? Typically,
only one application can have the
device open at a time.
Original comment by lst...@gmail.com
on 7 Feb 2010 at 10:10
Found the problem (I remember I've read it on some forums before) ...
Old code was:
port = new QextSerialPort( "COM15", QextSerialPort::EventDriven);
port->setBaudRate(BAUD57600);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setDtr( true );
port->setRts( true );
if (port->open(QIODevice::ReadWrite | QIODevice::Unbuffered) == true)
{
...
}
New code is:
port = new QextSerialPort( "COM15", QextSerialPort::EventDriven);
if (port->open(QIODevice::ReadWrite | QIODevice::Unbuffered) == true)
{
port->setBaudRate(BAUD57600);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setDtr( true );
port->setRts( true );
....
}
Anyway, is there a chance to increase the robustness a little bit more?
The issue can be closed from my side :)
Original comment by Michael....@treggs.com
on 8 Feb 2010 at 6:21
Analyzed the problem a little bit further. In fact the only problem seems to be
the following line:
port->setDtr( true );
I need to call it after port->open() to get the port working stable. All other
lines can be attached
before the open() method. Here is the reduced version of the problem:
port = new QextSerialPort( "COM15", QextSerialPort::EventDriven);
port->setBaudRate(BAUD57600);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setDtr( true );
port->setRts( true );
if (port->open( QIODevice::ReadWrite | QIODevice::Unbuffered ) == true)
{
port->setDtr( true ); //XXX needs to be set after open() once more
...
}
Original comment by Michael....@treggs.com
on 8 Feb 2010 at 7:00
You might be able to find it in the documentation, but certainly in the code
the comments say "This function will
have no effect if the port associated with the class is not currently open."
Original comment by lst...@gmail.com
on 8 Feb 2010 at 7:07
Original issue reported on code.google.com by
Michael....@treggs.com
on 7 Feb 2010 at 9:13