13constexpr QLatin1String kStableUsbNamePrefix(
"usb:");
15constexpr qint32 kStandardBaudRates[] = {
16 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800,
17 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000,
18 576000, 921600, 1000000, 1152000, 1500000, 2000000, 2500000, 3000000, 3500000, 4000000,
28 if ((name == port.portName()) || (!name.isEmpty() && (name == port.stableName()))) {
45 return QList<qint32>(std::begin(kStandardBaudRates), std::end(kStandardBaudRates));
50 return availablePorts(QStringLiteral(
"/dev"), QStringLiteral(
"/sys/class/tty"));
66 return (
portName.startsWith(QLatin1Char(
'/')) ||
portName.startsWith(QLatin1String(
"./")) ||
67 portName.startsWith(QLatin1String(
"../")) ||
portName.startsWith(kStableUsbNamePrefix))
69 : (QLatin1String(
"/dev/") +
portName);
static QString portNameFromSystemLocation(const QString &systemLocation)
static bool isUsbLocation(const QString &systemLocation)
QSerialPortInfo()=default
A null port info, which describes no port.
static QList< QSerialPortInfo > posixPorts(const QString &devDir, const QString &sysTtyDir, const QList< QSerialPortInfo > &usbPorts={})
static QList< QSerialPortInfo > availablePorts()
QString systemLocation() const
static QString portNameToSystemLocation(const QString &portName)
static QList< qint32 > standardBaudRates()
QList< QSerialPortInfo > availablePorts()