Results 1 to 12 of 12

Thread: Qextserial on debian linux and readyRead slot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qextserial on debian linux and readyRead slot

    Seems, you missed setup a port name, like:

    Qt Code:
    1. SerialPortReader::SerialPortReader(...)
    2. {
    3. ...
    4.  
    5. m_serialPort = new QSerialPort();
    6.  
    7. m_serialPort->setPortName("/dev/ttyUSB0"); // << :)
    8.  
    9. if (!m_serialPort->open(QIODevice::ReadWrite))
    10. return;
    11. ...
    12. }
    To copy to clipboard, switch view to plain text mode 

    UPD:

    Is it true I need to use connect before I open the port? In terminal example does this.
    Yes, you can... Has no difference do it before or after than open(). But if you do QObject::connect() after open(), don't forget after close() to call QObject::disconnect().

    I tried to this, and in open I get an error: "No such file or direcory". I tried /dev/ttyUSB0 and ttyUSB0 too.
    It because maybe really a port is not present.

    Could I debug into QtSerial?
    Yes, of course.
    Last edited by kuzulis; 15th December 2013 at 13:32.

  2. The following user says thank you to kuzulis for this useful post:


  3. #2
    Join Date
    Dec 2013
    Posts
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qextserial on debian linux and readyRead slot

    hi,

    Quote Originally Posted by kuzulis View Post
    Seems, you missed setup a port name, like:
    Yes thx, it was a little mistake, I already found it...

    It because maybe really a port is not present.
    No, the port continuously works, cutecom, gtkterm and qtserialport example terminal can use it and works well. There is a hw, which always sends 80 bytes of frames at every 5 ms.
    I used to check with lsof /dev/ttyUSB0 to opened locks. I am the member of dialout groups.

    What do I need to set for debugging into source of qtserialport?
    When I debug my program, I see the address of serialport, but I can't see the variables and I cannot step into a function.

    thx
    Zamek

  4. The following user says thank you to zamek42 for this useful post:


  5. #3
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qextserial on debian linux and readyRead slot

    What do I need to set for debugging into source of qtserialport?
    Build *.so library as "debug" target... Or directly connect the sources via "serialport-lib.pri" file (imho, *.pri - it is preffered and simple to do gebugging).

  6. The following user says thank you to kuzulis for this useful post:


  7. #4
    Join Date
    Dec 2013
    Posts
    7
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qextserial on debian linux and readyRead slot

    Hi Kuzulis,

    I found the problem. I wrote this test inside an infinite loop, so the main thread couldn't runs and there was no emitted event on received char.
    It was good lesson for me: the main thread cannot blocked!

    Many thx to you

    Zamek

Similar Threads

  1. Replies: 0
    Last Post: 1st August 2011, 13:06
  2. QtIOCompressor fix for Mac (Debian Linux?)
    By qdm in forum Qt Programming
    Replies: 0
    Last Post: 23rd June 2010, 02:17
  3. Replies: 1
    Last Post: 1st November 2007, 14:09
  4. Look and Feel on Debian Linux
    By Krish_ng in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2007, 09:11
  5. QT4 minimum requirements Debian GNU/Linux Sarge
    By Everall in forum Installation and Deployment
    Replies: 10
    Last Post: 21st February 2006, 12:21

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
  •  
Qt is a trademark of The Qt Company.