! * \brief Returns a list with the names of the available ports */
| 95 | * \brief Returns a list with the names of the available ports |
| 96 | */ |
| 97 | QStringList LiveDataSource::availablePorts() { |
| 98 | QStringList ports; |
| 99 | // qDebug() << "available ports count:" << QSerialPortInfo::availablePorts().size(); |
| 100 | |
| 101 | #ifdef HAVE_QTSERIALPORT |
| 102 | for (const QSerialPortInfo& sp : QSerialPortInfo::availablePorts()) { |
| 103 | ports.append(sp.portName()); |
| 104 | |
| 105 | DEBUG(" port " << STDSTRING(sp.portName()) << ": " << STDSTRING(sp.systemLocation()) << STDSTRING(sp.description()) << ' ' |
| 106 | << STDSTRING(sp.manufacturer()) << ' ' << STDSTRING(sp.serialNumber())); |
| 107 | } |
| 108 | // For Testing: |
| 109 | // ports.append("/dev/pts/26"); |
| 110 | #endif |
| 111 | |
| 112 | return ports; |
| 113 | } |
| 114 | |
| 115 | /*! |
| 116 | * \brief Returns a list with the supported baud rates |
nothing calls this directly
no test coverage detected