PDA

View Full Version : Problem with QExtSerialPort and a usb modem



Althor
31st October 2008, 11:16
Hi

I am testing qextserialport through qesptest example with a usb modem which uses COM18 port.

The example runs fine (open port) if I use settings by default, COM1 port, but when I want to use the serial port of the device, COM18, I always get port is not open.

How should I use the example with a usb modem?

Thanks in advance.
Regards.

Lesiok
31st October 2008, 11:27
On Windows ports with numbers equel or higher than 10 You must open with name \\.\COMnn not as COMnn, where nn is a port number. This described in MSDN. Of course You can use this method for ports 1-9 too.

Althor
31st October 2008, 11:49
Hi Lesiok

In this way?

QString portName="\\.\COM18";
port = new QextSerialPort(portName);

This doesn´t work :(

pastor
31st October 2008, 11:57
You should use double "\". Try this:


QString portName="\\\\.\\COM18";
port = new QextSerialPort(portName);

Althor
31st October 2008, 12:02
Oh, it´s true.

It now works fine :)

A lot of thanks.