Results 1 to 4 of 4

Thread: [serialport] QSerialPortInfo::availablePorts result

  1. #1
    Join Date
    Aug 2015
    Posts
    14
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default [serialport] QSerialPortInfo::availablePorts result

    I use Qt5 on ubuntu 14.04

    Why when I use QSerialPortInfo::availablePorts without a arduino plugged it return the all ports from /dev/ttyS0 to /dev/ttyS31 and when I use QSerialPortInfo::availablePorts with a arduino plugged it return ONLY /dev/ttyACM0?

  2. #2
    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: [serialport] QSerialPortInfo::availablePorts result

    Are the other devices still visible in /dev in the second situation?

    Cheers,
    _

  3. #3
    Join Date
    Aug 2015
    Posts
    14
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Android

    Default Re: [serialport] QSerialPortInfo::availablePorts result

    yes, there are

  4. #4
    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: [serialport] QSerialPortInfo::availablePorts result

    If we look at the relevant code we see that it can try three different methods of finding serial devices, falling back one by one if the current method fails.

    First it tries to get the information from udev, then from sysfs and only then falling back to device file nodes.

    So maybe what happens is that if you list ports without the Arduino attached, it falls back more then when it is attached.

    Cheers,
    _

Similar Threads

  1. QSerialPortInfo - Bluetooth SPP devices
    By BrianNorman in forum Qt Programming
    Replies: 16
    Last Post: 22nd February 2016, 14:18
  2. Qt5.5 QSerialPortInfo::AvailablePorts returns empty list
    By pilatomic in forum Qt Programming
    Replies: 1
    Last Post: 3rd August 2015, 21:20
  3. trouble with the QSerialPortInfo::availablePorts()
    By xiongxiongchuan in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2014, 09:42
  4. Replies: 3
    Last Post: 7th October 2013, 14:58
  5. QSerialPortInfo Broken
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 21st June 2013, 15:23

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.