1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4 #ifndef FLATBUFFERS_GENERATED_HOSTMESSAGES_CHRE_FBS_H_
5 #define FLATBUFFERS_GENERATED_HOSTMESSAGES_CHRE_FBS_H_
6
7 #include "flatbuffers/flatbuffers.h"
8
9 namespace chre {
10 namespace fbs {
11
12 struct NanoappMessage;
13 struct NanoappMessageBuilder;
14 struct NanoappMessageT;
15
16 struct HubInfoRequest;
17 struct HubInfoRequestBuilder;
18 struct HubInfoRequestT;
19
20 struct HubInfoResponse;
21 struct HubInfoResponseBuilder;
22 struct HubInfoResponseT;
23
24 struct NanoappListRequest;
25 struct NanoappListRequestBuilder;
26 struct NanoappListRequestT;
27
28 struct NanoappListEntry;
29 struct NanoappListEntryBuilder;
30 struct NanoappListEntryT;
31
32 struct NanoappListResponse;
33 struct NanoappListResponseBuilder;
34 struct NanoappListResponseT;
35
36 struct LoadNanoappRequest;
37 struct LoadNanoappRequestBuilder;
38 struct LoadNanoappRequestT;
39
40 struct LoadNanoappResponse;
41 struct LoadNanoappResponseBuilder;
42 struct LoadNanoappResponseT;
43
44 struct UnloadNanoappRequest;
45 struct UnloadNanoappRequestBuilder;
46 struct UnloadNanoappRequestT;
47
48 struct UnloadNanoappResponse;
49 struct UnloadNanoappResponseBuilder;
50 struct UnloadNanoappResponseT;
51
52 struct LogMessage;
53 struct LogMessageBuilder;
54 struct LogMessageT;
55
56 struct TimeSyncMessage;
57 struct TimeSyncMessageBuilder;
58 struct TimeSyncMessageT;
59
60 struct DebugDumpRequest;
61 struct DebugDumpRequestBuilder;
62 struct DebugDumpRequestT;
63
64 struct DebugDumpData;
65 struct DebugDumpDataBuilder;
66 struct DebugDumpDataT;
67
68 struct DebugDumpResponse;
69 struct DebugDumpResponseBuilder;
70 struct DebugDumpResponseT;
71
72 struct TimeSyncRequest;
73 struct TimeSyncRequestBuilder;
74 struct TimeSyncRequestT;
75
76 struct LowPowerMicAccessRequest;
77 struct LowPowerMicAccessRequestBuilder;
78 struct LowPowerMicAccessRequestT;
79
80 struct LowPowerMicAccessRelease;
81 struct LowPowerMicAccessReleaseBuilder;
82 struct LowPowerMicAccessReleaseT;
83
84 struct SettingChangeMessage;
85 struct SettingChangeMessageBuilder;
86 struct SettingChangeMessageT;
87
88 struct LogMessageV2;
89 struct LogMessageV2Builder;
90 struct LogMessageV2T;
91
92 struct SelfTestRequest;
93 struct SelfTestRequestBuilder;
94 struct SelfTestRequestT;
95
96 struct SelfTestResponse;
97 struct SelfTestResponseBuilder;
98 struct SelfTestResponseT;
99
100 struct HostAddress;
101
102 struct MessageContainer;
103 struct MessageContainerBuilder;
104 struct MessageContainerT;
105
106 /// An enum describing the setting type.
107 enum class Setting : int8_t {
108 LOCATION = 0,
109 WIFI_AVAILABLE = 1,
110 AIRPLANE_MODE = 2,
111 MICROPHONE = 3,
112 MIN = LOCATION,
113 MAX = MICROPHONE
114 };
115
EnumValuesSetting()116 inline const Setting (&EnumValuesSetting())[4] {
117 static const Setting values[] = {
118 Setting::LOCATION,
119 Setting::WIFI_AVAILABLE,
120 Setting::AIRPLANE_MODE,
121 Setting::MICROPHONE
122 };
123 return values;
124 }
125
EnumNamesSetting()126 inline const char * const *EnumNamesSetting() {
127 static const char * const names[5] = {
128 "LOCATION",
129 "WIFI_AVAILABLE",
130 "AIRPLANE_MODE",
131 "MICROPHONE",
132 nullptr
133 };
134 return names;
135 }
136
EnumNameSetting(Setting e)137 inline const char *EnumNameSetting(Setting e) {
138 if (flatbuffers::IsOutRange(e, Setting::LOCATION, Setting::MICROPHONE)) return "";
139 const size_t index = static_cast<size_t>(e);
140 return EnumNamesSetting()[index];
141 }
142
143 /// An enum describing the state of a setting.
144 enum class SettingState : int8_t {
145 DISABLED = 0,
146 ENABLED = 1,
147 MIN = DISABLED,
148 MAX = ENABLED
149 };
150
EnumValuesSettingState()151 inline const SettingState (&EnumValuesSettingState())[2] {
152 static const SettingState values[] = {
153 SettingState::DISABLED,
154 SettingState::ENABLED
155 };
156 return values;
157 }
158
EnumNamesSettingState()159 inline const char * const *EnumNamesSettingState() {
160 static const char * const names[3] = {
161 "DISABLED",
162 "ENABLED",
163 nullptr
164 };
165 return names;
166 }
167
EnumNameSettingState(SettingState e)168 inline const char *EnumNameSettingState(SettingState e) {
169 if (flatbuffers::IsOutRange(e, SettingState::DISABLED, SettingState::ENABLED)) return "";
170 const size_t index = static_cast<size_t>(e);
171 return EnumNamesSettingState()[index];
172 }
173
174 /// A union that joins together all possible messages. Note that in FlatBuffers,
175 /// unions have an implicit type
176 enum class ChreMessage : uint8_t {
177 NONE = 0,
178 NanoappMessage = 1,
179 HubInfoRequest = 2,
180 HubInfoResponse = 3,
181 NanoappListRequest = 4,
182 NanoappListResponse = 5,
183 LoadNanoappRequest = 6,
184 LoadNanoappResponse = 7,
185 UnloadNanoappRequest = 8,
186 UnloadNanoappResponse = 9,
187 LogMessage = 10,
188 TimeSyncMessage = 11,
189 DebugDumpRequest = 12,
190 DebugDumpData = 13,
191 DebugDumpResponse = 14,
192 TimeSyncRequest = 15,
193 LowPowerMicAccessRequest = 16,
194 LowPowerMicAccessRelease = 17,
195 SettingChangeMessage = 18,
196 LogMessageV2 = 19,
197 SelfTestRequest = 20,
198 SelfTestResponse = 21,
199 MIN = NONE,
200 MAX = SelfTestResponse
201 };
202
EnumValuesChreMessage()203 inline const ChreMessage (&EnumValuesChreMessage())[22] {
204 static const ChreMessage values[] = {
205 ChreMessage::NONE,
206 ChreMessage::NanoappMessage,
207 ChreMessage::HubInfoRequest,
208 ChreMessage::HubInfoResponse,
209 ChreMessage::NanoappListRequest,
210 ChreMessage::NanoappListResponse,
211 ChreMessage::LoadNanoappRequest,
212 ChreMessage::LoadNanoappResponse,
213 ChreMessage::UnloadNanoappRequest,
214 ChreMessage::UnloadNanoappResponse,
215 ChreMessage::LogMessage,
216 ChreMessage::TimeSyncMessage,
217 ChreMessage::DebugDumpRequest,
218 ChreMessage::DebugDumpData,
219 ChreMessage::DebugDumpResponse,
220 ChreMessage::TimeSyncRequest,
221 ChreMessage::LowPowerMicAccessRequest,
222 ChreMessage::LowPowerMicAccessRelease,
223 ChreMessage::SettingChangeMessage,
224 ChreMessage::LogMessageV2,
225 ChreMessage::SelfTestRequest,
226 ChreMessage::SelfTestResponse
227 };
228 return values;
229 }
230
EnumNamesChreMessage()231 inline const char * const *EnumNamesChreMessage() {
232 static const char * const names[23] = {
233 "NONE",
234 "NanoappMessage",
235 "HubInfoRequest",
236 "HubInfoResponse",
237 "NanoappListRequest",
238 "NanoappListResponse",
239 "LoadNanoappRequest",
240 "LoadNanoappResponse",
241 "UnloadNanoappRequest",
242 "UnloadNanoappResponse",
243 "LogMessage",
244 "TimeSyncMessage",
245 "DebugDumpRequest",
246 "DebugDumpData",
247 "DebugDumpResponse",
248 "TimeSyncRequest",
249 "LowPowerMicAccessRequest",
250 "LowPowerMicAccessRelease",
251 "SettingChangeMessage",
252 "LogMessageV2",
253 "SelfTestRequest",
254 "SelfTestResponse",
255 nullptr
256 };
257 return names;
258 }
259
EnumNameChreMessage(ChreMessage e)260 inline const char *EnumNameChreMessage(ChreMessage e) {
261 if (flatbuffers::IsOutRange(e, ChreMessage::NONE, ChreMessage::SelfTestResponse)) return "";
262 const size_t index = static_cast<size_t>(e);
263 return EnumNamesChreMessage()[index];
264 }
265
266 template<typename T> struct ChreMessageTraits {
267 static const ChreMessage enum_value = ChreMessage::NONE;
268 };
269
270 template<> struct ChreMessageTraits<chre::fbs::NanoappMessage> {
271 static const ChreMessage enum_value = ChreMessage::NanoappMessage;
272 };
273
274 template<> struct ChreMessageTraits<chre::fbs::HubInfoRequest> {
275 static const ChreMessage enum_value = ChreMessage::HubInfoRequest;
276 };
277
278 template<> struct ChreMessageTraits<chre::fbs::HubInfoResponse> {
279 static const ChreMessage enum_value = ChreMessage::HubInfoResponse;
280 };
281
282 template<> struct ChreMessageTraits<chre::fbs::NanoappListRequest> {
283 static const ChreMessage enum_value = ChreMessage::NanoappListRequest;
284 };
285
286 template<> struct ChreMessageTraits<chre::fbs::NanoappListResponse> {
287 static const ChreMessage enum_value = ChreMessage::NanoappListResponse;
288 };
289
290 template<> struct ChreMessageTraits<chre::fbs::LoadNanoappRequest> {
291 static const ChreMessage enum_value = ChreMessage::LoadNanoappRequest;
292 };
293
294 template<> struct ChreMessageTraits<chre::fbs::LoadNanoappResponse> {
295 static const ChreMessage enum_value = ChreMessage::LoadNanoappResponse;
296 };
297
298 template<> struct ChreMessageTraits<chre::fbs::UnloadNanoappRequest> {
299 static const ChreMessage enum_value = ChreMessage::UnloadNanoappRequest;
300 };
301
302 template<> struct ChreMessageTraits<chre::fbs::UnloadNanoappResponse> {
303 static const ChreMessage enum_value = ChreMessage::UnloadNanoappResponse;
304 };
305
306 template<> struct ChreMessageTraits<chre::fbs::LogMessage> {
307 static const ChreMessage enum_value = ChreMessage::LogMessage;
308 };
309
310 template<> struct ChreMessageTraits<chre::fbs::TimeSyncMessage> {
311 static const ChreMessage enum_value = ChreMessage::TimeSyncMessage;
312 };
313
314 template<> struct ChreMessageTraits<chre::fbs::DebugDumpRequest> {
315 static const ChreMessage enum_value = ChreMessage::DebugDumpRequest;
316 };
317
318 template<> struct ChreMessageTraits<chre::fbs::DebugDumpData> {
319 static const ChreMessage enum_value = ChreMessage::DebugDumpData;
320 };
321
322 template<> struct ChreMessageTraits<chre::fbs::DebugDumpResponse> {
323 static const ChreMessage enum_value = ChreMessage::DebugDumpResponse;
324 };
325
326 template<> struct ChreMessageTraits<chre::fbs::TimeSyncRequest> {
327 static const ChreMessage enum_value = ChreMessage::TimeSyncRequest;
328 };
329
330 template<> struct ChreMessageTraits<chre::fbs::LowPowerMicAccessRequest> {
331 static const ChreMessage enum_value = ChreMessage::LowPowerMicAccessRequest;
332 };
333
334 template<> struct ChreMessageTraits<chre::fbs::LowPowerMicAccessRelease> {
335 static const ChreMessage enum_value = ChreMessage::LowPowerMicAccessRelease;
336 };
337
338 template<> struct ChreMessageTraits<chre::fbs::SettingChangeMessage> {
339 static const ChreMessage enum_value = ChreMessage::SettingChangeMessage;
340 };
341
342 template<> struct ChreMessageTraits<chre::fbs::LogMessageV2> {
343 static const ChreMessage enum_value = ChreMessage::LogMessageV2;
344 };
345
346 template<> struct ChreMessageTraits<chre::fbs::SelfTestRequest> {
347 static const ChreMessage enum_value = ChreMessage::SelfTestRequest;
348 };
349
350 template<> struct ChreMessageTraits<chre::fbs::SelfTestResponse> {
351 static const ChreMessage enum_value = ChreMessage::SelfTestResponse;
352 };
353
354 struct ChreMessageUnion {
355 ChreMessage type;
356 void *value;
357
358 ChreMessageUnion() : type(ChreMessage::NONE), value(nullptr) {}
359 ChreMessageUnion(ChreMessageUnion&& u) FLATBUFFERS_NOEXCEPT :
360 type(ChreMessage::NONE), value(nullptr)
361 { std::swap(type, u.type); std::swap(value, u.value); }
362 ChreMessageUnion(const ChreMessageUnion &);
363 ChreMessageUnion &operator=(const ChreMessageUnion &u)
364 { ChreMessageUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
365 ChreMessageUnion &operator=(ChreMessageUnion &&u) FLATBUFFERS_NOEXCEPT
366 { std::swap(type, u.type); std::swap(value, u.value); return *this; }
367 ~ChreMessageUnion() { Reset(); }
368
369 void Reset();
370
371 #ifndef FLATBUFFERS_CPP98_STL
372 template <typename T>
373 void Set(T&& val) {
374 using RT = typename std::remove_reference<T>::type;
375 Reset();
376 type = ChreMessageTraits<typename RT::TableType>::enum_value;
377 if (type != ChreMessage::NONE) {
378 value = new RT(std::forward<T>(val));
379 }
380 }
381 #endif // FLATBUFFERS_CPP98_STL
382
383 static void *UnPack(const void *obj, ChreMessage type, const flatbuffers::resolver_function_t *resolver);
384 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
385
386 chre::fbs::NanoappMessageT *AsNanoappMessage() {
387 return type == ChreMessage::NanoappMessage ?
388 reinterpret_cast<chre::fbs::NanoappMessageT *>(value) : nullptr;
389 }
390 const chre::fbs::NanoappMessageT *AsNanoappMessage() const {
391 return type == ChreMessage::NanoappMessage ?
392 reinterpret_cast<const chre::fbs::NanoappMessageT *>(value) : nullptr;
393 }
394 chre::fbs::HubInfoRequestT *AsHubInfoRequest() {
395 return type == ChreMessage::HubInfoRequest ?
396 reinterpret_cast<chre::fbs::HubInfoRequestT *>(value) : nullptr;
397 }
398 const chre::fbs::HubInfoRequestT *AsHubInfoRequest() const {
399 return type == ChreMessage::HubInfoRequest ?
400 reinterpret_cast<const chre::fbs::HubInfoRequestT *>(value) : nullptr;
401 }
402 chre::fbs::HubInfoResponseT *AsHubInfoResponse() {
403 return type == ChreMessage::HubInfoResponse ?
404 reinterpret_cast<chre::fbs::HubInfoResponseT *>(value) : nullptr;
405 }
406 const chre::fbs::HubInfoResponseT *AsHubInfoResponse() const {
407 return type == ChreMessage::HubInfoResponse ?
408 reinterpret_cast<const chre::fbs::HubInfoResponseT *>(value) : nullptr;
409 }
410 chre::fbs::NanoappListRequestT *AsNanoappListRequest() {
411 return type == ChreMessage::NanoappListRequest ?
412 reinterpret_cast<chre::fbs::NanoappListRequestT *>(value) : nullptr;
413 }
414 const chre::fbs::NanoappListRequestT *AsNanoappListRequest() const {
415 return type == ChreMessage::NanoappListRequest ?
416 reinterpret_cast<const chre::fbs::NanoappListRequestT *>(value) : nullptr;
417 }
418 chre::fbs::NanoappListResponseT *AsNanoappListResponse() {
419 return type == ChreMessage::NanoappListResponse ?
420 reinterpret_cast<chre::fbs::NanoappListResponseT *>(value) : nullptr;
421 }
422 const chre::fbs::NanoappListResponseT *AsNanoappListResponse() const {
423 return type == ChreMessage::NanoappListResponse ?
424 reinterpret_cast<const chre::fbs::NanoappListResponseT *>(value) : nullptr;
425 }
426 chre::fbs::LoadNanoappRequestT *AsLoadNanoappRequest() {
427 return type == ChreMessage::LoadNanoappRequest ?
428 reinterpret_cast<chre::fbs::LoadNanoappRequestT *>(value) : nullptr;
429 }
430 const chre::fbs::LoadNanoappRequestT *AsLoadNanoappRequest() const {
431 return type == ChreMessage::LoadNanoappRequest ?
432 reinterpret_cast<const chre::fbs::LoadNanoappRequestT *>(value) : nullptr;
433 }
434 chre::fbs::LoadNanoappResponseT *AsLoadNanoappResponse() {
435 return type == ChreMessage::LoadNanoappResponse ?
436 reinterpret_cast<chre::fbs::LoadNanoappResponseT *>(value) : nullptr;
437 }
438 const chre::fbs::LoadNanoappResponseT *AsLoadNanoappResponse() const {
439 return type == ChreMessage::LoadNanoappResponse ?
440 reinterpret_cast<const chre::fbs::LoadNanoappResponseT *>(value) : nullptr;
441 }
442 chre::fbs::UnloadNanoappRequestT *AsUnloadNanoappRequest() {
443 return type == ChreMessage::UnloadNanoappRequest ?
444 reinterpret_cast<chre::fbs::UnloadNanoappRequestT *>(value) : nullptr;
445 }
446 const chre::fbs::UnloadNanoappRequestT *AsUnloadNanoappRequest() const {
447 return type == ChreMessage::UnloadNanoappRequest ?
448 reinterpret_cast<const chre::fbs::UnloadNanoappRequestT *>(value) : nullptr;
449 }
450 chre::fbs::UnloadNanoappResponseT *AsUnloadNanoappResponse() {
451 return type == ChreMessage::UnloadNanoappResponse ?
452 reinterpret_cast<chre::fbs::UnloadNanoappResponseT *>(value) : nullptr;
453 }
454 const chre::fbs::UnloadNanoappResponseT *AsUnloadNanoappResponse() const {
455 return type == ChreMessage::UnloadNanoappResponse ?
456 reinterpret_cast<const chre::fbs::UnloadNanoappResponseT *>(value) : nullptr;
457 }
458 chre::fbs::LogMessageT *AsLogMessage() {
459 return type == ChreMessage::LogMessage ?
460 reinterpret_cast<chre::fbs::LogMessageT *>(value) : nullptr;
461 }
462 const chre::fbs::LogMessageT *AsLogMessage() const {
463 return type == ChreMessage::LogMessage ?
464 reinterpret_cast<const chre::fbs::LogMessageT *>(value) : nullptr;
465 }
466 chre::fbs::TimeSyncMessageT *AsTimeSyncMessage() {
467 return type == ChreMessage::TimeSyncMessage ?
468 reinterpret_cast<chre::fbs::TimeSyncMessageT *>(value) : nullptr;
469 }
470 const chre::fbs::TimeSyncMessageT *AsTimeSyncMessage() const {
471 return type == ChreMessage::TimeSyncMessage ?
472 reinterpret_cast<const chre::fbs::TimeSyncMessageT *>(value) : nullptr;
473 }
474 chre::fbs::DebugDumpRequestT *AsDebugDumpRequest() {
475 return type == ChreMessage::DebugDumpRequest ?
476 reinterpret_cast<chre::fbs::DebugDumpRequestT *>(value) : nullptr;
477 }
478 const chre::fbs::DebugDumpRequestT *AsDebugDumpRequest() const {
479 return type == ChreMessage::DebugDumpRequest ?
480 reinterpret_cast<const chre::fbs::DebugDumpRequestT *>(value) : nullptr;
481 }
482 chre::fbs::DebugDumpDataT *AsDebugDumpData() {
483 return type == ChreMessage::DebugDumpData ?
484 reinterpret_cast<chre::fbs::DebugDumpDataT *>(value) : nullptr;
485 }
486 const chre::fbs::DebugDumpDataT *AsDebugDumpData() const {
487 return type == ChreMessage::DebugDumpData ?
488 reinterpret_cast<const chre::fbs::DebugDumpDataT *>(value) : nullptr;
489 }
490 chre::fbs::DebugDumpResponseT *AsDebugDumpResponse() {
491 return type == ChreMessage::DebugDumpResponse ?
492 reinterpret_cast<chre::fbs::DebugDumpResponseT *>(value) : nullptr;
493 }
494 const chre::fbs::DebugDumpResponseT *AsDebugDumpResponse() const {
495 return type == ChreMessage::DebugDumpResponse ?
496 reinterpret_cast<const chre::fbs::DebugDumpResponseT *>(value) : nullptr;
497 }
498 chre::fbs::TimeSyncRequestT *AsTimeSyncRequest() {
499 return type == ChreMessage::TimeSyncRequest ?
500 reinterpret_cast<chre::fbs::TimeSyncRequestT *>(value) : nullptr;
501 }
502 const chre::fbs::TimeSyncRequestT *AsTimeSyncRequest() const {
503 return type == ChreMessage::TimeSyncRequest ?
504 reinterpret_cast<const chre::fbs::TimeSyncRequestT *>(value) : nullptr;
505 }
506 chre::fbs::LowPowerMicAccessRequestT *AsLowPowerMicAccessRequest() {
507 return type == ChreMessage::LowPowerMicAccessRequest ?
508 reinterpret_cast<chre::fbs::LowPowerMicAccessRequestT *>(value) : nullptr;
509 }
510 const chre::fbs::LowPowerMicAccessRequestT *AsLowPowerMicAccessRequest() const {
511 return type == ChreMessage::LowPowerMicAccessRequest ?
512 reinterpret_cast<const chre::fbs::LowPowerMicAccessRequestT *>(value) : nullptr;
513 }
514 chre::fbs::LowPowerMicAccessReleaseT *AsLowPowerMicAccessRelease() {
515 return type == ChreMessage::LowPowerMicAccessRelease ?
516 reinterpret_cast<chre::fbs::LowPowerMicAccessReleaseT *>(value) : nullptr;
517 }
518 const chre::fbs::LowPowerMicAccessReleaseT *AsLowPowerMicAccessRelease() const {
519 return type == ChreMessage::LowPowerMicAccessRelease ?
520 reinterpret_cast<const chre::fbs::LowPowerMicAccessReleaseT *>(value) : nullptr;
521 }
522 chre::fbs::SettingChangeMessageT *AsSettingChangeMessage() {
523 return type == ChreMessage::SettingChangeMessage ?
524 reinterpret_cast<chre::fbs::SettingChangeMessageT *>(value) : nullptr;
525 }
526 const chre::fbs::SettingChangeMessageT *AsSettingChangeMessage() const {
527 return type == ChreMessage::SettingChangeMessage ?
528 reinterpret_cast<const chre::fbs::SettingChangeMessageT *>(value) : nullptr;
529 }
530 chre::fbs::LogMessageV2T *AsLogMessageV2() {
531 return type == ChreMessage::LogMessageV2 ?
532 reinterpret_cast<chre::fbs::LogMessageV2T *>(value) : nullptr;
533 }
534 const chre::fbs::LogMessageV2T *AsLogMessageV2() const {
535 return type == ChreMessage::LogMessageV2 ?
536 reinterpret_cast<const chre::fbs::LogMessageV2T *>(value) : nullptr;
537 }
538 chre::fbs::SelfTestRequestT *AsSelfTestRequest() {
539 return type == ChreMessage::SelfTestRequest ?
540 reinterpret_cast<chre::fbs::SelfTestRequestT *>(value) : nullptr;
541 }
542 const chre::fbs::SelfTestRequestT *AsSelfTestRequest() const {
543 return type == ChreMessage::SelfTestRequest ?
544 reinterpret_cast<const chre::fbs::SelfTestRequestT *>(value) : nullptr;
545 }
546 chre::fbs::SelfTestResponseT *AsSelfTestResponse() {
547 return type == ChreMessage::SelfTestResponse ?
548 reinterpret_cast<chre::fbs::SelfTestResponseT *>(value) : nullptr;
549 }
550 const chre::fbs::SelfTestResponseT *AsSelfTestResponse() const {
551 return type == ChreMessage::SelfTestResponse ?
552 reinterpret_cast<const chre::fbs::SelfTestResponseT *>(value) : nullptr;
553 }
554 };
555
556 bool VerifyChreMessage(flatbuffers::Verifier &verifier, const void *obj, ChreMessage type);
557 bool VerifyChreMessageVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
558
559 FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) HostAddress FLATBUFFERS_FINAL_CLASS {
560 private:
561 uint16_t client_id_;
562
563 public:
564 HostAddress() {
565 memset(static_cast<void *>(this), 0, sizeof(HostAddress));
566 }
567 HostAddress(uint16_t _client_id)
568 : client_id_(flatbuffers::EndianScalar(_client_id)) {
569 }
570 uint16_t client_id() const {
571 return flatbuffers::EndianScalar(client_id_);
572 }
573 void mutate_client_id(uint16_t _client_id) {
574 flatbuffers::WriteScalar(&client_id_, _client_id);
575 }
576 };
577 FLATBUFFERS_STRUCT_END(HostAddress, 2);
578
579 struct NanoappMessageT : public flatbuffers::NativeTable {
580 typedef NanoappMessage TableType;
581 uint64_t app_id;
582 uint32_t message_type;
583 uint16_t host_endpoint;
584 std::vector<uint8_t> message;
585 uint32_t message_permissions;
586 uint32_t permissions;
587 NanoappMessageT()
588 : app_id(0),
589 message_type(0),
590 host_endpoint(65534),
591 message_permissions(0),
592 permissions(0) {
593 }
594 };
595
596 /// Represents a message sent to/from a nanoapp from/to a client on the host
597 struct NanoappMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
598 typedef NanoappMessageT NativeTableType;
599 typedef NanoappMessageBuilder Builder;
600 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
601 VT_APP_ID = 4,
602 VT_MESSAGE_TYPE = 6,
603 VT_HOST_ENDPOINT = 8,
604 VT_MESSAGE = 10,
605 VT_MESSAGE_PERMISSIONS = 12,
606 VT_PERMISSIONS = 14
607 };
608 uint64_t app_id() const {
609 return GetField<uint64_t>(VT_APP_ID, 0);
610 }
611 bool mutate_app_id(uint64_t _app_id) {
612 return SetField<uint64_t>(VT_APP_ID, _app_id, 0);
613 }
614 uint32_t message_type() const {
615 return GetField<uint32_t>(VT_MESSAGE_TYPE, 0);
616 }
617 bool mutate_message_type(uint32_t _message_type) {
618 return SetField<uint32_t>(VT_MESSAGE_TYPE, _message_type, 0);
619 }
620 /// Identifies the host-side endpoint on the host that sent or should receive
621 /// this message. The default value is a special value defined in the HAL and
622 /// elsewhere that indicates that the endpoint is unspecified.
623 uint16_t host_endpoint() const {
624 return GetField<uint16_t>(VT_HOST_ENDPOINT, 65534);
625 }
626 bool mutate_host_endpoint(uint16_t _host_endpoint) {
627 return SetField<uint16_t>(VT_HOST_ENDPOINT, _host_endpoint, 65534);
628 }
629 /// Vector containing arbitrary application-specific message data
630 const flatbuffers::Vector<uint8_t> *message() const {
631 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_MESSAGE);
632 }
633 flatbuffers::Vector<uint8_t> *mutable_message() {
634 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_MESSAGE);
635 }
636 /// List of Android permissions that cover the contents of a message from a
637 /// nanoapp to the host.
638 /// These permissions are used to record and attribute access to
639 /// permissions-controlled resources.
640 uint32_t message_permissions() const {
641 return GetField<uint32_t>(VT_MESSAGE_PERMISSIONS, 0);
642 }
643 bool mutate_message_permissions(uint32_t _message_permissions) {
644 return SetField<uint32_t>(VT_MESSAGE_PERMISSIONS, _message_permissions, 0);
645 }
646 /// List of Android permissions declared by the nanoapp / granted to the host.
647 /// For messages from a nanoaapp to the host, this must be a superset of
648 /// message_permissions.
649 uint32_t permissions() const {
650 return GetField<uint32_t>(VT_PERMISSIONS, 0);
651 }
652 bool mutate_permissions(uint32_t _permissions) {
653 return SetField<uint32_t>(VT_PERMISSIONS, _permissions, 0);
654 }
655 bool Verify(flatbuffers::Verifier &verifier) const {
656 return VerifyTableStart(verifier) &&
657 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
658 VerifyField<uint32_t>(verifier, VT_MESSAGE_TYPE) &&
659 VerifyField<uint16_t>(verifier, VT_HOST_ENDPOINT) &&
660 VerifyOffsetRequired(verifier, VT_MESSAGE) &&
661 verifier.VerifyVector(message()) &&
662 VerifyField<uint32_t>(verifier, VT_MESSAGE_PERMISSIONS) &&
663 VerifyField<uint32_t>(verifier, VT_PERMISSIONS) &&
664 verifier.EndTable();
665 }
666 NanoappMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
667 void UnPackTo(NanoappMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
668 static flatbuffers::Offset<NanoappMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
669 };
670
671 struct NanoappMessageBuilder {
672 typedef NanoappMessage Table;
673 flatbuffers::FlatBufferBuilder &fbb_;
674 flatbuffers::uoffset_t start_;
675 void add_app_id(uint64_t app_id) {
676 fbb_.AddElement<uint64_t>(NanoappMessage::VT_APP_ID, app_id, 0);
677 }
678 void add_message_type(uint32_t message_type) {
679 fbb_.AddElement<uint32_t>(NanoappMessage::VT_MESSAGE_TYPE, message_type, 0);
680 }
681 void add_host_endpoint(uint16_t host_endpoint) {
682 fbb_.AddElement<uint16_t>(NanoappMessage::VT_HOST_ENDPOINT, host_endpoint, 65534);
683 }
684 void add_message(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> message) {
685 fbb_.AddOffset(NanoappMessage::VT_MESSAGE, message);
686 }
687 void add_message_permissions(uint32_t message_permissions) {
688 fbb_.AddElement<uint32_t>(NanoappMessage::VT_MESSAGE_PERMISSIONS, message_permissions, 0);
689 }
690 void add_permissions(uint32_t permissions) {
691 fbb_.AddElement<uint32_t>(NanoappMessage::VT_PERMISSIONS, permissions, 0);
692 }
693 explicit NanoappMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
694 : fbb_(_fbb) {
695 start_ = fbb_.StartTable();
696 }
697 NanoappMessageBuilder &operator=(const NanoappMessageBuilder &);
698 flatbuffers::Offset<NanoappMessage> Finish() {
699 const auto end = fbb_.EndTable(start_);
700 auto o = flatbuffers::Offset<NanoappMessage>(end);
701 fbb_.Required(o, NanoappMessage::VT_MESSAGE);
702 return o;
703 }
704 };
705
706 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(
707 flatbuffers::FlatBufferBuilder &_fbb,
708 uint64_t app_id = 0,
709 uint32_t message_type = 0,
710 uint16_t host_endpoint = 65534,
711 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> message = 0,
712 uint32_t message_permissions = 0,
713 uint32_t permissions = 0) {
714 NanoappMessageBuilder builder_(_fbb);
715 builder_.add_app_id(app_id);
716 builder_.add_permissions(permissions);
717 builder_.add_message_permissions(message_permissions);
718 builder_.add_message(message);
719 builder_.add_message_type(message_type);
720 builder_.add_host_endpoint(host_endpoint);
721 return builder_.Finish();
722 }
723
724 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessageDirect(
725 flatbuffers::FlatBufferBuilder &_fbb,
726 uint64_t app_id = 0,
727 uint32_t message_type = 0,
728 uint16_t host_endpoint = 65534,
729 const std::vector<uint8_t> *message = nullptr,
730 uint32_t message_permissions = 0,
731 uint32_t permissions = 0) {
732 auto message__ = message ? _fbb.CreateVector<uint8_t>(*message) : 0;
733 return chre::fbs::CreateNanoappMessage(
734 _fbb,
735 app_id,
736 message_type,
737 host_endpoint,
738 message__,
739 message_permissions,
740 permissions);
741 }
742
743 flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
744
745 struct HubInfoRequestT : public flatbuffers::NativeTable {
746 typedef HubInfoRequest TableType;
747 HubInfoRequestT() {
748 }
749 };
750
751 struct HubInfoRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
752 typedef HubInfoRequestT NativeTableType;
753 typedef HubInfoRequestBuilder Builder;
754 bool Verify(flatbuffers::Verifier &verifier) const {
755 return VerifyTableStart(verifier) &&
756 verifier.EndTable();
757 }
758 HubInfoRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
759 void UnPackTo(HubInfoRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
760 static flatbuffers::Offset<HubInfoRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
761 };
762
763 struct HubInfoRequestBuilder {
764 typedef HubInfoRequest Table;
765 flatbuffers::FlatBufferBuilder &fbb_;
766 flatbuffers::uoffset_t start_;
767 explicit HubInfoRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
768 : fbb_(_fbb) {
769 start_ = fbb_.StartTable();
770 }
771 HubInfoRequestBuilder &operator=(const HubInfoRequestBuilder &);
772 flatbuffers::Offset<HubInfoRequest> Finish() {
773 const auto end = fbb_.EndTable(start_);
774 auto o = flatbuffers::Offset<HubInfoRequest>(end);
775 return o;
776 }
777 };
778
779 inline flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(
780 flatbuffers::FlatBufferBuilder &_fbb) {
781 HubInfoRequestBuilder builder_(_fbb);
782 return builder_.Finish();
783 }
784
785 flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
786
787 struct HubInfoResponseT : public flatbuffers::NativeTable {
788 typedef HubInfoResponse TableType;
789 std::vector<int8_t> name;
790 std::vector<int8_t> vendor;
791 std::vector<int8_t> toolchain;
792 uint32_t platform_version;
793 uint32_t toolchain_version;
794 float peak_mips;
795 float stopped_power;
796 float sleep_power;
797 float peak_power;
798 uint32_t max_msg_len;
799 uint64_t platform_id;
800 uint32_t chre_platform_version;
801 HubInfoResponseT()
802 : platform_version(0),
803 toolchain_version(0),
804 peak_mips(0.0f),
805 stopped_power(0.0f),
806 sleep_power(0.0f),
807 peak_power(0.0f),
808 max_msg_len(0),
809 platform_id(0),
810 chre_platform_version(0) {
811 }
812 };
813
814 struct HubInfoResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
815 typedef HubInfoResponseT NativeTableType;
816 typedef HubInfoResponseBuilder Builder;
817 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
818 VT_NAME = 4,
819 VT_VENDOR = 6,
820 VT_TOOLCHAIN = 8,
821 VT_PLATFORM_VERSION = 10,
822 VT_TOOLCHAIN_VERSION = 12,
823 VT_PEAK_MIPS = 14,
824 VT_STOPPED_POWER = 16,
825 VT_SLEEP_POWER = 18,
826 VT_PEAK_POWER = 20,
827 VT_MAX_MSG_LEN = 22,
828 VT_PLATFORM_ID = 24,
829 VT_CHRE_PLATFORM_VERSION = 26
830 };
831 /// The name of the hub. Nominally a UTF-8 string, but note that we're not
832 /// using the built-in "string" data type from FlatBuffers here, because the
833 /// generated C++ uses std::string which is not well-supported in CHRE. This
834 /// applies for vendor and toolchain as well.
835 const flatbuffers::Vector<int8_t> *name() const {
836 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_NAME);
837 }
838 flatbuffers::Vector<int8_t> *mutable_name() {
839 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_NAME);
840 }
841 const flatbuffers::Vector<int8_t> *vendor() const {
842 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_VENDOR);
843 }
844 flatbuffers::Vector<int8_t> *mutable_vendor() {
845 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_VENDOR);
846 }
847 const flatbuffers::Vector<int8_t> *toolchain() const {
848 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_TOOLCHAIN);
849 }
850 flatbuffers::Vector<int8_t> *mutable_toolchain() {
851 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_TOOLCHAIN);
852 }
853 /// Legacy platform version reported in the HAL; semantics not strictly
854 /// defined
855 uint32_t platform_version() const {
856 return GetField<uint32_t>(VT_PLATFORM_VERSION, 0);
857 }
858 bool mutate_platform_version(uint32_t _platform_version) {
859 return SetField<uint32_t>(VT_PLATFORM_VERSION, _platform_version, 0);
860 }
861 /// Toolchain version reported in the HAL; semantics not strictly defined
862 uint32_t toolchain_version() const {
863 return GetField<uint32_t>(VT_TOOLCHAIN_VERSION, 0);
864 }
865 bool mutate_toolchain_version(uint32_t _toolchain_version) {
866 return SetField<uint32_t>(VT_TOOLCHAIN_VERSION, _toolchain_version, 0);
867 }
868 float peak_mips() const {
869 return GetField<float>(VT_PEAK_MIPS, 0.0f);
870 }
871 bool mutate_peak_mips(float _peak_mips) {
872 return SetField<float>(VT_PEAK_MIPS, _peak_mips, 0.0f);
873 }
874 float stopped_power() const {
875 return GetField<float>(VT_STOPPED_POWER, 0.0f);
876 }
877 bool mutate_stopped_power(float _stopped_power) {
878 return SetField<float>(VT_STOPPED_POWER, _stopped_power, 0.0f);
879 }
880 float sleep_power() const {
881 return GetField<float>(VT_SLEEP_POWER, 0.0f);
882 }
883 bool mutate_sleep_power(float _sleep_power) {
884 return SetField<float>(VT_SLEEP_POWER, _sleep_power, 0.0f);
885 }
886 float peak_power() const {
887 return GetField<float>(VT_PEAK_POWER, 0.0f);
888 }
889 bool mutate_peak_power(float _peak_power) {
890 return SetField<float>(VT_PEAK_POWER, _peak_power, 0.0f);
891 }
892 /// Maximum size message that can be sent to a nanoapp
893 uint32_t max_msg_len() const {
894 return GetField<uint32_t>(VT_MAX_MSG_LEN, 0);
895 }
896 bool mutate_max_msg_len(uint32_t _max_msg_len) {
897 return SetField<uint32_t>(VT_MAX_MSG_LEN, _max_msg_len, 0);
898 }
899 /// @see chreGetPlatformId()
900 uint64_t platform_id() const {
901 return GetField<uint64_t>(VT_PLATFORM_ID, 0);
902 }
903 bool mutate_platform_id(uint64_t _platform_id) {
904 return SetField<uint64_t>(VT_PLATFORM_ID, _platform_id, 0);
905 }
906 /// @see chreGetVersion()
907 uint32_t chre_platform_version() const {
908 return GetField<uint32_t>(VT_CHRE_PLATFORM_VERSION, 0);
909 }
910 bool mutate_chre_platform_version(uint32_t _chre_platform_version) {
911 return SetField<uint32_t>(VT_CHRE_PLATFORM_VERSION, _chre_platform_version, 0);
912 }
913 bool Verify(flatbuffers::Verifier &verifier) const {
914 return VerifyTableStart(verifier) &&
915 VerifyOffset(verifier, VT_NAME) &&
916 verifier.VerifyVector(name()) &&
917 VerifyOffset(verifier, VT_VENDOR) &&
918 verifier.VerifyVector(vendor()) &&
919 VerifyOffset(verifier, VT_TOOLCHAIN) &&
920 verifier.VerifyVector(toolchain()) &&
921 VerifyField<uint32_t>(verifier, VT_PLATFORM_VERSION) &&
922 VerifyField<uint32_t>(verifier, VT_TOOLCHAIN_VERSION) &&
923 VerifyField<float>(verifier, VT_PEAK_MIPS) &&
924 VerifyField<float>(verifier, VT_STOPPED_POWER) &&
925 VerifyField<float>(verifier, VT_SLEEP_POWER) &&
926 VerifyField<float>(verifier, VT_PEAK_POWER) &&
927 VerifyField<uint32_t>(verifier, VT_MAX_MSG_LEN) &&
928 VerifyField<uint64_t>(verifier, VT_PLATFORM_ID) &&
929 VerifyField<uint32_t>(verifier, VT_CHRE_PLATFORM_VERSION) &&
930 verifier.EndTable();
931 }
932 HubInfoResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
933 void UnPackTo(HubInfoResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
934 static flatbuffers::Offset<HubInfoResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
935 };
936
937 struct HubInfoResponseBuilder {
938 typedef HubInfoResponse Table;
939 flatbuffers::FlatBufferBuilder &fbb_;
940 flatbuffers::uoffset_t start_;
941 void add_name(flatbuffers::Offset<flatbuffers::Vector<int8_t>> name) {
942 fbb_.AddOffset(HubInfoResponse::VT_NAME, name);
943 }
944 void add_vendor(flatbuffers::Offset<flatbuffers::Vector<int8_t>> vendor) {
945 fbb_.AddOffset(HubInfoResponse::VT_VENDOR, vendor);
946 }
947 void add_toolchain(flatbuffers::Offset<flatbuffers::Vector<int8_t>> toolchain) {
948 fbb_.AddOffset(HubInfoResponse::VT_TOOLCHAIN, toolchain);
949 }
950 void add_platform_version(uint32_t platform_version) {
951 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_PLATFORM_VERSION, platform_version, 0);
952 }
953 void add_toolchain_version(uint32_t toolchain_version) {
954 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_TOOLCHAIN_VERSION, toolchain_version, 0);
955 }
956 void add_peak_mips(float peak_mips) {
957 fbb_.AddElement<float>(HubInfoResponse::VT_PEAK_MIPS, peak_mips, 0.0f);
958 }
959 void add_stopped_power(float stopped_power) {
960 fbb_.AddElement<float>(HubInfoResponse::VT_STOPPED_POWER, stopped_power, 0.0f);
961 }
962 void add_sleep_power(float sleep_power) {
963 fbb_.AddElement<float>(HubInfoResponse::VT_SLEEP_POWER, sleep_power, 0.0f);
964 }
965 void add_peak_power(float peak_power) {
966 fbb_.AddElement<float>(HubInfoResponse::VT_PEAK_POWER, peak_power, 0.0f);
967 }
968 void add_max_msg_len(uint32_t max_msg_len) {
969 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_MAX_MSG_LEN, max_msg_len, 0);
970 }
971 void add_platform_id(uint64_t platform_id) {
972 fbb_.AddElement<uint64_t>(HubInfoResponse::VT_PLATFORM_ID, platform_id, 0);
973 }
974 void add_chre_platform_version(uint32_t chre_platform_version) {
975 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_CHRE_PLATFORM_VERSION, chre_platform_version, 0);
976 }
977 explicit HubInfoResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
978 : fbb_(_fbb) {
979 start_ = fbb_.StartTable();
980 }
981 HubInfoResponseBuilder &operator=(const HubInfoResponseBuilder &);
982 flatbuffers::Offset<HubInfoResponse> Finish() {
983 const auto end = fbb_.EndTable(start_);
984 auto o = flatbuffers::Offset<HubInfoResponse>(end);
985 return o;
986 }
987 };
988
989 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(
990 flatbuffers::FlatBufferBuilder &_fbb,
991 flatbuffers::Offset<flatbuffers::Vector<int8_t>> name = 0,
992 flatbuffers::Offset<flatbuffers::Vector<int8_t>> vendor = 0,
993 flatbuffers::Offset<flatbuffers::Vector<int8_t>> toolchain = 0,
994 uint32_t platform_version = 0,
995 uint32_t toolchain_version = 0,
996 float peak_mips = 0.0f,
997 float stopped_power = 0.0f,
998 float sleep_power = 0.0f,
999 float peak_power = 0.0f,
1000 uint32_t max_msg_len = 0,
1001 uint64_t platform_id = 0,
1002 uint32_t chre_platform_version = 0) {
1003 HubInfoResponseBuilder builder_(_fbb);
1004 builder_.add_platform_id(platform_id);
1005 builder_.add_chre_platform_version(chre_platform_version);
1006 builder_.add_max_msg_len(max_msg_len);
1007 builder_.add_peak_power(peak_power);
1008 builder_.add_sleep_power(sleep_power);
1009 builder_.add_stopped_power(stopped_power);
1010 builder_.add_peak_mips(peak_mips);
1011 builder_.add_toolchain_version(toolchain_version);
1012 builder_.add_platform_version(platform_version);
1013 builder_.add_toolchain(toolchain);
1014 builder_.add_vendor(vendor);
1015 builder_.add_name(name);
1016 return builder_.Finish();
1017 }
1018
1019 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponseDirect(
1020 flatbuffers::FlatBufferBuilder &_fbb,
1021 const std::vector<int8_t> *name = nullptr,
1022 const std::vector<int8_t> *vendor = nullptr,
1023 const std::vector<int8_t> *toolchain = nullptr,
1024 uint32_t platform_version = 0,
1025 uint32_t toolchain_version = 0,
1026 float peak_mips = 0.0f,
1027 float stopped_power = 0.0f,
1028 float sleep_power = 0.0f,
1029 float peak_power = 0.0f,
1030 uint32_t max_msg_len = 0,
1031 uint64_t platform_id = 0,
1032 uint32_t chre_platform_version = 0) {
1033 auto name__ = name ? _fbb.CreateVector<int8_t>(*name) : 0;
1034 auto vendor__ = vendor ? _fbb.CreateVector<int8_t>(*vendor) : 0;
1035 auto toolchain__ = toolchain ? _fbb.CreateVector<int8_t>(*toolchain) : 0;
1036 return chre::fbs::CreateHubInfoResponse(
1037 _fbb,
1038 name__,
1039 vendor__,
1040 toolchain__,
1041 platform_version,
1042 toolchain_version,
1043 peak_mips,
1044 stopped_power,
1045 sleep_power,
1046 peak_power,
1047 max_msg_len,
1048 platform_id,
1049 chre_platform_version);
1050 }
1051
1052 flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1053
1054 struct NanoappListRequestT : public flatbuffers::NativeTable {
1055 typedef NanoappListRequest TableType;
1056 NanoappListRequestT() {
1057 }
1058 };
1059
1060 struct NanoappListRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1061 typedef NanoappListRequestT NativeTableType;
1062 typedef NanoappListRequestBuilder Builder;
1063 bool Verify(flatbuffers::Verifier &verifier) const {
1064 return VerifyTableStart(verifier) &&
1065 verifier.EndTable();
1066 }
1067 NanoappListRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1068 void UnPackTo(NanoappListRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1069 static flatbuffers::Offset<NanoappListRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1070 };
1071
1072 struct NanoappListRequestBuilder {
1073 typedef NanoappListRequest Table;
1074 flatbuffers::FlatBufferBuilder &fbb_;
1075 flatbuffers::uoffset_t start_;
1076 explicit NanoappListRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1077 : fbb_(_fbb) {
1078 start_ = fbb_.StartTable();
1079 }
1080 NanoappListRequestBuilder &operator=(const NanoappListRequestBuilder &);
1081 flatbuffers::Offset<NanoappListRequest> Finish() {
1082 const auto end = fbb_.EndTable(start_);
1083 auto o = flatbuffers::Offset<NanoappListRequest>(end);
1084 return o;
1085 }
1086 };
1087
1088 inline flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(
1089 flatbuffers::FlatBufferBuilder &_fbb) {
1090 NanoappListRequestBuilder builder_(_fbb);
1091 return builder_.Finish();
1092 }
1093
1094 flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1095
1096 struct NanoappListEntryT : public flatbuffers::NativeTable {
1097 typedef NanoappListEntry TableType;
1098 uint64_t app_id;
1099 uint32_t version;
1100 bool enabled;
1101 bool is_system;
1102 uint32_t permissions;
1103 NanoappListEntryT()
1104 : app_id(0),
1105 version(0),
1106 enabled(true),
1107 is_system(false),
1108 permissions(0) {
1109 }
1110 };
1111
1112 struct NanoappListEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1113 typedef NanoappListEntryT NativeTableType;
1114 typedef NanoappListEntryBuilder Builder;
1115 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1116 VT_APP_ID = 4,
1117 VT_VERSION = 6,
1118 VT_ENABLED = 8,
1119 VT_IS_SYSTEM = 10,
1120 VT_PERMISSIONS = 12
1121 };
1122 uint64_t app_id() const {
1123 return GetField<uint64_t>(VT_APP_ID, 0);
1124 }
1125 bool mutate_app_id(uint64_t _app_id) {
1126 return SetField<uint64_t>(VT_APP_ID, _app_id, 0);
1127 }
1128 uint32_t version() const {
1129 return GetField<uint32_t>(VT_VERSION, 0);
1130 }
1131 bool mutate_version(uint32_t _version) {
1132 return SetField<uint32_t>(VT_VERSION, _version, 0);
1133 }
1134 bool enabled() const {
1135 return GetField<uint8_t>(VT_ENABLED, 1) != 0;
1136 }
1137 bool mutate_enabled(bool _enabled) {
1138 return SetField<uint8_t>(VT_ENABLED, static_cast<uint8_t>(_enabled), 1);
1139 }
1140 /// Whether the nanoapp is a pre-loaded "system" nanoapp, i.e. one that should
1141 /// not show up in the list of nanoapps in the context hub HAL. System
1142 /// nanoapps are typically used to leverage CHRE for some device functionality
1143 /// and do not interact via the context hub HAL.
1144 bool is_system() const {
1145 return GetField<uint8_t>(VT_IS_SYSTEM, 0) != 0;
1146 }
1147 bool mutate_is_system(bool _is_system) {
1148 return SetField<uint8_t>(VT_IS_SYSTEM, static_cast<uint8_t>(_is_system), 0);
1149 }
1150 /// Nanoapp permissions, if supported. Nanoapp permissions are required on
1151 /// CHRE API v1.5+, and are defined in chre/util/system/napp_permissions.h
1152 uint32_t permissions() const {
1153 return GetField<uint32_t>(VT_PERMISSIONS, 0);
1154 }
1155 bool mutate_permissions(uint32_t _permissions) {
1156 return SetField<uint32_t>(VT_PERMISSIONS, _permissions, 0);
1157 }
1158 bool Verify(flatbuffers::Verifier &verifier) const {
1159 return VerifyTableStart(verifier) &&
1160 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
1161 VerifyField<uint32_t>(verifier, VT_VERSION) &&
1162 VerifyField<uint8_t>(verifier, VT_ENABLED) &&
1163 VerifyField<uint8_t>(verifier, VT_IS_SYSTEM) &&
1164 VerifyField<uint32_t>(verifier, VT_PERMISSIONS) &&
1165 verifier.EndTable();
1166 }
1167 NanoappListEntryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1168 void UnPackTo(NanoappListEntryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1169 static flatbuffers::Offset<NanoappListEntry> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1170 };
1171
1172 struct NanoappListEntryBuilder {
1173 typedef NanoappListEntry Table;
1174 flatbuffers::FlatBufferBuilder &fbb_;
1175 flatbuffers::uoffset_t start_;
1176 void add_app_id(uint64_t app_id) {
1177 fbb_.AddElement<uint64_t>(NanoappListEntry::VT_APP_ID, app_id, 0);
1178 }
1179 void add_version(uint32_t version) {
1180 fbb_.AddElement<uint32_t>(NanoappListEntry::VT_VERSION, version, 0);
1181 }
1182 void add_enabled(bool enabled) {
1183 fbb_.AddElement<uint8_t>(NanoappListEntry::VT_ENABLED, static_cast<uint8_t>(enabled), 1);
1184 }
1185 void add_is_system(bool is_system) {
1186 fbb_.AddElement<uint8_t>(NanoappListEntry::VT_IS_SYSTEM, static_cast<uint8_t>(is_system), 0);
1187 }
1188 void add_permissions(uint32_t permissions) {
1189 fbb_.AddElement<uint32_t>(NanoappListEntry::VT_PERMISSIONS, permissions, 0);
1190 }
1191 explicit NanoappListEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1192 : fbb_(_fbb) {
1193 start_ = fbb_.StartTable();
1194 }
1195 NanoappListEntryBuilder &operator=(const NanoappListEntryBuilder &);
1196 flatbuffers::Offset<NanoappListEntry> Finish() {
1197 const auto end = fbb_.EndTable(start_);
1198 auto o = flatbuffers::Offset<NanoappListEntry>(end);
1199 return o;
1200 }
1201 };
1202
1203 inline flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(
1204 flatbuffers::FlatBufferBuilder &_fbb,
1205 uint64_t app_id = 0,
1206 uint32_t version = 0,
1207 bool enabled = true,
1208 bool is_system = false,
1209 uint32_t permissions = 0) {
1210 NanoappListEntryBuilder builder_(_fbb);
1211 builder_.add_app_id(app_id);
1212 builder_.add_permissions(permissions);
1213 builder_.add_version(version);
1214 builder_.add_is_system(is_system);
1215 builder_.add_enabled(enabled);
1216 return builder_.Finish();
1217 }
1218
1219 flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1220
1221 struct NanoappListResponseT : public flatbuffers::NativeTable {
1222 typedef NanoappListResponse TableType;
1223 std::vector<std::unique_ptr<chre::fbs::NanoappListEntryT>> nanoapps;
1224 NanoappListResponseT() {
1225 }
1226 };
1227
1228 struct NanoappListResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1229 typedef NanoappListResponseT NativeTableType;
1230 typedef NanoappListResponseBuilder Builder;
1231 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1232 VT_NANOAPPS = 4
1233 };
1234 const flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> *nanoapps() const {
1235 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> *>(VT_NANOAPPS);
1236 }
1237 flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> *mutable_nanoapps() {
1238 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> *>(VT_NANOAPPS);
1239 }
1240 bool Verify(flatbuffers::Verifier &verifier) const {
1241 return VerifyTableStart(verifier) &&
1242 VerifyOffsetRequired(verifier, VT_NANOAPPS) &&
1243 verifier.VerifyVector(nanoapps()) &&
1244 verifier.VerifyVectorOfTables(nanoapps()) &&
1245 verifier.EndTable();
1246 }
1247 NanoappListResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1248 void UnPackTo(NanoappListResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1249 static flatbuffers::Offset<NanoappListResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1250 };
1251
1252 struct NanoappListResponseBuilder {
1253 typedef NanoappListResponse Table;
1254 flatbuffers::FlatBufferBuilder &fbb_;
1255 flatbuffers::uoffset_t start_;
1256 void add_nanoapps(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>>> nanoapps) {
1257 fbb_.AddOffset(NanoappListResponse::VT_NANOAPPS, nanoapps);
1258 }
1259 explicit NanoappListResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1260 : fbb_(_fbb) {
1261 start_ = fbb_.StartTable();
1262 }
1263 NanoappListResponseBuilder &operator=(const NanoappListResponseBuilder &);
1264 flatbuffers::Offset<NanoappListResponse> Finish() {
1265 const auto end = fbb_.EndTable(start_);
1266 auto o = flatbuffers::Offset<NanoappListResponse>(end);
1267 fbb_.Required(o, NanoappListResponse::VT_NANOAPPS);
1268 return o;
1269 }
1270 };
1271
1272 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(
1273 flatbuffers::FlatBufferBuilder &_fbb,
1274 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>>> nanoapps = 0) {
1275 NanoappListResponseBuilder builder_(_fbb);
1276 builder_.add_nanoapps(nanoapps);
1277 return builder_.Finish();
1278 }
1279
1280 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponseDirect(
1281 flatbuffers::FlatBufferBuilder &_fbb,
1282 const std::vector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> *nanoapps = nullptr) {
1283 auto nanoapps__ = nanoapps ? _fbb.CreateVector<flatbuffers::Offset<chre::fbs::NanoappListEntry>>(*nanoapps) : 0;
1284 return chre::fbs::CreateNanoappListResponse(
1285 _fbb,
1286 nanoapps__);
1287 }
1288
1289 flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1290
1291 struct LoadNanoappRequestT : public flatbuffers::NativeTable {
1292 typedef LoadNanoappRequest TableType;
1293 uint32_t transaction_id;
1294 uint64_t app_id;
1295 uint32_t app_version;
1296 uint32_t target_api_version;
1297 std::vector<uint8_t> app_binary;
1298 uint32_t fragment_id;
1299 uint32_t total_app_size;
1300 std::vector<int8_t> app_binary_file_name;
1301 uint32_t app_flags;
1302 bool respond_before_start;
1303 LoadNanoappRequestT()
1304 : transaction_id(0),
1305 app_id(0),
1306 app_version(0),
1307 target_api_version(0),
1308 fragment_id(0),
1309 total_app_size(0),
1310 app_flags(0),
1311 respond_before_start(false) {
1312 }
1313 };
1314
1315 /// Represents a request for loading a nanoapp.
1316 /// The nanaopp can either be requested to be loaded via a file or via a buffer.
1317 /// For loading via a file, the following steps will be taken:
1318 /// 1. The loader sends a LoadNanoappRequest message to CHRE. app_binary must
1319 /// be set for legacy purposes, but should be empty. Additionally,
1320 /// fragment_id and total_app_size are unused in this request. The loading
1321 /// that happens as part of this request is serialized, but asynchronous
1322 /// meaning that load requests will be processed in the order they are sent
1323 /// but multiple requests can be outstanding at any given time.
1324 /// 2. CHRE stores the filename and waits until its event loop is able to
1325 /// process the request.
1326 /// 3. Once ready, the nanoapp will be loaded from the file specified in the
1327 /// original request and will send a callback indicating the
1328 /// completion/failure of the request.
1329 /// For loading via a buffer, loading may optionally be fragmented into multiple
1330 /// sequential requests, which will follow the following steps:
1331 /// 1. The loader sends a LoadNanoappRequest message to CHRE. If the request
1332 /// is fragmented, then the fields fragment_id and total_app_size must
1333 /// be defined. Once the first fragment is sent to CHRE, all subsequent
1334 /// fragments must be delivered before a new LoadNanoappRequest can be
1335 /// issued. If a new request is received while a current request has
1336 /// outstanding fragments, the current request will be overridden with the
1337 /// new one.
1338 /// 2. CHRE preallocates the required amount of memory, and loads app_binary,
1339 /// appending to already loaded fragments as appropriate.
1340 /// 3. If the request is fragmented, then the requestor must sequentially send
1341 /// multiple LoadNanoappRequest with incremental nanoapp binary fragments.
1342 /// CHRE will respond with LoadNanoappResponse for each request. For
1343 /// requests starting from the second fragment, all fields except
1344 /// fragment_id and app_binary should be ignored by CHRE.
1345 ///
1346 /// Once the LoadNanoappRepsonse for the last fragment is received
1347 /// by the HAL, the HAL client will receive a callback indicating the
1348 /// completion/failure of a load request.
1349 ///
1350 /// If any request fragment is lost, then the entire load request will be
1351 /// considered to have failed. If the request times out (e.g. the requestor
1352 /// process crashes), then the load request will be cancelled at CHRE and fail.
1353 struct LoadNanoappRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1354 typedef LoadNanoappRequestT NativeTableType;
1355 typedef LoadNanoappRequestBuilder Builder;
1356 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1357 VT_TRANSACTION_ID = 4,
1358 VT_APP_ID = 6,
1359 VT_APP_VERSION = 8,
1360 VT_TARGET_API_VERSION = 10,
1361 VT_APP_BINARY = 12,
1362 VT_FRAGMENT_ID = 14,
1363 VT_TOTAL_APP_SIZE = 16,
1364 VT_APP_BINARY_FILE_NAME = 18,
1365 VT_APP_FLAGS = 20,
1366 VT_RESPOND_BEFORE_START = 22
1367 };
1368 uint32_t transaction_id() const {
1369 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1370 }
1371 bool mutate_transaction_id(uint32_t _transaction_id) {
1372 return SetField<uint32_t>(VT_TRANSACTION_ID, _transaction_id, 0);
1373 }
1374 uint64_t app_id() const {
1375 return GetField<uint64_t>(VT_APP_ID, 0);
1376 }
1377 bool mutate_app_id(uint64_t _app_id) {
1378 return SetField<uint64_t>(VT_APP_ID, _app_id, 0);
1379 }
1380 uint32_t app_version() const {
1381 return GetField<uint32_t>(VT_APP_VERSION, 0);
1382 }
1383 bool mutate_app_version(uint32_t _app_version) {
1384 return SetField<uint32_t>(VT_APP_VERSION, _app_version, 0);
1385 }
1386 uint32_t target_api_version() const {
1387 return GetField<uint32_t>(VT_TARGET_API_VERSION, 0);
1388 }
1389 bool mutate_target_api_version(uint32_t _target_api_version) {
1390 return SetField<uint32_t>(VT_TARGET_API_VERSION, _target_api_version, 0);
1391 }
1392 const flatbuffers::Vector<uint8_t> *app_binary() const {
1393 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_APP_BINARY);
1394 }
1395 flatbuffers::Vector<uint8_t> *mutable_app_binary() {
1396 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_APP_BINARY);
1397 }
1398 /// Fields that are relevant for fragmented loading
1399 /// The framgent count starts at 1 and should end at the total number of
1400 /// fragments. For clients that do not support fragmented loading, the
1401 /// default behavior should be to assume one fragment.
1402 uint32_t fragment_id() const {
1403 return GetField<uint32_t>(VT_FRAGMENT_ID, 0);
1404 }
1405 bool mutate_fragment_id(uint32_t _fragment_id) {
1406 return SetField<uint32_t>(VT_FRAGMENT_ID, _fragment_id, 0);
1407 }
1408 uint32_t total_app_size() const {
1409 return GetField<uint32_t>(VT_TOTAL_APP_SIZE, 0);
1410 }
1411 bool mutate_total_app_size(uint32_t _total_app_size) {
1412 return SetField<uint32_t>(VT_TOTAL_APP_SIZE, _total_app_size, 0);
1413 }
1414 /// Null-terminated ASCII string containing the file name that contains the
1415 /// app binary to be loaded.
1416 const flatbuffers::Vector<int8_t> *app_binary_file_name() const {
1417 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_APP_BINARY_FILE_NAME);
1418 }
1419 flatbuffers::Vector<int8_t> *mutable_app_binary_file_name() {
1420 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_APP_BINARY_FILE_NAME);
1421 }
1422 /// The nanoapp flag values from the nanoapp header defined in
1423 /// build/build_template.mk. Refer to that file for more details.
1424 uint32_t app_flags() const {
1425 return GetField<uint32_t>(VT_APP_FLAGS, 0);
1426 }
1427 bool mutate_app_flags(uint32_t _app_flags) {
1428 return SetField<uint32_t>(VT_APP_FLAGS, _app_flags, 0);
1429 }
1430 /// If true and fragmented loading is requested, the LoadNanoappResponse
1431 /// for the last fragment will be sent after the fragment was confirmed
1432 /// to be placed in memory and no additional response will be sent after
1433 /// the nanoapp is linked and started in the framework.
1434 bool respond_before_start() const {
1435 return GetField<uint8_t>(VT_RESPOND_BEFORE_START, 0) != 0;
1436 }
1437 bool mutate_respond_before_start(bool _respond_before_start) {
1438 return SetField<uint8_t>(VT_RESPOND_BEFORE_START, static_cast<uint8_t>(_respond_before_start), 0);
1439 }
1440 bool Verify(flatbuffers::Verifier &verifier) const {
1441 return VerifyTableStart(verifier) &&
1442 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1443 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
1444 VerifyField<uint32_t>(verifier, VT_APP_VERSION) &&
1445 VerifyField<uint32_t>(verifier, VT_TARGET_API_VERSION) &&
1446 VerifyOffsetRequired(verifier, VT_APP_BINARY) &&
1447 verifier.VerifyVector(app_binary()) &&
1448 VerifyField<uint32_t>(verifier, VT_FRAGMENT_ID) &&
1449 VerifyField<uint32_t>(verifier, VT_TOTAL_APP_SIZE) &&
1450 VerifyOffset(verifier, VT_APP_BINARY_FILE_NAME) &&
1451 verifier.VerifyVector(app_binary_file_name()) &&
1452 VerifyField<uint32_t>(verifier, VT_APP_FLAGS) &&
1453 VerifyField<uint8_t>(verifier, VT_RESPOND_BEFORE_START) &&
1454 verifier.EndTable();
1455 }
1456 LoadNanoappRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1457 void UnPackTo(LoadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1458 static flatbuffers::Offset<LoadNanoappRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1459 };
1460
1461 struct LoadNanoappRequestBuilder {
1462 typedef LoadNanoappRequest Table;
1463 flatbuffers::FlatBufferBuilder &fbb_;
1464 flatbuffers::uoffset_t start_;
1465 void add_transaction_id(uint32_t transaction_id) {
1466 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TRANSACTION_ID, transaction_id, 0);
1467 }
1468 void add_app_id(uint64_t app_id) {
1469 fbb_.AddElement<uint64_t>(LoadNanoappRequest::VT_APP_ID, app_id, 0);
1470 }
1471 void add_app_version(uint32_t app_version) {
1472 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_APP_VERSION, app_version, 0);
1473 }
1474 void add_target_api_version(uint32_t target_api_version) {
1475 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TARGET_API_VERSION, target_api_version, 0);
1476 }
1477 void add_app_binary(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> app_binary) {
1478 fbb_.AddOffset(LoadNanoappRequest::VT_APP_BINARY, app_binary);
1479 }
1480 void add_fragment_id(uint32_t fragment_id) {
1481 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_FRAGMENT_ID, fragment_id, 0);
1482 }
1483 void add_total_app_size(uint32_t total_app_size) {
1484 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TOTAL_APP_SIZE, total_app_size, 0);
1485 }
1486 void add_app_binary_file_name(flatbuffers::Offset<flatbuffers::Vector<int8_t>> app_binary_file_name) {
1487 fbb_.AddOffset(LoadNanoappRequest::VT_APP_BINARY_FILE_NAME, app_binary_file_name);
1488 }
1489 void add_app_flags(uint32_t app_flags) {
1490 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_APP_FLAGS, app_flags, 0);
1491 }
1492 void add_respond_before_start(bool respond_before_start) {
1493 fbb_.AddElement<uint8_t>(LoadNanoappRequest::VT_RESPOND_BEFORE_START, static_cast<uint8_t>(respond_before_start), 0);
1494 }
1495 explicit LoadNanoappRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1496 : fbb_(_fbb) {
1497 start_ = fbb_.StartTable();
1498 }
1499 LoadNanoappRequestBuilder &operator=(const LoadNanoappRequestBuilder &);
1500 flatbuffers::Offset<LoadNanoappRequest> Finish() {
1501 const auto end = fbb_.EndTable(start_);
1502 auto o = flatbuffers::Offset<LoadNanoappRequest>(end);
1503 fbb_.Required(o, LoadNanoappRequest::VT_APP_BINARY);
1504 return o;
1505 }
1506 };
1507
1508 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(
1509 flatbuffers::FlatBufferBuilder &_fbb,
1510 uint32_t transaction_id = 0,
1511 uint64_t app_id = 0,
1512 uint32_t app_version = 0,
1513 uint32_t target_api_version = 0,
1514 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> app_binary = 0,
1515 uint32_t fragment_id = 0,
1516 uint32_t total_app_size = 0,
1517 flatbuffers::Offset<flatbuffers::Vector<int8_t>> app_binary_file_name = 0,
1518 uint32_t app_flags = 0,
1519 bool respond_before_start = false) {
1520 LoadNanoappRequestBuilder builder_(_fbb);
1521 builder_.add_app_id(app_id);
1522 builder_.add_app_flags(app_flags);
1523 builder_.add_app_binary_file_name(app_binary_file_name);
1524 builder_.add_total_app_size(total_app_size);
1525 builder_.add_fragment_id(fragment_id);
1526 builder_.add_app_binary(app_binary);
1527 builder_.add_target_api_version(target_api_version);
1528 builder_.add_app_version(app_version);
1529 builder_.add_transaction_id(transaction_id);
1530 builder_.add_respond_before_start(respond_before_start);
1531 return builder_.Finish();
1532 }
1533
1534 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequestDirect(
1535 flatbuffers::FlatBufferBuilder &_fbb,
1536 uint32_t transaction_id = 0,
1537 uint64_t app_id = 0,
1538 uint32_t app_version = 0,
1539 uint32_t target_api_version = 0,
1540 const std::vector<uint8_t> *app_binary = nullptr,
1541 uint32_t fragment_id = 0,
1542 uint32_t total_app_size = 0,
1543 const std::vector<int8_t> *app_binary_file_name = nullptr,
1544 uint32_t app_flags = 0,
1545 bool respond_before_start = false) {
1546 auto app_binary__ = app_binary ? _fbb.CreateVector<uint8_t>(*app_binary) : 0;
1547 auto app_binary_file_name__ = app_binary_file_name ? _fbb.CreateVector<int8_t>(*app_binary_file_name) : 0;
1548 return chre::fbs::CreateLoadNanoappRequest(
1549 _fbb,
1550 transaction_id,
1551 app_id,
1552 app_version,
1553 target_api_version,
1554 app_binary__,
1555 fragment_id,
1556 total_app_size,
1557 app_binary_file_name__,
1558 app_flags,
1559 respond_before_start);
1560 }
1561
1562 flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1563
1564 struct LoadNanoappResponseT : public flatbuffers::NativeTable {
1565 typedef LoadNanoappResponse TableType;
1566 uint32_t transaction_id;
1567 bool success;
1568 uint32_t fragment_id;
1569 LoadNanoappResponseT()
1570 : transaction_id(0),
1571 success(false),
1572 fragment_id(0) {
1573 }
1574 };
1575
1576 struct LoadNanoappResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1577 typedef LoadNanoappResponseT NativeTableType;
1578 typedef LoadNanoappResponseBuilder Builder;
1579 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1580 VT_TRANSACTION_ID = 4,
1581 VT_SUCCESS = 6,
1582 VT_FRAGMENT_ID = 8
1583 };
1584 uint32_t transaction_id() const {
1585 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1586 }
1587 bool mutate_transaction_id(uint32_t _transaction_id) {
1588 return SetField<uint32_t>(VT_TRANSACTION_ID, _transaction_id, 0);
1589 }
1590 /// Denotes whether a load request succeeded or failed.
1591 /// If any fragment of a load request fails, the entire load request for
1592 /// the same transaction will fail.
1593 bool success() const {
1594 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
1595 }
1596 bool mutate_success(bool _success) {
1597 return SetField<uint8_t>(VT_SUCCESS, static_cast<uint8_t>(_success), 0);
1598 }
1599 /// The fragment count of the load reponse is for.
1600 uint32_t fragment_id() const {
1601 return GetField<uint32_t>(VT_FRAGMENT_ID, 0);
1602 }
1603 bool mutate_fragment_id(uint32_t _fragment_id) {
1604 return SetField<uint32_t>(VT_FRAGMENT_ID, _fragment_id, 0);
1605 }
1606 bool Verify(flatbuffers::Verifier &verifier) const {
1607 return VerifyTableStart(verifier) &&
1608 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1609 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
1610 VerifyField<uint32_t>(verifier, VT_FRAGMENT_ID) &&
1611 verifier.EndTable();
1612 }
1613 LoadNanoappResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1614 void UnPackTo(LoadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1615 static flatbuffers::Offset<LoadNanoappResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1616 };
1617
1618 struct LoadNanoappResponseBuilder {
1619 typedef LoadNanoappResponse Table;
1620 flatbuffers::FlatBufferBuilder &fbb_;
1621 flatbuffers::uoffset_t start_;
1622 void add_transaction_id(uint32_t transaction_id) {
1623 fbb_.AddElement<uint32_t>(LoadNanoappResponse::VT_TRANSACTION_ID, transaction_id, 0);
1624 }
1625 void add_success(bool success) {
1626 fbb_.AddElement<uint8_t>(LoadNanoappResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
1627 }
1628 void add_fragment_id(uint32_t fragment_id) {
1629 fbb_.AddElement<uint32_t>(LoadNanoappResponse::VT_FRAGMENT_ID, fragment_id, 0);
1630 }
1631 explicit LoadNanoappResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1632 : fbb_(_fbb) {
1633 start_ = fbb_.StartTable();
1634 }
1635 LoadNanoappResponseBuilder &operator=(const LoadNanoappResponseBuilder &);
1636 flatbuffers::Offset<LoadNanoappResponse> Finish() {
1637 const auto end = fbb_.EndTable(start_);
1638 auto o = flatbuffers::Offset<LoadNanoappResponse>(end);
1639 return o;
1640 }
1641 };
1642
1643 inline flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(
1644 flatbuffers::FlatBufferBuilder &_fbb,
1645 uint32_t transaction_id = 0,
1646 bool success = false,
1647 uint32_t fragment_id = 0) {
1648 LoadNanoappResponseBuilder builder_(_fbb);
1649 builder_.add_fragment_id(fragment_id);
1650 builder_.add_transaction_id(transaction_id);
1651 builder_.add_success(success);
1652 return builder_.Finish();
1653 }
1654
1655 flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1656
1657 struct UnloadNanoappRequestT : public flatbuffers::NativeTable {
1658 typedef UnloadNanoappRequest TableType;
1659 uint32_t transaction_id;
1660 uint64_t app_id;
1661 bool allow_system_nanoapp_unload;
1662 UnloadNanoappRequestT()
1663 : transaction_id(0),
1664 app_id(0),
1665 allow_system_nanoapp_unload(false) {
1666 }
1667 };
1668
1669 struct UnloadNanoappRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1670 typedef UnloadNanoappRequestT NativeTableType;
1671 typedef UnloadNanoappRequestBuilder Builder;
1672 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1673 VT_TRANSACTION_ID = 4,
1674 VT_APP_ID = 6,
1675 VT_ALLOW_SYSTEM_NANOAPP_UNLOAD = 8
1676 };
1677 uint32_t transaction_id() const {
1678 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1679 }
1680 bool mutate_transaction_id(uint32_t _transaction_id) {
1681 return SetField<uint32_t>(VT_TRANSACTION_ID, _transaction_id, 0);
1682 }
1683 uint64_t app_id() const {
1684 return GetField<uint64_t>(VT_APP_ID, 0);
1685 }
1686 bool mutate_app_id(uint64_t _app_id) {
1687 return SetField<uint64_t>(VT_APP_ID, _app_id, 0);
1688 }
1689 /// Set to true to allow this request to unload nanoapps identified as "system
1690 /// nanoapps", i.e. ones with is_system set to true in NanoappListResponse.
1691 bool allow_system_nanoapp_unload() const {
1692 return GetField<uint8_t>(VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, 0) != 0;
1693 }
1694 bool mutate_allow_system_nanoapp_unload(bool _allow_system_nanoapp_unload) {
1695 return SetField<uint8_t>(VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, static_cast<uint8_t>(_allow_system_nanoapp_unload), 0);
1696 }
1697 bool Verify(flatbuffers::Verifier &verifier) const {
1698 return VerifyTableStart(verifier) &&
1699 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1700 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
1701 VerifyField<uint8_t>(verifier, VT_ALLOW_SYSTEM_NANOAPP_UNLOAD) &&
1702 verifier.EndTable();
1703 }
1704 UnloadNanoappRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1705 void UnPackTo(UnloadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1706 static flatbuffers::Offset<UnloadNanoappRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1707 };
1708
1709 struct UnloadNanoappRequestBuilder {
1710 typedef UnloadNanoappRequest Table;
1711 flatbuffers::FlatBufferBuilder &fbb_;
1712 flatbuffers::uoffset_t start_;
1713 void add_transaction_id(uint32_t transaction_id) {
1714 fbb_.AddElement<uint32_t>(UnloadNanoappRequest::VT_TRANSACTION_ID, transaction_id, 0);
1715 }
1716 void add_app_id(uint64_t app_id) {
1717 fbb_.AddElement<uint64_t>(UnloadNanoappRequest::VT_APP_ID, app_id, 0);
1718 }
1719 void add_allow_system_nanoapp_unload(bool allow_system_nanoapp_unload) {
1720 fbb_.AddElement<uint8_t>(UnloadNanoappRequest::VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, static_cast<uint8_t>(allow_system_nanoapp_unload), 0);
1721 }
1722 explicit UnloadNanoappRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1723 : fbb_(_fbb) {
1724 start_ = fbb_.StartTable();
1725 }
1726 UnloadNanoappRequestBuilder &operator=(const UnloadNanoappRequestBuilder &);
1727 flatbuffers::Offset<UnloadNanoappRequest> Finish() {
1728 const auto end = fbb_.EndTable(start_);
1729 auto o = flatbuffers::Offset<UnloadNanoappRequest>(end);
1730 return o;
1731 }
1732 };
1733
1734 inline flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(
1735 flatbuffers::FlatBufferBuilder &_fbb,
1736 uint32_t transaction_id = 0,
1737 uint64_t app_id = 0,
1738 bool allow_system_nanoapp_unload = false) {
1739 UnloadNanoappRequestBuilder builder_(_fbb);
1740 builder_.add_app_id(app_id);
1741 builder_.add_transaction_id(transaction_id);
1742 builder_.add_allow_system_nanoapp_unload(allow_system_nanoapp_unload);
1743 return builder_.Finish();
1744 }
1745
1746 flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1747
1748 struct UnloadNanoappResponseT : public flatbuffers::NativeTable {
1749 typedef UnloadNanoappResponse TableType;
1750 uint32_t transaction_id;
1751 bool success;
1752 UnloadNanoappResponseT()
1753 : transaction_id(0),
1754 success(false) {
1755 }
1756 };
1757
1758 struct UnloadNanoappResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1759 typedef UnloadNanoappResponseT NativeTableType;
1760 typedef UnloadNanoappResponseBuilder Builder;
1761 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1762 VT_TRANSACTION_ID = 4,
1763 VT_SUCCESS = 6
1764 };
1765 uint32_t transaction_id() const {
1766 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1767 }
1768 bool mutate_transaction_id(uint32_t _transaction_id) {
1769 return SetField<uint32_t>(VT_TRANSACTION_ID, _transaction_id, 0);
1770 }
1771 bool success() const {
1772 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
1773 }
1774 bool mutate_success(bool _success) {
1775 return SetField<uint8_t>(VT_SUCCESS, static_cast<uint8_t>(_success), 0);
1776 }
1777 bool Verify(flatbuffers::Verifier &verifier) const {
1778 return VerifyTableStart(verifier) &&
1779 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1780 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
1781 verifier.EndTable();
1782 }
1783 UnloadNanoappResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1784 void UnPackTo(UnloadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1785 static flatbuffers::Offset<UnloadNanoappResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1786 };
1787
1788 struct UnloadNanoappResponseBuilder {
1789 typedef UnloadNanoappResponse Table;
1790 flatbuffers::FlatBufferBuilder &fbb_;
1791 flatbuffers::uoffset_t start_;
1792 void add_transaction_id(uint32_t transaction_id) {
1793 fbb_.AddElement<uint32_t>(UnloadNanoappResponse::VT_TRANSACTION_ID, transaction_id, 0);
1794 }
1795 void add_success(bool success) {
1796 fbb_.AddElement<uint8_t>(UnloadNanoappResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
1797 }
1798 explicit UnloadNanoappResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1799 : fbb_(_fbb) {
1800 start_ = fbb_.StartTable();
1801 }
1802 UnloadNanoappResponseBuilder &operator=(const UnloadNanoappResponseBuilder &);
1803 flatbuffers::Offset<UnloadNanoappResponse> Finish() {
1804 const auto end = fbb_.EndTable(start_);
1805 auto o = flatbuffers::Offset<UnloadNanoappResponse>(end);
1806 return o;
1807 }
1808 };
1809
1810 inline flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(
1811 flatbuffers::FlatBufferBuilder &_fbb,
1812 uint32_t transaction_id = 0,
1813 bool success = false) {
1814 UnloadNanoappResponseBuilder builder_(_fbb);
1815 builder_.add_transaction_id(transaction_id);
1816 builder_.add_success(success);
1817 return builder_.Finish();
1818 }
1819
1820 flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1821
1822 struct LogMessageT : public flatbuffers::NativeTable {
1823 typedef LogMessage TableType;
1824 std::vector<int8_t> buffer;
1825 LogMessageT() {
1826 }
1827 };
1828
1829 /// Represents log messages from CHRE.
1830 struct LogMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1831 typedef LogMessageT NativeTableType;
1832 typedef LogMessageBuilder Builder;
1833 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1834 VT_BUFFER = 4
1835 };
1836 /// A buffer containing formatted log data. A flat array is used here to avoid
1837 /// overhead in serializing and deserializing. The format is as follows:
1838 ///
1839 /// uint8_t - log level (1 = error, 2 = warning,
1840 /// 3 = info, 4 = debug)
1841 /// uint64_t, little-endian - timestamp in nanoseconds
1842 /// char[] - message to log
1843 /// char, \0 - null-terminator
1844 ///
1845 /// This pattern repeats until the end of the buffer for multiple log
1846 /// messages. The last byte will always be a null-terminator. There are no
1847 /// padding bytes between these fields. Treat this like a packed struct and be
1848 /// cautious with unaligned access when reading/writing this buffer.
1849 const flatbuffers::Vector<int8_t> *buffer() const {
1850 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_BUFFER);
1851 }
1852 flatbuffers::Vector<int8_t> *mutable_buffer() {
1853 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_BUFFER);
1854 }
1855 bool Verify(flatbuffers::Verifier &verifier) const {
1856 return VerifyTableStart(verifier) &&
1857 VerifyOffset(verifier, VT_BUFFER) &&
1858 verifier.VerifyVector(buffer()) &&
1859 verifier.EndTable();
1860 }
1861 LogMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1862 void UnPackTo(LogMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1863 static flatbuffers::Offset<LogMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1864 };
1865
1866 struct LogMessageBuilder {
1867 typedef LogMessage Table;
1868 flatbuffers::FlatBufferBuilder &fbb_;
1869 flatbuffers::uoffset_t start_;
1870 void add_buffer(flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer) {
1871 fbb_.AddOffset(LogMessage::VT_BUFFER, buffer);
1872 }
1873 explicit LogMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1874 : fbb_(_fbb) {
1875 start_ = fbb_.StartTable();
1876 }
1877 LogMessageBuilder &operator=(const LogMessageBuilder &);
1878 flatbuffers::Offset<LogMessage> Finish() {
1879 const auto end = fbb_.EndTable(start_);
1880 auto o = flatbuffers::Offset<LogMessage>(end);
1881 return o;
1882 }
1883 };
1884
1885 inline flatbuffers::Offset<LogMessage> CreateLogMessage(
1886 flatbuffers::FlatBufferBuilder &_fbb,
1887 flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0) {
1888 LogMessageBuilder builder_(_fbb);
1889 builder_.add_buffer(buffer);
1890 return builder_.Finish();
1891 }
1892
1893 inline flatbuffers::Offset<LogMessage> CreateLogMessageDirect(
1894 flatbuffers::FlatBufferBuilder &_fbb,
1895 const std::vector<int8_t> *buffer = nullptr) {
1896 auto buffer__ = buffer ? _fbb.CreateVector<int8_t>(*buffer) : 0;
1897 return chre::fbs::CreateLogMessage(
1898 _fbb,
1899 buffer__);
1900 }
1901
1902 flatbuffers::Offset<LogMessage> CreateLogMessage(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1903
1904 struct TimeSyncMessageT : public flatbuffers::NativeTable {
1905 typedef TimeSyncMessage TableType;
1906 int64_t offset;
1907 TimeSyncMessageT()
1908 : offset(0) {
1909 }
1910 };
1911
1912 /// Represents a message sent to CHRE to indicate AP timestamp for time sync
1913 struct TimeSyncMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1914 typedef TimeSyncMessageT NativeTableType;
1915 typedef TimeSyncMessageBuilder Builder;
1916 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1917 VT_OFFSET = 4
1918 };
1919 /// Offset between AP and CHRE timestamp
1920 int64_t offset() const {
1921 return GetField<int64_t>(VT_OFFSET, 0);
1922 }
1923 bool mutate_offset(int64_t _offset) {
1924 return SetField<int64_t>(VT_OFFSET, _offset, 0);
1925 }
1926 bool Verify(flatbuffers::Verifier &verifier) const {
1927 return VerifyTableStart(verifier) &&
1928 VerifyField<int64_t>(verifier, VT_OFFSET) &&
1929 verifier.EndTable();
1930 }
1931 TimeSyncMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1932 void UnPackTo(TimeSyncMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1933 static flatbuffers::Offset<TimeSyncMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1934 };
1935
1936 struct TimeSyncMessageBuilder {
1937 typedef TimeSyncMessage Table;
1938 flatbuffers::FlatBufferBuilder &fbb_;
1939 flatbuffers::uoffset_t start_;
1940 void add_offset(int64_t offset) {
1941 fbb_.AddElement<int64_t>(TimeSyncMessage::VT_OFFSET, offset, 0);
1942 }
1943 explicit TimeSyncMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1944 : fbb_(_fbb) {
1945 start_ = fbb_.StartTable();
1946 }
1947 TimeSyncMessageBuilder &operator=(const TimeSyncMessageBuilder &);
1948 flatbuffers::Offset<TimeSyncMessage> Finish() {
1949 const auto end = fbb_.EndTable(start_);
1950 auto o = flatbuffers::Offset<TimeSyncMessage>(end);
1951 return o;
1952 }
1953 };
1954
1955 inline flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(
1956 flatbuffers::FlatBufferBuilder &_fbb,
1957 int64_t offset = 0) {
1958 TimeSyncMessageBuilder builder_(_fbb);
1959 builder_.add_offset(offset);
1960 return builder_.Finish();
1961 }
1962
1963 flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1964
1965 struct DebugDumpRequestT : public flatbuffers::NativeTable {
1966 typedef DebugDumpRequest TableType;
1967 DebugDumpRequestT() {
1968 }
1969 };
1970
1971 /// A request to gather and return debugging information. Only one debug dump
1972 /// session can be active at a time. Upon accepting a request, zero or more
1973 /// DebugDumpData messages are generated, followed by a DebugDumpResponse
1974 /// indicating the completion of the operation.
1975 struct DebugDumpRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1976 typedef DebugDumpRequestT NativeTableType;
1977 typedef DebugDumpRequestBuilder Builder;
1978 bool Verify(flatbuffers::Verifier &verifier) const {
1979 return VerifyTableStart(verifier) &&
1980 verifier.EndTable();
1981 }
1982 DebugDumpRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1983 void UnPackTo(DebugDumpRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1984 static flatbuffers::Offset<DebugDumpRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1985 };
1986
1987 struct DebugDumpRequestBuilder {
1988 typedef DebugDumpRequest Table;
1989 flatbuffers::FlatBufferBuilder &fbb_;
1990 flatbuffers::uoffset_t start_;
1991 explicit DebugDumpRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1992 : fbb_(_fbb) {
1993 start_ = fbb_.StartTable();
1994 }
1995 DebugDumpRequestBuilder &operator=(const DebugDumpRequestBuilder &);
1996 flatbuffers::Offset<DebugDumpRequest> Finish() {
1997 const auto end = fbb_.EndTable(start_);
1998 auto o = flatbuffers::Offset<DebugDumpRequest>(end);
1999 return o;
2000 }
2001 };
2002
2003 inline flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(
2004 flatbuffers::FlatBufferBuilder &_fbb) {
2005 DebugDumpRequestBuilder builder_(_fbb);
2006 return builder_.Finish();
2007 }
2008
2009 flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2010
2011 struct DebugDumpDataT : public flatbuffers::NativeTable {
2012 typedef DebugDumpData TableType;
2013 std::vector<int8_t> debug_str;
2014 DebugDumpDataT() {
2015 }
2016 };
2017
2018 struct DebugDumpData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2019 typedef DebugDumpDataT NativeTableType;
2020 typedef DebugDumpDataBuilder Builder;
2021 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2022 VT_DEBUG_STR = 4
2023 };
2024 /// Null-terminated ASCII string containing debugging information
2025 const flatbuffers::Vector<int8_t> *debug_str() const {
2026 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_DEBUG_STR);
2027 }
2028 flatbuffers::Vector<int8_t> *mutable_debug_str() {
2029 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_DEBUG_STR);
2030 }
2031 bool Verify(flatbuffers::Verifier &verifier) const {
2032 return VerifyTableStart(verifier) &&
2033 VerifyOffset(verifier, VT_DEBUG_STR) &&
2034 verifier.VerifyVector(debug_str()) &&
2035 verifier.EndTable();
2036 }
2037 DebugDumpDataT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2038 void UnPackTo(DebugDumpDataT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2039 static flatbuffers::Offset<DebugDumpData> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2040 };
2041
2042 struct DebugDumpDataBuilder {
2043 typedef DebugDumpData Table;
2044 flatbuffers::FlatBufferBuilder &fbb_;
2045 flatbuffers::uoffset_t start_;
2046 void add_debug_str(flatbuffers::Offset<flatbuffers::Vector<int8_t>> debug_str) {
2047 fbb_.AddOffset(DebugDumpData::VT_DEBUG_STR, debug_str);
2048 }
2049 explicit DebugDumpDataBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2050 : fbb_(_fbb) {
2051 start_ = fbb_.StartTable();
2052 }
2053 DebugDumpDataBuilder &operator=(const DebugDumpDataBuilder &);
2054 flatbuffers::Offset<DebugDumpData> Finish() {
2055 const auto end = fbb_.EndTable(start_);
2056 auto o = flatbuffers::Offset<DebugDumpData>(end);
2057 return o;
2058 }
2059 };
2060
2061 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(
2062 flatbuffers::FlatBufferBuilder &_fbb,
2063 flatbuffers::Offset<flatbuffers::Vector<int8_t>> debug_str = 0) {
2064 DebugDumpDataBuilder builder_(_fbb);
2065 builder_.add_debug_str(debug_str);
2066 return builder_.Finish();
2067 }
2068
2069 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpDataDirect(
2070 flatbuffers::FlatBufferBuilder &_fbb,
2071 const std::vector<int8_t> *debug_str = nullptr) {
2072 auto debug_str__ = debug_str ? _fbb.CreateVector<int8_t>(*debug_str) : 0;
2073 return chre::fbs::CreateDebugDumpData(
2074 _fbb,
2075 debug_str__);
2076 }
2077
2078 flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2079
2080 struct DebugDumpResponseT : public flatbuffers::NativeTable {
2081 typedef DebugDumpResponse TableType;
2082 bool success;
2083 uint32_t data_count;
2084 DebugDumpResponseT()
2085 : success(false),
2086 data_count(0) {
2087 }
2088 };
2089
2090 struct DebugDumpResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2091 typedef DebugDumpResponseT NativeTableType;
2092 typedef DebugDumpResponseBuilder Builder;
2093 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2094 VT_SUCCESS = 4,
2095 VT_DATA_COUNT = 6
2096 };
2097 /// true if the request was accepted and a dump was performed, false if it was
2098 /// rejected or failed to complete for some reason
2099 bool success() const {
2100 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
2101 }
2102 bool mutate_success(bool _success) {
2103 return SetField<uint8_t>(VT_SUCCESS, static_cast<uint8_t>(_success), 0);
2104 }
2105 /// The number of DebugDumpData messages sent in this session
2106 uint32_t data_count() const {
2107 return GetField<uint32_t>(VT_DATA_COUNT, 0);
2108 }
2109 bool mutate_data_count(uint32_t _data_count) {
2110 return SetField<uint32_t>(VT_DATA_COUNT, _data_count, 0);
2111 }
2112 bool Verify(flatbuffers::Verifier &verifier) const {
2113 return VerifyTableStart(verifier) &&
2114 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
2115 VerifyField<uint32_t>(verifier, VT_DATA_COUNT) &&
2116 verifier.EndTable();
2117 }
2118 DebugDumpResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2119 void UnPackTo(DebugDumpResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2120 static flatbuffers::Offset<DebugDumpResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2121 };
2122
2123 struct DebugDumpResponseBuilder {
2124 typedef DebugDumpResponse Table;
2125 flatbuffers::FlatBufferBuilder &fbb_;
2126 flatbuffers::uoffset_t start_;
2127 void add_success(bool success) {
2128 fbb_.AddElement<uint8_t>(DebugDumpResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
2129 }
2130 void add_data_count(uint32_t data_count) {
2131 fbb_.AddElement<uint32_t>(DebugDumpResponse::VT_DATA_COUNT, data_count, 0);
2132 }
2133 explicit DebugDumpResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2134 : fbb_(_fbb) {
2135 start_ = fbb_.StartTable();
2136 }
2137 DebugDumpResponseBuilder &operator=(const DebugDumpResponseBuilder &);
2138 flatbuffers::Offset<DebugDumpResponse> Finish() {
2139 const auto end = fbb_.EndTable(start_);
2140 auto o = flatbuffers::Offset<DebugDumpResponse>(end);
2141 return o;
2142 }
2143 };
2144
2145 inline flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(
2146 flatbuffers::FlatBufferBuilder &_fbb,
2147 bool success = false,
2148 uint32_t data_count = 0) {
2149 DebugDumpResponseBuilder builder_(_fbb);
2150 builder_.add_data_count(data_count);
2151 builder_.add_success(success);
2152 return builder_.Finish();
2153 }
2154
2155 flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2156
2157 struct TimeSyncRequestT : public flatbuffers::NativeTable {
2158 typedef TimeSyncRequest TableType;
2159 TimeSyncRequestT() {
2160 }
2161 };
2162
2163 /// A request from CHRE for host to initiate a time sync message
2164 /// (system feature, platform-specific - not all platforms necessarily use this)
2165 struct TimeSyncRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2166 typedef TimeSyncRequestT NativeTableType;
2167 typedef TimeSyncRequestBuilder Builder;
2168 bool Verify(flatbuffers::Verifier &verifier) const {
2169 return VerifyTableStart(verifier) &&
2170 verifier.EndTable();
2171 }
2172 TimeSyncRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2173 void UnPackTo(TimeSyncRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2174 static flatbuffers::Offset<TimeSyncRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2175 };
2176
2177 struct TimeSyncRequestBuilder {
2178 typedef TimeSyncRequest Table;
2179 flatbuffers::FlatBufferBuilder &fbb_;
2180 flatbuffers::uoffset_t start_;
2181 explicit TimeSyncRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2182 : fbb_(_fbb) {
2183 start_ = fbb_.StartTable();
2184 }
2185 TimeSyncRequestBuilder &operator=(const TimeSyncRequestBuilder &);
2186 flatbuffers::Offset<TimeSyncRequest> Finish() {
2187 const auto end = fbb_.EndTable(start_);
2188 auto o = flatbuffers::Offset<TimeSyncRequest>(end);
2189 return o;
2190 }
2191 };
2192
2193 inline flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(
2194 flatbuffers::FlatBufferBuilder &_fbb) {
2195 TimeSyncRequestBuilder builder_(_fbb);
2196 return builder_.Finish();
2197 }
2198
2199 flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2200
2201 struct LowPowerMicAccessRequestT : public flatbuffers::NativeTable {
2202 typedef LowPowerMicAccessRequest TableType;
2203 LowPowerMicAccessRequestT() {
2204 }
2205 };
2206
2207 /// Request from CHRE to enable direct access to data from the low-power
2208 /// microphone. On some systems, coordination via the AP (e.g. with
2209 /// SoundTrigger HAL) is needed to ensure this capability is powered up when
2210 /// CHRE needs it. The host does not send a response.
2211 struct LowPowerMicAccessRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2212 typedef LowPowerMicAccessRequestT NativeTableType;
2213 typedef LowPowerMicAccessRequestBuilder Builder;
2214 bool Verify(flatbuffers::Verifier &verifier) const {
2215 return VerifyTableStart(verifier) &&
2216 verifier.EndTable();
2217 }
2218 LowPowerMicAccessRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2219 void UnPackTo(LowPowerMicAccessRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2220 static flatbuffers::Offset<LowPowerMicAccessRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2221 };
2222
2223 struct LowPowerMicAccessRequestBuilder {
2224 typedef LowPowerMicAccessRequest Table;
2225 flatbuffers::FlatBufferBuilder &fbb_;
2226 flatbuffers::uoffset_t start_;
2227 explicit LowPowerMicAccessRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2228 : fbb_(_fbb) {
2229 start_ = fbb_.StartTable();
2230 }
2231 LowPowerMicAccessRequestBuilder &operator=(const LowPowerMicAccessRequestBuilder &);
2232 flatbuffers::Offset<LowPowerMicAccessRequest> Finish() {
2233 const auto end = fbb_.EndTable(start_);
2234 auto o = flatbuffers::Offset<LowPowerMicAccessRequest>(end);
2235 return o;
2236 }
2237 };
2238
2239 inline flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(
2240 flatbuffers::FlatBufferBuilder &_fbb) {
2241 LowPowerMicAccessRequestBuilder builder_(_fbb);
2242 return builder_.Finish();
2243 }
2244
2245 flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2246
2247 struct LowPowerMicAccessReleaseT : public flatbuffers::NativeTable {
2248 typedef LowPowerMicAccessRelease TableType;
2249 LowPowerMicAccessReleaseT() {
2250 }
2251 };
2252
2253 /// Notification from CHRE that it no longer needs direct access to low-power
2254 /// microphone data.
2255 struct LowPowerMicAccessRelease FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2256 typedef LowPowerMicAccessReleaseT NativeTableType;
2257 typedef LowPowerMicAccessReleaseBuilder Builder;
2258 bool Verify(flatbuffers::Verifier &verifier) const {
2259 return VerifyTableStart(verifier) &&
2260 verifier.EndTable();
2261 }
2262 LowPowerMicAccessReleaseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2263 void UnPackTo(LowPowerMicAccessReleaseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2264 static flatbuffers::Offset<LowPowerMicAccessRelease> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2265 };
2266
2267 struct LowPowerMicAccessReleaseBuilder {
2268 typedef LowPowerMicAccessRelease Table;
2269 flatbuffers::FlatBufferBuilder &fbb_;
2270 flatbuffers::uoffset_t start_;
2271 explicit LowPowerMicAccessReleaseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2272 : fbb_(_fbb) {
2273 start_ = fbb_.StartTable();
2274 }
2275 LowPowerMicAccessReleaseBuilder &operator=(const LowPowerMicAccessReleaseBuilder &);
2276 flatbuffers::Offset<LowPowerMicAccessRelease> Finish() {
2277 const auto end = fbb_.EndTable(start_);
2278 auto o = flatbuffers::Offset<LowPowerMicAccessRelease>(end);
2279 return o;
2280 }
2281 };
2282
2283 inline flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(
2284 flatbuffers::FlatBufferBuilder &_fbb) {
2285 LowPowerMicAccessReleaseBuilder builder_(_fbb);
2286 return builder_.Finish();
2287 }
2288
2289 flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2290
2291 struct SettingChangeMessageT : public flatbuffers::NativeTable {
2292 typedef SettingChangeMessage TableType;
2293 chre::fbs::Setting setting;
2294 chre::fbs::SettingState state;
2295 SettingChangeMessageT()
2296 : setting(chre::fbs::Setting::LOCATION),
2297 state(chre::fbs::SettingState::DISABLED) {
2298 }
2299 };
2300
2301 /// Notification from the host that a system setting has changed
2302 struct SettingChangeMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2303 typedef SettingChangeMessageT NativeTableType;
2304 typedef SettingChangeMessageBuilder Builder;
2305 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2306 VT_SETTING = 4,
2307 VT_STATE = 6
2308 };
2309 /// The setting that has changed
2310 chre::fbs::Setting setting() const {
2311 return static_cast<chre::fbs::Setting>(GetField<int8_t>(VT_SETTING, 0));
2312 }
2313 bool mutate_setting(chre::fbs::Setting _setting) {
2314 return SetField<int8_t>(VT_SETTING, static_cast<int8_t>(_setting), 0);
2315 }
2316 /// The new setting value
2317 chre::fbs::SettingState state() const {
2318 return static_cast<chre::fbs::SettingState>(GetField<int8_t>(VT_STATE, 0));
2319 }
2320 bool mutate_state(chre::fbs::SettingState _state) {
2321 return SetField<int8_t>(VT_STATE, static_cast<int8_t>(_state), 0);
2322 }
2323 bool Verify(flatbuffers::Verifier &verifier) const {
2324 return VerifyTableStart(verifier) &&
2325 VerifyField<int8_t>(verifier, VT_SETTING) &&
2326 VerifyField<int8_t>(verifier, VT_STATE) &&
2327 verifier.EndTable();
2328 }
2329 SettingChangeMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2330 void UnPackTo(SettingChangeMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2331 static flatbuffers::Offset<SettingChangeMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SettingChangeMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2332 };
2333
2334 struct SettingChangeMessageBuilder {
2335 typedef SettingChangeMessage Table;
2336 flatbuffers::FlatBufferBuilder &fbb_;
2337 flatbuffers::uoffset_t start_;
2338 void add_setting(chre::fbs::Setting setting) {
2339 fbb_.AddElement<int8_t>(SettingChangeMessage::VT_SETTING, static_cast<int8_t>(setting), 0);
2340 }
2341 void add_state(chre::fbs::SettingState state) {
2342 fbb_.AddElement<int8_t>(SettingChangeMessage::VT_STATE, static_cast<int8_t>(state), 0);
2343 }
2344 explicit SettingChangeMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2345 : fbb_(_fbb) {
2346 start_ = fbb_.StartTable();
2347 }
2348 SettingChangeMessageBuilder &operator=(const SettingChangeMessageBuilder &);
2349 flatbuffers::Offset<SettingChangeMessage> Finish() {
2350 const auto end = fbb_.EndTable(start_);
2351 auto o = flatbuffers::Offset<SettingChangeMessage>(end);
2352 return o;
2353 }
2354 };
2355
2356 inline flatbuffers::Offset<SettingChangeMessage> CreateSettingChangeMessage(
2357 flatbuffers::FlatBufferBuilder &_fbb,
2358 chre::fbs::Setting setting = chre::fbs::Setting::LOCATION,
2359 chre::fbs::SettingState state = chre::fbs::SettingState::DISABLED) {
2360 SettingChangeMessageBuilder builder_(_fbb);
2361 builder_.add_state(state);
2362 builder_.add_setting(setting);
2363 return builder_.Finish();
2364 }
2365
2366 flatbuffers::Offset<SettingChangeMessage> CreateSettingChangeMessage(flatbuffers::FlatBufferBuilder &_fbb, const SettingChangeMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2367
2368 struct LogMessageV2T : public flatbuffers::NativeTable {
2369 typedef LogMessageV2 TableType;
2370 std::vector<int8_t> buffer;
2371 uint32_t num_logs_dropped;
2372 LogMessageV2T()
2373 : num_logs_dropped(0) {
2374 }
2375 };
2376
2377 /// Represents V2 log messages from CHRE.
2378 struct LogMessageV2 FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2379 typedef LogMessageV2T NativeTableType;
2380 typedef LogMessageV2Builder Builder;
2381 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2382 VT_BUFFER = 4,
2383 VT_NUM_LOGS_DROPPED = 6
2384 };
2385 /// A buffer containing formatted log data. A flat array is used here to avoid
2386 /// overhead in serializing and deserializing. The format is as follows:
2387 ///
2388 /// uint8_t - LogBuffer log level (1 = error, 2 = warn,
2389 /// 3 = info, 4 = debug,
2390 /// 5 = verbose)
2391 /// uint32_t, little-endian - timestamp in milliseconds
2392 /// char[] - message to log
2393 /// char, \0 - null-terminator
2394 ///
2395 /// This pattern repeats until the end of the buffer for multiple log
2396 /// messages. The last byte will always be a null-terminator. There are no
2397 /// padding bytes between these fields. Treat this like a packed struct and be
2398 /// cautious with unaligned access when reading/writing this buffer.
2399 const flatbuffers::Vector<int8_t> *buffer() const {
2400 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_BUFFER);
2401 }
2402 flatbuffers::Vector<int8_t> *mutable_buffer() {
2403 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_BUFFER);
2404 }
2405 /// The number of logs dropped since CHRE started
2406 uint32_t num_logs_dropped() const {
2407 return GetField<uint32_t>(VT_NUM_LOGS_DROPPED, 0);
2408 }
2409 bool mutate_num_logs_dropped(uint32_t _num_logs_dropped) {
2410 return SetField<uint32_t>(VT_NUM_LOGS_DROPPED, _num_logs_dropped, 0);
2411 }
2412 bool Verify(flatbuffers::Verifier &verifier) const {
2413 return VerifyTableStart(verifier) &&
2414 VerifyOffset(verifier, VT_BUFFER) &&
2415 verifier.VerifyVector(buffer()) &&
2416 VerifyField<uint32_t>(verifier, VT_NUM_LOGS_DROPPED) &&
2417 verifier.EndTable();
2418 }
2419 LogMessageV2T *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2420 void UnPackTo(LogMessageV2T *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2421 static flatbuffers::Offset<LogMessageV2> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageV2T* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2422 };
2423
2424 struct LogMessageV2Builder {
2425 typedef LogMessageV2 Table;
2426 flatbuffers::FlatBufferBuilder &fbb_;
2427 flatbuffers::uoffset_t start_;
2428 void add_buffer(flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer) {
2429 fbb_.AddOffset(LogMessageV2::VT_BUFFER, buffer);
2430 }
2431 void add_num_logs_dropped(uint32_t num_logs_dropped) {
2432 fbb_.AddElement<uint32_t>(LogMessageV2::VT_NUM_LOGS_DROPPED, num_logs_dropped, 0);
2433 }
2434 explicit LogMessageV2Builder(flatbuffers::FlatBufferBuilder &_fbb)
2435 : fbb_(_fbb) {
2436 start_ = fbb_.StartTable();
2437 }
2438 LogMessageV2Builder &operator=(const LogMessageV2Builder &);
2439 flatbuffers::Offset<LogMessageV2> Finish() {
2440 const auto end = fbb_.EndTable(start_);
2441 auto o = flatbuffers::Offset<LogMessageV2>(end);
2442 return o;
2443 }
2444 };
2445
2446 inline flatbuffers::Offset<LogMessageV2> CreateLogMessageV2(
2447 flatbuffers::FlatBufferBuilder &_fbb,
2448 flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0,
2449 uint32_t num_logs_dropped = 0) {
2450 LogMessageV2Builder builder_(_fbb);
2451 builder_.add_num_logs_dropped(num_logs_dropped);
2452 builder_.add_buffer(buffer);
2453 return builder_.Finish();
2454 }
2455
2456 inline flatbuffers::Offset<LogMessageV2> CreateLogMessageV2Direct(
2457 flatbuffers::FlatBufferBuilder &_fbb,
2458 const std::vector<int8_t> *buffer = nullptr,
2459 uint32_t num_logs_dropped = 0) {
2460 auto buffer__ = buffer ? _fbb.CreateVector<int8_t>(*buffer) : 0;
2461 return chre::fbs::CreateLogMessageV2(
2462 _fbb,
2463 buffer__,
2464 num_logs_dropped);
2465 }
2466
2467 flatbuffers::Offset<LogMessageV2> CreateLogMessageV2(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageV2T *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2468
2469 struct SelfTestRequestT : public flatbuffers::NativeTable {
2470 typedef SelfTestRequest TableType;
2471 SelfTestRequestT() {
2472 }
2473 };
2474
2475 struct SelfTestRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2476 typedef SelfTestRequestT NativeTableType;
2477 typedef SelfTestRequestBuilder Builder;
2478 bool Verify(flatbuffers::Verifier &verifier) const {
2479 return VerifyTableStart(verifier) &&
2480 verifier.EndTable();
2481 }
2482 SelfTestRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2483 void UnPackTo(SelfTestRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2484 static flatbuffers::Offset<SelfTestRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2485 };
2486
2487 struct SelfTestRequestBuilder {
2488 typedef SelfTestRequest Table;
2489 flatbuffers::FlatBufferBuilder &fbb_;
2490 flatbuffers::uoffset_t start_;
2491 explicit SelfTestRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2492 : fbb_(_fbb) {
2493 start_ = fbb_.StartTable();
2494 }
2495 SelfTestRequestBuilder &operator=(const SelfTestRequestBuilder &);
2496 flatbuffers::Offset<SelfTestRequest> Finish() {
2497 const auto end = fbb_.EndTable(start_);
2498 auto o = flatbuffers::Offset<SelfTestRequest>(end);
2499 return o;
2500 }
2501 };
2502
2503 inline flatbuffers::Offset<SelfTestRequest> CreateSelfTestRequest(
2504 flatbuffers::FlatBufferBuilder &_fbb) {
2505 SelfTestRequestBuilder builder_(_fbb);
2506 return builder_.Finish();
2507 }
2508
2509 flatbuffers::Offset<SelfTestRequest> CreateSelfTestRequest(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2510
2511 struct SelfTestResponseT : public flatbuffers::NativeTable {
2512 typedef SelfTestResponse TableType;
2513 bool success;
2514 SelfTestResponseT()
2515 : success(false) {
2516 }
2517 };
2518
2519 struct SelfTestResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2520 typedef SelfTestResponseT NativeTableType;
2521 typedef SelfTestResponseBuilder Builder;
2522 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2523 VT_SUCCESS = 4
2524 };
2525 bool success() const {
2526 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
2527 }
2528 bool mutate_success(bool _success) {
2529 return SetField<uint8_t>(VT_SUCCESS, static_cast<uint8_t>(_success), 0);
2530 }
2531 bool Verify(flatbuffers::Verifier &verifier) const {
2532 return VerifyTableStart(verifier) &&
2533 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
2534 verifier.EndTable();
2535 }
2536 SelfTestResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2537 void UnPackTo(SelfTestResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2538 static flatbuffers::Offset<SelfTestResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2539 };
2540
2541 struct SelfTestResponseBuilder {
2542 typedef SelfTestResponse Table;
2543 flatbuffers::FlatBufferBuilder &fbb_;
2544 flatbuffers::uoffset_t start_;
2545 void add_success(bool success) {
2546 fbb_.AddElement<uint8_t>(SelfTestResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
2547 }
2548 explicit SelfTestResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2549 : fbb_(_fbb) {
2550 start_ = fbb_.StartTable();
2551 }
2552 SelfTestResponseBuilder &operator=(const SelfTestResponseBuilder &);
2553 flatbuffers::Offset<SelfTestResponse> Finish() {
2554 const auto end = fbb_.EndTable(start_);
2555 auto o = flatbuffers::Offset<SelfTestResponse>(end);
2556 return o;
2557 }
2558 };
2559
2560 inline flatbuffers::Offset<SelfTestResponse> CreateSelfTestResponse(
2561 flatbuffers::FlatBufferBuilder &_fbb,
2562 bool success = false) {
2563 SelfTestResponseBuilder builder_(_fbb);
2564 builder_.add_success(success);
2565 return builder_.Finish();
2566 }
2567
2568 flatbuffers::Offset<SelfTestResponse> CreateSelfTestResponse(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2569
2570 struct MessageContainerT : public flatbuffers::NativeTable {
2571 typedef MessageContainer TableType;
2572 chre::fbs::ChreMessageUnion message;
2573 std::unique_ptr<chre::fbs::HostAddress> host_addr;
2574 MessageContainerT() {
2575 }
2576 };
2577
2578 /// The top-level container that encapsulates all possible messages. Note that
2579 /// per FlatBuffers requirements, we can't use a union as the top-level
2580 /// structure (root type), so we must wrap it in a table.
2581 struct MessageContainer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
2582 typedef MessageContainerT NativeTableType;
2583 typedef MessageContainerBuilder Builder;
2584 enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
2585 VT_MESSAGE_TYPE = 4,
2586 VT_MESSAGE = 6,
2587 VT_HOST_ADDR = 8
2588 };
2589 chre::fbs::ChreMessage message_type() const {
2590 return static_cast<chre::fbs::ChreMessage>(GetField<uint8_t>(VT_MESSAGE_TYPE, 0));
2591 }
2592 const void *message() const {
2593 return GetPointer<const void *>(VT_MESSAGE);
2594 }
2595 template<typename T> const T *message_as() const;
2596 const chre::fbs::NanoappMessage *message_as_NanoappMessage() const {
2597 return message_type() == chre::fbs::ChreMessage::NanoappMessage ? static_cast<const chre::fbs::NanoappMessage *>(message()) : nullptr;
2598 }
2599 const chre::fbs::HubInfoRequest *message_as_HubInfoRequest() const {
2600 return message_type() == chre::fbs::ChreMessage::HubInfoRequest ? static_cast<const chre::fbs::HubInfoRequest *>(message()) : nullptr;
2601 }
2602 const chre::fbs::HubInfoResponse *message_as_HubInfoResponse() const {
2603 return message_type() == chre::fbs::ChreMessage::HubInfoResponse ? static_cast<const chre::fbs::HubInfoResponse *>(message()) : nullptr;
2604 }
2605 const chre::fbs::NanoappListRequest *message_as_NanoappListRequest() const {
2606 return message_type() == chre::fbs::ChreMessage::NanoappListRequest ? static_cast<const chre::fbs::NanoappListRequest *>(message()) : nullptr;
2607 }
2608 const chre::fbs::NanoappListResponse *message_as_NanoappListResponse() const {
2609 return message_type() == chre::fbs::ChreMessage::NanoappListResponse ? static_cast<const chre::fbs::NanoappListResponse *>(message()) : nullptr;
2610 }
2611 const chre::fbs::LoadNanoappRequest *message_as_LoadNanoappRequest() const {
2612 return message_type() == chre::fbs::ChreMessage::LoadNanoappRequest ? static_cast<const chre::fbs::LoadNanoappRequest *>(message()) : nullptr;
2613 }
2614 const chre::fbs::LoadNanoappResponse *message_as_LoadNanoappResponse() const {
2615 return message_type() == chre::fbs::ChreMessage::LoadNanoappResponse ? static_cast<const chre::fbs::LoadNanoappResponse *>(message()) : nullptr;
2616 }
2617 const chre::fbs::UnloadNanoappRequest *message_as_UnloadNanoappRequest() const {
2618 return message_type() == chre::fbs::ChreMessage::UnloadNanoappRequest ? static_cast<const chre::fbs::UnloadNanoappRequest *>(message()) : nullptr;
2619 }
2620 const chre::fbs::UnloadNanoappResponse *message_as_UnloadNanoappResponse() const {
2621 return message_type() == chre::fbs::ChreMessage::UnloadNanoappResponse ? static_cast<const chre::fbs::UnloadNanoappResponse *>(message()) : nullptr;
2622 }
2623 const chre::fbs::LogMessage *message_as_LogMessage() const {
2624 return message_type() == chre::fbs::ChreMessage::LogMessage ? static_cast<const chre::fbs::LogMessage *>(message()) : nullptr;
2625 }
2626 const chre::fbs::TimeSyncMessage *message_as_TimeSyncMessage() const {
2627 return message_type() == chre::fbs::ChreMessage::TimeSyncMessage ? static_cast<const chre::fbs::TimeSyncMessage *>(message()) : nullptr;
2628 }
2629 const chre::fbs::DebugDumpRequest *message_as_DebugDumpRequest() const {
2630 return message_type() == chre::fbs::ChreMessage::DebugDumpRequest ? static_cast<const chre::fbs::DebugDumpRequest *>(message()) : nullptr;
2631 }
2632 const chre::fbs::DebugDumpData *message_as_DebugDumpData() const {
2633 return message_type() == chre::fbs::ChreMessage::DebugDumpData ? static_cast<const chre::fbs::DebugDumpData *>(message()) : nullptr;
2634 }
2635 const chre::fbs::DebugDumpResponse *message_as_DebugDumpResponse() const {
2636 return message_type() == chre::fbs::ChreMessage::DebugDumpResponse ? static_cast<const chre::fbs::DebugDumpResponse *>(message()) : nullptr;
2637 }
2638 const chre::fbs::TimeSyncRequest *message_as_TimeSyncRequest() const {
2639 return message_type() == chre::fbs::ChreMessage::TimeSyncRequest ? static_cast<const chre::fbs::TimeSyncRequest *>(message()) : nullptr;
2640 }
2641 const chre::fbs::LowPowerMicAccessRequest *message_as_LowPowerMicAccessRequest() const {
2642 return message_type() == chre::fbs::ChreMessage::LowPowerMicAccessRequest ? static_cast<const chre::fbs::LowPowerMicAccessRequest *>(message()) : nullptr;
2643 }
2644 const chre::fbs::LowPowerMicAccessRelease *message_as_LowPowerMicAccessRelease() const {
2645 return message_type() == chre::fbs::ChreMessage::LowPowerMicAccessRelease ? static_cast<const chre::fbs::LowPowerMicAccessRelease *>(message()) : nullptr;
2646 }
2647 const chre::fbs::SettingChangeMessage *message_as_SettingChangeMessage() const {
2648 return message_type() == chre::fbs::ChreMessage::SettingChangeMessage ? static_cast<const chre::fbs::SettingChangeMessage *>(message()) : nullptr;
2649 }
2650 const chre::fbs::LogMessageV2 *message_as_LogMessageV2() const {
2651 return message_type() == chre::fbs::ChreMessage::LogMessageV2 ? static_cast<const chre::fbs::LogMessageV2 *>(message()) : nullptr;
2652 }
2653 const chre::fbs::SelfTestRequest *message_as_SelfTestRequest() const {
2654 return message_type() == chre::fbs::ChreMessage::SelfTestRequest ? static_cast<const chre::fbs::SelfTestRequest *>(message()) : nullptr;
2655 }
2656 const chre::fbs::SelfTestResponse *message_as_SelfTestResponse() const {
2657 return message_type() == chre::fbs::ChreMessage::SelfTestResponse ? static_cast<const chre::fbs::SelfTestResponse *>(message()) : nullptr;
2658 }
2659 void *mutable_message() {
2660 return GetPointer<void *>(VT_MESSAGE);
2661 }
2662 /// The originating or destination client ID on the host side, used to direct
2663 /// responses only to the client that sent the request. Although initially
2664 /// populated by the requesting client, this is enforced to be the correct
2665 /// value by the entity guarding access to CHRE.
2666 /// This is wrapped in a struct to ensure that it is always included when
2667 /// encoding the message, so it can be mutated by the host daemon.
2668 const chre::fbs::HostAddress *host_addr() const {
2669 return GetStruct<const chre::fbs::HostAddress *>(VT_HOST_ADDR);
2670 }
2671 chre::fbs::HostAddress *mutable_host_addr() {
2672 return GetStruct<chre::fbs::HostAddress *>(VT_HOST_ADDR);
2673 }
2674 bool Verify(flatbuffers::Verifier &verifier) const {
2675 return VerifyTableStart(verifier) &&
2676 VerifyField<uint8_t>(verifier, VT_MESSAGE_TYPE) &&
2677 VerifyOffsetRequired(verifier, VT_MESSAGE) &&
2678 VerifyChreMessage(verifier, message(), message_type()) &&
2679 VerifyFieldRequired<chre::fbs::HostAddress>(verifier, VT_HOST_ADDR) &&
2680 verifier.EndTable();
2681 }
2682 MessageContainerT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2683 void UnPackTo(MessageContainerT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
2684 static flatbuffers::Offset<MessageContainer> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2685 };
2686
2687 template<> inline const chre::fbs::NanoappMessage *MessageContainer::message_as<chre::fbs::NanoappMessage>() const {
2688 return message_as_NanoappMessage();
2689 }
2690
2691 template<> inline const chre::fbs::HubInfoRequest *MessageContainer::message_as<chre::fbs::HubInfoRequest>() const {
2692 return message_as_HubInfoRequest();
2693 }
2694
2695 template<> inline const chre::fbs::HubInfoResponse *MessageContainer::message_as<chre::fbs::HubInfoResponse>() const {
2696 return message_as_HubInfoResponse();
2697 }
2698
2699 template<> inline const chre::fbs::NanoappListRequest *MessageContainer::message_as<chre::fbs::NanoappListRequest>() const {
2700 return message_as_NanoappListRequest();
2701 }
2702
2703 template<> inline const chre::fbs::NanoappListResponse *MessageContainer::message_as<chre::fbs::NanoappListResponse>() const {
2704 return message_as_NanoappListResponse();
2705 }
2706
2707 template<> inline const chre::fbs::LoadNanoappRequest *MessageContainer::message_as<chre::fbs::LoadNanoappRequest>() const {
2708 return message_as_LoadNanoappRequest();
2709 }
2710
2711 template<> inline const chre::fbs::LoadNanoappResponse *MessageContainer::message_as<chre::fbs::LoadNanoappResponse>() const {
2712 return message_as_LoadNanoappResponse();
2713 }
2714
2715 template<> inline const chre::fbs::UnloadNanoappRequest *MessageContainer::message_as<chre::fbs::UnloadNanoappRequest>() const {
2716 return message_as_UnloadNanoappRequest();
2717 }
2718
2719 template<> inline const chre::fbs::UnloadNanoappResponse *MessageContainer::message_as<chre::fbs::UnloadNanoappResponse>() const {
2720 return message_as_UnloadNanoappResponse();
2721 }
2722
2723 template<> inline const chre::fbs::LogMessage *MessageContainer::message_as<chre::fbs::LogMessage>() const {
2724 return message_as_LogMessage();
2725 }
2726
2727 template<> inline const chre::fbs::TimeSyncMessage *MessageContainer::message_as<chre::fbs::TimeSyncMessage>() const {
2728 return message_as_TimeSyncMessage();
2729 }
2730
2731 template<> inline const chre::fbs::DebugDumpRequest *MessageContainer::message_as<chre::fbs::DebugDumpRequest>() const {
2732 return message_as_DebugDumpRequest();
2733 }
2734
2735 template<> inline const chre::fbs::DebugDumpData *MessageContainer::message_as<chre::fbs::DebugDumpData>() const {
2736 return message_as_DebugDumpData();
2737 }
2738
2739 template<> inline const chre::fbs::DebugDumpResponse *MessageContainer::message_as<chre::fbs::DebugDumpResponse>() const {
2740 return message_as_DebugDumpResponse();
2741 }
2742
2743 template<> inline const chre::fbs::TimeSyncRequest *MessageContainer::message_as<chre::fbs::TimeSyncRequest>() const {
2744 return message_as_TimeSyncRequest();
2745 }
2746
2747 template<> inline const chre::fbs::LowPowerMicAccessRequest *MessageContainer::message_as<chre::fbs::LowPowerMicAccessRequest>() const {
2748 return message_as_LowPowerMicAccessRequest();
2749 }
2750
2751 template<> inline const chre::fbs::LowPowerMicAccessRelease *MessageContainer::message_as<chre::fbs::LowPowerMicAccessRelease>() const {
2752 return message_as_LowPowerMicAccessRelease();
2753 }
2754
2755 template<> inline const chre::fbs::SettingChangeMessage *MessageContainer::message_as<chre::fbs::SettingChangeMessage>() const {
2756 return message_as_SettingChangeMessage();
2757 }
2758
2759 template<> inline const chre::fbs::LogMessageV2 *MessageContainer::message_as<chre::fbs::LogMessageV2>() const {
2760 return message_as_LogMessageV2();
2761 }
2762
2763 template<> inline const chre::fbs::SelfTestRequest *MessageContainer::message_as<chre::fbs::SelfTestRequest>() const {
2764 return message_as_SelfTestRequest();
2765 }
2766
2767 template<> inline const chre::fbs::SelfTestResponse *MessageContainer::message_as<chre::fbs::SelfTestResponse>() const {
2768 return message_as_SelfTestResponse();
2769 }
2770
2771 struct MessageContainerBuilder {
2772 typedef MessageContainer Table;
2773 flatbuffers::FlatBufferBuilder &fbb_;
2774 flatbuffers::uoffset_t start_;
2775 void add_message_type(chre::fbs::ChreMessage message_type) {
2776 fbb_.AddElement<uint8_t>(MessageContainer::VT_MESSAGE_TYPE, static_cast<uint8_t>(message_type), 0);
2777 }
2778 void add_message(flatbuffers::Offset<void> message) {
2779 fbb_.AddOffset(MessageContainer::VT_MESSAGE, message);
2780 }
2781 void add_host_addr(const chre::fbs::HostAddress *host_addr) {
2782 fbb_.AddStruct(MessageContainer::VT_HOST_ADDR, host_addr);
2783 }
2784 explicit MessageContainerBuilder(flatbuffers::FlatBufferBuilder &_fbb)
2785 : fbb_(_fbb) {
2786 start_ = fbb_.StartTable();
2787 }
2788 MessageContainerBuilder &operator=(const MessageContainerBuilder &);
2789 flatbuffers::Offset<MessageContainer> Finish() {
2790 const auto end = fbb_.EndTable(start_);
2791 auto o = flatbuffers::Offset<MessageContainer>(end);
2792 fbb_.Required(o, MessageContainer::VT_MESSAGE);
2793 fbb_.Required(o, MessageContainer::VT_HOST_ADDR);
2794 return o;
2795 }
2796 };
2797
2798 inline flatbuffers::Offset<MessageContainer> CreateMessageContainer(
2799 flatbuffers::FlatBufferBuilder &_fbb,
2800 chre::fbs::ChreMessage message_type = chre::fbs::ChreMessage::NONE,
2801 flatbuffers::Offset<void> message = 0,
2802 const chre::fbs::HostAddress *host_addr = 0) {
2803 MessageContainerBuilder builder_(_fbb);
2804 builder_.add_host_addr(host_addr);
2805 builder_.add_message(message);
2806 builder_.add_message_type(message_type);
2807 return builder_.Finish();
2808 }
2809
2810 flatbuffers::Offset<MessageContainer> CreateMessageContainer(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
2811
2812 inline NanoappMessageT *NanoappMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2813 std::unique_ptr<chre::fbs::NanoappMessageT> _o = std::unique_ptr<chre::fbs::NanoappMessageT>(new NanoappMessageT());
2814 UnPackTo(_o.get(), _resolver);
2815 return _o.release();
2816 }
2817
2818 inline void NanoappMessage::UnPackTo(NanoappMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2819 (void)_o;
2820 (void)_resolver;
2821 { auto _e = app_id(); _o->app_id = _e; }
2822 { auto _e = message_type(); _o->message_type = _e; }
2823 { auto _e = host_endpoint(); _o->host_endpoint = _e; }
2824 { auto _e = message(); if (_e) { _o->message.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->message[_i] = _e->Get(_i); } } }
2825 { auto _e = message_permissions(); _o->message_permissions = _e; }
2826 { auto _e = permissions(); _o->permissions = _e; }
2827 }
2828
2829 inline flatbuffers::Offset<NanoappMessage> NanoappMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2830 return CreateNanoappMessage(_fbb, _o, _rehasher);
2831 }
2832
2833 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2834 (void)_rehasher;
2835 (void)_o;
2836 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NanoappMessageT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2837 auto _app_id = _o->app_id;
2838 auto _message_type = _o->message_type;
2839 auto _host_endpoint = _o->host_endpoint;
2840 auto _message = _fbb.CreateVector(_o->message);
2841 auto _message_permissions = _o->message_permissions;
2842 auto _permissions = _o->permissions;
2843 return chre::fbs::CreateNanoappMessage(
2844 _fbb,
2845 _app_id,
2846 _message_type,
2847 _host_endpoint,
2848 _message,
2849 _message_permissions,
2850 _permissions);
2851 }
2852
2853 inline HubInfoRequestT *HubInfoRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2854 std::unique_ptr<chre::fbs::HubInfoRequestT> _o = std::unique_ptr<chre::fbs::HubInfoRequestT>(new HubInfoRequestT());
2855 UnPackTo(_o.get(), _resolver);
2856 return _o.release();
2857 }
2858
2859 inline void HubInfoRequest::UnPackTo(HubInfoRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2860 (void)_o;
2861 (void)_resolver;
2862 }
2863
2864 inline flatbuffers::Offset<HubInfoRequest> HubInfoRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2865 return CreateHubInfoRequest(_fbb, _o, _rehasher);
2866 }
2867
2868 inline flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2869 (void)_rehasher;
2870 (void)_o;
2871 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const HubInfoRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2872 return chre::fbs::CreateHubInfoRequest(
2873 _fbb);
2874 }
2875
2876 inline HubInfoResponseT *HubInfoResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2877 std::unique_ptr<chre::fbs::HubInfoResponseT> _o = std::unique_ptr<chre::fbs::HubInfoResponseT>(new HubInfoResponseT());
2878 UnPackTo(_o.get(), _resolver);
2879 return _o.release();
2880 }
2881
2882 inline void HubInfoResponse::UnPackTo(HubInfoResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2883 (void)_o;
2884 (void)_resolver;
2885 { auto _e = name(); if (_e) { _o->name.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->name[_i] = _e->Get(_i); } } }
2886 { auto _e = vendor(); if (_e) { _o->vendor.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vendor[_i] = _e->Get(_i); } } }
2887 { auto _e = toolchain(); if (_e) { _o->toolchain.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->toolchain[_i] = _e->Get(_i); } } }
2888 { auto _e = platform_version(); _o->platform_version = _e; }
2889 { auto _e = toolchain_version(); _o->toolchain_version = _e; }
2890 { auto _e = peak_mips(); _o->peak_mips = _e; }
2891 { auto _e = stopped_power(); _o->stopped_power = _e; }
2892 { auto _e = sleep_power(); _o->sleep_power = _e; }
2893 { auto _e = peak_power(); _o->peak_power = _e; }
2894 { auto _e = max_msg_len(); _o->max_msg_len = _e; }
2895 { auto _e = platform_id(); _o->platform_id = _e; }
2896 { auto _e = chre_platform_version(); _o->chre_platform_version = _e; }
2897 }
2898
2899 inline flatbuffers::Offset<HubInfoResponse> HubInfoResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2900 return CreateHubInfoResponse(_fbb, _o, _rehasher);
2901 }
2902
2903 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2904 (void)_rehasher;
2905 (void)_o;
2906 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const HubInfoResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2907 auto _name = _o->name.size() ? _fbb.CreateVector(_o->name) : 0;
2908 auto _vendor = _o->vendor.size() ? _fbb.CreateVector(_o->vendor) : 0;
2909 auto _toolchain = _o->toolchain.size() ? _fbb.CreateVector(_o->toolchain) : 0;
2910 auto _platform_version = _o->platform_version;
2911 auto _toolchain_version = _o->toolchain_version;
2912 auto _peak_mips = _o->peak_mips;
2913 auto _stopped_power = _o->stopped_power;
2914 auto _sleep_power = _o->sleep_power;
2915 auto _peak_power = _o->peak_power;
2916 auto _max_msg_len = _o->max_msg_len;
2917 auto _platform_id = _o->platform_id;
2918 auto _chre_platform_version = _o->chre_platform_version;
2919 return chre::fbs::CreateHubInfoResponse(
2920 _fbb,
2921 _name,
2922 _vendor,
2923 _toolchain,
2924 _platform_version,
2925 _toolchain_version,
2926 _peak_mips,
2927 _stopped_power,
2928 _sleep_power,
2929 _peak_power,
2930 _max_msg_len,
2931 _platform_id,
2932 _chre_platform_version);
2933 }
2934
2935 inline NanoappListRequestT *NanoappListRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2936 std::unique_ptr<chre::fbs::NanoappListRequestT> _o = std::unique_ptr<chre::fbs::NanoappListRequestT>(new NanoappListRequestT());
2937 UnPackTo(_o.get(), _resolver);
2938 return _o.release();
2939 }
2940
2941 inline void NanoappListRequest::UnPackTo(NanoappListRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2942 (void)_o;
2943 (void)_resolver;
2944 }
2945
2946 inline flatbuffers::Offset<NanoappListRequest> NanoappListRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2947 return CreateNanoappListRequest(_fbb, _o, _rehasher);
2948 }
2949
2950 inline flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2951 (void)_rehasher;
2952 (void)_o;
2953 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NanoappListRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2954 return chre::fbs::CreateNanoappListRequest(
2955 _fbb);
2956 }
2957
2958 inline NanoappListEntryT *NanoappListEntry::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2959 std::unique_ptr<chre::fbs::NanoappListEntryT> _o = std::unique_ptr<chre::fbs::NanoappListEntryT>(new NanoappListEntryT());
2960 UnPackTo(_o.get(), _resolver);
2961 return _o.release();
2962 }
2963
2964 inline void NanoappListEntry::UnPackTo(NanoappListEntryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2965 (void)_o;
2966 (void)_resolver;
2967 { auto _e = app_id(); _o->app_id = _e; }
2968 { auto _e = version(); _o->version = _e; }
2969 { auto _e = enabled(); _o->enabled = _e; }
2970 { auto _e = is_system(); _o->is_system = _e; }
2971 { auto _e = permissions(); _o->permissions = _e; }
2972 }
2973
2974 inline flatbuffers::Offset<NanoappListEntry> NanoappListEntry::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2975 return CreateNanoappListEntry(_fbb, _o, _rehasher);
2976 }
2977
2978 inline flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2979 (void)_rehasher;
2980 (void)_o;
2981 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NanoappListEntryT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
2982 auto _app_id = _o->app_id;
2983 auto _version = _o->version;
2984 auto _enabled = _o->enabled;
2985 auto _is_system = _o->is_system;
2986 auto _permissions = _o->permissions;
2987 return chre::fbs::CreateNanoappListEntry(
2988 _fbb,
2989 _app_id,
2990 _version,
2991 _enabled,
2992 _is_system,
2993 _permissions);
2994 }
2995
2996 inline NanoappListResponseT *NanoappListResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2997 std::unique_ptr<chre::fbs::NanoappListResponseT> _o = std::unique_ptr<chre::fbs::NanoappListResponseT>(new NanoappListResponseT());
2998 UnPackTo(_o.get(), _resolver);
2999 return _o.release();
3000 }
3001
3002 inline void NanoappListResponse::UnPackTo(NanoappListResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3003 (void)_o;
3004 (void)_resolver;
3005 { auto _e = nanoapps(); if (_e) { _o->nanoapps.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->nanoapps[_i] = std::unique_ptr<chre::fbs::NanoappListEntryT>(_e->Get(_i)->UnPack(_resolver)); } } }
3006 }
3007
3008 inline flatbuffers::Offset<NanoappListResponse> NanoappListResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3009 return CreateNanoappListResponse(_fbb, _o, _rehasher);
3010 }
3011
3012 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3013 (void)_rehasher;
3014 (void)_o;
3015 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const NanoappListResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3016 auto _nanoapps = _fbb.CreateVector<flatbuffers::Offset<chre::fbs::NanoappListEntry>> (_o->nanoapps.size(), [](size_t i, _VectorArgs *__va) { return CreateNanoappListEntry(*__va->__fbb, __va->__o->nanoapps[i].get(), __va->__rehasher); }, &_va );
3017 return chre::fbs::CreateNanoappListResponse(
3018 _fbb,
3019 _nanoapps);
3020 }
3021
3022 inline LoadNanoappRequestT *LoadNanoappRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3023 std::unique_ptr<chre::fbs::LoadNanoappRequestT> _o = std::unique_ptr<chre::fbs::LoadNanoappRequestT>(new LoadNanoappRequestT());
3024 UnPackTo(_o.get(), _resolver);
3025 return _o.release();
3026 }
3027
3028 inline void LoadNanoappRequest::UnPackTo(LoadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3029 (void)_o;
3030 (void)_resolver;
3031 { auto _e = transaction_id(); _o->transaction_id = _e; }
3032 { auto _e = app_id(); _o->app_id = _e; }
3033 { auto _e = app_version(); _o->app_version = _e; }
3034 { auto _e = target_api_version(); _o->target_api_version = _e; }
3035 { auto _e = app_binary(); if (_e) { _o->app_binary.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->app_binary[_i] = _e->Get(_i); } } }
3036 { auto _e = fragment_id(); _o->fragment_id = _e; }
3037 { auto _e = total_app_size(); _o->total_app_size = _e; }
3038 { auto _e = app_binary_file_name(); if (_e) { _o->app_binary_file_name.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->app_binary_file_name[_i] = _e->Get(_i); } } }
3039 { auto _e = app_flags(); _o->app_flags = _e; }
3040 { auto _e = respond_before_start(); _o->respond_before_start = _e; }
3041 }
3042
3043 inline flatbuffers::Offset<LoadNanoappRequest> LoadNanoappRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3044 return CreateLoadNanoappRequest(_fbb, _o, _rehasher);
3045 }
3046
3047 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3048 (void)_rehasher;
3049 (void)_o;
3050 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LoadNanoappRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3051 auto _transaction_id = _o->transaction_id;
3052 auto _app_id = _o->app_id;
3053 auto _app_version = _o->app_version;
3054 auto _target_api_version = _o->target_api_version;
3055 auto _app_binary = _fbb.CreateVector(_o->app_binary);
3056 auto _fragment_id = _o->fragment_id;
3057 auto _total_app_size = _o->total_app_size;
3058 auto _app_binary_file_name = _o->app_binary_file_name.size() ? _fbb.CreateVector(_o->app_binary_file_name) : 0;
3059 auto _app_flags = _o->app_flags;
3060 auto _respond_before_start = _o->respond_before_start;
3061 return chre::fbs::CreateLoadNanoappRequest(
3062 _fbb,
3063 _transaction_id,
3064 _app_id,
3065 _app_version,
3066 _target_api_version,
3067 _app_binary,
3068 _fragment_id,
3069 _total_app_size,
3070 _app_binary_file_name,
3071 _app_flags,
3072 _respond_before_start);
3073 }
3074
3075 inline LoadNanoappResponseT *LoadNanoappResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3076 std::unique_ptr<chre::fbs::LoadNanoappResponseT> _o = std::unique_ptr<chre::fbs::LoadNanoappResponseT>(new LoadNanoappResponseT());
3077 UnPackTo(_o.get(), _resolver);
3078 return _o.release();
3079 }
3080
3081 inline void LoadNanoappResponse::UnPackTo(LoadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3082 (void)_o;
3083 (void)_resolver;
3084 { auto _e = transaction_id(); _o->transaction_id = _e; }
3085 { auto _e = success(); _o->success = _e; }
3086 { auto _e = fragment_id(); _o->fragment_id = _e; }
3087 }
3088
3089 inline flatbuffers::Offset<LoadNanoappResponse> LoadNanoappResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3090 return CreateLoadNanoappResponse(_fbb, _o, _rehasher);
3091 }
3092
3093 inline flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3094 (void)_rehasher;
3095 (void)_o;
3096 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LoadNanoappResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3097 auto _transaction_id = _o->transaction_id;
3098 auto _success = _o->success;
3099 auto _fragment_id = _o->fragment_id;
3100 return chre::fbs::CreateLoadNanoappResponse(
3101 _fbb,
3102 _transaction_id,
3103 _success,
3104 _fragment_id);
3105 }
3106
3107 inline UnloadNanoappRequestT *UnloadNanoappRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3108 std::unique_ptr<chre::fbs::UnloadNanoappRequestT> _o = std::unique_ptr<chre::fbs::UnloadNanoappRequestT>(new UnloadNanoappRequestT());
3109 UnPackTo(_o.get(), _resolver);
3110 return _o.release();
3111 }
3112
3113 inline void UnloadNanoappRequest::UnPackTo(UnloadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3114 (void)_o;
3115 (void)_resolver;
3116 { auto _e = transaction_id(); _o->transaction_id = _e; }
3117 { auto _e = app_id(); _o->app_id = _e; }
3118 { auto _e = allow_system_nanoapp_unload(); _o->allow_system_nanoapp_unload = _e; }
3119 }
3120
3121 inline flatbuffers::Offset<UnloadNanoappRequest> UnloadNanoappRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3122 return CreateUnloadNanoappRequest(_fbb, _o, _rehasher);
3123 }
3124
3125 inline flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3126 (void)_rehasher;
3127 (void)_o;
3128 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const UnloadNanoappRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3129 auto _transaction_id = _o->transaction_id;
3130 auto _app_id = _o->app_id;
3131 auto _allow_system_nanoapp_unload = _o->allow_system_nanoapp_unload;
3132 return chre::fbs::CreateUnloadNanoappRequest(
3133 _fbb,
3134 _transaction_id,
3135 _app_id,
3136 _allow_system_nanoapp_unload);
3137 }
3138
3139 inline UnloadNanoappResponseT *UnloadNanoappResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3140 std::unique_ptr<chre::fbs::UnloadNanoappResponseT> _o = std::unique_ptr<chre::fbs::UnloadNanoappResponseT>(new UnloadNanoappResponseT());
3141 UnPackTo(_o.get(), _resolver);
3142 return _o.release();
3143 }
3144
3145 inline void UnloadNanoappResponse::UnPackTo(UnloadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3146 (void)_o;
3147 (void)_resolver;
3148 { auto _e = transaction_id(); _o->transaction_id = _e; }
3149 { auto _e = success(); _o->success = _e; }
3150 }
3151
3152 inline flatbuffers::Offset<UnloadNanoappResponse> UnloadNanoappResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3153 return CreateUnloadNanoappResponse(_fbb, _o, _rehasher);
3154 }
3155
3156 inline flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3157 (void)_rehasher;
3158 (void)_o;
3159 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const UnloadNanoappResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3160 auto _transaction_id = _o->transaction_id;
3161 auto _success = _o->success;
3162 return chre::fbs::CreateUnloadNanoappResponse(
3163 _fbb,
3164 _transaction_id,
3165 _success);
3166 }
3167
3168 inline LogMessageT *LogMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3169 std::unique_ptr<chre::fbs::LogMessageT> _o = std::unique_ptr<chre::fbs::LogMessageT>(new LogMessageT());
3170 UnPackTo(_o.get(), _resolver);
3171 return _o.release();
3172 }
3173
3174 inline void LogMessage::UnPackTo(LogMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3175 (void)_o;
3176 (void)_resolver;
3177 { auto _e = buffer(); if (_e) { _o->buffer.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->buffer[_i] = _e->Get(_i); } } }
3178 }
3179
3180 inline flatbuffers::Offset<LogMessage> LogMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3181 return CreateLogMessage(_fbb, _o, _rehasher);
3182 }
3183
3184 inline flatbuffers::Offset<LogMessage> CreateLogMessage(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3185 (void)_rehasher;
3186 (void)_o;
3187 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LogMessageT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3188 auto _buffer = _o->buffer.size() ? _fbb.CreateVector(_o->buffer) : 0;
3189 return chre::fbs::CreateLogMessage(
3190 _fbb,
3191 _buffer);
3192 }
3193
3194 inline TimeSyncMessageT *TimeSyncMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3195 std::unique_ptr<chre::fbs::TimeSyncMessageT> _o = std::unique_ptr<chre::fbs::TimeSyncMessageT>(new TimeSyncMessageT());
3196 UnPackTo(_o.get(), _resolver);
3197 return _o.release();
3198 }
3199
3200 inline void TimeSyncMessage::UnPackTo(TimeSyncMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3201 (void)_o;
3202 (void)_resolver;
3203 { auto _e = offset(); _o->offset = _e; }
3204 }
3205
3206 inline flatbuffers::Offset<TimeSyncMessage> TimeSyncMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3207 return CreateTimeSyncMessage(_fbb, _o, _rehasher);
3208 }
3209
3210 inline flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3211 (void)_rehasher;
3212 (void)_o;
3213 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TimeSyncMessageT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3214 auto _offset = _o->offset;
3215 return chre::fbs::CreateTimeSyncMessage(
3216 _fbb,
3217 _offset);
3218 }
3219
3220 inline DebugDumpRequestT *DebugDumpRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3221 std::unique_ptr<chre::fbs::DebugDumpRequestT> _o = std::unique_ptr<chre::fbs::DebugDumpRequestT>(new DebugDumpRequestT());
3222 UnPackTo(_o.get(), _resolver);
3223 return _o.release();
3224 }
3225
3226 inline void DebugDumpRequest::UnPackTo(DebugDumpRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3227 (void)_o;
3228 (void)_resolver;
3229 }
3230
3231 inline flatbuffers::Offset<DebugDumpRequest> DebugDumpRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3232 return CreateDebugDumpRequest(_fbb, _o, _rehasher);
3233 }
3234
3235 inline flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3236 (void)_rehasher;
3237 (void)_o;
3238 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DebugDumpRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3239 return chre::fbs::CreateDebugDumpRequest(
3240 _fbb);
3241 }
3242
3243 inline DebugDumpDataT *DebugDumpData::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3244 std::unique_ptr<chre::fbs::DebugDumpDataT> _o = std::unique_ptr<chre::fbs::DebugDumpDataT>(new DebugDumpDataT());
3245 UnPackTo(_o.get(), _resolver);
3246 return _o.release();
3247 }
3248
3249 inline void DebugDumpData::UnPackTo(DebugDumpDataT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3250 (void)_o;
3251 (void)_resolver;
3252 { auto _e = debug_str(); if (_e) { _o->debug_str.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->debug_str[_i] = _e->Get(_i); } } }
3253 }
3254
3255 inline flatbuffers::Offset<DebugDumpData> DebugDumpData::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3256 return CreateDebugDumpData(_fbb, _o, _rehasher);
3257 }
3258
3259 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3260 (void)_rehasher;
3261 (void)_o;
3262 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DebugDumpDataT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3263 auto _debug_str = _o->debug_str.size() ? _fbb.CreateVector(_o->debug_str) : 0;
3264 return chre::fbs::CreateDebugDumpData(
3265 _fbb,
3266 _debug_str);
3267 }
3268
3269 inline DebugDumpResponseT *DebugDumpResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3270 std::unique_ptr<chre::fbs::DebugDumpResponseT> _o = std::unique_ptr<chre::fbs::DebugDumpResponseT>(new DebugDumpResponseT());
3271 UnPackTo(_o.get(), _resolver);
3272 return _o.release();
3273 }
3274
3275 inline void DebugDumpResponse::UnPackTo(DebugDumpResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3276 (void)_o;
3277 (void)_resolver;
3278 { auto _e = success(); _o->success = _e; }
3279 { auto _e = data_count(); _o->data_count = _e; }
3280 }
3281
3282 inline flatbuffers::Offset<DebugDumpResponse> DebugDumpResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3283 return CreateDebugDumpResponse(_fbb, _o, _rehasher);
3284 }
3285
3286 inline flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3287 (void)_rehasher;
3288 (void)_o;
3289 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const DebugDumpResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3290 auto _success = _o->success;
3291 auto _data_count = _o->data_count;
3292 return chre::fbs::CreateDebugDumpResponse(
3293 _fbb,
3294 _success,
3295 _data_count);
3296 }
3297
3298 inline TimeSyncRequestT *TimeSyncRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3299 std::unique_ptr<chre::fbs::TimeSyncRequestT> _o = std::unique_ptr<chre::fbs::TimeSyncRequestT>(new TimeSyncRequestT());
3300 UnPackTo(_o.get(), _resolver);
3301 return _o.release();
3302 }
3303
3304 inline void TimeSyncRequest::UnPackTo(TimeSyncRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3305 (void)_o;
3306 (void)_resolver;
3307 }
3308
3309 inline flatbuffers::Offset<TimeSyncRequest> TimeSyncRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3310 return CreateTimeSyncRequest(_fbb, _o, _rehasher);
3311 }
3312
3313 inline flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3314 (void)_rehasher;
3315 (void)_o;
3316 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TimeSyncRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3317 return chre::fbs::CreateTimeSyncRequest(
3318 _fbb);
3319 }
3320
3321 inline LowPowerMicAccessRequestT *LowPowerMicAccessRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3322 std::unique_ptr<chre::fbs::LowPowerMicAccessRequestT> _o = std::unique_ptr<chre::fbs::LowPowerMicAccessRequestT>(new LowPowerMicAccessRequestT());
3323 UnPackTo(_o.get(), _resolver);
3324 return _o.release();
3325 }
3326
3327 inline void LowPowerMicAccessRequest::UnPackTo(LowPowerMicAccessRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3328 (void)_o;
3329 (void)_resolver;
3330 }
3331
3332 inline flatbuffers::Offset<LowPowerMicAccessRequest> LowPowerMicAccessRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3333 return CreateLowPowerMicAccessRequest(_fbb, _o, _rehasher);
3334 }
3335
3336 inline flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3337 (void)_rehasher;
3338 (void)_o;
3339 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LowPowerMicAccessRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3340 return chre::fbs::CreateLowPowerMicAccessRequest(
3341 _fbb);
3342 }
3343
3344 inline LowPowerMicAccessReleaseT *LowPowerMicAccessRelease::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3345 std::unique_ptr<chre::fbs::LowPowerMicAccessReleaseT> _o = std::unique_ptr<chre::fbs::LowPowerMicAccessReleaseT>(new LowPowerMicAccessReleaseT());
3346 UnPackTo(_o.get(), _resolver);
3347 return _o.release();
3348 }
3349
3350 inline void LowPowerMicAccessRelease::UnPackTo(LowPowerMicAccessReleaseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3351 (void)_o;
3352 (void)_resolver;
3353 }
3354
3355 inline flatbuffers::Offset<LowPowerMicAccessRelease> LowPowerMicAccessRelease::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3356 return CreateLowPowerMicAccessRelease(_fbb, _o, _rehasher);
3357 }
3358
3359 inline flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3360 (void)_rehasher;
3361 (void)_o;
3362 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LowPowerMicAccessReleaseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3363 return chre::fbs::CreateLowPowerMicAccessRelease(
3364 _fbb);
3365 }
3366
3367 inline SettingChangeMessageT *SettingChangeMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3368 std::unique_ptr<chre::fbs::SettingChangeMessageT> _o = std::unique_ptr<chre::fbs::SettingChangeMessageT>(new SettingChangeMessageT());
3369 UnPackTo(_o.get(), _resolver);
3370 return _o.release();
3371 }
3372
3373 inline void SettingChangeMessage::UnPackTo(SettingChangeMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3374 (void)_o;
3375 (void)_resolver;
3376 { auto _e = setting(); _o->setting = _e; }
3377 { auto _e = state(); _o->state = _e; }
3378 }
3379
3380 inline flatbuffers::Offset<SettingChangeMessage> SettingChangeMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SettingChangeMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3381 return CreateSettingChangeMessage(_fbb, _o, _rehasher);
3382 }
3383
3384 inline flatbuffers::Offset<SettingChangeMessage> CreateSettingChangeMessage(flatbuffers::FlatBufferBuilder &_fbb, const SettingChangeMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3385 (void)_rehasher;
3386 (void)_o;
3387 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SettingChangeMessageT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3388 auto _setting = _o->setting;
3389 auto _state = _o->state;
3390 return chre::fbs::CreateSettingChangeMessage(
3391 _fbb,
3392 _setting,
3393 _state);
3394 }
3395
3396 inline LogMessageV2T *LogMessageV2::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3397 std::unique_ptr<chre::fbs::LogMessageV2T> _o = std::unique_ptr<chre::fbs::LogMessageV2T>(new LogMessageV2T());
3398 UnPackTo(_o.get(), _resolver);
3399 return _o.release();
3400 }
3401
3402 inline void LogMessageV2::UnPackTo(LogMessageV2T *_o, const flatbuffers::resolver_function_t *_resolver) const {
3403 (void)_o;
3404 (void)_resolver;
3405 { auto _e = buffer(); if (_e) { _o->buffer.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->buffer[_i] = _e->Get(_i); } } }
3406 { auto _e = num_logs_dropped(); _o->num_logs_dropped = _e; }
3407 }
3408
3409 inline flatbuffers::Offset<LogMessageV2> LogMessageV2::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageV2T* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3410 return CreateLogMessageV2(_fbb, _o, _rehasher);
3411 }
3412
3413 inline flatbuffers::Offset<LogMessageV2> CreateLogMessageV2(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageV2T *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3414 (void)_rehasher;
3415 (void)_o;
3416 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const LogMessageV2T* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3417 auto _buffer = _o->buffer.size() ? _fbb.CreateVector(_o->buffer) : 0;
3418 auto _num_logs_dropped = _o->num_logs_dropped;
3419 return chre::fbs::CreateLogMessageV2(
3420 _fbb,
3421 _buffer,
3422 _num_logs_dropped);
3423 }
3424
3425 inline SelfTestRequestT *SelfTestRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3426 std::unique_ptr<chre::fbs::SelfTestRequestT> _o = std::unique_ptr<chre::fbs::SelfTestRequestT>(new SelfTestRequestT());
3427 UnPackTo(_o.get(), _resolver);
3428 return _o.release();
3429 }
3430
3431 inline void SelfTestRequest::UnPackTo(SelfTestRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3432 (void)_o;
3433 (void)_resolver;
3434 }
3435
3436 inline flatbuffers::Offset<SelfTestRequest> SelfTestRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3437 return CreateSelfTestRequest(_fbb, _o, _rehasher);
3438 }
3439
3440 inline flatbuffers::Offset<SelfTestRequest> CreateSelfTestRequest(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3441 (void)_rehasher;
3442 (void)_o;
3443 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SelfTestRequestT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3444 return chre::fbs::CreateSelfTestRequest(
3445 _fbb);
3446 }
3447
3448 inline SelfTestResponseT *SelfTestResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3449 std::unique_ptr<chre::fbs::SelfTestResponseT> _o = std::unique_ptr<chre::fbs::SelfTestResponseT>(new SelfTestResponseT());
3450 UnPackTo(_o.get(), _resolver);
3451 return _o.release();
3452 }
3453
3454 inline void SelfTestResponse::UnPackTo(SelfTestResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3455 (void)_o;
3456 (void)_resolver;
3457 { auto _e = success(); _o->success = _e; }
3458 }
3459
3460 inline flatbuffers::Offset<SelfTestResponse> SelfTestResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3461 return CreateSelfTestResponse(_fbb, _o, _rehasher);
3462 }
3463
3464 inline flatbuffers::Offset<SelfTestResponse> CreateSelfTestResponse(flatbuffers::FlatBufferBuilder &_fbb, const SelfTestResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3465 (void)_rehasher;
3466 (void)_o;
3467 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const SelfTestResponseT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3468 auto _success = _o->success;
3469 return chre::fbs::CreateSelfTestResponse(
3470 _fbb,
3471 _success);
3472 }
3473
3474 inline MessageContainerT *MessageContainer::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
3475 std::unique_ptr<chre::fbs::MessageContainerT> _o = std::unique_ptr<chre::fbs::MessageContainerT>(new MessageContainerT());
3476 UnPackTo(_o.get(), _resolver);
3477 return _o.release();
3478 }
3479
3480 inline void MessageContainer::UnPackTo(MessageContainerT *_o, const flatbuffers::resolver_function_t *_resolver) const {
3481 (void)_o;
3482 (void)_resolver;
3483 { auto _e = message_type(); _o->message.type = _e; }
3484 { auto _e = message(); if (_e) _o->message.value = chre::fbs::ChreMessageUnion::UnPack(_e, message_type(), _resolver); }
3485 { auto _e = host_addr(); if (_e) _o->host_addr = std::unique_ptr<chre::fbs::HostAddress>(new chre::fbs::HostAddress(*_e)); }
3486 }
3487
3488 inline flatbuffers::Offset<MessageContainer> MessageContainer::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
3489 return CreateMessageContainer(_fbb, _o, _rehasher);
3490 }
3491
3492 inline flatbuffers::Offset<MessageContainer> CreateMessageContainer(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
3493 (void)_rehasher;
3494 (void)_o;
3495 struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const MessageContainerT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
3496 auto _message_type = _o->message.type;
3497 auto _message = _o->message.Pack(_fbb);
3498 auto _host_addr = _o->host_addr ? _o->host_addr.get() : 0;
3499 return chre::fbs::CreateMessageContainer(
3500 _fbb,
3501 _message_type,
3502 _message,
3503 _host_addr);
3504 }
3505
3506 inline bool VerifyChreMessage(flatbuffers::Verifier &verifier, const void *obj, ChreMessage type) {
3507 switch (type) {
3508 case ChreMessage::NONE: {
3509 return true;
3510 }
3511 case ChreMessage::NanoappMessage: {
3512 auto ptr = reinterpret_cast<const chre::fbs::NanoappMessage *>(obj);
3513 return verifier.VerifyTable(ptr);
3514 }
3515 case ChreMessage::HubInfoRequest: {
3516 auto ptr = reinterpret_cast<const chre::fbs::HubInfoRequest *>(obj);
3517 return verifier.VerifyTable(ptr);
3518 }
3519 case ChreMessage::HubInfoResponse: {
3520 auto ptr = reinterpret_cast<const chre::fbs::HubInfoResponse *>(obj);
3521 return verifier.VerifyTable(ptr);
3522 }
3523 case ChreMessage::NanoappListRequest: {
3524 auto ptr = reinterpret_cast<const chre::fbs::NanoappListRequest *>(obj);
3525 return verifier.VerifyTable(ptr);
3526 }
3527 case ChreMessage::NanoappListResponse: {
3528 auto ptr = reinterpret_cast<const chre::fbs::NanoappListResponse *>(obj);
3529 return verifier.VerifyTable(ptr);
3530 }
3531 case ChreMessage::LoadNanoappRequest: {
3532 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappRequest *>(obj);
3533 return verifier.VerifyTable(ptr);
3534 }
3535 case ChreMessage::LoadNanoappResponse: {
3536 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappResponse *>(obj);
3537 return verifier.VerifyTable(ptr);
3538 }
3539 case ChreMessage::UnloadNanoappRequest: {
3540 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappRequest *>(obj);
3541 return verifier.VerifyTable(ptr);
3542 }
3543 case ChreMessage::UnloadNanoappResponse: {
3544 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappResponse *>(obj);
3545 return verifier.VerifyTable(ptr);
3546 }
3547 case ChreMessage::LogMessage: {
3548 auto ptr = reinterpret_cast<const chre::fbs::LogMessage *>(obj);
3549 return verifier.VerifyTable(ptr);
3550 }
3551 case ChreMessage::TimeSyncMessage: {
3552 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncMessage *>(obj);
3553 return verifier.VerifyTable(ptr);
3554 }
3555 case ChreMessage::DebugDumpRequest: {
3556 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpRequest *>(obj);
3557 return verifier.VerifyTable(ptr);
3558 }
3559 case ChreMessage::DebugDumpData: {
3560 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpData *>(obj);
3561 return verifier.VerifyTable(ptr);
3562 }
3563 case ChreMessage::DebugDumpResponse: {
3564 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpResponse *>(obj);
3565 return verifier.VerifyTable(ptr);
3566 }
3567 case ChreMessage::TimeSyncRequest: {
3568 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncRequest *>(obj);
3569 return verifier.VerifyTable(ptr);
3570 }
3571 case ChreMessage::LowPowerMicAccessRequest: {
3572 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessRequest *>(obj);
3573 return verifier.VerifyTable(ptr);
3574 }
3575 case ChreMessage::LowPowerMicAccessRelease: {
3576 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessRelease *>(obj);
3577 return verifier.VerifyTable(ptr);
3578 }
3579 case ChreMessage::SettingChangeMessage: {
3580 auto ptr = reinterpret_cast<const chre::fbs::SettingChangeMessage *>(obj);
3581 return verifier.VerifyTable(ptr);
3582 }
3583 case ChreMessage::LogMessageV2: {
3584 auto ptr = reinterpret_cast<const chre::fbs::LogMessageV2 *>(obj);
3585 return verifier.VerifyTable(ptr);
3586 }
3587 case ChreMessage::SelfTestRequest: {
3588 auto ptr = reinterpret_cast<const chre::fbs::SelfTestRequest *>(obj);
3589 return verifier.VerifyTable(ptr);
3590 }
3591 case ChreMessage::SelfTestResponse: {
3592 auto ptr = reinterpret_cast<const chre::fbs::SelfTestResponse *>(obj);
3593 return verifier.VerifyTable(ptr);
3594 }
3595 default: return true;
3596 }
3597 }
3598
3599 inline bool VerifyChreMessageVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
3600 if (!values || !types) return !values && !types;
3601 if (values->size() != types->size()) return false;
3602 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
3603 if (!VerifyChreMessage(
3604 verifier, values->Get(i), types->GetEnum<ChreMessage>(i))) {
3605 return false;
3606 }
3607 }
3608 return true;
3609 }
3610
3611 inline void *ChreMessageUnion::UnPack(const void *obj, ChreMessage type, const flatbuffers::resolver_function_t *resolver) {
3612 switch (type) {
3613 case ChreMessage::NanoappMessage: {
3614 auto ptr = reinterpret_cast<const chre::fbs::NanoappMessage *>(obj);
3615 return ptr->UnPack(resolver);
3616 }
3617 case ChreMessage::HubInfoRequest: {
3618 auto ptr = reinterpret_cast<const chre::fbs::HubInfoRequest *>(obj);
3619 return ptr->UnPack(resolver);
3620 }
3621 case ChreMessage::HubInfoResponse: {
3622 auto ptr = reinterpret_cast<const chre::fbs::HubInfoResponse *>(obj);
3623 return ptr->UnPack(resolver);
3624 }
3625 case ChreMessage::NanoappListRequest: {
3626 auto ptr = reinterpret_cast<const chre::fbs::NanoappListRequest *>(obj);
3627 return ptr->UnPack(resolver);
3628 }
3629 case ChreMessage::NanoappListResponse: {
3630 auto ptr = reinterpret_cast<const chre::fbs::NanoappListResponse *>(obj);
3631 return ptr->UnPack(resolver);
3632 }
3633 case ChreMessage::LoadNanoappRequest: {
3634 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappRequest *>(obj);
3635 return ptr->UnPack(resolver);
3636 }
3637 case ChreMessage::LoadNanoappResponse: {
3638 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappResponse *>(obj);
3639 return ptr->UnPack(resolver);
3640 }
3641 case ChreMessage::UnloadNanoappRequest: {
3642 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappRequest *>(obj);
3643 return ptr->UnPack(resolver);
3644 }
3645 case ChreMessage::UnloadNanoappResponse: {
3646 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappResponse *>(obj);
3647 return ptr->UnPack(resolver);
3648 }
3649 case ChreMessage::LogMessage: {
3650 auto ptr = reinterpret_cast<const chre::fbs::LogMessage *>(obj);
3651 return ptr->UnPack(resolver);
3652 }
3653 case ChreMessage::TimeSyncMessage: {
3654 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncMessage *>(obj);
3655 return ptr->UnPack(resolver);
3656 }
3657 case ChreMessage::DebugDumpRequest: {
3658 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpRequest *>(obj);
3659 return ptr->UnPack(resolver);
3660 }
3661 case ChreMessage::DebugDumpData: {
3662 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpData *>(obj);
3663 return ptr->UnPack(resolver);
3664 }
3665 case ChreMessage::DebugDumpResponse: {
3666 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpResponse *>(obj);
3667 return ptr->UnPack(resolver);
3668 }
3669 case ChreMessage::TimeSyncRequest: {
3670 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncRequest *>(obj);
3671 return ptr->UnPack(resolver);
3672 }
3673 case ChreMessage::LowPowerMicAccessRequest: {
3674 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessRequest *>(obj);
3675 return ptr->UnPack(resolver);
3676 }
3677 case ChreMessage::LowPowerMicAccessRelease: {
3678 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessRelease *>(obj);
3679 return ptr->UnPack(resolver);
3680 }
3681 case ChreMessage::SettingChangeMessage: {
3682 auto ptr = reinterpret_cast<const chre::fbs::SettingChangeMessage *>(obj);
3683 return ptr->UnPack(resolver);
3684 }
3685 case ChreMessage::LogMessageV2: {
3686 auto ptr = reinterpret_cast<const chre::fbs::LogMessageV2 *>(obj);
3687 return ptr->UnPack(resolver);
3688 }
3689 case ChreMessage::SelfTestRequest: {
3690 auto ptr = reinterpret_cast<const chre::fbs::SelfTestRequest *>(obj);
3691 return ptr->UnPack(resolver);
3692 }
3693 case ChreMessage::SelfTestResponse: {
3694 auto ptr = reinterpret_cast<const chre::fbs::SelfTestResponse *>(obj);
3695 return ptr->UnPack(resolver);
3696 }
3697 default: return nullptr;
3698 }
3699 }
3700
3701 inline flatbuffers::Offset<void> ChreMessageUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
3702 switch (type) {
3703 case ChreMessage::NanoappMessage: {
3704 auto ptr = reinterpret_cast<const chre::fbs::NanoappMessageT *>(value);
3705 return CreateNanoappMessage(_fbb, ptr, _rehasher).Union();
3706 }
3707 case ChreMessage::HubInfoRequest: {
3708 auto ptr = reinterpret_cast<const chre::fbs::HubInfoRequestT *>(value);
3709 return CreateHubInfoRequest(_fbb, ptr, _rehasher).Union();
3710 }
3711 case ChreMessage::HubInfoResponse: {
3712 auto ptr = reinterpret_cast<const chre::fbs::HubInfoResponseT *>(value);
3713 return CreateHubInfoResponse(_fbb, ptr, _rehasher).Union();
3714 }
3715 case ChreMessage::NanoappListRequest: {
3716 auto ptr = reinterpret_cast<const chre::fbs::NanoappListRequestT *>(value);
3717 return CreateNanoappListRequest(_fbb, ptr, _rehasher).Union();
3718 }
3719 case ChreMessage::NanoappListResponse: {
3720 auto ptr = reinterpret_cast<const chre::fbs::NanoappListResponseT *>(value);
3721 return CreateNanoappListResponse(_fbb, ptr, _rehasher).Union();
3722 }
3723 case ChreMessage::LoadNanoappRequest: {
3724 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappRequestT *>(value);
3725 return CreateLoadNanoappRequest(_fbb, ptr, _rehasher).Union();
3726 }
3727 case ChreMessage::LoadNanoappResponse: {
3728 auto ptr = reinterpret_cast<const chre::fbs::LoadNanoappResponseT *>(value);
3729 return CreateLoadNanoappResponse(_fbb, ptr, _rehasher).Union();
3730 }
3731 case ChreMessage::UnloadNanoappRequest: {
3732 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappRequestT *>(value);
3733 return CreateUnloadNanoappRequest(_fbb, ptr, _rehasher).Union();
3734 }
3735 case ChreMessage::UnloadNanoappResponse: {
3736 auto ptr = reinterpret_cast<const chre::fbs::UnloadNanoappResponseT *>(value);
3737 return CreateUnloadNanoappResponse(_fbb, ptr, _rehasher).Union();
3738 }
3739 case ChreMessage::LogMessage: {
3740 auto ptr = reinterpret_cast<const chre::fbs::LogMessageT *>(value);
3741 return CreateLogMessage(_fbb, ptr, _rehasher).Union();
3742 }
3743 case ChreMessage::TimeSyncMessage: {
3744 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncMessageT *>(value);
3745 return CreateTimeSyncMessage(_fbb, ptr, _rehasher).Union();
3746 }
3747 case ChreMessage::DebugDumpRequest: {
3748 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpRequestT *>(value);
3749 return CreateDebugDumpRequest(_fbb, ptr, _rehasher).Union();
3750 }
3751 case ChreMessage::DebugDumpData: {
3752 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpDataT *>(value);
3753 return CreateDebugDumpData(_fbb, ptr, _rehasher).Union();
3754 }
3755 case ChreMessage::DebugDumpResponse: {
3756 auto ptr = reinterpret_cast<const chre::fbs::DebugDumpResponseT *>(value);
3757 return CreateDebugDumpResponse(_fbb, ptr, _rehasher).Union();
3758 }
3759 case ChreMessage::TimeSyncRequest: {
3760 auto ptr = reinterpret_cast<const chre::fbs::TimeSyncRequestT *>(value);
3761 return CreateTimeSyncRequest(_fbb, ptr, _rehasher).Union();
3762 }
3763 case ChreMessage::LowPowerMicAccessRequest: {
3764 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessRequestT *>(value);
3765 return CreateLowPowerMicAccessRequest(_fbb, ptr, _rehasher).Union();
3766 }
3767 case ChreMessage::LowPowerMicAccessRelease: {
3768 auto ptr = reinterpret_cast<const chre::fbs::LowPowerMicAccessReleaseT *>(value);
3769 return CreateLowPowerMicAccessRelease(_fbb, ptr, _rehasher).Union();
3770 }
3771 case ChreMessage::SettingChangeMessage: {
3772 auto ptr = reinterpret_cast<const chre::fbs::SettingChangeMessageT *>(value);
3773 return CreateSettingChangeMessage(_fbb, ptr, _rehasher).Union();
3774 }
3775 case ChreMessage::LogMessageV2: {
3776 auto ptr = reinterpret_cast<const chre::fbs::LogMessageV2T *>(value);
3777 return CreateLogMessageV2(_fbb, ptr, _rehasher).Union();
3778 }
3779 case ChreMessage::SelfTestRequest: {
3780 auto ptr = reinterpret_cast<const chre::fbs::SelfTestRequestT *>(value);
3781 return CreateSelfTestRequest(_fbb, ptr, _rehasher).Union();
3782 }
3783 case ChreMessage::SelfTestResponse: {
3784 auto ptr = reinterpret_cast<const chre::fbs::SelfTestResponseT *>(value);
3785 return CreateSelfTestResponse(_fbb, ptr, _rehasher).Union();
3786 }
3787 default: return 0;
3788 }
3789 }
3790
3791 inline ChreMessageUnion::ChreMessageUnion(const ChreMessageUnion &u) : type(u.type), value(nullptr) {
3792 switch (type) {
3793 case ChreMessage::NanoappMessage: {
3794 value = new chre::fbs::NanoappMessageT(*reinterpret_cast<chre::fbs::NanoappMessageT *>(u.value));
3795 break;
3796 }
3797 case ChreMessage::HubInfoRequest: {
3798 value = new chre::fbs::HubInfoRequestT(*reinterpret_cast<chre::fbs::HubInfoRequestT *>(u.value));
3799 break;
3800 }
3801 case ChreMessage::HubInfoResponse: {
3802 value = new chre::fbs::HubInfoResponseT(*reinterpret_cast<chre::fbs::HubInfoResponseT *>(u.value));
3803 break;
3804 }
3805 case ChreMessage::NanoappListRequest: {
3806 value = new chre::fbs::NanoappListRequestT(*reinterpret_cast<chre::fbs::NanoappListRequestT *>(u.value));
3807 break;
3808 }
3809 case ChreMessage::NanoappListResponse: {
3810 FLATBUFFERS_ASSERT(false); // chre::fbs::NanoappListResponseT not copyable.
3811 break;
3812 }
3813 case ChreMessage::LoadNanoappRequest: {
3814 value = new chre::fbs::LoadNanoappRequestT(*reinterpret_cast<chre::fbs::LoadNanoappRequestT *>(u.value));
3815 break;
3816 }
3817 case ChreMessage::LoadNanoappResponse: {
3818 value = new chre::fbs::LoadNanoappResponseT(*reinterpret_cast<chre::fbs::LoadNanoappResponseT *>(u.value));
3819 break;
3820 }
3821 case ChreMessage::UnloadNanoappRequest: {
3822 value = new chre::fbs::UnloadNanoappRequestT(*reinterpret_cast<chre::fbs::UnloadNanoappRequestT *>(u.value));
3823 break;
3824 }
3825 case ChreMessage::UnloadNanoappResponse: {
3826 value = new chre::fbs::UnloadNanoappResponseT(*reinterpret_cast<chre::fbs::UnloadNanoappResponseT *>(u.value));
3827 break;
3828 }
3829 case ChreMessage::LogMessage: {
3830 value = new chre::fbs::LogMessageT(*reinterpret_cast<chre::fbs::LogMessageT *>(u.value));
3831 break;
3832 }
3833 case ChreMessage::TimeSyncMessage: {
3834 value = new chre::fbs::TimeSyncMessageT(*reinterpret_cast<chre::fbs::TimeSyncMessageT *>(u.value));
3835 break;
3836 }
3837 case ChreMessage::DebugDumpRequest: {
3838 value = new chre::fbs::DebugDumpRequestT(*reinterpret_cast<chre::fbs::DebugDumpRequestT *>(u.value));
3839 break;
3840 }
3841 case ChreMessage::DebugDumpData: {
3842 value = new chre::fbs::DebugDumpDataT(*reinterpret_cast<chre::fbs::DebugDumpDataT *>(u.value));
3843 break;
3844 }
3845 case ChreMessage::DebugDumpResponse: {
3846 value = new chre::fbs::DebugDumpResponseT(*reinterpret_cast<chre::fbs::DebugDumpResponseT *>(u.value));
3847 break;
3848 }
3849 case ChreMessage::TimeSyncRequest: {
3850 value = new chre::fbs::TimeSyncRequestT(*reinterpret_cast<chre::fbs::TimeSyncRequestT *>(u.value));
3851 break;
3852 }
3853 case ChreMessage::LowPowerMicAccessRequest: {
3854 value = new chre::fbs::LowPowerMicAccessRequestT(*reinterpret_cast<chre::fbs::LowPowerMicAccessRequestT *>(u.value));
3855 break;
3856 }
3857 case ChreMessage::LowPowerMicAccessRelease: {
3858 value = new chre::fbs::LowPowerMicAccessReleaseT(*reinterpret_cast<chre::fbs::LowPowerMicAccessReleaseT *>(u.value));
3859 break;
3860 }
3861 case ChreMessage::SettingChangeMessage: {
3862 value = new chre::fbs::SettingChangeMessageT(*reinterpret_cast<chre::fbs::SettingChangeMessageT *>(u.value));
3863 break;
3864 }
3865 case ChreMessage::LogMessageV2: {
3866 value = new chre::fbs::LogMessageV2T(*reinterpret_cast<chre::fbs::LogMessageV2T *>(u.value));
3867 break;
3868 }
3869 case ChreMessage::SelfTestRequest: {
3870 value = new chre::fbs::SelfTestRequestT(*reinterpret_cast<chre::fbs::SelfTestRequestT *>(u.value));
3871 break;
3872 }
3873 case ChreMessage::SelfTestResponse: {
3874 value = new chre::fbs::SelfTestResponseT(*reinterpret_cast<chre::fbs::SelfTestResponseT *>(u.value));
3875 break;
3876 }
3877 default:
3878 break;
3879 }
3880 }
3881
3882 inline void ChreMessageUnion::Reset() {
3883 switch (type) {
3884 case ChreMessage::NanoappMessage: {
3885 auto ptr = reinterpret_cast<chre::fbs::NanoappMessageT *>(value);
3886 delete ptr;
3887 break;
3888 }
3889 case ChreMessage::HubInfoRequest: {
3890 auto ptr = reinterpret_cast<chre::fbs::HubInfoRequestT *>(value);
3891 delete ptr;
3892 break;
3893 }
3894 case ChreMessage::HubInfoResponse: {
3895 auto ptr = reinterpret_cast<chre::fbs::HubInfoResponseT *>(value);
3896 delete ptr;
3897 break;
3898 }
3899 case ChreMessage::NanoappListRequest: {
3900 auto ptr = reinterpret_cast<chre::fbs::NanoappListRequestT *>(value);
3901 delete ptr;
3902 break;
3903 }
3904 case ChreMessage::NanoappListResponse: {
3905 auto ptr = reinterpret_cast<chre::fbs::NanoappListResponseT *>(value);
3906 delete ptr;
3907 break;
3908 }
3909 case ChreMessage::LoadNanoappRequest: {
3910 auto ptr = reinterpret_cast<chre::fbs::LoadNanoappRequestT *>(value);
3911 delete ptr;
3912 break;
3913 }
3914 case ChreMessage::LoadNanoappResponse: {
3915 auto ptr = reinterpret_cast<chre::fbs::LoadNanoappResponseT *>(value);
3916 delete ptr;
3917 break;
3918 }
3919 case ChreMessage::UnloadNanoappRequest: {
3920 auto ptr = reinterpret_cast<chre::fbs::UnloadNanoappRequestT *>(value);
3921 delete ptr;
3922 break;
3923 }
3924 case ChreMessage::UnloadNanoappResponse: {
3925 auto ptr = reinterpret_cast<chre::fbs::UnloadNanoappResponseT *>(value);
3926 delete ptr;
3927 break;
3928 }
3929 case ChreMessage::LogMessage: {
3930 auto ptr = reinterpret_cast<chre::fbs::LogMessageT *>(value);
3931 delete ptr;
3932 break;
3933 }
3934 case ChreMessage::TimeSyncMessage: {
3935 auto ptr = reinterpret_cast<chre::fbs::TimeSyncMessageT *>(value);
3936 delete ptr;
3937 break;
3938 }
3939 case ChreMessage::DebugDumpRequest: {
3940 auto ptr = reinterpret_cast<chre::fbs::DebugDumpRequestT *>(value);
3941 delete ptr;
3942 break;
3943 }
3944 case ChreMessage::DebugDumpData: {
3945 auto ptr = reinterpret_cast<chre::fbs::DebugDumpDataT *>(value);
3946 delete ptr;
3947 break;
3948 }
3949 case ChreMessage::DebugDumpResponse: {
3950 auto ptr = reinterpret_cast<chre::fbs::DebugDumpResponseT *>(value);
3951 delete ptr;
3952 break;
3953 }
3954 case ChreMessage::TimeSyncRequest: {
3955 auto ptr = reinterpret_cast<chre::fbs::TimeSyncRequestT *>(value);
3956 delete ptr;
3957 break;
3958 }
3959 case ChreMessage::LowPowerMicAccessRequest: {
3960 auto ptr = reinterpret_cast<chre::fbs::LowPowerMicAccessRequestT *>(value);
3961 delete ptr;
3962 break;
3963 }
3964 case ChreMessage::LowPowerMicAccessRelease: {
3965 auto ptr = reinterpret_cast<chre::fbs::LowPowerMicAccessReleaseT *>(value);
3966 delete ptr;
3967 break;
3968 }
3969 case ChreMessage::SettingChangeMessage: {
3970 auto ptr = reinterpret_cast<chre::fbs::SettingChangeMessageT *>(value);
3971 delete ptr;
3972 break;
3973 }
3974 case ChreMessage::LogMessageV2: {
3975 auto ptr = reinterpret_cast<chre::fbs::LogMessageV2T *>(value);
3976 delete ptr;
3977 break;
3978 }
3979 case ChreMessage::SelfTestRequest: {
3980 auto ptr = reinterpret_cast<chre::fbs::SelfTestRequestT *>(value);
3981 delete ptr;
3982 break;
3983 }
3984 case ChreMessage::SelfTestResponse: {
3985 auto ptr = reinterpret_cast<chre::fbs::SelfTestResponseT *>(value);
3986 delete ptr;
3987 break;
3988 }
3989 default: break;
3990 }
3991 value = nullptr;
3992 type = ChreMessage::NONE;
3993 }
3994
3995 inline const chre::fbs::MessageContainer *GetMessageContainer(const void *buf) {
3996 return flatbuffers::GetRoot<chre::fbs::MessageContainer>(buf);
3997 }
3998
3999 inline const chre::fbs::MessageContainer *GetSizePrefixedMessageContainer(const void *buf) {
4000 return flatbuffers::GetSizePrefixedRoot<chre::fbs::MessageContainer>(buf);
4001 }
4002
4003 inline MessageContainer *GetMutableMessageContainer(void *buf) {
4004 return flatbuffers::GetMutableRoot<MessageContainer>(buf);
4005 }
4006
4007 inline bool VerifyMessageContainerBuffer(
4008 flatbuffers::Verifier &verifier) {
4009 return verifier.VerifyBuffer<chre::fbs::MessageContainer>(nullptr);
4010 }
4011
4012 inline bool VerifySizePrefixedMessageContainerBuffer(
4013 flatbuffers::Verifier &verifier) {
4014 return verifier.VerifySizePrefixedBuffer<chre::fbs::MessageContainer>(nullptr);
4015 }
4016
4017 inline void FinishMessageContainerBuffer(
4018 flatbuffers::FlatBufferBuilder &fbb,
4019 flatbuffers::Offset<chre::fbs::MessageContainer> root) {
4020 fbb.Finish(root);
4021 }
4022
4023 inline void FinishSizePrefixedMessageContainerBuffer(
4024 flatbuffers::FlatBufferBuilder &fbb,
4025 flatbuffers::Offset<chre::fbs::MessageContainer> root) {
4026 fbb.FinishSizePrefixed(root);
4027 }
4028
4029 inline std::unique_ptr<chre::fbs::MessageContainerT> UnPackMessageContainer(
4030 const void *buf,
4031 const flatbuffers::resolver_function_t *res = nullptr) {
4032 return std::unique_ptr<chre::fbs::MessageContainerT>(GetMessageContainer(buf)->UnPack(res));
4033 }
4034
4035 inline std::unique_ptr<chre::fbs::MessageContainerT> UnPackSizePrefixedMessageContainer(
4036 const void *buf,
4037 const flatbuffers::resolver_function_t *res = nullptr) {
4038 return std::unique_ptr<chre::fbs::MessageContainerT>(GetSizePrefixedMessageContainer(buf)->UnPack(res));
4039 }
4040
4041 } // namespace fbs
4042 } // namespace chre
4043
4044 #endif // FLATBUFFERS_GENERATED_HOSTMESSAGES_CHRE_FBS_H_
4045