1 | // Copyright (C) 2019 Andre Hartmann <aha_1980@gmx.de> |
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 LIBSOCKETCAN_H |
5 | #define LIBSOCKETCAN_H |
6 | |
7 | #include <QtCore/qglobal.h> |
8 | #include <QtSerialBus/qcanbusdevice.h> |
9 | |
10 | // |
11 | // W A R N I N G |
12 | // ------------- |
13 | // |
14 | // This file is not part of the Qt API. It exists purely as an |
15 | // implementation detail. This header file may change from version to |
16 | // version without notice, or even be removed. |
17 | // |
18 | // We mean it. |
19 | // |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class QString; |
24 | |
25 | class LibSocketCan final |
26 | { |
27 | public: |
28 | explicit LibSocketCan(QString *errorString = nullptr); |
29 | |
30 | bool start(const QString &interface); |
31 | bool stop(const QString &interface); |
32 | bool restart(const QString &interface); |
33 | |
34 | quint32 bitrate(const QString &interface) const; |
35 | bool setBitrate(const QString &interface, quint32 bitrate); |
36 | |
37 | bool hasBusStatus() const; |
38 | QCanBusDevice::CanBusStatus busStatus(const QString &interface) const; |
39 | }; |
40 | |
41 | QT_END_NAMESPACE |
42 | |
43 | #endif // LIBSOCKETCAN_H |
44 | |