Serial Communications Basics Using QextSerialPort

Hello.

I'm trying to connect to a Diecimila board with QextSerialPort but my application hangs when the port->open() call is made.

This is the code I'm using to open the port:

port = new QextSerialPort("/dev/tty.usbserial-A4001uwj");
port->open(QIODevice::ReadWrite);
port->setBaudRate(BAUD9600);   
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);    
port->setDataBits(DATA_8);   
port->setStopBits(STOP_1);

qDebug("is open: %d", port->isOpen());

UPDATE:
I just noticed that if I run a python script that opens a connection to the same port (using pySerial), and then run the above code everything works.

You might try printing out the QList returned by QextSerialPortEnumerator::getPorts() to verify that the name you are using is valid.

Also I use setQueryMode(QextSerialBase::Polling) before the open(), my port->open() uses QextSerialBase::ReadWrite rather than QIODevice::ReadWrite, and I use FLOW_HARDWARE rather than FLOW_OFF (not that this last one will help if open() is not returning).

What platform and what version of QextSerialPort are you using? I'm on a Mac and using ver 1.1. I can't find the setQueryMode() function from 1.1 API docs (or from QT Creator). I tried compiling 1.2 but it came back with an error of "objbase.h and initguid.h missing". I take it that these are some Windows headers.

What platform and what version of QextSerialPort are you using?

Windows. Not sure of the version, but it's public-domain derived (prior to the Google Code BSD-licensing) with all the original headers removed, so the providence can't be traced.

If open() is not working then my guess is either the way you are constructing the name or a permissions problem.