Results 1 to 5 of 5

Thread: QSerialPort::ResourceError called endlessly when USB detached

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: QSerialPort::ResourceError called endlessly when USB detached

    it is already be fixed in 5.6.0

  2. #2
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QSerialPort::ResourceError called endlessly when USB detached

    I prefer not to upgrade my Qt version.
    There's also the licencing issue that has changed in that version...

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSerialPort::ResourceError called endlessly when USB detached

    Delete the object and recreate it for further use?

    Cheers,
    _

  4. #4
    Join Date
    Jan 2011
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QSerialPort::ResourceError called endlessly when USB detached

    For those coming here from Ubuntu or derivatives, I've uploaded a patched version of qt5 serialport package to my ppa: https://launchpad.net/~hyozd/+archiv...tu/serialplot/ . I basically back-ported fixes from Qt 5.6. Here is the diff:

    Qt Code:
    1. --- a/src/serialport/qserialport_unix.cpp
    2. +++ b/src/serialport/qserialport_unix.cpp
    3. @@ -208,14 +208,11 @@
    4.  
    5. void QSerialPortPrivate::close()
    6. {
    7. - if (settingsRestoredOnClose) {
    8. - if (::tcsetattr(descriptor, TCSANOW, &restoredTermios) == -1)
    9. - setError(getSystemError());
    10. - }
    11. + if (settingsRestoredOnClose)
    12. + ::tcsetattr(descriptor, TCSANOW, &restoredTermios);
    13.  
    14. #ifdef TIOCNXCL
    15. - if (::ioctl(descriptor, TIOCNXCL) == -1)
    16. - setError(getSystemError());
    17. + ::ioctl(descriptor, TIOCNXCL);
    18. #endif
    19.  
    20. if (readNotifier) {
    21. @@ -228,8 +225,7 @@
    22. writeNotifier = Q_NULLPTR;
    23. }
    24.  
    25. - if (qt_safe_close(descriptor) == -1)
    26. - setError(getSystemError());
    27. + qt_safe_close(descriptor);
    28.  
    29. lockFileScopedPointer.reset(Q_NULLPTR);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 7
    Last Post: 12th October 2016, 08:48
  2. Performance issues with detached QProcess
    By simon71717 in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2014, 10:07
  3. Ignoring stdout and stder of detached process
    By Lapsio in forum Qt Programming
    Replies: 1
    Last Post: 31st July 2012, 05:38
  4. Positioning Detached Process Window
    By GTBuilder in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2008, 00:17
  5. Information From Detached Process
    By GTBuilder in forum Qt Programming
    Replies: 6
    Last Post: 18th February 2008, 14:49

Tags for this Thread

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.