Results 1 to 13 of 13

Thread: QextSerialPort and modem

  1. #1
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default QextSerialPort and modem

    Hello, i have problem with opening port with modem on it, i connect phone with my notebook by bluetooth. Im using QextSerialPort to communicate with COM port, my application is working with normal RS232 cable but when on COM is modem the port dont want to open, anny suggestions how to deal with it?

    this is how i make QextSerialPort object
    Qt Code:
    1. this->port = new QextSerialPort(this->portInformations->portName);
    To copy to clipboard, switch view to plain text mode 
    this is how i open the port
    Qt Code:
    1. this->port->open(QIODevice::ReadWrite);
    To copy to clipboard, switch view to plain text mode 

    Best Regards
    kaszewczyk

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QextSerialPort and modem

    and what is this->portInformations->portName value?

  3. #3
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QextSerialPort and modem

    This is class where i hold all the port informations as a number of data bits, stop bits etc

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QextSerialPort and modem

    portName is a class?

  5. #5
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QextSerialPort and modem

    Sorry mate i get it wrong it was late when i read your post, the portName is QString with port name chosen by user. The portInformations is object of class where i hold all port informations it has only public members. Sorry agin for my mistake.

    Best Regards
    kaszewczyk

  6. #6
    Join Date
    Oct 2009
    Posts
    7
    Thanks
    1

    Default Re: QextSerialPort and modem

    what is the exact value of portName used when calling:
    Qt Code:
    1. this->port = new QextSerialPort(this->portInformations->portName);
    To copy to clipboard, switch view to plain text mode 

    are you sure that port exists on your system? and/or it is enabled in bios?

  7. #7
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QextSerialPort and modem

    Yes, i am sure because i can use system Hyperterminal with that port

  8. #8
    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: QextSerialPort and modem

    Please show us what is in this->portInformations->portName.
    For higher number of COM ports You must specify port name as "\\.\COMnn". I don't remember what is boundary value. Of course You can use this long name of COM port with all numbers.

  9. #9
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QextSerialPort and modem

    This PortInformations look like this:
    Qt Code:
    1. class PortInformations{
    2. public:
    3. QString portName;
    4. QString nrOfDataBits:
    5. //etc...
    6. }
    To copy to clipboard, switch view to plain text mode 
    This could be a problem because the modem is on COM40 but i dont know how to add "\\.\" to QString cus i cand doing by operator + ?

  10. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QextSerialPort and modem

    portName.prepend("\\\\.\\") ?

  11. #11
    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: QextSerialPort and modem

    Quote Originally Posted by kaszewczyk View Post
    This PortInformations look like this:
    Qt Code:
    1. class PortInformations{
    2. public:
    3. QString portName;
    4. QString nrOfDataBits:
    5. //etc...
    6. }
    To copy to clipboard, switch view to plain text mode 
    This could be a problem because the modem is on COM40 but i dont know how to add "\\.\" to QString cus i cand doing by operator + ?
    Qt Code:
    1. QString CreatePortName( int portNumber )
    2. {
    3. return QString("\\\\.\\%1").arg(portNumber);
    4. }
    To copy to clipboard, switch view to plain text mode 

  12. The following user says thank you to Lesiok for this useful post:

    kaszewczyk (7th November 2009)

  13. #12
    Join Date
    Oct 2009
    Location
    Poland
    Posts
    34
    Thanks
    3
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QextSerialPort and modem

    Thanks it work

    Best Regards
    kaszewczyk

  14. #13
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QextSerialPort and modem

    It would have been solved much earlier too if you had given us the information

    I gave up asking, two more people asked the same question and yet you still held out.

    Maybe next time?

Similar Threads

  1. QExtSerialPort with AT commands
    By Althor in forum Qt Programming
    Replies: 2
    Last Post: 6th September 2011, 18:15
  2. Problem in reading port using QextSerialPort
    By cutie.monkey in forum Qt Programming
    Replies: 6
    Last Post: 2nd July 2009, 02:07
  3. QExtSerialport question
    By bnilsson in forum Qt Programming
    Replies: 0
    Last Post: 6th June 2009, 22:29
  4. Problem with QExtSerialPort and a usb modem
    By Althor in forum Qt Programming
    Replies: 4
    Last Post: 31st October 2008, 12:02
  5. accessing the GSM modem using serialport in windows OS
    By jjbabu in forum Qt Programming
    Replies: 11
    Last Post: 31st December 2007, 11:38

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.