Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36296

QSerialPortInfo fails to find FTDI serial port on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 Alpha
    • 5.2.0
    • Serial Port
    • None
    • Android RockChip rk30sdk 10" tablet.
    • Android
    • 0e46e8d319d054c7325d00b97ba4d7bd30f97e7c

    Description

      When using an FTDI USB to RS485 device on an Android tablet, QSerialPortInfo::availablePorts() returns nothing, when a device is connected.

      We're using an add-on module for Android in /system/lib/modules/ftdi_sio.ko, which recognizes the FTDI device and populates /dev/ttyUSB0, however this device isn't shown by QSerialPortInfo::availablePort().

      We've hard-coded the port to be /dev/ttyUSB0, but it would be nice if the availablePorts() returned the port connected to the FTDI device. Here is the code I'm using. If I remove the #ifndef statement, nothing is output to the terminal for an Android build.

      <code>
      port = new QSerialPort(portName);

      #ifndef Q_OS_ANDROID
      qDebug() << "*********Populating Serial Port(s)************";
      foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())

      { qDebug() << "Name : " << info.portName(); qDebug() << "Description : " << info.description(); qDebug() << "Product ID : " << info.productIdentifier(); qDebug() << "Manufacturer: " << info.manufacturer(); if( info.manufacturer() == "FTDI") port->setPort(info); }

      #endif
      <code>

      Attachments

        Activity

          People

            lukeandrew Luke Andrew
            lukeandrew Luke Andrew
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: