summaryrefslogtreecommitdiffstats
path: root/src/serialbus/qcancommondefinitions.h
blob: c094538b60b45639ea7247cd33bd83cd7413f388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QCANCOMMONDEFINITIONS_H
#define QCANCOMMONDEFINITIONS_H

#include <QtCore/qtconfigmacros.h>
#include <QtCore/qtypes.h>

#include <QtSerialBus/qtserialbusglobal.h>

QT_BEGIN_NAMESPACE

namespace QtCanBus {

enum class DataSource : quint8 {
    Payload = 0,
    FrameId
};

enum class DataFormat : quint8 {
    SignedInteger = 0,
    UnsignedInteger,
    Float,
    Double,
    Ascii
};

enum class DataEndian : quint8 {
    LittleEndian = 0,
    BigEndian
};

enum class MultiplexState : quint8 {
    None = 0x00,
    MultiplexorSwitch = 0x01,
    MultiplexedSignal = 0x02,
    SwitchAndSignal = MultiplexorSwitch | MultiplexedSignal
};

using UniqueId = quint32;

} // namespace QtCanBus

#ifndef QT_NO_DEBUG_STREAM

class QDebug;

Q_SERIALBUS_EXPORT QDebug operator<<(QDebug dbg, QtCanBus::DataSource source);
Q_SERIALBUS_EXPORT QDebug operator<<(QDebug dbg, QtCanBus::DataFormat format);
Q_SERIALBUS_EXPORT QDebug operator<<(QDebug dbg, QtCanBus::DataEndian endian);
Q_SERIALBUS_EXPORT QDebug operator<<(QDebug dbg, QtCanBus::MultiplexState state);

#endif // QT_NO_DEBUG_STREAM

QT_END_NAMESPACE

#endif // QCANCOMMONDEFINITIONS_H