| 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 QCANBUSDEVICE_P_H |
| 5 | #define QCANBUSDEVICE_P_H |
| 6 | |
| 7 | #include <QtCore/qmutex.h> |
| 8 | #include <QtSerialBus/qcanbusdevice.h> |
| 9 | |
| 10 | #include <private/qobject_p.h> |
| 11 | |
| 12 | // |
| 13 | // W A R N I N G |
| 14 | // ------------- |
| 15 | // |
| 16 | // This file is not part of the Qt API. It exists purely as an |
| 17 | // implementation detail. This header file may change from version to |
| 18 | // version without notice, or even be removed. |
| 19 | // |
| 20 | // We mean it. |
| 21 | // |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | typedef QPair<QCanBusDevice::ConfigurationKey, QVariant > ConfigEntry; |
| 26 | |
| 27 | class QCanBusDevicePrivate : public QObjectPrivate |
| 28 | { |
| 29 | Q_DECLARE_PUBLIC(QCanBusDevice) |
| 30 | public: |
| 31 | QCanBusDevicePrivate() {} |
| 32 | |
| 33 | QCanBusDevice::CanBusError lastError = QCanBusDevice::CanBusError::NoError; |
| 34 | QCanBusDevice::CanBusDeviceState state = QCanBusDevice::UnconnectedState; |
| 35 | QString errorText; |
| 36 | |
| 37 | QList<QCanBusFrame> incomingFrames; |
| 38 | mutable QMutex incomingFramesGuard; |
| 39 | QList<QCanBusFrame> outgoingFrames; |
| 40 | QList<ConfigEntry> configOptions; |
| 41 | |
| 42 | bool waitForReceivedEntered = false; |
| 43 | bool waitForWrittenEntered = false; |
| 44 | |
| 45 | std::function<void()> m_resetControllerFunction; |
| 46 | std::function<QCanBusDevice::CanBusStatus()> m_busStatusGetter; |
| 47 | }; |
| 48 | |
| 49 | QT_END_NAMESPACE |
| 50 | |
| 51 | #endif // QCANBUSDEVICE_P_H |
| 52 |
