InertiaSDK

Loading...
Searching...
No Matches
LoggingCommands.h
1#pragma once
2
3#include "data/command/InertiaCommand.h"
4
5 namespace inertia
6{
7
9 enum LoggingCommands : uint8_t {
10 LoggingStart = 1,
11 LoggingStop = 2,
12 LoggingGetFirst = 3,
13 LoggingState = 4,
14 LoggingReadRange = 5,
15 LoggingOpen = 6,
16 LoggingClose = 7,
17 LoggingMonMode = 8,
18 LoggingLast
19};
20
21
23 enum LoggingSearchType {
24 LoggingSearchFrameNumber = 0,
25 LoggingSearchTimestamp = 1,
26 LoggingSearchNone = 255 // get first file of sequence with specified ID
27};
28
29
31 enum SearchCondition {
32 SearchConditionAny = 0,
33 SearchConditionLowerEqual = 1,
34 SearchConditionHigherEqual = 2,
35 SearchConditionEqual = 3
36};
37
38
40 enum ReadRangeStatusCode {
41 ReadRangeStatusOK = 0,
42 ReadRangeStatusInvalid = 1,
43 ReadRangeStatusEOF = 2
44};
45
46
47 struct INERTIA_API LoggingCommand
48 : InertiaCommand
49{
50 protected:
51 LoggingCommand();
52 LoggingCommand(const uint8_t* packet, const unsigned max_size);
53 LoggingCommand(std::wstring const& argString);
54
55 public:
56 InertiaCommandGroups GetGroup() const override;
57 static std::wstring GetName(LoggingCommands const command);
58
59 static InertiaCommandPtr Parse(const uint8_t* in, unsigned const packetSize);
60 static InertiaCommandPtr Parse(std::wstring const& argString);
61};
62
63
64 struct INERTIA_API LoggingStartRequest
65 : LoggingCommand
66{
67 LoggingStartRequest();
68 LoggingStartRequest(const uint8_t* packet, const unsigned max_size);
69 LoggingStartRequest(std::wstring const& argString);
70
71 void GetBytes(std::vector<uint8_t>& out) const override;
72 const std::wstring ToString() const override;
73
74#ifdef WITH_BOOST_PROGRAM_OPTIONS
75 static const po::options_description GetOptionDescription();
76#endif
77
78 uint8_t GetType() const override;
79 bool IsResponse() const override;
80};
81
82
83 struct INERTIA_API LoggingStartResponse
84 : LoggingCommand
85 , BoolValue
86{
87 LoggingStartResponse(const uint8_t* packet, const unsigned max_size);
88 LoggingStartResponse(std::wstring const& argString);
89
90 void GetBytes(std::vector<uint8_t>& out) const override;
91 const std::wstring ToString() const override;
92
93#ifdef WITH_BOOST_PROGRAM_OPTIONS
94 static const po::options_description GetOptionDescription();
95#endif
96
97 uint8_t GetType() const override;
98 bool IsResponse() const override;
99};
100
101
102 struct INERTIA_API LoggingStopRequest
103 : LoggingCommand
104{
105 LoggingStopRequest();
106 LoggingStopRequest(const uint8_t* packet, const unsigned max_size);
107 LoggingStopRequest(std::wstring const& argString);
108
109 void GetBytes(std::vector<uint8_t>& out) const override;
110 const std::wstring ToString() const override;
111
112#ifdef WITH_BOOST_PROGRAM_OPTIONS
113 static const po::options_description GetOptionDescription();
114#endif
115
116 uint8_t GetType() const override;
117 bool IsResponse() const override;
118};
119
120
121 struct INERTIA_API LoggingStopResponse
122 : LoggingCommand
123 , BoolValue
124{
125 LoggingStopResponse(const uint8_t* packet, const unsigned max_size);
126 LoggingStopResponse(std::wstring const& argString);
127
128 void GetBytes(std::vector<uint8_t>& out) const override;
129 const std::wstring ToString() const override;
130
131#ifdef WITH_BOOST_PROGRAM_OPTIONS
132 static const po::options_description GetOptionDescription();
133#endif
134
135 uint8_t GetType() const override;
136 bool IsResponse() const override;
137};
138
139
140 struct INERTIA_API LoggingGetFirstRequest
141 : LoggingCommand
142{
143 LoggingSearchType searchType;
144 uint8_t sequenceID; // file sequence to search in, 0xff when not used
145 uint32_t searchParam; // timestamp or frame
146 SearchCondition condition; // any/before/after/equal timestamp
147
148 LoggingGetFirstRequest();
149 LoggingGetFirstRequest(const uint8_t* packet, const unsigned max_size);
150 LoggingGetFirstRequest(std::wstring const& argString);
151
152 void GetBytes(std::vector<uint8_t>& out) const override;
153 const std::wstring ToString() const override;
154
155#ifdef WITH_BOOST_PROGRAM_OPTIONS
156 static const po::options_description GetOptionDescription();
157#endif
158
159 uint8_t GetType() const override;
160 bool IsResponse() const override;
161};
162
163
164 struct INERTIA_API LoggingGetFirstResponse
165 : LoggingCommand
166{
167 bool result; // success or failure
168 uint8_t sequenceID;
169 uint32_t filePointer;
170
171 LoggingGetFirstResponse(const uint8_t* packet, const unsigned max_size);
172 LoggingGetFirstResponse(std::wstring const& argString);
173
174 void GetBytes(std::vector<uint8_t>& out) const override;
175 const std::wstring ToString() const override;
176
177#ifdef WITH_BOOST_PROGRAM_OPTIONS
178 static const po::options_description GetOptionDescription();
179#endif
180
181 uint8_t GetType() const override;
182 bool IsResponse() const override;
183};
184
185
186 struct INERTIA_API LoggingStateRequest
187 : LoggingCommand
188{
189 LoggingStateRequest();
190 LoggingStateRequest(const uint8_t* packet, const unsigned max_size);
191 LoggingStateRequest(std::wstring const& argString);
192
193 void GetBytes(std::vector<uint8_t>& out) const override;
194 const std::wstring ToString() const override;
195
196#ifdef WITH_BOOST_PROGRAM_OPTIONS
197 static const po::options_description GetOptionDescription();
198#endif
199
200 uint8_t GetType() const override;
201 bool IsResponse() const override;
202};
203
204
205 struct INERTIA_API LoggingStateResponse
206 : LoggingCommand
207{
208 bool loggingActive;
209
210 LoggingStateResponse(const uint8_t* packet, const unsigned max_size);
211 LoggingStateResponse(std::wstring const& argString);
212
213 void GetBytes(std::vector<uint8_t>& out) const override;
214 const std::wstring ToString() const override;
215
216#ifdef WITH_BOOST_PROGRAM_OPTIONS
217 static const po::options_description GetOptionDescription();
218#endif
219
220 uint8_t GetType() const override;
221 bool IsResponse() const override;
222};
223
224
225 struct INERTIA_API LoggingReadRangeRequest
226 : LoggingCommand
227{
228 std::vector<std::pair<uint32_t, uint32_t> > frameRanges;
229
230 LoggingReadRangeRequest();
231 LoggingReadRangeRequest(const uint8_t* packet, const unsigned max_size);
232 LoggingReadRangeRequest(std::wstring const& argString);
233
234 void GetBytes(std::vector<uint8_t>& out) const override;
235 const std::wstring ToString() const override;
236
237#ifdef WITH_BOOST_PROGRAM_OPTIONS
238 static const po::options_description GetOptionDescription();
239#endif
240
241 uint8_t GetType() const override;
242 bool IsResponse() const override;
243};
244
245
246 struct INERTIA_API LoggingReadRangeResponse
247 : LoggingCommand
248{
249 ReadRangeStatusCode statusCode;
250 std::vector<uint8_t> rawdata;
251
252 LoggingReadRangeResponse(const uint8_t* packet, const unsigned max_size);
253 LoggingReadRangeResponse(std::wstring const& argString);
254
255 void GetBytes(std::vector<uint8_t>& out) const override;
256 const std::wstring ToString() const override;
257
258#ifdef WITH_BOOST_PROGRAM_OPTIONS
259 static const po::options_description GetOptionDescription();
260#endif
261
262 uint8_t GetType() const override;
263 bool IsResponse() const override;
264};
265
266
267 struct INERTIA_API LoggingOpenRequest
268 : LoggingCommand
269{
270 std::wstring filename;
271
272 LoggingOpenRequest();
273 LoggingOpenRequest(const uint8_t* packet, const unsigned max_size);
274 LoggingOpenRequest(std::wstring const& argString);
275
276 void GetBytes(std::vector<uint8_t>& out) const override;
277 const std::wstring ToString() const override;
278
279#ifdef WITH_BOOST_PROGRAM_OPTIONS
280 static const po::options_description GetOptionDescription();
281#endif
282
283 uint8_t GetType() const override;
284 bool IsResponse() const override;
285};
286
287
288 struct INERTIA_API LoggingOpenResponse
289 : LoggingCommand
290 , BoolValue
291{
292 LoggingOpenResponse(const uint8_t* packet, const unsigned max_size);
293 LoggingOpenResponse(std::wstring const& argString);
294
295 void GetBytes(std::vector<uint8_t>& out) const override;
296 const std::wstring ToString() const override;
297
298#ifdef WITH_BOOST_PROGRAM_OPTIONS
299 static const po::options_description GetOptionDescription();
300#endif
301
302 uint8_t GetType() const override;
303 bool IsResponse() const override;
304};
305
306
307 struct INERTIA_API LoggingCloseRequest
308 : LoggingCommand
309{
310 LoggingCloseRequest();
311 LoggingCloseRequest(const uint8_t* packet, const unsigned max_size);
312 LoggingCloseRequest(std::wstring const& argString);
313
314 void GetBytes(std::vector<uint8_t>& out) const override;
315 const std::wstring ToString() const override;
316
317#ifdef WITH_BOOST_PROGRAM_OPTIONS
318 static const po::options_description GetOptionDescription();
319#endif
320
321 uint8_t GetType() const override;
322 bool IsResponse() const override;
323};
324
325
326 struct INERTIA_API LoggingCloseResponse
327 : LoggingCommand
328 , BoolValue
329{
330 LoggingCloseResponse(const uint8_t* packet, const unsigned max_size);
331 LoggingCloseResponse(std::wstring const& argString);
332
333 void GetBytes(std::vector<uint8_t>& out) const override;
334 const std::wstring ToString() const override;
335
336#ifdef WITH_BOOST_PROGRAM_OPTIONS
337 static const po::options_description GetOptionDescription();
338#endif
339
340 uint8_t GetType() const override;
341 bool IsResponse() const override;
342};
343
344
345 struct INERTIA_API LoggingMonitoringModeRequest
346 : LoggingCommand
347{
348 bool forceEnable;
349
350 LoggingMonitoringModeRequest();
351 LoggingMonitoringModeRequest(const uint8_t* packet, const unsigned max_size);
352 LoggingMonitoringModeRequest(std::wstring const& argString);
353
354 void GetBytes(std::vector<uint8_t>& out) const override;
355 const std::wstring ToString() const override;
356
357#ifdef WITH_BOOST_PROGRAM_OPTIONS
358 static const po::options_description GetOptionDescription();
359#endif
360
361 uint8_t GetType() const override;
362 bool IsResponse() const override;
363};
364
365
366 struct INERTIA_API LoggingMonitoringModeResponse
367 : LoggingCommand
368 , BoolValue
369{
370 LoggingMonitoringModeResponse(const uint8_t* packet, const unsigned max_size);
371 LoggingMonitoringModeResponse(std::wstring const& argString);
372
373 void GetBytes(std::vector<uint8_t>& out) const override;
374 const std::wstring ToString() const override;
375
376#ifdef WITH_BOOST_PROGRAM_OPTIONS
377 static const po::options_description GetOptionDescription();
378#endif
379
380 uint8_t GetType() const override;
381 bool IsResponse() const override;
382};
383
384}
inertia
Definition FlashCommands.h:6
inertia::LoggingCommands
LoggingCommands
Definition LoggingCommands.h:9
inertia::LoggingSearchType
LoggingSearchType
Definition LoggingCommands.h:23
inertia::InertiaCommandPtr
std::shared_ptr< InertiaCommand > InertiaCommandPtr
Pointer to an InertiaCommand.
Definition platform.h:52
inertia::ReadRangeStatusCode
ReadRangeStatusCode
Definition LoggingCommands.h:40
inertia::InertiaCommandGroups
InertiaCommandGroups
Definition InertiaCommand.h:7
inertia::SearchCondition
SearchCondition
Definition LoggingCommands.h:31