Vector BLF: ObjectHeaderBase.h Source File

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