Results 1 to 5 of 5

Thread: Problem with QExtSerialPort and a usb modem

  1. #1
    Join Date
    Oct 2008
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with QExtSerialPort and a usb modem

    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.

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with QExtSerialPort and a usb modem

    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.

  3. #3
    Join Date
    Oct 2008
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QExtSerialPort and a usb modem

    Hi Lesiok

    In this way?

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


    This doesn´t work

  4. #4
    Join Date
    Oct 2008
    Posts
    70
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Default Re: Problem with QExtSerialPort and a usb modem

    You should use double "\". Try this:

    Qt Code:
    1. QString portName="\\\\.\\COM18";
    2. port = new QextSerialPort(portName);
    To copy to clipboard, switch view to plain text mode 
    Last edited by pastor; 31st October 2008 at 12:42.

  5. #5
    Join Date
    Oct 2008
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with QExtSerialPort and a usb modem

    Oh, it´s true.

    It now works fine

    A lot of thanks.

Similar Threads

  1. qextserialport BAUDRATE problem
    By dheeraj in forum Qt Programming
    Replies: 6
    Last Post: 19th March 2009, 19:29
  2. Replies: 7
    Last Post: 29th August 2008, 10:24
  3. Problem in QExtserialport program.
    By dheeraj in forum Qt Programming
    Replies: 5
    Last Post: 31st May 2008, 10:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.