// Copyright (C) 2012 Denis Shienkov // Copyright (C) 2012 Laszlo Papp // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QSERIALPORTINFO_H #define QSERIALPORTINFO_H #include #include #include QT_BEGIN_NAMESPACE class QSerialPort; class QSerialPortInfoPrivate; class Q_SERIALPORT_EXPORT QSerialPortInfo { Q_DECLARE_PRIVATE(QSerialPortInfo) public: QSerialPortInfo(); explicit QSerialPortInfo(const QSerialPort &port); explicit QSerialPortInfo(const QString &name); QSerialPortInfo(const QSerialPortInfo &other); ~QSerialPortInfo(); QSerialPortInfo& operator=(const QSerialPortInfo &other); void swap(QSerialPortInfo &other); QString portName() const; QString systemLocation() const; QString description() const; QString manufacturer() const; QString serialNumber() const; quint16 vendorIdentifier() const; quint16 productIdentifier() const; bool hasVendorIdentifier() const; bool hasProductIdentifier() const; bool isNull() const; static QList standardBaudRates(); static QList availablePorts(); private: QSerialPortInfo(const QSerialPortInfoPrivate &dd); friend QList availablePortsByUdev(bool &ok); friend QList availablePortsBySysfs(bool &ok); friend QList availablePortsByFiltersOfDevices(bool &ok); std::unique_ptr d_ptr; }; inline bool QSerialPortInfo::isNull() const { return !d_ptr; } QT_END_NAMESPACE #endif // QSERIALPORTINFO_H