Vector BLF

Loading...
Searching...
No Matches
ObjectHeaderBase.h
1// SPDX-FileCopyrightText: 2013-2021 Tobias Lorenz <tobias.lorenz@gmx.net>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
7#include <Vector/BLF/platform.h>
8
9#include <Vector/BLF/AbstractFile.h>
10
11#include <Vector/BLF/vector_blf_export.h>
12
13#include <cstdint>
14
15 namespace Vector {
16 namespace BLF {
17
23 enum class ObjectType : uint32_t {
24 UNKNOWN = 0,
25 CAN_MESSAGE = 1,
26 CAN_ERROR = 2,
27 CAN_OVERLOAD = 3,
28 CAN_STATISTIC = 4,
29 APP_TRIGGER = 5,
30 ENV_INTEGER = 6,
31 ENV_DOUBLE = 7,
32 ENV_STRING = 8,
33 ENV_DATA = 9,
34 LOG_CONTAINER = 10,
35 LIN_MESSAGE = 11,
36 LIN_CRC_ERROR = 12,
37 LIN_DLC_INFO = 13,
38 LIN_RCV_ERROR = 14,
39 LIN_SND_ERROR = 15,
40 LIN_SLV_TIMEOUT = 16,
41 LIN_SCHED_MODCH = 17,
42 LIN_SYN_ERROR = 18,
43 LIN_BAUDRATE = 19,
44 LIN_SLEEP = 20,
45 LIN_WAKEUP = 21,
46 MOST_SPY = 22,
47 MOST_CTRL = 23,
48 MOST_LIGHTLOCK = 24,
49 MOST_STATISTIC = 25,
50 Reserved26 = 26,
51 Reserved27 = 27,
52 Reserved28 = 28,
53 FLEXRAY_DATA = 29,
54 FLEXRAY_SYNC = 30,
55 CAN_DRIVER_ERROR = 31,
56 MOST_PKT = 32,
57 MOST_PKT2 = 33,
58 MOST_HWMODE = 34,
59 MOST_REG = 35,
60 MOST_GENREG = 36,
61 MOST_NETSTATE = 37,
62 MOST_DATALOST = 38,
63 MOST_TRIGGER = 39,
64 FLEXRAY_CYCLE = 40,
65 FLEXRAY_MESSAGE = 41,
66 LIN_CHECKSUM_INFO = 42,
67 LIN_SPIKE_EVENT = 43,
68 CAN_DRIVER_SYNC = 44,
69 FLEXRAY_STATUS = 45,
70 GPS_EVENT = 46,
71 FR_ERROR = 47,
72 FR_STATUS = 48,
73 FR_STARTCYCLE = 49,
74 FR_RCVMESSAGE = 50,
75 REALTIMECLOCK = 51,
76 Reserved52 = 52,
77 Reserved53 = 53,
78 LIN_STATISTIC = 54,
79 J1708_MESSAGE = 55,
80 J1708_VIRTUAL_MSG = 56,
81 LIN_MESSAGE2 = 57,
82 LIN_SND_ERROR2 = 58,
83 LIN_SYN_ERROR2 = 59,
84 LIN_CRC_ERROR2 = 60,
85 LIN_RCV_ERROR2 = 61,
86 LIN_WAKEUP2 = 62,
87 LIN_SPIKE_EVENT2 = 63,
88 LIN_LONG_DOM_SIG = 64,
89 APP_TEXT = 65,
90 FR_RCVMESSAGE_EX = 66,
91 MOST_STATISTICEX = 67,
92 MOST_TXLIGHT = 68,
93 MOST_ALLOCTAB = 69,
94 MOST_STRESS = 70,
95 ETHERNET_FRAME = 71,
96 SYS_VARIABLE = 72,
97 CAN_ERROR_EXT = 73,
98 CAN_DRIVER_ERROR_EXT = 74,
99 LIN_LONG_DOM_SIG2 = 75,
100 MOST_150_MESSAGE = 76,
101 MOST_150_PKT = 77,
102 MOST_ETHERNET_PKT = 78,
103 MOST_150_MESSAGE_FRAGMENT = 79,
104 MOST_150_PKT_FRAGMENT = 80,
105 MOST_ETHERNET_PKT_FRAGMENT = 81,
106 MOST_SYSTEM_EVENT = 82,
107 MOST_150_ALLOCTAB = 83,
108 MOST_50_MESSAGE = 84,
109 MOST_50_PKT = 85,
110 CAN_MESSAGE2 = 86,
111 LIN_UNEXPECTED_WAKEUP = 87,
112 LIN_SHORT_OR_SLOW_RESPONSE = 88,
113 LIN_DISTURBANCE_EVENT = 89,
114 SERIAL_EVENT = 90,
115 OVERRUN_ERROR = 91,
116 EVENT_COMMENT = 92,
117 WLAN_FRAME = 93,
118 WLAN_STATISTIC = 94,
119 MOST_ECL = 95,
120 GLOBAL_MARKER = 96,
121 AFDX_FRAME = 97,
122 AFDX_STATISTIC = 98,
123 KLINE_STATUSEVENT = 99,
124 CAN_FD_MESSAGE = 100,
125 CAN_FD_MESSAGE_64 = 101,
126 ETHERNET_RX_ERROR = 102,
127 ETHERNET_STATUS = 103,
128 CAN_FD_ERROR_64 = 104,
129 LIN_SHORT_OR_SLOW_RESPONSE2 = 105,
130 AFDX_STATUS = 106,
131 AFDX_BUS_STATISTIC = 107,
132 Reserved108 = 108,
133 AFDX_ERROR_EVENT = 109,
134 A429_ERROR = 110,
135 A429_STATUS = 111,
136 A429_BUS_STATISTIC = 112,
137 A429_MESSAGE = 113,
138 ETHERNET_STATISTIC = 114,
139 Unknown115 = 115,
140 Reserved116 = 116,
141 Reserved117 = 117,
142 TEST_STRUCTURE = 118,
143 DIAG_REQUEST_INTERPRETATION = 119,
144 ETHERNET_FRAME_EX = 120,
145 ETHERNET_FRAME_FORWARDED = 121,
146 ETHERNET_ERROR_EX = 122,
147 ETHERNET_ERROR_FORWARDED = 123,
148 FUNCTION_BUS = 124,
149 DATA_LOST_BEGIN = 125,
150 DATA_LOST_END = 126,
151 WATER_MARK_EVENT = 127,
152 TRIGGER_CONDITION = 128,
153 CAN_SETTING_CHANGED = 129,
154 DISTRIBUTED_OBJECT_MEMBER = 130,
155 ATTRIBUTE_EVENT = 131,
156};
157
159 const uint32_t ObjectSignature = 0x4A424F4C; /* LOBJ */
160
166 struct VECTOR_BLF_EXPORT ObjectHeaderBase {
167 ObjectHeaderBase(const uint16_t headerVersion, const ObjectType objectType);
168 virtual ~ObjectHeaderBase() noexcept = default;
169 ObjectHeaderBase(const ObjectHeaderBase &) = default;
170 ObjectHeaderBase & operator=(const ObjectHeaderBase &) = default;
171 ObjectHeaderBase(ObjectHeaderBase &&) = default;
172 ObjectHeaderBase & operator=(ObjectHeaderBase &&) = default;
173
179 virtual void read(AbstractFile & is);
180
186 virtual void write(AbstractFile & os);
187
193 virtual uint16_t calculateHeaderSize() const;
194
200 virtual uint32_t calculateObjectSize() const;
201
207 uint32_t signature {ObjectSignature};
208
217 uint16_t headerSize {};
218
232 uint16_t headerVersion {};
233
239 uint32_t objectSize {};
240
248 ObjectType objectType {ObjectType::UNKNOWN};
249};
250
251}
252}
Vector::BLF::AbstractFile
Definition AbstractFile.h:19
Vector::BLF::ObjectHeaderBase::objectType
ObjectType objectType
object type
Definition ObjectHeaderBase.h:248
Vector::BLF::ObjectHeaderBase::objectSize
uint32_t objectSize
object size
Definition ObjectHeaderBase.h:239
Vector::BLF::ObjectHeaderBase::headerSize
uint16_t headerSize
sizeof object header
Definition ObjectHeaderBase.h:217
Vector::BLF::ObjectHeaderBase::headerVersion
uint16_t headerVersion
header version (1)
Definition ObjectHeaderBase.h:232
Vector::BLF::ObjectHeaderBase::read
virtual void read(AbstractFile &is)
Definition ObjectHeaderBase.cpp:18
Vector::BLF::ObjectHeaderBase::calculateObjectSize
virtual uint32_t calculateObjectSize() const
Definition ObjectHeaderBase.cpp:49
Vector::BLF::ObjectHeaderBase::calculateHeaderSize
virtual uint16_t calculateHeaderSize() const
Definition ObjectHeaderBase.cpp:40
Vector::BLF::ObjectHeaderBase::write
virtual void write(AbstractFile &os)
Definition ObjectHeaderBase.cpp:28
Vector::BLF::ObjectHeaderBase::signature
uint32_t signature
signature (ObjectSignature)
Definition ObjectHeaderBase.h:207