InertiaSDK

Loading...
Searching...
No Matches
IOConfigCommands.h
1#pragma once
2
3#include "data/command/InertiaCommand.h"
4#include "data/config/IOConfigSettings.h"
5
6 namespace inertia
7{
8
10 enum IOCommands : uint8_t {
11 CommandIOSpecific = 0,
12 CommandIOCommon = 1,
13 CommandIOError = 255
14};
15
16
17 struct INERTIA_API IOConfigCommand
18 : InertiaCommand
19{
20 protected:
21 IOConfigCommand();
22 IOConfigCommand(const uint8_t* packet, const unsigned max_size);
23 IOConfigCommand(std::wstring const& argString);
24
25 public:
26 InertiaCommandGroups GetGroup() const override;
27
28 static InertiaCommandPtr Parse(const uint8_t* in, unsigned const packetSize);
29 static InertiaCommandPtr Parse(std::wstring const& argString);
30
31#ifdef WITH_BOOST_PROGRAM_OPTIONS
32 static const po::options_description GetOptionDescription();
33#endif
34};
35
36
37 struct INERTIA_API IOConfigCommonCommand
38 : IOConfigCommand
39{
40 IOCommonModeID commonID;
41 IOCommonMessageID messageID;
42
43 protected:
44 IOConfigCommonCommand(IOCommonModeID const& _commonID, IOCommonMessageID const& _messageID);
45 IOConfigCommonCommand(const uint8_t* packet, const unsigned max_size);
46 IOConfigCommonCommand(std::wstring const& argString);
47
48 void GetBytes(std::vector<uint8_t>& out) const override;
49 const std::wstring ToString() const override;
50
51#ifdef WITH_BOOST_PROGRAM_OPTIONS
52 static const po::options_description GetOptionDescription();
53#endif
54
55 uint8_t GetType() const override;
56};
57
58
59 struct INERTIA_API IOConfigSpecificCommand
60 : IOConfigCommand
61{
62 uint8_t ioID;
63 IOModeID modeID;
64 IOMessageID messageID;
65
66 protected:
67 IOConfigSpecificCommand(uint8_t const& _ioID, IOModeID const& _modeID, IOMessageID const& _messageID);
68 IOConfigSpecificCommand(const uint8_t* packet, const unsigned max_size);
69 IOConfigSpecificCommand(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};
80
81
82 struct INERTIA_API IOCommandUnsupportedResponse
83 : IOConfigCommand
84{
85 IOCommandUnsupportedResponse(const uint8_t* packet, const unsigned max_size);
86 IOCommandUnsupportedResponse(std::wstring const& argString);
87
88 void GetBytes(std::vector<uint8_t>& out) const override;
89 const std::wstring ToString() const override;
90
91#ifdef WITH_BOOST_PROGRAM_OPTIONS
92 static const po::options_description GetOptionDescription();
93#endif
94
95 uint8_t GetType() const override;
96 bool IsResponse() const override;
97};
98
99
100 struct INERTIA_API IOConfigTriggerOutputForceRequest
101 : IOConfigSpecificCommand
102{
103 bool forceState;
104
105 IOConfigTriggerOutputForceRequest(uint8_t const& ioID, bool const _forceState);
106 IOConfigTriggerOutputForceRequest(const uint8_t* packet, const unsigned max_size);
107 IOConfigTriggerOutputForceRequest(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 bool IsResponse() const override;
117};
118
119
120 struct INERTIA_API IOConfigTriggerOutputForceResponse
121 : IOConfigSpecificCommand
122{
123 uint32_t frameNumber;
124
125 IOConfigTriggerOutputForceResponse(const uint8_t* packet, const unsigned max_size);
126 IOConfigTriggerOutputForceResponse(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 bool IsResponse() const override;
136};
137
138
139 struct INERTIA_API IOConfigTriggerOutputEvent
140 : IOConfigSpecificCommand
141{
142 IOConfigTriggerOutputEvent(const uint8_t* packet, const unsigned max_size);
143 IOConfigTriggerOutputEvent(std::wstring const& argString);
144
145 void GetBytes(std::vector<uint8_t>& out) const override;
146 const std::wstring ToString() const override;
147
148#ifdef WITH_BOOST_PROGRAM_OPTIONS
149 static const po::options_description GetOptionDescription();
150#endif
151
152 bool IsResponse() const override;
153};
154
155
156 struct INERTIA_API IOConfigTriggerInputEvent
157 : IOConfigSpecificCommand
158{
159 uint32_t frameNumber;
160 float phaseShift;
161
162 IOConfigTriggerInputEvent(const uint8_t* packet, const unsigned max_size);
163 IOConfigTriggerInputEvent(std::wstring const& argString);
164
165 void GetBytes(std::vector<uint8_t>& out) const override;
166 const std::wstring ToString() const override;
167
168#ifdef WITH_BOOST_PROGRAM_OPTIONS
169 static const po::options_description GetOptionDescription();
170#endif
171
172 bool IsResponse() const override;
173};
174
175
176 struct INERTIA_API IOConfigInputReadRequest
177 : IOConfigSpecificCommand
178{
179 IOConfigInputReadRequest(uint8_t const& ioID);
180 IOConfigInputReadRequest(const uint8_t* packet, const unsigned max_size);
181 IOConfigInputReadRequest(std::wstring const& argString);
182
183 void GetBytes(std::vector<uint8_t>& out) const override;
184 const std::wstring ToString() const override;
185
186#ifdef WITH_BOOST_PROGRAM_OPTIONS
187 static const po::options_description GetOptionDescription();
188#endif
189
190 bool IsResponse() const override;
191};
192
193
194 struct INERTIA_API IOConfigInputReadResponse
195 : IOConfigSpecificCommand
196{
197 bool state;
198 bool error;
199
200 IOConfigInputReadResponse(const uint8_t* packet, const unsigned max_size);
201 IOConfigInputReadResponse(std::wstring const& argString);
202
203 void GetBytes(std::vector<uint8_t>& out) const override;
204 const std::wstring ToString() const override;
205
206#ifdef WITH_BOOST_PROGRAM_OPTIONS
207 static const po::options_description GetOptionDescription();
208#endif
209
210 bool IsResponse() const override;
211};
212
213
214 struct INERTIA_API IOConfigOutputWriteRequest
215 : IOConfigSpecificCommand
216{
217 bool state;
218
219 IOConfigOutputWriteRequest(uint8_t const& ioID, bool const _state);
220 IOConfigOutputWriteRequest(const uint8_t* packet, const unsigned max_size);
221 IOConfigOutputWriteRequest(std::wstring const& argString);
222
223 void GetBytes(std::vector<uint8_t>& out) const override;
224 const std::wstring ToString() const override;
225
226#ifdef WITH_BOOST_PROGRAM_OPTIONS
227 static const po::options_description GetOptionDescription();
228#endif
229
230 bool IsResponse() const override;
231};
232
233
234 struct INERTIA_API IOConfigOutputWriteResponse
235 : IOConfigSpecificCommand
236{
237 bool success;
238
239 IOConfigOutputWriteResponse(const uint8_t* packet, const unsigned max_size);
240 IOConfigOutputWriteResponse(std::wstring const& argString);
241
242 void GetBytes(std::vector<uint8_t>& out) const override;
243 const std::wstring ToString() const override;
244
245#ifdef WITH_BOOST_PROGRAM_OPTIONS
246 static const po::options_description GetOptionDescription();
247#endif
248
249 bool IsResponse() const override;
250};
251
252}
inertia
Definition FlashCommands.h:6
inertia::IOMessageID
IOMessageID
Definition IOConfigSettings.h:31
inertia::IOModeID
IOModeID
Definition IOConfigSettings.h:19
inertia::IOCommonMessageID
IOCommonMessageID
Definition IOConfigSettings.h:47
inertia::InertiaCommandPtr
std::shared_ptr< InertiaCommand > InertiaCommandPtr
Pointer to an InertiaCommand.
Definition platform.h:52
inertia::IOCommands
IOCommands
Definition IOConfigCommands.h:10
inertia::InertiaCommandGroups
InertiaCommandGroups
Definition InertiaCommand.h:7
inertia::IOCommonModeID
IOCommonModeID
Definition IOConfigSettings.h:41