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
12QT_BEGIN_NAMESPACE
13
14class Q_SERIALBUS_EXPORT QCanBus : public QObject
15{
16 Q_OBJECT
17
18public:
19 static QCanBus *instance();
20 QStringList plugins() const;
21
22 QList<QCanBusDeviceInfo> availableDevices(const QString &plugin, QString *errorMessage = nullptr) const;
23
24 QCanBusDevice *createDevice(const QString &plugin,
25 const QString &interfaceName,
26 QString *errorMessage = nullptr) const;
27
28private:
29 QCanBus(QObject *parent = nullptr);
30
31 Q_DISABLE_COPY(QCanBus)
32};
33
34QT_END_NAMESPACE
35
36#endif // QSERIALBUS_H
37

source code of qtserialbus/src/serialbus/qcanbus.h