QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
qserialportinfo.h
Go to the documentation of this file.
1// Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
2// Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#pragma once
6
7#include <QtCore/qlist.h>
8#include <QtCore/qscopedpointer.h>
9
10#include "qserialportglobal.h"
11
13
14class QSerialPort;
16
18{
19 Q_DECLARE_PRIVATE(QSerialPortInfo)
20public:
22 explicit QSerialPortInfo(const QSerialPort& port);
23 explicit QSerialPortInfo(const QString& name);
24 QSerialPortInfo(const QSerialPortInfo& other);
27
28 QSerialPortInfo& operator=(const QSerialPortInfo& other);
29 void swap(QSerialPortInfo& other);
30
31 QString portName() const;
32 QString systemLocation() const;
33 QString description() const;
34 QString manufacturer() const;
35 QString serialNumber() const;
36
37 quint16 vendorIdentifier() const;
38 quint16 productIdentifier() const;
39
40 bool hasVendorIdentifier() const;
41 bool hasProductIdentifier() const;
42
43 bool isNull() const;
44
45 static QList<qint32> standardBaudRates();
46 static QList<QSerialPortInfo> availablePorts();
47
48private:
49 friend QList<QSerialPortInfo> availablePortsByFiltersOfDevices(bool& ok);
50 std::unique_ptr<QSerialPortInfoPrivate> d_ptr;
51};
52
53inline bool QSerialPortInfo::isNull() const
54{
55 return !d_ptr;
56}
57
58QT_END_NAMESPACE
Provides information about existing serial ports.
bool isNull() const
Provides functions to access serial ports.
Definition qserialport.h:17
QT_BEGIN_NAMESPACE
QT_BEGIN_NAMESPACE QList< QSerialPortInfo > availablePortsByFiltersOfDevices(bool &ok)
#define Q_SERIALPORT_EXPORT