| 1 | // Copyright (C) 2017 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QCANBUS_H | 
| 5 | #define QCANBUS_H | 
| 6 |  | 
| 7 | #include <QtCore/qobject.h> | 
| 8 | #include <QtSerialBus/qtserialbusglobal.h> | 
| 9 | #include <QtSerialBus/qcanbusdevice.h> | 
| 10 | #include <QtSerialBus/qcanbusdeviceinfo.h> | 
| 11 |  | 
| 12 | QT_BEGIN_NAMESPACE | 
| 13 |  | 
| 14 | class Q_SERIALBUS_EXPORT QCanBus : public QObject | 
| 15 | { | 
| 16 |     Q_OBJECT | 
| 17 |  | 
| 18 | public: | 
| 19 |     static QCanBus *instance(); | 
| 20 |     QStringList plugins() const; | 
| 21 |  | 
| 22 |     QList<QCanBusDeviceInfo> availableDevices(const QString &plugin, QString *errorMessage = nullptr) const; | 
| 23 |     QList<QCanBusDeviceInfo> availableDevices(QString *errorMessage = nullptr) const; | 
| 24 |  | 
| 25 |     QCanBusDevice *createDevice(const QString &plugin, | 
| 26 |                                 const QString &interfaceName, | 
| 27 |                                 QString *errorMessage = nullptr) const; | 
| 28 |  | 
| 29 | private: | 
| 30 |     QCanBus(QObject *parent = nullptr); | 
| 31 |  | 
| 32 |     Q_DISABLE_COPY(QCanBus) | 
| 33 | }; | 
| 34 |  | 
| 35 | QT_END_NAMESPACE | 
| 36 |  | 
| 37 | #endif // QSERIALBUS_H | 
| 38 |  |