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 NanoappMessageT;
14
15 struct HubInfoRequest;
16 struct HubInfoRequestT;
17
18 struct HubInfoResponse;
19 struct HubInfoResponseT;
20
21 struct NanoappListRequest;
22 struct NanoappListRequestT;
23
24 struct NanoappListEntry;
25 struct NanoappListEntryT;
26
27 struct NanoappListResponse;
28 struct NanoappListResponseT;
29
30 struct LoadNanoappRequest;
31 struct LoadNanoappRequestT;
32
33 struct LoadNanoappResponse;
34 struct LoadNanoappResponseT;
35
36 struct UnloadNanoappRequest;
37 struct UnloadNanoappRequestT;
38
39 struct UnloadNanoappResponse;
40 struct UnloadNanoappResponseT;
41
42 struct LogMessage;
43 struct LogMessageT;
44
45 struct TimeSyncMessage;
46 struct TimeSyncMessageT;
47
48 struct DebugDumpRequest;
49 struct DebugDumpRequestT;
50
51 struct DebugDumpData;
52 struct DebugDumpDataT;
53
54 struct DebugDumpResponse;
55 struct DebugDumpResponseT;
56
57 struct TimeSyncRequest;
58 struct TimeSyncRequestT;
59
60 struct LowPowerMicAccessRequest;
61 struct LowPowerMicAccessRequestT;
62
63 struct LowPowerMicAccessRelease;
64 struct LowPowerMicAccessReleaseT;
65
66 struct HostAddress;
67
68 struct MessageContainer;
69 struct MessageContainerT;
70
71 /// A union that joins together all possible messages. Note that in FlatBuffers,
72 /// unions have an implicit type
73 enum class ChreMessage : uint8_t {
74 NONE = 0,
75 NanoappMessage = 1,
76 HubInfoRequest = 2,
77 HubInfoResponse = 3,
78 NanoappListRequest = 4,
79 NanoappListResponse = 5,
80 LoadNanoappRequest = 6,
81 LoadNanoappResponse = 7,
82 UnloadNanoappRequest = 8,
83 UnloadNanoappResponse = 9,
84 LogMessage = 10,
85 TimeSyncMessage = 11,
86 DebugDumpRequest = 12,
87 DebugDumpData = 13,
88 DebugDumpResponse = 14,
89 TimeSyncRequest = 15,
90 LowPowerMicAccessRequest = 16,
91 LowPowerMicAccessRelease = 17,
92 MIN = NONE,
93 MAX = LowPowerMicAccessRelease
94 };
95
EnumNamesChreMessage()96 inline const char **EnumNamesChreMessage() {
97 static const char *names[] = {
98 "NONE",
99 "NanoappMessage",
100 "HubInfoRequest",
101 "HubInfoResponse",
102 "NanoappListRequest",
103 "NanoappListResponse",
104 "LoadNanoappRequest",
105 "LoadNanoappResponse",
106 "UnloadNanoappRequest",
107 "UnloadNanoappResponse",
108 "LogMessage",
109 "TimeSyncMessage",
110 "DebugDumpRequest",
111 "DebugDumpData",
112 "DebugDumpResponse",
113 "TimeSyncRequest",
114 "LowPowerMicAccessRequest",
115 "LowPowerMicAccessRelease",
116 nullptr
117 };
118 return names;
119 }
120
EnumNameChreMessage(ChreMessage e)121 inline const char *EnumNameChreMessage(ChreMessage e) {
122 const size_t index = static_cast<int>(e);
123 return EnumNamesChreMessage()[index];
124 }
125
126 template<typename T> struct ChreMessageTraits {
127 static const ChreMessage enum_value = ChreMessage::NONE;
128 };
129
130 template<> struct ChreMessageTraits<NanoappMessage> {
131 static const ChreMessage enum_value = ChreMessage::NanoappMessage;
132 };
133
134 template<> struct ChreMessageTraits<HubInfoRequest> {
135 static const ChreMessage enum_value = ChreMessage::HubInfoRequest;
136 };
137
138 template<> struct ChreMessageTraits<HubInfoResponse> {
139 static const ChreMessage enum_value = ChreMessage::HubInfoResponse;
140 };
141
142 template<> struct ChreMessageTraits<NanoappListRequest> {
143 static const ChreMessage enum_value = ChreMessage::NanoappListRequest;
144 };
145
146 template<> struct ChreMessageTraits<NanoappListResponse> {
147 static const ChreMessage enum_value = ChreMessage::NanoappListResponse;
148 };
149
150 template<> struct ChreMessageTraits<LoadNanoappRequest> {
151 static const ChreMessage enum_value = ChreMessage::LoadNanoappRequest;
152 };
153
154 template<> struct ChreMessageTraits<LoadNanoappResponse> {
155 static const ChreMessage enum_value = ChreMessage::LoadNanoappResponse;
156 };
157
158 template<> struct ChreMessageTraits<UnloadNanoappRequest> {
159 static const ChreMessage enum_value = ChreMessage::UnloadNanoappRequest;
160 };
161
162 template<> struct ChreMessageTraits<UnloadNanoappResponse> {
163 static const ChreMessage enum_value = ChreMessage::UnloadNanoappResponse;
164 };
165
166 template<> struct ChreMessageTraits<LogMessage> {
167 static const ChreMessage enum_value = ChreMessage::LogMessage;
168 };
169
170 template<> struct ChreMessageTraits<TimeSyncMessage> {
171 static const ChreMessage enum_value = ChreMessage::TimeSyncMessage;
172 };
173
174 template<> struct ChreMessageTraits<DebugDumpRequest> {
175 static const ChreMessage enum_value = ChreMessage::DebugDumpRequest;
176 };
177
178 template<> struct ChreMessageTraits<DebugDumpData> {
179 static const ChreMessage enum_value = ChreMessage::DebugDumpData;
180 };
181
182 template<> struct ChreMessageTraits<DebugDumpResponse> {
183 static const ChreMessage enum_value = ChreMessage::DebugDumpResponse;
184 };
185
186 template<> struct ChreMessageTraits<TimeSyncRequest> {
187 static const ChreMessage enum_value = ChreMessage::TimeSyncRequest;
188 };
189
190 template<> struct ChreMessageTraits<LowPowerMicAccessRequest> {
191 static const ChreMessage enum_value = ChreMessage::LowPowerMicAccessRequest;
192 };
193
194 template<> struct ChreMessageTraits<LowPowerMicAccessRelease> {
195 static const ChreMessage enum_value = ChreMessage::LowPowerMicAccessRelease;
196 };
197
198 struct ChreMessageUnion {
199 ChreMessage type;
200 flatbuffers::NativeTable *table;
201
202 ChreMessageUnion() : type(ChreMessage::NONE), table(nullptr) {}
203 ChreMessageUnion(ChreMessageUnion&& u):
204 type(std::move(u.type)), table(std::move(u.table)) {}
205 ChreMessageUnion(const ChreMessageUnion &);
206 ChreMessageUnion &operator=(const ChreMessageUnion &);
207 ~ChreMessageUnion() { Reset(); }
208
209 void Reset();
210
211 template <typename T>
212 void Set(T&& value) {
213 Reset();
214 type = ChreMessageTraits<typename T::TableType>::enum_value;
215 if (type != ChreMessage::NONE) {
216 table = new T(std::forward<T>(value));
217 }
218 }
219
220 static flatbuffers::NativeTable *UnPack(const void *obj, ChreMessage type, const flatbuffers::resolver_function_t *resolver);
221 flatbuffers::Offset<void> Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher = nullptr) const;
222
223 NanoappMessageT *AsNanoappMessage() {
224 return type == ChreMessage::NanoappMessage ?
225 reinterpret_cast<NanoappMessageT *>(table) : nullptr;
226 }
227 HubInfoRequestT *AsHubInfoRequest() {
228 return type == ChreMessage::HubInfoRequest ?
229 reinterpret_cast<HubInfoRequestT *>(table) : nullptr;
230 }
231 HubInfoResponseT *AsHubInfoResponse() {
232 return type == ChreMessage::HubInfoResponse ?
233 reinterpret_cast<HubInfoResponseT *>(table) : nullptr;
234 }
235 NanoappListRequestT *AsNanoappListRequest() {
236 return type == ChreMessage::NanoappListRequest ?
237 reinterpret_cast<NanoappListRequestT *>(table) : nullptr;
238 }
239 NanoappListResponseT *AsNanoappListResponse() {
240 return type == ChreMessage::NanoappListResponse ?
241 reinterpret_cast<NanoappListResponseT *>(table) : nullptr;
242 }
243 LoadNanoappRequestT *AsLoadNanoappRequest() {
244 return type == ChreMessage::LoadNanoappRequest ?
245 reinterpret_cast<LoadNanoappRequestT *>(table) : nullptr;
246 }
247 LoadNanoappResponseT *AsLoadNanoappResponse() {
248 return type == ChreMessage::LoadNanoappResponse ?
249 reinterpret_cast<LoadNanoappResponseT *>(table) : nullptr;
250 }
251 UnloadNanoappRequestT *AsUnloadNanoappRequest() {
252 return type == ChreMessage::UnloadNanoappRequest ?
253 reinterpret_cast<UnloadNanoappRequestT *>(table) : nullptr;
254 }
255 UnloadNanoappResponseT *AsUnloadNanoappResponse() {
256 return type == ChreMessage::UnloadNanoappResponse ?
257 reinterpret_cast<UnloadNanoappResponseT *>(table) : nullptr;
258 }
259 LogMessageT *AsLogMessage() {
260 return type == ChreMessage::LogMessage ?
261 reinterpret_cast<LogMessageT *>(table) : nullptr;
262 }
263 TimeSyncMessageT *AsTimeSyncMessage() {
264 return type == ChreMessage::TimeSyncMessage ?
265 reinterpret_cast<TimeSyncMessageT *>(table) : nullptr;
266 }
267 DebugDumpRequestT *AsDebugDumpRequest() {
268 return type == ChreMessage::DebugDumpRequest ?
269 reinterpret_cast<DebugDumpRequestT *>(table) : nullptr;
270 }
271 DebugDumpDataT *AsDebugDumpData() {
272 return type == ChreMessage::DebugDumpData ?
273 reinterpret_cast<DebugDumpDataT *>(table) : nullptr;
274 }
275 DebugDumpResponseT *AsDebugDumpResponse() {
276 return type == ChreMessage::DebugDumpResponse ?
277 reinterpret_cast<DebugDumpResponseT *>(table) : nullptr;
278 }
279 TimeSyncRequestT *AsTimeSyncRequest() {
280 return type == ChreMessage::TimeSyncRequest ?
281 reinterpret_cast<TimeSyncRequestT *>(table) : nullptr;
282 }
283 LowPowerMicAccessRequestT *AsLowPowerMicAccessRequest() {
284 return type == ChreMessage::LowPowerMicAccessRequest ?
285 reinterpret_cast<LowPowerMicAccessRequestT *>(table) : nullptr;
286 }
287 LowPowerMicAccessReleaseT *AsLowPowerMicAccessRelease() {
288 return type == ChreMessage::LowPowerMicAccessRelease ?
289 reinterpret_cast<LowPowerMicAccessReleaseT *>(table) : nullptr;
290 }
291 };
292
293 bool VerifyChreMessage(flatbuffers::Verifier &verifier, const void *obj, ChreMessage type);
294 bool VerifyChreMessageVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types);
295
296 MANUALLY_ALIGNED_STRUCT(2) HostAddress FLATBUFFERS_FINAL_CLASS {
297 private:
298 uint16_t client_id_;
299
300 public:
301 HostAddress() {
302 memset(this, 0, sizeof(HostAddress));
303 }
304 HostAddress(const HostAddress &_o) {
305 memcpy(this, &_o, sizeof(HostAddress));
306 }
307 HostAddress(uint16_t _client_id)
308 : client_id_(flatbuffers::EndianScalar(_client_id)) {
309 }
310 uint16_t client_id() const {
311 return flatbuffers::EndianScalar(client_id_);
312 }
313 void mutate_client_id(uint16_t _client_id) {
314 flatbuffers::WriteScalar(&client_id_, _client_id);
315 }
316 };
317 STRUCT_END(HostAddress, 2);
318
319 struct NanoappMessageT : public flatbuffers::NativeTable {
320 typedef NanoappMessage TableType;
321 uint64_t app_id;
322 uint32_t message_type;
323 uint16_t host_endpoint;
324 std::vector<uint8_t> message;
325 NanoappMessageT()
326 : app_id(0),
327 message_type(0),
328 host_endpoint(65534) {
329 }
330 };
331
332 /// Represents a message sent to/from a nanoapp from/to a client on the host
333 struct NanoappMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
334 typedef NanoappMessageT NativeTableType;
335 enum {
336 VT_APP_ID = 4,
337 VT_MESSAGE_TYPE = 6,
338 VT_HOST_ENDPOINT = 8,
339 VT_MESSAGE = 10
340 };
341 uint64_t app_id() const {
342 return GetField<uint64_t>(VT_APP_ID, 0);
343 }
344 bool mutate_app_id(uint64_t _app_id) {
345 return SetField(VT_APP_ID, _app_id);
346 }
347 uint32_t message_type() const {
348 return GetField<uint32_t>(VT_MESSAGE_TYPE, 0);
349 }
350 bool mutate_message_type(uint32_t _message_type) {
351 return SetField(VT_MESSAGE_TYPE, _message_type);
352 }
353 /// Identifies the host-side endpoint on the host that sent or should receive
354 /// this message. The default value is a special value defined in the HAL and
355 /// elsewhere that indicates that the endpoint is unspecified.
356 uint16_t host_endpoint() const {
357 return GetField<uint16_t>(VT_HOST_ENDPOINT, 65534);
358 }
359 bool mutate_host_endpoint(uint16_t _host_endpoint) {
360 return SetField(VT_HOST_ENDPOINT, _host_endpoint);
361 }
362 /// Vector containing arbitrary application-specific message data
363 const flatbuffers::Vector<uint8_t> *message() const {
364 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_MESSAGE);
365 }
366 flatbuffers::Vector<uint8_t> *mutable_message() {
367 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_MESSAGE);
368 }
369 bool Verify(flatbuffers::Verifier &verifier) const {
370 return VerifyTableStart(verifier) &&
371 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
372 VerifyField<uint32_t>(verifier, VT_MESSAGE_TYPE) &&
373 VerifyField<uint16_t>(verifier, VT_HOST_ENDPOINT) &&
374 VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_MESSAGE) &&
375 verifier.Verify(message()) &&
376 verifier.EndTable();
377 }
378 NanoappMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
379 void UnPackTo(NanoappMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
380 static flatbuffers::Offset<NanoappMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
381 };
382
383 struct NanoappMessageBuilder {
384 flatbuffers::FlatBufferBuilder &fbb_;
385 flatbuffers::uoffset_t start_;
386 void add_app_id(uint64_t app_id) {
387 fbb_.AddElement<uint64_t>(NanoappMessage::VT_APP_ID, app_id, 0);
388 }
389 void add_message_type(uint32_t message_type) {
390 fbb_.AddElement<uint32_t>(NanoappMessage::VT_MESSAGE_TYPE, message_type, 0);
391 }
392 void add_host_endpoint(uint16_t host_endpoint) {
393 fbb_.AddElement<uint16_t>(NanoappMessage::VT_HOST_ENDPOINT, host_endpoint, 65534);
394 }
395 void add_message(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> message) {
396 fbb_.AddOffset(NanoappMessage::VT_MESSAGE, message);
397 }
398 NanoappMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
399 : fbb_(_fbb) {
400 start_ = fbb_.StartTable();
401 }
402 NanoappMessageBuilder &operator=(const NanoappMessageBuilder &);
403 flatbuffers::Offset<NanoappMessage> Finish() {
404 const auto end = fbb_.EndTable(start_, 4);
405 auto o = flatbuffers::Offset<NanoappMessage>(end);
406 fbb_.Required(o, NanoappMessage::VT_MESSAGE);
407 return o;
408 }
409 };
410
411 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(
412 flatbuffers::FlatBufferBuilder &_fbb,
413 uint64_t app_id = 0,
414 uint32_t message_type = 0,
415 uint16_t host_endpoint = 65534,
416 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> message = 0) {
417 NanoappMessageBuilder builder_(_fbb);
418 builder_.add_app_id(app_id);
419 builder_.add_message(message);
420 builder_.add_message_type(message_type);
421 builder_.add_host_endpoint(host_endpoint);
422 return builder_.Finish();
423 }
424
425 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessageDirect(
426 flatbuffers::FlatBufferBuilder &_fbb,
427 uint64_t app_id = 0,
428 uint32_t message_type = 0,
429 uint16_t host_endpoint = 65534,
430 const std::vector<uint8_t> *message = nullptr) {
431 return chre::fbs::CreateNanoappMessage(
432 _fbb,
433 app_id,
434 message_type,
435 host_endpoint,
436 message ? _fbb.CreateVector<uint8_t>(*message) : 0);
437 }
438
439 flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
440
441 struct HubInfoRequestT : public flatbuffers::NativeTable {
442 typedef HubInfoRequest TableType;
443 HubInfoRequestT() {
444 }
445 };
446
447 struct HubInfoRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
448 typedef HubInfoRequestT NativeTableType;
449 bool Verify(flatbuffers::Verifier &verifier) const {
450 return VerifyTableStart(verifier) &&
451 verifier.EndTable();
452 }
453 HubInfoRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
454 void UnPackTo(HubInfoRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
455 static flatbuffers::Offset<HubInfoRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
456 };
457
458 struct HubInfoRequestBuilder {
459 flatbuffers::FlatBufferBuilder &fbb_;
460 flatbuffers::uoffset_t start_;
461 HubInfoRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
462 : fbb_(_fbb) {
463 start_ = fbb_.StartTable();
464 }
465 HubInfoRequestBuilder &operator=(const HubInfoRequestBuilder &);
466 flatbuffers::Offset<HubInfoRequest> Finish() {
467 const auto end = fbb_.EndTable(start_, 0);
468 auto o = flatbuffers::Offset<HubInfoRequest>(end);
469 return o;
470 }
471 };
472
473 inline flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(
474 flatbuffers::FlatBufferBuilder &_fbb) {
475 HubInfoRequestBuilder builder_(_fbb);
476 return builder_.Finish();
477 }
478
479 flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
480
481 struct HubInfoResponseT : public flatbuffers::NativeTable {
482 typedef HubInfoResponse TableType;
483 std::vector<int8_t> name;
484 std::vector<int8_t> vendor;
485 std::vector<int8_t> toolchain;
486 uint32_t platform_version;
487 uint32_t toolchain_version;
488 float peak_mips;
489 float stopped_power;
490 float sleep_power;
491 float peak_power;
492 uint32_t max_msg_len;
493 uint64_t platform_id;
494 uint32_t chre_platform_version;
495 HubInfoResponseT()
496 : platform_version(0),
497 toolchain_version(0),
498 peak_mips(0.0f),
499 stopped_power(0.0f),
500 sleep_power(0.0f),
501 peak_power(0.0f),
502 max_msg_len(0),
503 platform_id(0),
504 chre_platform_version(0) {
505 }
506 };
507
508 struct HubInfoResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
509 typedef HubInfoResponseT NativeTableType;
510 enum {
511 VT_NAME = 4,
512 VT_VENDOR = 6,
513 VT_TOOLCHAIN = 8,
514 VT_PLATFORM_VERSION = 10,
515 VT_TOOLCHAIN_VERSION = 12,
516 VT_PEAK_MIPS = 14,
517 VT_STOPPED_POWER = 16,
518 VT_SLEEP_POWER = 18,
519 VT_PEAK_POWER = 20,
520 VT_MAX_MSG_LEN = 22,
521 VT_PLATFORM_ID = 24,
522 VT_CHRE_PLATFORM_VERSION = 26
523 };
524 /// The name of the hub. Nominally a UTF-8 string, but note that we're not
525 /// using the built-in "string" data type from FlatBuffers here, because the
526 /// generated C++ uses std::string which is not well-supported in CHRE. This
527 /// applies for vendor and toolchain as well.
528 const flatbuffers::Vector<int8_t> *name() const {
529 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_NAME);
530 }
531 flatbuffers::Vector<int8_t> *mutable_name() {
532 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_NAME);
533 }
534 const flatbuffers::Vector<int8_t> *vendor() const {
535 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_VENDOR);
536 }
537 flatbuffers::Vector<int8_t> *mutable_vendor() {
538 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_VENDOR);
539 }
540 const flatbuffers::Vector<int8_t> *toolchain() const {
541 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_TOOLCHAIN);
542 }
543 flatbuffers::Vector<int8_t> *mutable_toolchain() {
544 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_TOOLCHAIN);
545 }
546 /// Legacy platform version reported in the HAL; semantics not strictly
547 /// defined
548 uint32_t platform_version() const {
549 return GetField<uint32_t>(VT_PLATFORM_VERSION, 0);
550 }
551 bool mutate_platform_version(uint32_t _platform_version) {
552 return SetField(VT_PLATFORM_VERSION, _platform_version);
553 }
554 /// Toolchain version reported in the HAL; semantics not strictly defined
555 uint32_t toolchain_version() const {
556 return GetField<uint32_t>(VT_TOOLCHAIN_VERSION, 0);
557 }
558 bool mutate_toolchain_version(uint32_t _toolchain_version) {
559 return SetField(VT_TOOLCHAIN_VERSION, _toolchain_version);
560 }
561 float peak_mips() const {
562 return GetField<float>(VT_PEAK_MIPS, 0.0f);
563 }
564 bool mutate_peak_mips(float _peak_mips) {
565 return SetField(VT_PEAK_MIPS, _peak_mips);
566 }
567 float stopped_power() const {
568 return GetField<float>(VT_STOPPED_POWER, 0.0f);
569 }
570 bool mutate_stopped_power(float _stopped_power) {
571 return SetField(VT_STOPPED_POWER, _stopped_power);
572 }
573 float sleep_power() const {
574 return GetField<float>(VT_SLEEP_POWER, 0.0f);
575 }
576 bool mutate_sleep_power(float _sleep_power) {
577 return SetField(VT_SLEEP_POWER, _sleep_power);
578 }
579 float peak_power() const {
580 return GetField<float>(VT_PEAK_POWER, 0.0f);
581 }
582 bool mutate_peak_power(float _peak_power) {
583 return SetField(VT_PEAK_POWER, _peak_power);
584 }
585 /// Maximum size message that can be sent to a nanoapp
586 uint32_t max_msg_len() const {
587 return GetField<uint32_t>(VT_MAX_MSG_LEN, 0);
588 }
589 bool mutate_max_msg_len(uint32_t _max_msg_len) {
590 return SetField(VT_MAX_MSG_LEN, _max_msg_len);
591 }
592 /// @see chreGetPlatformId()
593 uint64_t platform_id() const {
594 return GetField<uint64_t>(VT_PLATFORM_ID, 0);
595 }
596 bool mutate_platform_id(uint64_t _platform_id) {
597 return SetField(VT_PLATFORM_ID, _platform_id);
598 }
599 /// @see chreGetVersion()
600 uint32_t chre_platform_version() const {
601 return GetField<uint32_t>(VT_CHRE_PLATFORM_VERSION, 0);
602 }
603 bool mutate_chre_platform_version(uint32_t _chre_platform_version) {
604 return SetField(VT_CHRE_PLATFORM_VERSION, _chre_platform_version);
605 }
606 bool Verify(flatbuffers::Verifier &verifier) const {
607 return VerifyTableStart(verifier) &&
608 VerifyField<flatbuffers::uoffset_t>(verifier, VT_NAME) &&
609 verifier.Verify(name()) &&
610 VerifyField<flatbuffers::uoffset_t>(verifier, VT_VENDOR) &&
611 verifier.Verify(vendor()) &&
612 VerifyField<flatbuffers::uoffset_t>(verifier, VT_TOOLCHAIN) &&
613 verifier.Verify(toolchain()) &&
614 VerifyField<uint32_t>(verifier, VT_PLATFORM_VERSION) &&
615 VerifyField<uint32_t>(verifier, VT_TOOLCHAIN_VERSION) &&
616 VerifyField<float>(verifier, VT_PEAK_MIPS) &&
617 VerifyField<float>(verifier, VT_STOPPED_POWER) &&
618 VerifyField<float>(verifier, VT_SLEEP_POWER) &&
619 VerifyField<float>(verifier, VT_PEAK_POWER) &&
620 VerifyField<uint32_t>(verifier, VT_MAX_MSG_LEN) &&
621 VerifyField<uint64_t>(verifier, VT_PLATFORM_ID) &&
622 VerifyField<uint32_t>(verifier, VT_CHRE_PLATFORM_VERSION) &&
623 verifier.EndTable();
624 }
625 HubInfoResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
626 void UnPackTo(HubInfoResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
627 static flatbuffers::Offset<HubInfoResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
628 };
629
630 struct HubInfoResponseBuilder {
631 flatbuffers::FlatBufferBuilder &fbb_;
632 flatbuffers::uoffset_t start_;
633 void add_name(flatbuffers::Offset<flatbuffers::Vector<int8_t>> name) {
634 fbb_.AddOffset(HubInfoResponse::VT_NAME, name);
635 }
636 void add_vendor(flatbuffers::Offset<flatbuffers::Vector<int8_t>> vendor) {
637 fbb_.AddOffset(HubInfoResponse::VT_VENDOR, vendor);
638 }
639 void add_toolchain(flatbuffers::Offset<flatbuffers::Vector<int8_t>> toolchain) {
640 fbb_.AddOffset(HubInfoResponse::VT_TOOLCHAIN, toolchain);
641 }
642 void add_platform_version(uint32_t platform_version) {
643 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_PLATFORM_VERSION, platform_version, 0);
644 }
645 void add_toolchain_version(uint32_t toolchain_version) {
646 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_TOOLCHAIN_VERSION, toolchain_version, 0);
647 }
648 void add_peak_mips(float peak_mips) {
649 fbb_.AddElement<float>(HubInfoResponse::VT_PEAK_MIPS, peak_mips, 0.0f);
650 }
651 void add_stopped_power(float stopped_power) {
652 fbb_.AddElement<float>(HubInfoResponse::VT_STOPPED_POWER, stopped_power, 0.0f);
653 }
654 void add_sleep_power(float sleep_power) {
655 fbb_.AddElement<float>(HubInfoResponse::VT_SLEEP_POWER, sleep_power, 0.0f);
656 }
657 void add_peak_power(float peak_power) {
658 fbb_.AddElement<float>(HubInfoResponse::VT_PEAK_POWER, peak_power, 0.0f);
659 }
660 void add_max_msg_len(uint32_t max_msg_len) {
661 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_MAX_MSG_LEN, max_msg_len, 0);
662 }
663 void add_platform_id(uint64_t platform_id) {
664 fbb_.AddElement<uint64_t>(HubInfoResponse::VT_PLATFORM_ID, platform_id, 0);
665 }
666 void add_chre_platform_version(uint32_t chre_platform_version) {
667 fbb_.AddElement<uint32_t>(HubInfoResponse::VT_CHRE_PLATFORM_VERSION, chre_platform_version, 0);
668 }
669 HubInfoResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
670 : fbb_(_fbb) {
671 start_ = fbb_.StartTable();
672 }
673 HubInfoResponseBuilder &operator=(const HubInfoResponseBuilder &);
674 flatbuffers::Offset<HubInfoResponse> Finish() {
675 const auto end = fbb_.EndTable(start_, 12);
676 auto o = flatbuffers::Offset<HubInfoResponse>(end);
677 return o;
678 }
679 };
680
681 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(
682 flatbuffers::FlatBufferBuilder &_fbb,
683 flatbuffers::Offset<flatbuffers::Vector<int8_t>> name = 0,
684 flatbuffers::Offset<flatbuffers::Vector<int8_t>> vendor = 0,
685 flatbuffers::Offset<flatbuffers::Vector<int8_t>> toolchain = 0,
686 uint32_t platform_version = 0,
687 uint32_t toolchain_version = 0,
688 float peak_mips = 0.0f,
689 float stopped_power = 0.0f,
690 float sleep_power = 0.0f,
691 float peak_power = 0.0f,
692 uint32_t max_msg_len = 0,
693 uint64_t platform_id = 0,
694 uint32_t chre_platform_version = 0) {
695 HubInfoResponseBuilder builder_(_fbb);
696 builder_.add_platform_id(platform_id);
697 builder_.add_chre_platform_version(chre_platform_version);
698 builder_.add_max_msg_len(max_msg_len);
699 builder_.add_peak_power(peak_power);
700 builder_.add_sleep_power(sleep_power);
701 builder_.add_stopped_power(stopped_power);
702 builder_.add_peak_mips(peak_mips);
703 builder_.add_toolchain_version(toolchain_version);
704 builder_.add_platform_version(platform_version);
705 builder_.add_toolchain(toolchain);
706 builder_.add_vendor(vendor);
707 builder_.add_name(name);
708 return builder_.Finish();
709 }
710
711 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponseDirect(
712 flatbuffers::FlatBufferBuilder &_fbb,
713 const std::vector<int8_t> *name = nullptr,
714 const std::vector<int8_t> *vendor = nullptr,
715 const std::vector<int8_t> *toolchain = nullptr,
716 uint32_t platform_version = 0,
717 uint32_t toolchain_version = 0,
718 float peak_mips = 0.0f,
719 float stopped_power = 0.0f,
720 float sleep_power = 0.0f,
721 float peak_power = 0.0f,
722 uint32_t max_msg_len = 0,
723 uint64_t platform_id = 0,
724 uint32_t chre_platform_version = 0) {
725 return chre::fbs::CreateHubInfoResponse(
726 _fbb,
727 name ? _fbb.CreateVector<int8_t>(*name) : 0,
728 vendor ? _fbb.CreateVector<int8_t>(*vendor) : 0,
729 toolchain ? _fbb.CreateVector<int8_t>(*toolchain) : 0,
730 platform_version,
731 toolchain_version,
732 peak_mips,
733 stopped_power,
734 sleep_power,
735 peak_power,
736 max_msg_len,
737 platform_id,
738 chre_platform_version);
739 }
740
741 flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
742
743 struct NanoappListRequestT : public flatbuffers::NativeTable {
744 typedef NanoappListRequest TableType;
745 NanoappListRequestT() {
746 }
747 };
748
749 struct NanoappListRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
750 typedef NanoappListRequestT NativeTableType;
751 bool Verify(flatbuffers::Verifier &verifier) const {
752 return VerifyTableStart(verifier) &&
753 verifier.EndTable();
754 }
755 NanoappListRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
756 void UnPackTo(NanoappListRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
757 static flatbuffers::Offset<NanoappListRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
758 };
759
760 struct NanoappListRequestBuilder {
761 flatbuffers::FlatBufferBuilder &fbb_;
762 flatbuffers::uoffset_t start_;
763 NanoappListRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
764 : fbb_(_fbb) {
765 start_ = fbb_.StartTable();
766 }
767 NanoappListRequestBuilder &operator=(const NanoappListRequestBuilder &);
768 flatbuffers::Offset<NanoappListRequest> Finish() {
769 const auto end = fbb_.EndTable(start_, 0);
770 auto o = flatbuffers::Offset<NanoappListRequest>(end);
771 return o;
772 }
773 };
774
775 inline flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(
776 flatbuffers::FlatBufferBuilder &_fbb) {
777 NanoappListRequestBuilder builder_(_fbb);
778 return builder_.Finish();
779 }
780
781 flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
782
783 struct NanoappListEntryT : public flatbuffers::NativeTable {
784 typedef NanoappListEntry TableType;
785 uint64_t app_id;
786 uint32_t version;
787 bool enabled;
788 bool is_system;
789 NanoappListEntryT()
790 : app_id(0),
791 version(0),
792 enabled(true),
793 is_system(false) {
794 }
795 };
796
797 struct NanoappListEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
798 typedef NanoappListEntryT NativeTableType;
799 enum {
800 VT_APP_ID = 4,
801 VT_VERSION = 6,
802 VT_ENABLED = 8,
803 VT_IS_SYSTEM = 10
804 };
805 uint64_t app_id() const {
806 return GetField<uint64_t>(VT_APP_ID, 0);
807 }
808 bool mutate_app_id(uint64_t _app_id) {
809 return SetField(VT_APP_ID, _app_id);
810 }
811 uint32_t version() const {
812 return GetField<uint32_t>(VT_VERSION, 0);
813 }
814 bool mutate_version(uint32_t _version) {
815 return SetField(VT_VERSION, _version);
816 }
817 bool enabled() const {
818 return GetField<uint8_t>(VT_ENABLED, 1) != 0;
819 }
820 bool mutate_enabled(bool _enabled) {
821 return SetField(VT_ENABLED, static_cast<uint8_t>(_enabled));
822 }
823 /// Whether the nanoapp is a pre-loaded "system" nanoapp, i.e. one that should
824 /// not show up in the list of nanoapps in the context hub HAL. System
825 /// nanoapps are typically used to leverage CHRE for some device functionality
826 /// and do not interact via the context hub HAL.
827 bool is_system() const {
828 return GetField<uint8_t>(VT_IS_SYSTEM, 0) != 0;
829 }
830 bool mutate_is_system(bool _is_system) {
831 return SetField(VT_IS_SYSTEM, static_cast<uint8_t>(_is_system));
832 }
833 bool Verify(flatbuffers::Verifier &verifier) const {
834 return VerifyTableStart(verifier) &&
835 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
836 VerifyField<uint32_t>(verifier, VT_VERSION) &&
837 VerifyField<uint8_t>(verifier, VT_ENABLED) &&
838 VerifyField<uint8_t>(verifier, VT_IS_SYSTEM) &&
839 verifier.EndTable();
840 }
841 NanoappListEntryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
842 void UnPackTo(NanoappListEntryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
843 static flatbuffers::Offset<NanoappListEntry> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
844 };
845
846 struct NanoappListEntryBuilder {
847 flatbuffers::FlatBufferBuilder &fbb_;
848 flatbuffers::uoffset_t start_;
849 void add_app_id(uint64_t app_id) {
850 fbb_.AddElement<uint64_t>(NanoappListEntry::VT_APP_ID, app_id, 0);
851 }
852 void add_version(uint32_t version) {
853 fbb_.AddElement<uint32_t>(NanoappListEntry::VT_VERSION, version, 0);
854 }
855 void add_enabled(bool enabled) {
856 fbb_.AddElement<uint8_t>(NanoappListEntry::VT_ENABLED, static_cast<uint8_t>(enabled), 1);
857 }
858 void add_is_system(bool is_system) {
859 fbb_.AddElement<uint8_t>(NanoappListEntry::VT_IS_SYSTEM, static_cast<uint8_t>(is_system), 0);
860 }
861 NanoappListEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
862 : fbb_(_fbb) {
863 start_ = fbb_.StartTable();
864 }
865 NanoappListEntryBuilder &operator=(const NanoappListEntryBuilder &);
866 flatbuffers::Offset<NanoappListEntry> Finish() {
867 const auto end = fbb_.EndTable(start_, 4);
868 auto o = flatbuffers::Offset<NanoappListEntry>(end);
869 return o;
870 }
871 };
872
873 inline flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(
874 flatbuffers::FlatBufferBuilder &_fbb,
875 uint64_t app_id = 0,
876 uint32_t version = 0,
877 bool enabled = true,
878 bool is_system = false) {
879 NanoappListEntryBuilder builder_(_fbb);
880 builder_.add_app_id(app_id);
881 builder_.add_version(version);
882 builder_.add_is_system(is_system);
883 builder_.add_enabled(enabled);
884 return builder_.Finish();
885 }
886
887 flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
888
889 struct NanoappListResponseT : public flatbuffers::NativeTable {
890 typedef NanoappListResponse TableType;
891 std::vector<std::unique_ptr<NanoappListEntryT>> nanoapps;
892 NanoappListResponseT() {
893 }
894 };
895
896 struct NanoappListResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
897 typedef NanoappListResponseT NativeTableType;
898 enum {
899 VT_NANOAPPS = 4
900 };
901 const flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>> *nanoapps() const {
902 return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>> *>(VT_NANOAPPS);
903 }
904 flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>> *mutable_nanoapps() {
905 return GetPointer<flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>> *>(VT_NANOAPPS);
906 }
907 bool Verify(flatbuffers::Verifier &verifier) const {
908 return VerifyTableStart(verifier) &&
909 VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_NANOAPPS) &&
910 verifier.Verify(nanoapps()) &&
911 verifier.VerifyVectorOfTables(nanoapps()) &&
912 verifier.EndTable();
913 }
914 NanoappListResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
915 void UnPackTo(NanoappListResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
916 static flatbuffers::Offset<NanoappListResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
917 };
918
919 struct NanoappListResponseBuilder {
920 flatbuffers::FlatBufferBuilder &fbb_;
921 flatbuffers::uoffset_t start_;
922 void add_nanoapps(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>>> nanoapps) {
923 fbb_.AddOffset(NanoappListResponse::VT_NANOAPPS, nanoapps);
924 }
925 NanoappListResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
926 : fbb_(_fbb) {
927 start_ = fbb_.StartTable();
928 }
929 NanoappListResponseBuilder &operator=(const NanoappListResponseBuilder &);
930 flatbuffers::Offset<NanoappListResponse> Finish() {
931 const auto end = fbb_.EndTable(start_, 1);
932 auto o = flatbuffers::Offset<NanoappListResponse>(end);
933 fbb_.Required(o, NanoappListResponse::VT_NANOAPPS);
934 return o;
935 }
936 };
937
938 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(
939 flatbuffers::FlatBufferBuilder &_fbb,
940 flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<NanoappListEntry>>> nanoapps = 0) {
941 NanoappListResponseBuilder builder_(_fbb);
942 builder_.add_nanoapps(nanoapps);
943 return builder_.Finish();
944 }
945
946 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponseDirect(
947 flatbuffers::FlatBufferBuilder &_fbb,
948 const std::vector<flatbuffers::Offset<NanoappListEntry>> *nanoapps = nullptr) {
949 return chre::fbs::CreateNanoappListResponse(
950 _fbb,
951 nanoapps ? _fbb.CreateVector<flatbuffers::Offset<NanoappListEntry>>(*nanoapps) : 0);
952 }
953
954 flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
955
956 struct LoadNanoappRequestT : public flatbuffers::NativeTable {
957 typedef LoadNanoappRequest TableType;
958 uint32_t transaction_id;
959 uint64_t app_id;
960 uint32_t app_version;
961 uint32_t target_api_version;
962 std::vector<uint8_t> app_binary;
963 uint32_t fragment_id;
964 uint32_t total_app_size;
965 std::vector<int8_t> app_binary_file_name;
966 LoadNanoappRequestT()
967 : transaction_id(0),
968 app_id(0),
969 app_version(0),
970 target_api_version(0),
971 fragment_id(0),
972 total_app_size(0) {
973 }
974 };
975
976 /// Represents a request for loading a nanoapp.
977 /// The nanaopp can either be requested to be loaded via a file or via a buffer.
978 /// For loading via a file, the following steps will be taken:
979 /// 1. The loader sends a LoadNanoappRequest message to CHRE. app_binary must
980 /// be set for legacy purposes, but should be empty. Additionally,
981 /// fragment_id and total_app_size are unused in this request. The loading
982 /// that happens as part of this request is serialized, but asynchronous
983 /// meaning that load requests will be processed in the order they are sent
984 /// but multiple requests can be outstanding at any given time.
985 /// 2. CHRE stores the filename and waits until its event loop is able to
986 /// process the request.
987 /// 3. Once ready, the nanoapp will be loaded from the file specified in the
988 /// original request and will send a callback indicating the
989 /// completion/failure of the request.
990 /// For loading via a buffer, loading may optionally be fragmented into multiple
991 /// sequential requests, which will follow the following steps:
992 /// 1. The loader sends a LoadNanoappRequest message to CHRE. If the request
993 /// is fragmented, then the fields fragment_id and total_app_size must
994 /// be defined. Once the first fragment is sent to CHRE, all subsequent
995 /// fragments must be delivered before a new LoadNanoappRequest can be
996 /// issued. If a new request is received while a current request has
997 /// outstanding fragments, the current request will be overridden with the
998 /// new one.
999 /// 2. CHRE preallocates the required amount of memory, and loads app_binary,
1000 /// appending to already loaded fragments as appropriate.
1001 /// 3. If the request is fragmented, then the requestor must sequentially send
1002 /// multiple LoadNanoappRequest with incremental nanoapp binary fragments.
1003 /// CHRE will respond with LoadNanoappResponse for each request. For
1004 /// requests starting from the second fragment, all fields except
1005 /// fragment_id and app_binary should be ignored by CHRE.
1006 ///
1007 /// Once the LoadNanoappRepsonse for the last fragment is received
1008 /// by the HAL, the HAL client will receive a callback indicating the
1009 /// completion/failure of a load request.
1010 ///
1011 /// If any request fragment is lost, then the entire load request will be
1012 /// considered to have failed. If the request times out (e.g. the requestor
1013 /// process crashes), then the load request will be cancelled at CHRE and fail.
1014 struct LoadNanoappRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1015 typedef LoadNanoappRequestT NativeTableType;
1016 enum {
1017 VT_TRANSACTION_ID = 4,
1018 VT_APP_ID = 6,
1019 VT_APP_VERSION = 8,
1020 VT_TARGET_API_VERSION = 10,
1021 VT_APP_BINARY = 12,
1022 VT_FRAGMENT_ID = 14,
1023 VT_TOTAL_APP_SIZE = 16,
1024 VT_APP_BINARY_FILE_NAME = 18
1025 };
1026 uint32_t transaction_id() const {
1027 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1028 }
1029 bool mutate_transaction_id(uint32_t _transaction_id) {
1030 return SetField(VT_TRANSACTION_ID, _transaction_id);
1031 }
1032 uint64_t app_id() const {
1033 return GetField<uint64_t>(VT_APP_ID, 0);
1034 }
1035 bool mutate_app_id(uint64_t _app_id) {
1036 return SetField(VT_APP_ID, _app_id);
1037 }
1038 uint32_t app_version() const {
1039 return GetField<uint32_t>(VT_APP_VERSION, 0);
1040 }
1041 bool mutate_app_version(uint32_t _app_version) {
1042 return SetField(VT_APP_VERSION, _app_version);
1043 }
1044 uint32_t target_api_version() const {
1045 return GetField<uint32_t>(VT_TARGET_API_VERSION, 0);
1046 }
1047 bool mutate_target_api_version(uint32_t _target_api_version) {
1048 return SetField(VT_TARGET_API_VERSION, _target_api_version);
1049 }
1050 const flatbuffers::Vector<uint8_t> *app_binary() const {
1051 return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_APP_BINARY);
1052 }
1053 flatbuffers::Vector<uint8_t> *mutable_app_binary() {
1054 return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_APP_BINARY);
1055 }
1056 /// Fields that are relevant for fragmented loading
1057 /// The framgent count starts at 1 and should end at the total number of
1058 /// fragments. For clients that do not support fragmented loading, the
1059 /// default behavior should be to assume one fragment.
1060 uint32_t fragment_id() const {
1061 return GetField<uint32_t>(VT_FRAGMENT_ID, 0);
1062 }
1063 bool mutate_fragment_id(uint32_t _fragment_id) {
1064 return SetField(VT_FRAGMENT_ID, _fragment_id);
1065 }
1066 uint32_t total_app_size() const {
1067 return GetField<uint32_t>(VT_TOTAL_APP_SIZE, 0);
1068 }
1069 bool mutate_total_app_size(uint32_t _total_app_size) {
1070 return SetField(VT_TOTAL_APP_SIZE, _total_app_size);
1071 }
1072 /// Null-terminated ASCII string containing the file name that contains the
1073 /// app binary to be loaded.
1074 const flatbuffers::Vector<int8_t> *app_binary_file_name() const {
1075 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_APP_BINARY_FILE_NAME);
1076 }
1077 flatbuffers::Vector<int8_t> *mutable_app_binary_file_name() {
1078 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_APP_BINARY_FILE_NAME);
1079 }
1080 bool Verify(flatbuffers::Verifier &verifier) const {
1081 return VerifyTableStart(verifier) &&
1082 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1083 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
1084 VerifyField<uint32_t>(verifier, VT_APP_VERSION) &&
1085 VerifyField<uint32_t>(verifier, VT_TARGET_API_VERSION) &&
1086 VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_APP_BINARY) &&
1087 verifier.Verify(app_binary()) &&
1088 VerifyField<uint32_t>(verifier, VT_FRAGMENT_ID) &&
1089 VerifyField<uint32_t>(verifier, VT_TOTAL_APP_SIZE) &&
1090 VerifyField<flatbuffers::uoffset_t>(verifier, VT_APP_BINARY_FILE_NAME) &&
1091 verifier.Verify(app_binary_file_name()) &&
1092 verifier.EndTable();
1093 }
1094 LoadNanoappRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1095 void UnPackTo(LoadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1096 static flatbuffers::Offset<LoadNanoappRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1097 };
1098
1099 struct LoadNanoappRequestBuilder {
1100 flatbuffers::FlatBufferBuilder &fbb_;
1101 flatbuffers::uoffset_t start_;
1102 void add_transaction_id(uint32_t transaction_id) {
1103 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TRANSACTION_ID, transaction_id, 0);
1104 }
1105 void add_app_id(uint64_t app_id) {
1106 fbb_.AddElement<uint64_t>(LoadNanoappRequest::VT_APP_ID, app_id, 0);
1107 }
1108 void add_app_version(uint32_t app_version) {
1109 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_APP_VERSION, app_version, 0);
1110 }
1111 void add_target_api_version(uint32_t target_api_version) {
1112 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TARGET_API_VERSION, target_api_version, 0);
1113 }
1114 void add_app_binary(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> app_binary) {
1115 fbb_.AddOffset(LoadNanoappRequest::VT_APP_BINARY, app_binary);
1116 }
1117 void add_fragment_id(uint32_t fragment_id) {
1118 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_FRAGMENT_ID, fragment_id, 0);
1119 }
1120 void add_total_app_size(uint32_t total_app_size) {
1121 fbb_.AddElement<uint32_t>(LoadNanoappRequest::VT_TOTAL_APP_SIZE, total_app_size, 0);
1122 }
1123 void add_app_binary_file_name(flatbuffers::Offset<flatbuffers::Vector<int8_t>> app_binary_file_name) {
1124 fbb_.AddOffset(LoadNanoappRequest::VT_APP_BINARY_FILE_NAME, app_binary_file_name);
1125 }
1126 LoadNanoappRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1127 : fbb_(_fbb) {
1128 start_ = fbb_.StartTable();
1129 }
1130 LoadNanoappRequestBuilder &operator=(const LoadNanoappRequestBuilder &);
1131 flatbuffers::Offset<LoadNanoappRequest> Finish() {
1132 const auto end = fbb_.EndTable(start_, 8);
1133 auto o = flatbuffers::Offset<LoadNanoappRequest>(end);
1134 fbb_.Required(o, LoadNanoappRequest::VT_APP_BINARY);
1135 return o;
1136 }
1137 };
1138
1139 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(
1140 flatbuffers::FlatBufferBuilder &_fbb,
1141 uint32_t transaction_id = 0,
1142 uint64_t app_id = 0,
1143 uint32_t app_version = 0,
1144 uint32_t target_api_version = 0,
1145 flatbuffers::Offset<flatbuffers::Vector<uint8_t>> app_binary = 0,
1146 uint32_t fragment_id = 0,
1147 uint32_t total_app_size = 0,
1148 flatbuffers::Offset<flatbuffers::Vector<int8_t>> app_binary_file_name = 0) {
1149 LoadNanoappRequestBuilder builder_(_fbb);
1150 builder_.add_app_id(app_id);
1151 builder_.add_app_binary_file_name(app_binary_file_name);
1152 builder_.add_total_app_size(total_app_size);
1153 builder_.add_fragment_id(fragment_id);
1154 builder_.add_app_binary(app_binary);
1155 builder_.add_target_api_version(target_api_version);
1156 builder_.add_app_version(app_version);
1157 builder_.add_transaction_id(transaction_id);
1158 return builder_.Finish();
1159 }
1160
1161 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequestDirect(
1162 flatbuffers::FlatBufferBuilder &_fbb,
1163 uint32_t transaction_id = 0,
1164 uint64_t app_id = 0,
1165 uint32_t app_version = 0,
1166 uint32_t target_api_version = 0,
1167 const std::vector<uint8_t> *app_binary = nullptr,
1168 uint32_t fragment_id = 0,
1169 uint32_t total_app_size = 0,
1170 const std::vector<int8_t> *app_binary_file_name = nullptr) {
1171 return chre::fbs::CreateLoadNanoappRequest(
1172 _fbb,
1173 transaction_id,
1174 app_id,
1175 app_version,
1176 target_api_version,
1177 app_binary ? _fbb.CreateVector<uint8_t>(*app_binary) : 0,
1178 fragment_id,
1179 total_app_size,
1180 app_binary_file_name ? _fbb.CreateVector<int8_t>(*app_binary_file_name) : 0);
1181 }
1182
1183 flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1184
1185 struct LoadNanoappResponseT : public flatbuffers::NativeTable {
1186 typedef LoadNanoappResponse TableType;
1187 uint32_t transaction_id;
1188 bool success;
1189 uint32_t fragment_id;
1190 LoadNanoappResponseT()
1191 : transaction_id(0),
1192 success(false),
1193 fragment_id(0) {
1194 }
1195 };
1196
1197 struct LoadNanoappResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1198 typedef LoadNanoappResponseT NativeTableType;
1199 enum {
1200 VT_TRANSACTION_ID = 4,
1201 VT_SUCCESS = 6,
1202 VT_FRAGMENT_ID = 8
1203 };
1204 uint32_t transaction_id() const {
1205 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1206 }
1207 bool mutate_transaction_id(uint32_t _transaction_id) {
1208 return SetField(VT_TRANSACTION_ID, _transaction_id);
1209 }
1210 /// Denotes whether a load request succeeded or failed.
1211 /// If any fragment of a load request fails, the entire load request for
1212 /// the same transaction will fail.
1213 bool success() const {
1214 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
1215 }
1216 bool mutate_success(bool _success) {
1217 return SetField(VT_SUCCESS, static_cast<uint8_t>(_success));
1218 }
1219 /// The fragment count of the load reponse is for.
1220 uint32_t fragment_id() const {
1221 return GetField<uint32_t>(VT_FRAGMENT_ID, 0);
1222 }
1223 bool mutate_fragment_id(uint32_t _fragment_id) {
1224 return SetField(VT_FRAGMENT_ID, _fragment_id);
1225 }
1226 bool Verify(flatbuffers::Verifier &verifier) const {
1227 return VerifyTableStart(verifier) &&
1228 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1229 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
1230 VerifyField<uint32_t>(verifier, VT_FRAGMENT_ID) &&
1231 verifier.EndTable();
1232 }
1233 LoadNanoappResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1234 void UnPackTo(LoadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1235 static flatbuffers::Offset<LoadNanoappResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1236 };
1237
1238 struct LoadNanoappResponseBuilder {
1239 flatbuffers::FlatBufferBuilder &fbb_;
1240 flatbuffers::uoffset_t start_;
1241 void add_transaction_id(uint32_t transaction_id) {
1242 fbb_.AddElement<uint32_t>(LoadNanoappResponse::VT_TRANSACTION_ID, transaction_id, 0);
1243 }
1244 void add_success(bool success) {
1245 fbb_.AddElement<uint8_t>(LoadNanoappResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
1246 }
1247 void add_fragment_id(uint32_t fragment_id) {
1248 fbb_.AddElement<uint32_t>(LoadNanoappResponse::VT_FRAGMENT_ID, fragment_id, 0);
1249 }
1250 LoadNanoappResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1251 : fbb_(_fbb) {
1252 start_ = fbb_.StartTable();
1253 }
1254 LoadNanoappResponseBuilder &operator=(const LoadNanoappResponseBuilder &);
1255 flatbuffers::Offset<LoadNanoappResponse> Finish() {
1256 const auto end = fbb_.EndTable(start_, 3);
1257 auto o = flatbuffers::Offset<LoadNanoappResponse>(end);
1258 return o;
1259 }
1260 };
1261
1262 inline flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(
1263 flatbuffers::FlatBufferBuilder &_fbb,
1264 uint32_t transaction_id = 0,
1265 bool success = false,
1266 uint32_t fragment_id = 0) {
1267 LoadNanoappResponseBuilder builder_(_fbb);
1268 builder_.add_fragment_id(fragment_id);
1269 builder_.add_transaction_id(transaction_id);
1270 builder_.add_success(success);
1271 return builder_.Finish();
1272 }
1273
1274 flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1275
1276 struct UnloadNanoappRequestT : public flatbuffers::NativeTable {
1277 typedef UnloadNanoappRequest TableType;
1278 uint32_t transaction_id;
1279 uint64_t app_id;
1280 bool allow_system_nanoapp_unload;
1281 UnloadNanoappRequestT()
1282 : transaction_id(0),
1283 app_id(0),
1284 allow_system_nanoapp_unload(false) {
1285 }
1286 };
1287
1288 struct UnloadNanoappRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1289 typedef UnloadNanoappRequestT NativeTableType;
1290 enum {
1291 VT_TRANSACTION_ID = 4,
1292 VT_APP_ID = 6,
1293 VT_ALLOW_SYSTEM_NANOAPP_UNLOAD = 8
1294 };
1295 uint32_t transaction_id() const {
1296 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1297 }
1298 bool mutate_transaction_id(uint32_t _transaction_id) {
1299 return SetField(VT_TRANSACTION_ID, _transaction_id);
1300 }
1301 uint64_t app_id() const {
1302 return GetField<uint64_t>(VT_APP_ID, 0);
1303 }
1304 bool mutate_app_id(uint64_t _app_id) {
1305 return SetField(VT_APP_ID, _app_id);
1306 }
1307 /// Set to true to allow this request to unload nanoapps identified as "system
1308 /// nanoapps", i.e. ones with is_system set to true in NanoappListResponse.
1309 bool allow_system_nanoapp_unload() const {
1310 return GetField<uint8_t>(VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, 0) != 0;
1311 }
1312 bool mutate_allow_system_nanoapp_unload(bool _allow_system_nanoapp_unload) {
1313 return SetField(VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, static_cast<uint8_t>(_allow_system_nanoapp_unload));
1314 }
1315 bool Verify(flatbuffers::Verifier &verifier) const {
1316 return VerifyTableStart(verifier) &&
1317 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1318 VerifyField<uint64_t>(verifier, VT_APP_ID) &&
1319 VerifyField<uint8_t>(verifier, VT_ALLOW_SYSTEM_NANOAPP_UNLOAD) &&
1320 verifier.EndTable();
1321 }
1322 UnloadNanoappRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1323 void UnPackTo(UnloadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1324 static flatbuffers::Offset<UnloadNanoappRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1325 };
1326
1327 struct UnloadNanoappRequestBuilder {
1328 flatbuffers::FlatBufferBuilder &fbb_;
1329 flatbuffers::uoffset_t start_;
1330 void add_transaction_id(uint32_t transaction_id) {
1331 fbb_.AddElement<uint32_t>(UnloadNanoappRequest::VT_TRANSACTION_ID, transaction_id, 0);
1332 }
1333 void add_app_id(uint64_t app_id) {
1334 fbb_.AddElement<uint64_t>(UnloadNanoappRequest::VT_APP_ID, app_id, 0);
1335 }
1336 void add_allow_system_nanoapp_unload(bool allow_system_nanoapp_unload) {
1337 fbb_.AddElement<uint8_t>(UnloadNanoappRequest::VT_ALLOW_SYSTEM_NANOAPP_UNLOAD, static_cast<uint8_t>(allow_system_nanoapp_unload), 0);
1338 }
1339 UnloadNanoappRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1340 : fbb_(_fbb) {
1341 start_ = fbb_.StartTable();
1342 }
1343 UnloadNanoappRequestBuilder &operator=(const UnloadNanoappRequestBuilder &);
1344 flatbuffers::Offset<UnloadNanoappRequest> Finish() {
1345 const auto end = fbb_.EndTable(start_, 3);
1346 auto o = flatbuffers::Offset<UnloadNanoappRequest>(end);
1347 return o;
1348 }
1349 };
1350
1351 inline flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(
1352 flatbuffers::FlatBufferBuilder &_fbb,
1353 uint32_t transaction_id = 0,
1354 uint64_t app_id = 0,
1355 bool allow_system_nanoapp_unload = false) {
1356 UnloadNanoappRequestBuilder builder_(_fbb);
1357 builder_.add_app_id(app_id);
1358 builder_.add_transaction_id(transaction_id);
1359 builder_.add_allow_system_nanoapp_unload(allow_system_nanoapp_unload);
1360 return builder_.Finish();
1361 }
1362
1363 flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1364
1365 struct UnloadNanoappResponseT : public flatbuffers::NativeTable {
1366 typedef UnloadNanoappResponse TableType;
1367 uint32_t transaction_id;
1368 bool success;
1369 UnloadNanoappResponseT()
1370 : transaction_id(0),
1371 success(false) {
1372 }
1373 };
1374
1375 struct UnloadNanoappResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1376 typedef UnloadNanoappResponseT NativeTableType;
1377 enum {
1378 VT_TRANSACTION_ID = 4,
1379 VT_SUCCESS = 6
1380 };
1381 uint32_t transaction_id() const {
1382 return GetField<uint32_t>(VT_TRANSACTION_ID, 0);
1383 }
1384 bool mutate_transaction_id(uint32_t _transaction_id) {
1385 return SetField(VT_TRANSACTION_ID, _transaction_id);
1386 }
1387 bool success() const {
1388 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
1389 }
1390 bool mutate_success(bool _success) {
1391 return SetField(VT_SUCCESS, static_cast<uint8_t>(_success));
1392 }
1393 bool Verify(flatbuffers::Verifier &verifier) const {
1394 return VerifyTableStart(verifier) &&
1395 VerifyField<uint32_t>(verifier, VT_TRANSACTION_ID) &&
1396 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
1397 verifier.EndTable();
1398 }
1399 UnloadNanoappResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1400 void UnPackTo(UnloadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1401 static flatbuffers::Offset<UnloadNanoappResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1402 };
1403
1404 struct UnloadNanoappResponseBuilder {
1405 flatbuffers::FlatBufferBuilder &fbb_;
1406 flatbuffers::uoffset_t start_;
1407 void add_transaction_id(uint32_t transaction_id) {
1408 fbb_.AddElement<uint32_t>(UnloadNanoappResponse::VT_TRANSACTION_ID, transaction_id, 0);
1409 }
1410 void add_success(bool success) {
1411 fbb_.AddElement<uint8_t>(UnloadNanoappResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
1412 }
1413 UnloadNanoappResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1414 : fbb_(_fbb) {
1415 start_ = fbb_.StartTable();
1416 }
1417 UnloadNanoappResponseBuilder &operator=(const UnloadNanoappResponseBuilder &);
1418 flatbuffers::Offset<UnloadNanoappResponse> Finish() {
1419 const auto end = fbb_.EndTable(start_, 2);
1420 auto o = flatbuffers::Offset<UnloadNanoappResponse>(end);
1421 return o;
1422 }
1423 };
1424
1425 inline flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(
1426 flatbuffers::FlatBufferBuilder &_fbb,
1427 uint32_t transaction_id = 0,
1428 bool success = false) {
1429 UnloadNanoappResponseBuilder builder_(_fbb);
1430 builder_.add_transaction_id(transaction_id);
1431 builder_.add_success(success);
1432 return builder_.Finish();
1433 }
1434
1435 flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1436
1437 struct LogMessageT : public flatbuffers::NativeTable {
1438 typedef LogMessage TableType;
1439 std::vector<int8_t> buffer;
1440 LogMessageT() {
1441 }
1442 };
1443
1444 /// Represents log messages from CHRE.
1445 struct LogMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1446 typedef LogMessageT NativeTableType;
1447 enum {
1448 VT_BUFFER = 4
1449 };
1450 /// A buffer containing formatted log data. A flat array is used here to avoid
1451 /// overhead in serializing and deserializing. The format is as follows:
1452 ///
1453 /// uint8_t - log level (1 = error, 2 = warning,
1454 /// 3 = info, 4 = debug)
1455 /// uint64_t, little-endian - timestamp in nanoseconds
1456 /// char[] - message to log
1457 /// char, \0 - null-terminator
1458 ///
1459 /// This pattern repeats until the end of the buffer for multiple log
1460 /// messages. The last byte will always be a null-terminator. There are no
1461 /// padding bytes between these fields. Treat this like a packed struct and be
1462 /// cautious with unaligned access when reading/writing this buffer.
1463 const flatbuffers::Vector<int8_t> *buffer() const {
1464 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_BUFFER);
1465 }
1466 flatbuffers::Vector<int8_t> *mutable_buffer() {
1467 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_BUFFER);
1468 }
1469 bool Verify(flatbuffers::Verifier &verifier) const {
1470 return VerifyTableStart(verifier) &&
1471 VerifyField<flatbuffers::uoffset_t>(verifier, VT_BUFFER) &&
1472 verifier.Verify(buffer()) &&
1473 verifier.EndTable();
1474 }
1475 LogMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1476 void UnPackTo(LogMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1477 static flatbuffers::Offset<LogMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1478 };
1479
1480 struct LogMessageBuilder {
1481 flatbuffers::FlatBufferBuilder &fbb_;
1482 flatbuffers::uoffset_t start_;
1483 void add_buffer(flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer) {
1484 fbb_.AddOffset(LogMessage::VT_BUFFER, buffer);
1485 }
1486 LogMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1487 : fbb_(_fbb) {
1488 start_ = fbb_.StartTable();
1489 }
1490 LogMessageBuilder &operator=(const LogMessageBuilder &);
1491 flatbuffers::Offset<LogMessage> Finish() {
1492 const auto end = fbb_.EndTable(start_, 1);
1493 auto o = flatbuffers::Offset<LogMessage>(end);
1494 return o;
1495 }
1496 };
1497
1498 inline flatbuffers::Offset<LogMessage> CreateLogMessage(
1499 flatbuffers::FlatBufferBuilder &_fbb,
1500 flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0) {
1501 LogMessageBuilder builder_(_fbb);
1502 builder_.add_buffer(buffer);
1503 return builder_.Finish();
1504 }
1505
1506 inline flatbuffers::Offset<LogMessage> CreateLogMessageDirect(
1507 flatbuffers::FlatBufferBuilder &_fbb,
1508 const std::vector<int8_t> *buffer = nullptr) {
1509 return chre::fbs::CreateLogMessage(
1510 _fbb,
1511 buffer ? _fbb.CreateVector<int8_t>(*buffer) : 0);
1512 }
1513
1514 flatbuffers::Offset<LogMessage> CreateLogMessage(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1515
1516 struct TimeSyncMessageT : public flatbuffers::NativeTable {
1517 typedef TimeSyncMessage TableType;
1518 int64_t offset;
1519 TimeSyncMessageT()
1520 : offset(0) {
1521 }
1522 };
1523
1524 /// Represents a message sent to CHRE to indicate AP timestamp for time sync
1525 struct TimeSyncMessage FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1526 typedef TimeSyncMessageT NativeTableType;
1527 enum {
1528 VT_OFFSET = 4
1529 };
1530 /// Offset between AP and CHRE timestamp
1531 int64_t offset() const {
1532 return GetField<int64_t>(VT_OFFSET, 0);
1533 }
1534 bool mutate_offset(int64_t _offset) {
1535 return SetField(VT_OFFSET, _offset);
1536 }
1537 bool Verify(flatbuffers::Verifier &verifier) const {
1538 return VerifyTableStart(verifier) &&
1539 VerifyField<int64_t>(verifier, VT_OFFSET) &&
1540 verifier.EndTable();
1541 }
1542 TimeSyncMessageT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1543 void UnPackTo(TimeSyncMessageT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1544 static flatbuffers::Offset<TimeSyncMessage> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1545 };
1546
1547 struct TimeSyncMessageBuilder {
1548 flatbuffers::FlatBufferBuilder &fbb_;
1549 flatbuffers::uoffset_t start_;
1550 void add_offset(int64_t offset) {
1551 fbb_.AddElement<int64_t>(TimeSyncMessage::VT_OFFSET, offset, 0);
1552 }
1553 TimeSyncMessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1554 : fbb_(_fbb) {
1555 start_ = fbb_.StartTable();
1556 }
1557 TimeSyncMessageBuilder &operator=(const TimeSyncMessageBuilder &);
1558 flatbuffers::Offset<TimeSyncMessage> Finish() {
1559 const auto end = fbb_.EndTable(start_, 1);
1560 auto o = flatbuffers::Offset<TimeSyncMessage>(end);
1561 return o;
1562 }
1563 };
1564
1565 inline flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(
1566 flatbuffers::FlatBufferBuilder &_fbb,
1567 int64_t offset = 0) {
1568 TimeSyncMessageBuilder builder_(_fbb);
1569 builder_.add_offset(offset);
1570 return builder_.Finish();
1571 }
1572
1573 flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1574
1575 struct DebugDumpRequestT : public flatbuffers::NativeTable {
1576 typedef DebugDumpRequest TableType;
1577 DebugDumpRequestT() {
1578 }
1579 };
1580
1581 /// A request to gather and return debugging information. Only one debug dump
1582 /// session can be active at a time. Upon accepting a request, zero or more
1583 /// DebugDumpData messages are generated, followed by a DebugDumpResponse
1584 /// indicating the completion of the operation.
1585 struct DebugDumpRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1586 typedef DebugDumpRequestT NativeTableType;
1587 bool Verify(flatbuffers::Verifier &verifier) const {
1588 return VerifyTableStart(verifier) &&
1589 verifier.EndTable();
1590 }
1591 DebugDumpRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1592 void UnPackTo(DebugDumpRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1593 static flatbuffers::Offset<DebugDumpRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1594 };
1595
1596 struct DebugDumpRequestBuilder {
1597 flatbuffers::FlatBufferBuilder &fbb_;
1598 flatbuffers::uoffset_t start_;
1599 DebugDumpRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1600 : fbb_(_fbb) {
1601 start_ = fbb_.StartTable();
1602 }
1603 DebugDumpRequestBuilder &operator=(const DebugDumpRequestBuilder &);
1604 flatbuffers::Offset<DebugDumpRequest> Finish() {
1605 const auto end = fbb_.EndTable(start_, 0);
1606 auto o = flatbuffers::Offset<DebugDumpRequest>(end);
1607 return o;
1608 }
1609 };
1610
1611 inline flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(
1612 flatbuffers::FlatBufferBuilder &_fbb) {
1613 DebugDumpRequestBuilder builder_(_fbb);
1614 return builder_.Finish();
1615 }
1616
1617 flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1618
1619 struct DebugDumpDataT : public flatbuffers::NativeTable {
1620 typedef DebugDumpData TableType;
1621 std::vector<int8_t> debug_str;
1622 DebugDumpDataT() {
1623 }
1624 };
1625
1626 struct DebugDumpData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1627 typedef DebugDumpDataT NativeTableType;
1628 enum {
1629 VT_DEBUG_STR = 4
1630 };
1631 /// Null-terminated ASCII string containing debugging information
1632 const flatbuffers::Vector<int8_t> *debug_str() const {
1633 return GetPointer<const flatbuffers::Vector<int8_t> *>(VT_DEBUG_STR);
1634 }
1635 flatbuffers::Vector<int8_t> *mutable_debug_str() {
1636 return GetPointer<flatbuffers::Vector<int8_t> *>(VT_DEBUG_STR);
1637 }
1638 bool Verify(flatbuffers::Verifier &verifier) const {
1639 return VerifyTableStart(verifier) &&
1640 VerifyField<flatbuffers::uoffset_t>(verifier, VT_DEBUG_STR) &&
1641 verifier.Verify(debug_str()) &&
1642 verifier.EndTable();
1643 }
1644 DebugDumpDataT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1645 void UnPackTo(DebugDumpDataT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1646 static flatbuffers::Offset<DebugDumpData> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1647 };
1648
1649 struct DebugDumpDataBuilder {
1650 flatbuffers::FlatBufferBuilder &fbb_;
1651 flatbuffers::uoffset_t start_;
1652 void add_debug_str(flatbuffers::Offset<flatbuffers::Vector<int8_t>> debug_str) {
1653 fbb_.AddOffset(DebugDumpData::VT_DEBUG_STR, debug_str);
1654 }
1655 DebugDumpDataBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1656 : fbb_(_fbb) {
1657 start_ = fbb_.StartTable();
1658 }
1659 DebugDumpDataBuilder &operator=(const DebugDumpDataBuilder &);
1660 flatbuffers::Offset<DebugDumpData> Finish() {
1661 const auto end = fbb_.EndTable(start_, 1);
1662 auto o = flatbuffers::Offset<DebugDumpData>(end);
1663 return o;
1664 }
1665 };
1666
1667 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(
1668 flatbuffers::FlatBufferBuilder &_fbb,
1669 flatbuffers::Offset<flatbuffers::Vector<int8_t>> debug_str = 0) {
1670 DebugDumpDataBuilder builder_(_fbb);
1671 builder_.add_debug_str(debug_str);
1672 return builder_.Finish();
1673 }
1674
1675 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpDataDirect(
1676 flatbuffers::FlatBufferBuilder &_fbb,
1677 const std::vector<int8_t> *debug_str = nullptr) {
1678 return chre::fbs::CreateDebugDumpData(
1679 _fbb,
1680 debug_str ? _fbb.CreateVector<int8_t>(*debug_str) : 0);
1681 }
1682
1683 flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1684
1685 struct DebugDumpResponseT : public flatbuffers::NativeTable {
1686 typedef DebugDumpResponse TableType;
1687 bool success;
1688 uint32_t data_count;
1689 DebugDumpResponseT()
1690 : success(false),
1691 data_count(0) {
1692 }
1693 };
1694
1695 struct DebugDumpResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1696 typedef DebugDumpResponseT NativeTableType;
1697 enum {
1698 VT_SUCCESS = 4,
1699 VT_DATA_COUNT = 6
1700 };
1701 /// true if the request was accepted and a dump was performed, false if it was
1702 /// rejected or failed to complete for some reason
1703 bool success() const {
1704 return GetField<uint8_t>(VT_SUCCESS, 0) != 0;
1705 }
1706 bool mutate_success(bool _success) {
1707 return SetField(VT_SUCCESS, static_cast<uint8_t>(_success));
1708 }
1709 /// The number of DebugDumpData messages sent in this session
1710 uint32_t data_count() const {
1711 return GetField<uint32_t>(VT_DATA_COUNT, 0);
1712 }
1713 bool mutate_data_count(uint32_t _data_count) {
1714 return SetField(VT_DATA_COUNT, _data_count);
1715 }
1716 bool Verify(flatbuffers::Verifier &verifier) const {
1717 return VerifyTableStart(verifier) &&
1718 VerifyField<uint8_t>(verifier, VT_SUCCESS) &&
1719 VerifyField<uint32_t>(verifier, VT_DATA_COUNT) &&
1720 verifier.EndTable();
1721 }
1722 DebugDumpResponseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1723 void UnPackTo(DebugDumpResponseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1724 static flatbuffers::Offset<DebugDumpResponse> Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1725 };
1726
1727 struct DebugDumpResponseBuilder {
1728 flatbuffers::FlatBufferBuilder &fbb_;
1729 flatbuffers::uoffset_t start_;
1730 void add_success(bool success) {
1731 fbb_.AddElement<uint8_t>(DebugDumpResponse::VT_SUCCESS, static_cast<uint8_t>(success), 0);
1732 }
1733 void add_data_count(uint32_t data_count) {
1734 fbb_.AddElement<uint32_t>(DebugDumpResponse::VT_DATA_COUNT, data_count, 0);
1735 }
1736 DebugDumpResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1737 : fbb_(_fbb) {
1738 start_ = fbb_.StartTable();
1739 }
1740 DebugDumpResponseBuilder &operator=(const DebugDumpResponseBuilder &);
1741 flatbuffers::Offset<DebugDumpResponse> Finish() {
1742 const auto end = fbb_.EndTable(start_, 2);
1743 auto o = flatbuffers::Offset<DebugDumpResponse>(end);
1744 return o;
1745 }
1746 };
1747
1748 inline flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(
1749 flatbuffers::FlatBufferBuilder &_fbb,
1750 bool success = false,
1751 uint32_t data_count = 0) {
1752 DebugDumpResponseBuilder builder_(_fbb);
1753 builder_.add_data_count(data_count);
1754 builder_.add_success(success);
1755 return builder_.Finish();
1756 }
1757
1758 flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1759
1760 struct TimeSyncRequestT : public flatbuffers::NativeTable {
1761 typedef TimeSyncRequest TableType;
1762 TimeSyncRequestT() {
1763 }
1764 };
1765
1766 /// A request from CHRE for host to initiate a time sync message
1767 /// (system feature, platform-specific - not all platforms necessarily use this)
1768 struct TimeSyncRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1769 typedef TimeSyncRequestT NativeTableType;
1770 bool Verify(flatbuffers::Verifier &verifier) const {
1771 return VerifyTableStart(verifier) &&
1772 verifier.EndTable();
1773 }
1774 TimeSyncRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1775 void UnPackTo(TimeSyncRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1776 static flatbuffers::Offset<TimeSyncRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1777 };
1778
1779 struct TimeSyncRequestBuilder {
1780 flatbuffers::FlatBufferBuilder &fbb_;
1781 flatbuffers::uoffset_t start_;
1782 TimeSyncRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1783 : fbb_(_fbb) {
1784 start_ = fbb_.StartTable();
1785 }
1786 TimeSyncRequestBuilder &operator=(const TimeSyncRequestBuilder &);
1787 flatbuffers::Offset<TimeSyncRequest> Finish() {
1788 const auto end = fbb_.EndTable(start_, 0);
1789 auto o = flatbuffers::Offset<TimeSyncRequest>(end);
1790 return o;
1791 }
1792 };
1793
1794 inline flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(
1795 flatbuffers::FlatBufferBuilder &_fbb) {
1796 TimeSyncRequestBuilder builder_(_fbb);
1797 return builder_.Finish();
1798 }
1799
1800 flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1801
1802 struct LowPowerMicAccessRequestT : public flatbuffers::NativeTable {
1803 typedef LowPowerMicAccessRequest TableType;
1804 LowPowerMicAccessRequestT() {
1805 }
1806 };
1807
1808 /// Request from CHRE to enable direct access to data from the low-power
1809 /// microphone. On some systems, coordination via the AP (e.g. with
1810 /// SoundTrigger HAL) is needed to ensure this capability is powered up when
1811 /// CHRE needs it. The host does not send a response.
1812 struct LowPowerMicAccessRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1813 typedef LowPowerMicAccessRequestT NativeTableType;
1814 bool Verify(flatbuffers::Verifier &verifier) const {
1815 return VerifyTableStart(verifier) &&
1816 verifier.EndTable();
1817 }
1818 LowPowerMicAccessRequestT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1819 void UnPackTo(LowPowerMicAccessRequestT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1820 static flatbuffers::Offset<LowPowerMicAccessRequest> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1821 };
1822
1823 struct LowPowerMicAccessRequestBuilder {
1824 flatbuffers::FlatBufferBuilder &fbb_;
1825 flatbuffers::uoffset_t start_;
1826 LowPowerMicAccessRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1827 : fbb_(_fbb) {
1828 start_ = fbb_.StartTable();
1829 }
1830 LowPowerMicAccessRequestBuilder &operator=(const LowPowerMicAccessRequestBuilder &);
1831 flatbuffers::Offset<LowPowerMicAccessRequest> Finish() {
1832 const auto end = fbb_.EndTable(start_, 0);
1833 auto o = flatbuffers::Offset<LowPowerMicAccessRequest>(end);
1834 return o;
1835 }
1836 };
1837
1838 inline flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(
1839 flatbuffers::FlatBufferBuilder &_fbb) {
1840 LowPowerMicAccessRequestBuilder builder_(_fbb);
1841 return builder_.Finish();
1842 }
1843
1844 flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1845
1846 struct LowPowerMicAccessReleaseT : public flatbuffers::NativeTable {
1847 typedef LowPowerMicAccessRelease TableType;
1848 LowPowerMicAccessReleaseT() {
1849 }
1850 };
1851
1852 /// Notification from CHRE that it no longer needs direct access to low-power
1853 /// microphone data.
1854 struct LowPowerMicAccessRelease FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1855 typedef LowPowerMicAccessReleaseT NativeTableType;
1856 bool Verify(flatbuffers::Verifier &verifier) const {
1857 return VerifyTableStart(verifier) &&
1858 verifier.EndTable();
1859 }
1860 LowPowerMicAccessReleaseT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1861 void UnPackTo(LowPowerMicAccessReleaseT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1862 static flatbuffers::Offset<LowPowerMicAccessRelease> Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1863 };
1864
1865 struct LowPowerMicAccessReleaseBuilder {
1866 flatbuffers::FlatBufferBuilder &fbb_;
1867 flatbuffers::uoffset_t start_;
1868 LowPowerMicAccessReleaseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1869 : fbb_(_fbb) {
1870 start_ = fbb_.StartTable();
1871 }
1872 LowPowerMicAccessReleaseBuilder &operator=(const LowPowerMicAccessReleaseBuilder &);
1873 flatbuffers::Offset<LowPowerMicAccessRelease> Finish() {
1874 const auto end = fbb_.EndTable(start_, 0);
1875 auto o = flatbuffers::Offset<LowPowerMicAccessRelease>(end);
1876 return o;
1877 }
1878 };
1879
1880 inline flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(
1881 flatbuffers::FlatBufferBuilder &_fbb) {
1882 LowPowerMicAccessReleaseBuilder builder_(_fbb);
1883 return builder_.Finish();
1884 }
1885
1886 flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1887
1888 struct MessageContainerT : public flatbuffers::NativeTable {
1889 typedef MessageContainer TableType;
1890 ChreMessageUnion message;
1891 std::unique_ptr<HostAddress> host_addr;
1892 MessageContainerT() {
1893 }
1894 };
1895
1896 /// The top-level container that encapsulates all possible messages. Note that
1897 /// per FlatBuffers requirements, we can't use a union as the top-level
1898 /// structure (root type), so we must wrap it in a table.
1899 struct MessageContainer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1900 typedef MessageContainerT NativeTableType;
1901 enum {
1902 VT_MESSAGE_TYPE = 4,
1903 VT_MESSAGE = 6,
1904 VT_HOST_ADDR = 8
1905 };
1906 ChreMessage message_type() const {
1907 return static_cast<ChreMessage>(GetField<uint8_t>(VT_MESSAGE_TYPE, 0));
1908 }
1909 bool mutate_message_type(ChreMessage _message_type) {
1910 return SetField(VT_MESSAGE_TYPE, static_cast<uint8_t>(_message_type));
1911 }
1912 const void *message() const {
1913 return GetPointer<const void *>(VT_MESSAGE);
1914 }
1915 void *mutable_message() {
1916 return GetPointer<void *>(VT_MESSAGE);
1917 }
1918 /// The originating or destination client ID on the host side, used to direct
1919 /// responses only to the client that sent the request. Although initially
1920 /// populated by the requesting client, this is enforced to be the correct
1921 /// value by the entity guarding access to CHRE.
1922 /// This is wrapped in a struct to ensure that it is always included when
1923 /// encoding the message, so it can be mutated by the host daemon.
1924 const HostAddress *host_addr() const {
1925 return GetStruct<const HostAddress *>(VT_HOST_ADDR);
1926 }
1927 HostAddress *mutable_host_addr() {
1928 return GetStruct<HostAddress *>(VT_HOST_ADDR);
1929 }
1930 bool Verify(flatbuffers::Verifier &verifier) const {
1931 return VerifyTableStart(verifier) &&
1932 VerifyField<uint8_t>(verifier, VT_MESSAGE_TYPE) &&
1933 VerifyFieldRequired<flatbuffers::uoffset_t>(verifier, VT_MESSAGE) &&
1934 VerifyChreMessage(verifier, message(), message_type()) &&
1935 VerifyFieldRequired<HostAddress>(verifier, VT_HOST_ADDR) &&
1936 verifier.EndTable();
1937 }
1938 MessageContainerT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1939 void UnPackTo(MessageContainerT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
1940 static flatbuffers::Offset<MessageContainer> Pack(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1941 };
1942
1943 struct MessageContainerBuilder {
1944 flatbuffers::FlatBufferBuilder &fbb_;
1945 flatbuffers::uoffset_t start_;
1946 void add_message_type(ChreMessage message_type) {
1947 fbb_.AddElement<uint8_t>(MessageContainer::VT_MESSAGE_TYPE, static_cast<uint8_t>(message_type), 0);
1948 }
1949 void add_message(flatbuffers::Offset<void> message) {
1950 fbb_.AddOffset(MessageContainer::VT_MESSAGE, message);
1951 }
1952 void add_host_addr(const HostAddress *host_addr) {
1953 fbb_.AddStruct(MessageContainer::VT_HOST_ADDR, host_addr);
1954 }
1955 MessageContainerBuilder(flatbuffers::FlatBufferBuilder &_fbb)
1956 : fbb_(_fbb) {
1957 start_ = fbb_.StartTable();
1958 }
1959 MessageContainerBuilder &operator=(const MessageContainerBuilder &);
1960 flatbuffers::Offset<MessageContainer> Finish() {
1961 const auto end = fbb_.EndTable(start_, 3);
1962 auto o = flatbuffers::Offset<MessageContainer>(end);
1963 fbb_.Required(o, MessageContainer::VT_MESSAGE);
1964 fbb_.Required(o, MessageContainer::VT_HOST_ADDR);
1965 return o;
1966 }
1967 };
1968
1969 inline flatbuffers::Offset<MessageContainer> CreateMessageContainer(
1970 flatbuffers::FlatBufferBuilder &_fbb,
1971 ChreMessage message_type = ChreMessage::NONE,
1972 flatbuffers::Offset<void> message = 0,
1973 const HostAddress *host_addr = 0) {
1974 MessageContainerBuilder builder_(_fbb);
1975 builder_.add_host_addr(host_addr);
1976 builder_.add_message(message);
1977 builder_.add_message_type(message_type);
1978 return builder_.Finish();
1979 }
1980
1981 flatbuffers::Offset<MessageContainer> CreateMessageContainer(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
1982
1983 inline NanoappMessageT *NanoappMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
1984 auto _o = new NanoappMessageT();
1985 UnPackTo(_o, _resolver);
1986 return _o;
1987 }
1988
1989 inline void NanoappMessage::UnPackTo(NanoappMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
1990 (void)_o;
1991 (void)_resolver;
1992 { auto _e = app_id(); _o->app_id = _e; };
1993 { auto _e = message_type(); _o->message_type = _e; };
1994 { auto _e = host_endpoint(); _o->host_endpoint = _e; };
1995 { auto _e = message(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->message.push_back(_e->Get(_i)); } };
1996 }
1997
1998 inline flatbuffers::Offset<NanoappMessage> NanoappMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
1999 return CreateNanoappMessage(_fbb, _o, _rehasher);
2000 }
2001
2002 inline flatbuffers::Offset<NanoappMessage> CreateNanoappMessage(flatbuffers::FlatBufferBuilder &_fbb, const NanoappMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2003 (void)_rehasher;
2004 (void)_o;
2005 auto _app_id = _o->app_id;
2006 auto _message_type = _o->message_type;
2007 auto _host_endpoint = _o->host_endpoint;
2008 auto _message = _fbb.CreateVector(_o->message);
2009 return chre::fbs::CreateNanoappMessage(
2010 _fbb,
2011 _app_id,
2012 _message_type,
2013 _host_endpoint,
2014 _message);
2015 }
2016
2017 inline HubInfoRequestT *HubInfoRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2018 auto _o = new HubInfoRequestT();
2019 UnPackTo(_o, _resolver);
2020 return _o;
2021 }
2022
2023 inline void HubInfoRequest::UnPackTo(HubInfoRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2024 (void)_o;
2025 (void)_resolver;
2026 }
2027
2028 inline flatbuffers::Offset<HubInfoRequest> HubInfoRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2029 return CreateHubInfoRequest(_fbb, _o, _rehasher);
2030 }
2031
2032 inline flatbuffers::Offset<HubInfoRequest> CreateHubInfoRequest(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2033 (void)_rehasher;
2034 (void)_o;
2035 return chre::fbs::CreateHubInfoRequest(
2036 _fbb);
2037 }
2038
2039 inline HubInfoResponseT *HubInfoResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2040 auto _o = new HubInfoResponseT();
2041 UnPackTo(_o, _resolver);
2042 return _o;
2043 }
2044
2045 inline void HubInfoResponse::UnPackTo(HubInfoResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2046 (void)_o;
2047 (void)_resolver;
2048 { auto _e = name(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->name.push_back(_e->Get(_i)); } };
2049 { auto _e = vendor(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->vendor.push_back(_e->Get(_i)); } };
2050 { auto _e = toolchain(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->toolchain.push_back(_e->Get(_i)); } };
2051 { auto _e = platform_version(); _o->platform_version = _e; };
2052 { auto _e = toolchain_version(); _o->toolchain_version = _e; };
2053 { auto _e = peak_mips(); _o->peak_mips = _e; };
2054 { auto _e = stopped_power(); _o->stopped_power = _e; };
2055 { auto _e = sleep_power(); _o->sleep_power = _e; };
2056 { auto _e = peak_power(); _o->peak_power = _e; };
2057 { auto _e = max_msg_len(); _o->max_msg_len = _e; };
2058 { auto _e = platform_id(); _o->platform_id = _e; };
2059 { auto _e = chre_platform_version(); _o->chre_platform_version = _e; };
2060 }
2061
2062 inline flatbuffers::Offset<HubInfoResponse> HubInfoResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2063 return CreateHubInfoResponse(_fbb, _o, _rehasher);
2064 }
2065
2066 inline flatbuffers::Offset<HubInfoResponse> CreateHubInfoResponse(flatbuffers::FlatBufferBuilder &_fbb, const HubInfoResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2067 (void)_rehasher;
2068 (void)_o;
2069 auto _name = _o->name.size() ? _fbb.CreateVector(_o->name) : 0;
2070 auto _vendor = _o->vendor.size() ? _fbb.CreateVector(_o->vendor) : 0;
2071 auto _toolchain = _o->toolchain.size() ? _fbb.CreateVector(_o->toolchain) : 0;
2072 auto _platform_version = _o->platform_version;
2073 auto _toolchain_version = _o->toolchain_version;
2074 auto _peak_mips = _o->peak_mips;
2075 auto _stopped_power = _o->stopped_power;
2076 auto _sleep_power = _o->sleep_power;
2077 auto _peak_power = _o->peak_power;
2078 auto _max_msg_len = _o->max_msg_len;
2079 auto _platform_id = _o->platform_id;
2080 auto _chre_platform_version = _o->chre_platform_version;
2081 return chre::fbs::CreateHubInfoResponse(
2082 _fbb,
2083 _name,
2084 _vendor,
2085 _toolchain,
2086 _platform_version,
2087 _toolchain_version,
2088 _peak_mips,
2089 _stopped_power,
2090 _sleep_power,
2091 _peak_power,
2092 _max_msg_len,
2093 _platform_id,
2094 _chre_platform_version);
2095 }
2096
2097 inline NanoappListRequestT *NanoappListRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2098 auto _o = new NanoappListRequestT();
2099 UnPackTo(_o, _resolver);
2100 return _o;
2101 }
2102
2103 inline void NanoappListRequest::UnPackTo(NanoappListRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2104 (void)_o;
2105 (void)_resolver;
2106 }
2107
2108 inline flatbuffers::Offset<NanoappListRequest> NanoappListRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2109 return CreateNanoappListRequest(_fbb, _o, _rehasher);
2110 }
2111
2112 inline flatbuffers::Offset<NanoappListRequest> CreateNanoappListRequest(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2113 (void)_rehasher;
2114 (void)_o;
2115 return chre::fbs::CreateNanoappListRequest(
2116 _fbb);
2117 }
2118
2119 inline NanoappListEntryT *NanoappListEntry::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2120 auto _o = new NanoappListEntryT();
2121 UnPackTo(_o, _resolver);
2122 return _o;
2123 }
2124
2125 inline void NanoappListEntry::UnPackTo(NanoappListEntryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2126 (void)_o;
2127 (void)_resolver;
2128 { auto _e = app_id(); _o->app_id = _e; };
2129 { auto _e = version(); _o->version = _e; };
2130 { auto _e = enabled(); _o->enabled = _e; };
2131 { auto _e = is_system(); _o->is_system = _e; };
2132 }
2133
2134 inline flatbuffers::Offset<NanoappListEntry> NanoappListEntry::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2135 return CreateNanoappListEntry(_fbb, _o, _rehasher);
2136 }
2137
2138 inline flatbuffers::Offset<NanoappListEntry> CreateNanoappListEntry(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListEntryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2139 (void)_rehasher;
2140 (void)_o;
2141 auto _app_id = _o->app_id;
2142 auto _version = _o->version;
2143 auto _enabled = _o->enabled;
2144 auto _is_system = _o->is_system;
2145 return chre::fbs::CreateNanoappListEntry(
2146 _fbb,
2147 _app_id,
2148 _version,
2149 _enabled,
2150 _is_system);
2151 }
2152
2153 inline NanoappListResponseT *NanoappListResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2154 auto _o = new NanoappListResponseT();
2155 UnPackTo(_o, _resolver);
2156 return _o;
2157 }
2158
2159 inline void NanoappListResponse::UnPackTo(NanoappListResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2160 (void)_o;
2161 (void)_resolver;
2162 { auto _e = nanoapps(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->nanoapps.push_back(std::unique_ptr<NanoappListEntryT>(_e->Get(_i)->UnPack(_resolver))); } };
2163 }
2164
2165 inline flatbuffers::Offset<NanoappListResponse> NanoappListResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2166 return CreateNanoappListResponse(_fbb, _o, _rehasher);
2167 }
2168
2169 inline flatbuffers::Offset<NanoappListResponse> CreateNanoappListResponse(flatbuffers::FlatBufferBuilder &_fbb, const NanoappListResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2170 (void)_rehasher;
2171 (void)_o;
2172 auto _nanoapps = _fbb.CreateVector<flatbuffers::Offset<NanoappListEntry>>(_o->nanoapps.size(), [&](size_t i) { return CreateNanoappListEntry(_fbb, _o->nanoapps[i].get(), _rehasher); });
2173 return chre::fbs::CreateNanoappListResponse(
2174 _fbb,
2175 _nanoapps);
2176 }
2177
2178 inline LoadNanoappRequestT *LoadNanoappRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2179 auto _o = new LoadNanoappRequestT();
2180 UnPackTo(_o, _resolver);
2181 return _o;
2182 }
2183
2184 inline void LoadNanoappRequest::UnPackTo(LoadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2185 (void)_o;
2186 (void)_resolver;
2187 { auto _e = transaction_id(); _o->transaction_id = _e; };
2188 { auto _e = app_id(); _o->app_id = _e; };
2189 { auto _e = app_version(); _o->app_version = _e; };
2190 { auto _e = target_api_version(); _o->target_api_version = _e; };
2191 { auto _e = app_binary(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->app_binary.push_back(_e->Get(_i)); } };
2192 { auto _e = fragment_id(); _o->fragment_id = _e; };
2193 { auto _e = total_app_size(); _o->total_app_size = _e; };
2194 { auto _e = app_binary_file_name(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->app_binary_file_name.push_back(_e->Get(_i)); } };
2195 }
2196
2197 inline flatbuffers::Offset<LoadNanoappRequest> LoadNanoappRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2198 return CreateLoadNanoappRequest(_fbb, _o, _rehasher);
2199 }
2200
2201 inline flatbuffers::Offset<LoadNanoappRequest> CreateLoadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2202 (void)_rehasher;
2203 (void)_o;
2204 auto _transaction_id = _o->transaction_id;
2205 auto _app_id = _o->app_id;
2206 auto _app_version = _o->app_version;
2207 auto _target_api_version = _o->target_api_version;
2208 auto _app_binary = _fbb.CreateVector(_o->app_binary);
2209 auto _fragment_id = _o->fragment_id;
2210 auto _total_app_size = _o->total_app_size;
2211 auto _app_binary_file_name = _o->app_binary_file_name.size() ? _fbb.CreateVector(_o->app_binary_file_name) : 0;
2212 return chre::fbs::CreateLoadNanoappRequest(
2213 _fbb,
2214 _transaction_id,
2215 _app_id,
2216 _app_version,
2217 _target_api_version,
2218 _app_binary,
2219 _fragment_id,
2220 _total_app_size,
2221 _app_binary_file_name);
2222 }
2223
2224 inline LoadNanoappResponseT *LoadNanoappResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2225 auto _o = new LoadNanoappResponseT();
2226 UnPackTo(_o, _resolver);
2227 return _o;
2228 }
2229
2230 inline void LoadNanoappResponse::UnPackTo(LoadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2231 (void)_o;
2232 (void)_resolver;
2233 { auto _e = transaction_id(); _o->transaction_id = _e; };
2234 { auto _e = success(); _o->success = _e; };
2235 { auto _e = fragment_id(); _o->fragment_id = _e; };
2236 }
2237
2238 inline flatbuffers::Offset<LoadNanoappResponse> LoadNanoappResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2239 return CreateLoadNanoappResponse(_fbb, _o, _rehasher);
2240 }
2241
2242 inline flatbuffers::Offset<LoadNanoappResponse> CreateLoadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const LoadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2243 (void)_rehasher;
2244 (void)_o;
2245 auto _transaction_id = _o->transaction_id;
2246 auto _success = _o->success;
2247 auto _fragment_id = _o->fragment_id;
2248 return chre::fbs::CreateLoadNanoappResponse(
2249 _fbb,
2250 _transaction_id,
2251 _success,
2252 _fragment_id);
2253 }
2254
2255 inline UnloadNanoappRequestT *UnloadNanoappRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2256 auto _o = new UnloadNanoappRequestT();
2257 UnPackTo(_o, _resolver);
2258 return _o;
2259 }
2260
2261 inline void UnloadNanoappRequest::UnPackTo(UnloadNanoappRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2262 (void)_o;
2263 (void)_resolver;
2264 { auto _e = transaction_id(); _o->transaction_id = _e; };
2265 { auto _e = app_id(); _o->app_id = _e; };
2266 { auto _e = allow_system_nanoapp_unload(); _o->allow_system_nanoapp_unload = _e; };
2267 }
2268
2269 inline flatbuffers::Offset<UnloadNanoappRequest> UnloadNanoappRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2270 return CreateUnloadNanoappRequest(_fbb, _o, _rehasher);
2271 }
2272
2273 inline flatbuffers::Offset<UnloadNanoappRequest> CreateUnloadNanoappRequest(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2274 (void)_rehasher;
2275 (void)_o;
2276 auto _transaction_id = _o->transaction_id;
2277 auto _app_id = _o->app_id;
2278 auto _allow_system_nanoapp_unload = _o->allow_system_nanoapp_unload;
2279 return chre::fbs::CreateUnloadNanoappRequest(
2280 _fbb,
2281 _transaction_id,
2282 _app_id,
2283 _allow_system_nanoapp_unload);
2284 }
2285
2286 inline UnloadNanoappResponseT *UnloadNanoappResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2287 auto _o = new UnloadNanoappResponseT();
2288 UnPackTo(_o, _resolver);
2289 return _o;
2290 }
2291
2292 inline void UnloadNanoappResponse::UnPackTo(UnloadNanoappResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2293 (void)_o;
2294 (void)_resolver;
2295 { auto _e = transaction_id(); _o->transaction_id = _e; };
2296 { auto _e = success(); _o->success = _e; };
2297 }
2298
2299 inline flatbuffers::Offset<UnloadNanoappResponse> UnloadNanoappResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2300 return CreateUnloadNanoappResponse(_fbb, _o, _rehasher);
2301 }
2302
2303 inline flatbuffers::Offset<UnloadNanoappResponse> CreateUnloadNanoappResponse(flatbuffers::FlatBufferBuilder &_fbb, const UnloadNanoappResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2304 (void)_rehasher;
2305 (void)_o;
2306 auto _transaction_id = _o->transaction_id;
2307 auto _success = _o->success;
2308 return chre::fbs::CreateUnloadNanoappResponse(
2309 _fbb,
2310 _transaction_id,
2311 _success);
2312 }
2313
2314 inline LogMessageT *LogMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2315 auto _o = new LogMessageT();
2316 UnPackTo(_o, _resolver);
2317 return _o;
2318 }
2319
2320 inline void LogMessage::UnPackTo(LogMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2321 (void)_o;
2322 (void)_resolver;
2323 { auto _e = buffer(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->buffer.push_back(_e->Get(_i)); } };
2324 }
2325
2326 inline flatbuffers::Offset<LogMessage> LogMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2327 return CreateLogMessage(_fbb, _o, _rehasher);
2328 }
2329
2330 inline flatbuffers::Offset<LogMessage> CreateLogMessage(flatbuffers::FlatBufferBuilder &_fbb, const LogMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2331 (void)_rehasher;
2332 (void)_o;
2333 auto _buffer = _o->buffer.size() ? _fbb.CreateVector(_o->buffer) : 0;
2334 return chre::fbs::CreateLogMessage(
2335 _fbb,
2336 _buffer);
2337 }
2338
2339 inline TimeSyncMessageT *TimeSyncMessage::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2340 auto _o = new TimeSyncMessageT();
2341 UnPackTo(_o, _resolver);
2342 return _o;
2343 }
2344
2345 inline void TimeSyncMessage::UnPackTo(TimeSyncMessageT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2346 (void)_o;
2347 (void)_resolver;
2348 { auto _e = offset(); _o->offset = _e; };
2349 }
2350
2351 inline flatbuffers::Offset<TimeSyncMessage> TimeSyncMessage::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2352 return CreateTimeSyncMessage(_fbb, _o, _rehasher);
2353 }
2354
2355 inline flatbuffers::Offset<TimeSyncMessage> CreateTimeSyncMessage(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncMessageT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2356 (void)_rehasher;
2357 (void)_o;
2358 auto _offset = _o->offset;
2359 return chre::fbs::CreateTimeSyncMessage(
2360 _fbb,
2361 _offset);
2362 }
2363
2364 inline DebugDumpRequestT *DebugDumpRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2365 auto _o = new DebugDumpRequestT();
2366 UnPackTo(_o, _resolver);
2367 return _o;
2368 }
2369
2370 inline void DebugDumpRequest::UnPackTo(DebugDumpRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2371 (void)_o;
2372 (void)_resolver;
2373 }
2374
2375 inline flatbuffers::Offset<DebugDumpRequest> DebugDumpRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2376 return CreateDebugDumpRequest(_fbb, _o, _rehasher);
2377 }
2378
2379 inline flatbuffers::Offset<DebugDumpRequest> CreateDebugDumpRequest(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2380 (void)_rehasher;
2381 (void)_o;
2382 return chre::fbs::CreateDebugDumpRequest(
2383 _fbb);
2384 }
2385
2386 inline DebugDumpDataT *DebugDumpData::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2387 auto _o = new DebugDumpDataT();
2388 UnPackTo(_o, _resolver);
2389 return _o;
2390 }
2391
2392 inline void DebugDumpData::UnPackTo(DebugDumpDataT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2393 (void)_o;
2394 (void)_resolver;
2395 { auto _e = debug_str(); if (_e) for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->debug_str.push_back(_e->Get(_i)); } };
2396 }
2397
2398 inline flatbuffers::Offset<DebugDumpData> DebugDumpData::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2399 return CreateDebugDumpData(_fbb, _o, _rehasher);
2400 }
2401
2402 inline flatbuffers::Offset<DebugDumpData> CreateDebugDumpData(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpDataT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2403 (void)_rehasher;
2404 (void)_o;
2405 auto _debug_str = _o->debug_str.size() ? _fbb.CreateVector(_o->debug_str) : 0;
2406 return chre::fbs::CreateDebugDumpData(
2407 _fbb,
2408 _debug_str);
2409 }
2410
2411 inline DebugDumpResponseT *DebugDumpResponse::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2412 auto _o = new DebugDumpResponseT();
2413 UnPackTo(_o, _resolver);
2414 return _o;
2415 }
2416
2417 inline void DebugDumpResponse::UnPackTo(DebugDumpResponseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2418 (void)_o;
2419 (void)_resolver;
2420 { auto _e = success(); _o->success = _e; };
2421 { auto _e = data_count(); _o->data_count = _e; };
2422 }
2423
2424 inline flatbuffers::Offset<DebugDumpResponse> DebugDumpResponse::Pack(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2425 return CreateDebugDumpResponse(_fbb, _o, _rehasher);
2426 }
2427
2428 inline flatbuffers::Offset<DebugDumpResponse> CreateDebugDumpResponse(flatbuffers::FlatBufferBuilder &_fbb, const DebugDumpResponseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2429 (void)_rehasher;
2430 (void)_o;
2431 auto _success = _o->success;
2432 auto _data_count = _o->data_count;
2433 return chre::fbs::CreateDebugDumpResponse(
2434 _fbb,
2435 _success,
2436 _data_count);
2437 }
2438
2439 inline TimeSyncRequestT *TimeSyncRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2440 auto _o = new TimeSyncRequestT();
2441 UnPackTo(_o, _resolver);
2442 return _o;
2443 }
2444
2445 inline void TimeSyncRequest::UnPackTo(TimeSyncRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2446 (void)_o;
2447 (void)_resolver;
2448 }
2449
2450 inline flatbuffers::Offset<TimeSyncRequest> TimeSyncRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2451 return CreateTimeSyncRequest(_fbb, _o, _rehasher);
2452 }
2453
2454 inline flatbuffers::Offset<TimeSyncRequest> CreateTimeSyncRequest(flatbuffers::FlatBufferBuilder &_fbb, const TimeSyncRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2455 (void)_rehasher;
2456 (void)_o;
2457 return chre::fbs::CreateTimeSyncRequest(
2458 _fbb);
2459 }
2460
2461 inline LowPowerMicAccessRequestT *LowPowerMicAccessRequest::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2462 auto _o = new LowPowerMicAccessRequestT();
2463 UnPackTo(_o, _resolver);
2464 return _o;
2465 }
2466
2467 inline void LowPowerMicAccessRequest::UnPackTo(LowPowerMicAccessRequestT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2468 (void)_o;
2469 (void)_resolver;
2470 }
2471
2472 inline flatbuffers::Offset<LowPowerMicAccessRequest> LowPowerMicAccessRequest::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2473 return CreateLowPowerMicAccessRequest(_fbb, _o, _rehasher);
2474 }
2475
2476 inline flatbuffers::Offset<LowPowerMicAccessRequest> CreateLowPowerMicAccessRequest(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessRequestT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2477 (void)_rehasher;
2478 (void)_o;
2479 return chre::fbs::CreateLowPowerMicAccessRequest(
2480 _fbb);
2481 }
2482
2483 inline LowPowerMicAccessReleaseT *LowPowerMicAccessRelease::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2484 auto _o = new LowPowerMicAccessReleaseT();
2485 UnPackTo(_o, _resolver);
2486 return _o;
2487 }
2488
2489 inline void LowPowerMicAccessRelease::UnPackTo(LowPowerMicAccessReleaseT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2490 (void)_o;
2491 (void)_resolver;
2492 }
2493
2494 inline flatbuffers::Offset<LowPowerMicAccessRelease> LowPowerMicAccessRelease::Pack(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2495 return CreateLowPowerMicAccessRelease(_fbb, _o, _rehasher);
2496 }
2497
2498 inline flatbuffers::Offset<LowPowerMicAccessRelease> CreateLowPowerMicAccessRelease(flatbuffers::FlatBufferBuilder &_fbb, const LowPowerMicAccessReleaseT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2499 (void)_rehasher;
2500 (void)_o;
2501 return chre::fbs::CreateLowPowerMicAccessRelease(
2502 _fbb);
2503 }
2504
2505 inline MessageContainerT *MessageContainer::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
2506 auto _o = new MessageContainerT();
2507 UnPackTo(_o, _resolver);
2508 return _o;
2509 }
2510
2511 inline void MessageContainer::UnPackTo(MessageContainerT *_o, const flatbuffers::resolver_function_t *_resolver) const {
2512 (void)_o;
2513 (void)_resolver;
2514 { auto _e = message_type(); _o->message.type = _e; };
2515 { auto _e = message(); if (_e) _o->message.table = ChreMessageUnion::UnPack(_e, message_type(),_resolver); };
2516 { auto _e = host_addr(); if (_e) _o->host_addr = std::unique_ptr<HostAddress>(new HostAddress(*_e)); };
2517 }
2518
2519 inline flatbuffers::Offset<MessageContainer> MessageContainer::Pack(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
2520 return CreateMessageContainer(_fbb, _o, _rehasher);
2521 }
2522
2523 inline flatbuffers::Offset<MessageContainer> CreateMessageContainer(flatbuffers::FlatBufferBuilder &_fbb, const MessageContainerT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
2524 (void)_rehasher;
2525 (void)_o;
2526 auto _message_type = _o->message.type;
2527 auto _message = _o->message.Pack(_fbb);
2528 auto _host_addr = _o->host_addr ? _o->host_addr.get() : 0;
2529 return chre::fbs::CreateMessageContainer(
2530 _fbb,
2531 _message_type,
2532 _message,
2533 _host_addr);
2534 }
2535
2536 inline bool VerifyChreMessage(flatbuffers::Verifier &verifier, const void *obj, ChreMessage type) {
2537 switch (type) {
2538 case ChreMessage::NONE: {
2539 return true;
2540 }
2541 case ChreMessage::NanoappMessage: {
2542 auto ptr = reinterpret_cast<const NanoappMessage *>(obj);
2543 return verifier.VerifyTable(ptr);
2544 }
2545 case ChreMessage::HubInfoRequest: {
2546 auto ptr = reinterpret_cast<const HubInfoRequest *>(obj);
2547 return verifier.VerifyTable(ptr);
2548 }
2549 case ChreMessage::HubInfoResponse: {
2550 auto ptr = reinterpret_cast<const HubInfoResponse *>(obj);
2551 return verifier.VerifyTable(ptr);
2552 }
2553 case ChreMessage::NanoappListRequest: {
2554 auto ptr = reinterpret_cast<const NanoappListRequest *>(obj);
2555 return verifier.VerifyTable(ptr);
2556 }
2557 case ChreMessage::NanoappListResponse: {
2558 auto ptr = reinterpret_cast<const NanoappListResponse *>(obj);
2559 return verifier.VerifyTable(ptr);
2560 }
2561 case ChreMessage::LoadNanoappRequest: {
2562 auto ptr = reinterpret_cast<const LoadNanoappRequest *>(obj);
2563 return verifier.VerifyTable(ptr);
2564 }
2565 case ChreMessage::LoadNanoappResponse: {
2566 auto ptr = reinterpret_cast<const LoadNanoappResponse *>(obj);
2567 return verifier.VerifyTable(ptr);
2568 }
2569 case ChreMessage::UnloadNanoappRequest: {
2570 auto ptr = reinterpret_cast<const UnloadNanoappRequest *>(obj);
2571 return verifier.VerifyTable(ptr);
2572 }
2573 case ChreMessage::UnloadNanoappResponse: {
2574 auto ptr = reinterpret_cast<const UnloadNanoappResponse *>(obj);
2575 return verifier.VerifyTable(ptr);
2576 }
2577 case ChreMessage::LogMessage: {
2578 auto ptr = reinterpret_cast<const LogMessage *>(obj);
2579 return verifier.VerifyTable(ptr);
2580 }
2581 case ChreMessage::TimeSyncMessage: {
2582 auto ptr = reinterpret_cast<const TimeSyncMessage *>(obj);
2583 return verifier.VerifyTable(ptr);
2584 }
2585 case ChreMessage::DebugDumpRequest: {
2586 auto ptr = reinterpret_cast<const DebugDumpRequest *>(obj);
2587 return verifier.VerifyTable(ptr);
2588 }
2589 case ChreMessage::DebugDumpData: {
2590 auto ptr = reinterpret_cast<const DebugDumpData *>(obj);
2591 return verifier.VerifyTable(ptr);
2592 }
2593 case ChreMessage::DebugDumpResponse: {
2594 auto ptr = reinterpret_cast<const DebugDumpResponse *>(obj);
2595 return verifier.VerifyTable(ptr);
2596 }
2597 case ChreMessage::TimeSyncRequest: {
2598 auto ptr = reinterpret_cast<const TimeSyncRequest *>(obj);
2599 return verifier.VerifyTable(ptr);
2600 }
2601 case ChreMessage::LowPowerMicAccessRequest: {
2602 auto ptr = reinterpret_cast<const LowPowerMicAccessRequest *>(obj);
2603 return verifier.VerifyTable(ptr);
2604 }
2605 case ChreMessage::LowPowerMicAccessRelease: {
2606 auto ptr = reinterpret_cast<const LowPowerMicAccessRelease *>(obj);
2607 return verifier.VerifyTable(ptr);
2608 }
2609 default: return false;
2610 }
2611 }
2612
2613 inline bool VerifyChreMessageVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<uint8_t> *types) {
2614 if (values->size() != types->size()) return false;
2615 for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
2616 if (!VerifyChreMessage(
2617 verifier, values->Get(i), types->GetEnum<ChreMessage>(i))) {
2618 return false;
2619 }
2620 }
2621 return true;
2622 }
2623
2624 inline flatbuffers::NativeTable *ChreMessageUnion::UnPack(const void *obj, ChreMessage type, const flatbuffers::resolver_function_t *resolver) {
2625 switch (type) {
2626 case ChreMessage::NanoappMessage: {
2627 auto ptr = reinterpret_cast<const NanoappMessage *>(obj);
2628 return ptr->UnPack(resolver);
2629 }
2630 case ChreMessage::HubInfoRequest: {
2631 auto ptr = reinterpret_cast<const HubInfoRequest *>(obj);
2632 return ptr->UnPack(resolver);
2633 }
2634 case ChreMessage::HubInfoResponse: {
2635 auto ptr = reinterpret_cast<const HubInfoResponse *>(obj);
2636 return ptr->UnPack(resolver);
2637 }
2638 case ChreMessage::NanoappListRequest: {
2639 auto ptr = reinterpret_cast<const NanoappListRequest *>(obj);
2640 return ptr->UnPack(resolver);
2641 }
2642 case ChreMessage::NanoappListResponse: {
2643 auto ptr = reinterpret_cast<const NanoappListResponse *>(obj);
2644 return ptr->UnPack(resolver);
2645 }
2646 case ChreMessage::LoadNanoappRequest: {
2647 auto ptr = reinterpret_cast<const LoadNanoappRequest *>(obj);
2648 return ptr->UnPack(resolver);
2649 }
2650 case ChreMessage::LoadNanoappResponse: {
2651 auto ptr = reinterpret_cast<const LoadNanoappResponse *>(obj);
2652 return ptr->UnPack(resolver);
2653 }
2654 case ChreMessage::UnloadNanoappRequest: {
2655 auto ptr = reinterpret_cast<const UnloadNanoappRequest *>(obj);
2656 return ptr->UnPack(resolver);
2657 }
2658 case ChreMessage::UnloadNanoappResponse: {
2659 auto ptr = reinterpret_cast<const UnloadNanoappResponse *>(obj);
2660 return ptr->UnPack(resolver);
2661 }
2662 case ChreMessage::LogMessage: {
2663 auto ptr = reinterpret_cast<const LogMessage *>(obj);
2664 return ptr->UnPack(resolver);
2665 }
2666 case ChreMessage::TimeSyncMessage: {
2667 auto ptr = reinterpret_cast<const TimeSyncMessage *>(obj);
2668 return ptr->UnPack(resolver);
2669 }
2670 case ChreMessage::DebugDumpRequest: {
2671 auto ptr = reinterpret_cast<const DebugDumpRequest *>(obj);
2672 return ptr->UnPack(resolver);
2673 }
2674 case ChreMessage::DebugDumpData: {
2675 auto ptr = reinterpret_cast<const DebugDumpData *>(obj);
2676 return ptr->UnPack(resolver);
2677 }
2678 case ChreMessage::DebugDumpResponse: {
2679 auto ptr = reinterpret_cast<const DebugDumpResponse *>(obj);
2680 return ptr->UnPack(resolver);
2681 }
2682 case ChreMessage::TimeSyncRequest: {
2683 auto ptr = reinterpret_cast<const TimeSyncRequest *>(obj);
2684 return ptr->UnPack(resolver);
2685 }
2686 case ChreMessage::LowPowerMicAccessRequest: {
2687 auto ptr = reinterpret_cast<const LowPowerMicAccessRequest *>(obj);
2688 return ptr->UnPack(resolver);
2689 }
2690 case ChreMessage::LowPowerMicAccessRelease: {
2691 auto ptr = reinterpret_cast<const LowPowerMicAccessRelease *>(obj);
2692 return ptr->UnPack(resolver);
2693 }
2694 default: return nullptr;
2695 }
2696 }
2697
2698 inline flatbuffers::Offset<void> ChreMessageUnion::Pack(flatbuffers::FlatBufferBuilder &_fbb, const flatbuffers::rehasher_function_t *_rehasher) const {
2699 switch (type) {
2700 case ChreMessage::NanoappMessage: {
2701 auto ptr = reinterpret_cast<const NanoappMessageT *>(table);
2702 return CreateNanoappMessage(_fbb, ptr, _rehasher).Union();
2703 }
2704 case ChreMessage::HubInfoRequest: {
2705 auto ptr = reinterpret_cast<const HubInfoRequestT *>(table);
2706 return CreateHubInfoRequest(_fbb, ptr, _rehasher).Union();
2707 }
2708 case ChreMessage::HubInfoResponse: {
2709 auto ptr = reinterpret_cast<const HubInfoResponseT *>(table);
2710 return CreateHubInfoResponse(_fbb, ptr, _rehasher).Union();
2711 }
2712 case ChreMessage::NanoappListRequest: {
2713 auto ptr = reinterpret_cast<const NanoappListRequestT *>(table);
2714 return CreateNanoappListRequest(_fbb, ptr, _rehasher).Union();
2715 }
2716 case ChreMessage::NanoappListResponse: {
2717 auto ptr = reinterpret_cast<const NanoappListResponseT *>(table);
2718 return CreateNanoappListResponse(_fbb, ptr, _rehasher).Union();
2719 }
2720 case ChreMessage::LoadNanoappRequest: {
2721 auto ptr = reinterpret_cast<const LoadNanoappRequestT *>(table);
2722 return CreateLoadNanoappRequest(_fbb, ptr, _rehasher).Union();
2723 }
2724 case ChreMessage::LoadNanoappResponse: {
2725 auto ptr = reinterpret_cast<const LoadNanoappResponseT *>(table);
2726 return CreateLoadNanoappResponse(_fbb, ptr, _rehasher).Union();
2727 }
2728 case ChreMessage::UnloadNanoappRequest: {
2729 auto ptr = reinterpret_cast<const UnloadNanoappRequestT *>(table);
2730 return CreateUnloadNanoappRequest(_fbb, ptr, _rehasher).Union();
2731 }
2732 case ChreMessage::UnloadNanoappResponse: {
2733 auto ptr = reinterpret_cast<const UnloadNanoappResponseT *>(table);
2734 return CreateUnloadNanoappResponse(_fbb, ptr, _rehasher).Union();
2735 }
2736 case ChreMessage::LogMessage: {
2737 auto ptr = reinterpret_cast<const LogMessageT *>(table);
2738 return CreateLogMessage(_fbb, ptr, _rehasher).Union();
2739 }
2740 case ChreMessage::TimeSyncMessage: {
2741 auto ptr = reinterpret_cast<const TimeSyncMessageT *>(table);
2742 return CreateTimeSyncMessage(_fbb, ptr, _rehasher).Union();
2743 }
2744 case ChreMessage::DebugDumpRequest: {
2745 auto ptr = reinterpret_cast<const DebugDumpRequestT *>(table);
2746 return CreateDebugDumpRequest(_fbb, ptr, _rehasher).Union();
2747 }
2748 case ChreMessage::DebugDumpData: {
2749 auto ptr = reinterpret_cast<const DebugDumpDataT *>(table);
2750 return CreateDebugDumpData(_fbb, ptr, _rehasher).Union();
2751 }
2752 case ChreMessage::DebugDumpResponse: {
2753 auto ptr = reinterpret_cast<const DebugDumpResponseT *>(table);
2754 return CreateDebugDumpResponse(_fbb, ptr, _rehasher).Union();
2755 }
2756 case ChreMessage::TimeSyncRequest: {
2757 auto ptr = reinterpret_cast<const TimeSyncRequestT *>(table);
2758 return CreateTimeSyncRequest(_fbb, ptr, _rehasher).Union();
2759 }
2760 case ChreMessage::LowPowerMicAccessRequest: {
2761 auto ptr = reinterpret_cast<const LowPowerMicAccessRequestT *>(table);
2762 return CreateLowPowerMicAccessRequest(_fbb, ptr, _rehasher).Union();
2763 }
2764 case ChreMessage::LowPowerMicAccessRelease: {
2765 auto ptr = reinterpret_cast<const LowPowerMicAccessReleaseT *>(table);
2766 return CreateLowPowerMicAccessRelease(_fbb, ptr, _rehasher).Union();
2767 }
2768 default: return 0;
2769 }
2770 }
2771
2772 inline void ChreMessageUnion::Reset() {
2773 switch (type) {
2774 case ChreMessage::NanoappMessage: {
2775 auto ptr = reinterpret_cast<NanoappMessageT *>(table);
2776 delete ptr;
2777 break;
2778 }
2779 case ChreMessage::HubInfoRequest: {
2780 auto ptr = reinterpret_cast<HubInfoRequestT *>(table);
2781 delete ptr;
2782 break;
2783 }
2784 case ChreMessage::HubInfoResponse: {
2785 auto ptr = reinterpret_cast<HubInfoResponseT *>(table);
2786 delete ptr;
2787 break;
2788 }
2789 case ChreMessage::NanoappListRequest: {
2790 auto ptr = reinterpret_cast<NanoappListRequestT *>(table);
2791 delete ptr;
2792 break;
2793 }
2794 case ChreMessage::NanoappListResponse: {
2795 auto ptr = reinterpret_cast<NanoappListResponseT *>(table);
2796 delete ptr;
2797 break;
2798 }
2799 case ChreMessage::LoadNanoappRequest: {
2800 auto ptr = reinterpret_cast<LoadNanoappRequestT *>(table);
2801 delete ptr;
2802 break;
2803 }
2804 case ChreMessage::LoadNanoappResponse: {
2805 auto ptr = reinterpret_cast<LoadNanoappResponseT *>(table);
2806 delete ptr;
2807 break;
2808 }
2809 case ChreMessage::UnloadNanoappRequest: {
2810 auto ptr = reinterpret_cast<UnloadNanoappRequestT *>(table);
2811 delete ptr;
2812 break;
2813 }
2814 case ChreMessage::UnloadNanoappResponse: {
2815 auto ptr = reinterpret_cast<UnloadNanoappResponseT *>(table);
2816 delete ptr;
2817 break;
2818 }
2819 case ChreMessage::LogMessage: {
2820 auto ptr = reinterpret_cast<LogMessageT *>(table);
2821 delete ptr;
2822 break;
2823 }
2824 case ChreMessage::TimeSyncMessage: {
2825 auto ptr = reinterpret_cast<TimeSyncMessageT *>(table);
2826 delete ptr;
2827 break;
2828 }
2829 case ChreMessage::DebugDumpRequest: {
2830 auto ptr = reinterpret_cast<DebugDumpRequestT *>(table);
2831 delete ptr;
2832 break;
2833 }
2834 case ChreMessage::DebugDumpData: {
2835 auto ptr = reinterpret_cast<DebugDumpDataT *>(table);
2836 delete ptr;
2837 break;
2838 }
2839 case ChreMessage::DebugDumpResponse: {
2840 auto ptr = reinterpret_cast<DebugDumpResponseT *>(table);
2841 delete ptr;
2842 break;
2843 }
2844 case ChreMessage::TimeSyncRequest: {
2845 auto ptr = reinterpret_cast<TimeSyncRequestT *>(table);
2846 delete ptr;
2847 break;
2848 }
2849 case ChreMessage::LowPowerMicAccessRequest: {
2850 auto ptr = reinterpret_cast<LowPowerMicAccessRequestT *>(table);
2851 delete ptr;
2852 break;
2853 }
2854 case ChreMessage::LowPowerMicAccessRelease: {
2855 auto ptr = reinterpret_cast<LowPowerMicAccessReleaseT *>(table);
2856 delete ptr;
2857 break;
2858 }
2859 default: break;
2860 }
2861 table = nullptr;
2862 type = ChreMessage::NONE;
2863 }
2864
2865 inline const chre::fbs::MessageContainer *GetMessageContainer(const void *buf) {
2866 return flatbuffers::GetRoot<chre::fbs::MessageContainer>(buf);
2867 }
2868
2869 inline MessageContainer *GetMutableMessageContainer(void *buf) {
2870 return flatbuffers::GetMutableRoot<MessageContainer>(buf);
2871 }
2872
2873 inline bool VerifyMessageContainerBuffer(
2874 flatbuffers::Verifier &verifier) {
2875 return verifier.VerifyBuffer<chre::fbs::MessageContainer>(nullptr);
2876 }
2877
2878 inline void FinishMessageContainerBuffer(
2879 flatbuffers::FlatBufferBuilder &fbb,
2880 flatbuffers::Offset<chre::fbs::MessageContainer> root) {
2881 fbb.Finish(root);
2882 }
2883
2884 inline std::unique_ptr<MessageContainerT> UnPackMessageContainer(
2885 const void *buf,
2886 const flatbuffers::resolver_function_t *res = nullptr) {
2887 return std::unique_ptr<MessageContainerT>(GetMessageContainer(buf)->UnPack(res));
2888 }
2889
2890 } // namespace fbs
2891 } // namespace chre
2892
2893 #endif // FLATBUFFERS_GENERATED_HOSTMESSAGES_CHRE_FBS_H_
2894