Results 1 to 5 of 5

Thread: QSerialPort::ResourceError called endlessly when USB detached

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2016
    Posts
    6
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QSerialPort::ResourceError called endlessly when USB detached

    Hi,
    My app' is talking with a GSM modem, over USB.
    • /dev/ttyACM0 is used for pppd (external process, not within my Qt app').

    • /dev/ttyACM5 is used for 'control' AT commands (RSSI, provider local time, voice calls, etc.)


    Everything is working fine till the modem's USB cable is plugged out (actually, every few hours the modem crashes, or something else, which ends up in the USB interface is destroyed, what seems to my Linux as a detach-event).

    On detach:
    • pppd dies and frees /dev/ttyACM0.

    • My QSerialPort receives a ResourceError signal, I call MyQSerialPort.close() and receive another ResourceError signal, in an endless loop. The app' finally crashes (but the Linux doesn't), but the modem has already reconnected and uDev creates ttyACM0, 1, 2, 3, 4, 6, 7 - missing ttyACM5 (because it was held by the app').


    What am I doing wrong?
    Should I disconnect all signals from MyQSerialPort before calling close(), and reconnect after?
    I'm afraid of a memory/resource leak.

    Qt 5.5.1, Linux.

    Thanks
    Last edited by RamiRosenbaum; 31st March 2016 at 10:14.

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.