setting port in qexserialport
Hey everybody,
just got a question if anyone noticed similar problem to mine...
im using qt 4.5 with qexserialport 1.2 alpha
got a device connected to USB Serial Port (FTDI)
I noticed that it actually cant open (or set) the port correctly... like something in windows functions
the application works ok only if i open the chosen port with other program (like putty,realterm etc.) close it and then open it with my application and communication works perfectly... but if i remove a cable and plug it again than windows closes and openes virtual port again and qextserialport cant set it parameters correctly
some examples witch are in the library work the same way
here is my port settings
Code:
port = new QextSerialPort(COM, QextSerialPort::EventDriven);
port->setBaudRate(BAUD57600);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setTimeout(500);
read function
Code:
//receive data from RS485 ... 422
char data[1024];
//int numBytes;
//int bytesRead;
float var;
port->readLine(data, sizeof(data));
before i had implementation of read() but it was the same
write function
Code:
if (port->isOpen()){
port->write(message.toAscii(),
message.length());
}
just wanted to add that read and write are in other thread
Re: setting port in qexserialport
ok problem is solved... u just had to load port setting after calling QIODevice::open
easy correction directly in library
Re: setting port in qexserialport
Hi Myx,
Is it possible for you to show me how you fixed that problem in the library please?
Thank you!