xref: /btstack/src/btstack_event.h (revision b3fcedb9c9ccbcc9680da165cd86f394be5d84a8)
1 /*
2  * Copyright (C) 2016 BlueKitchen GmbH
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holders nor the names of
14  *    contributors may be used to endorse or promote products derived
15  *    from this software without specific prior written permission.
16  * 4. Any redistribution, use, or modification is done solely for
17  *    personal benefit and not for any commercial purpose or for
18  *    monetary gain.
19  *
20  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
24  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * Please inquire about commercial licensing options at
34  * [email protected]
35  *
36  */
37 
38 
39 /*
40  *  btstack_event.h
41  *
42  *  @brief BTstack event getter/setter
43  *  @note  Don't edit - generated by tool/btstack_event_generator.py
44  *
45  */
46 
47 #ifndef __BTSTACK_EVENT_H
48 #define __BTSTACK_EVENT_H
49 
50 #if defined __cplusplus
51 extern "C" {
52 #endif
53 
54 #include "btstack_util.h"
55 #include <stdint.h>
56 
57 #ifdef ENABLE_BLE
58 #include "ble/gatt_client.h"
59 #endif
60 
61 /* API_START */
62 
63 /**
64  * @brief Get event type
65  * @param event
66  * @return type of event
67  */
68 static inline uint8_t hci_event_packet_get_type(const uint8_t * event){
69     return event[0];
70 }
71 
72 /***
73  * @brief Get subevent code for hsp event
74  * @param event packet
75  * @return subevent_code
76  */
77 static inline uint8_t hci_event_hsp_meta_get_subevent_code(const uint8_t * event){
78     return event[2];
79 }
80 /***
81  * @brief Get subevent code for hfp event
82  * @param event packet
83  * @return subevent_code
84  */
85 static inline uint8_t hci_event_hfp_meta_get_subevent_code(const uint8_t * event){
86     return event[2];
87 }
88 /***
89  * @brief Get subevent code for ancs event
90  * @param event packet
91  * @return subevent_code
92  */
93 static inline uint8_t hci_event_ancs_meta_get_subevent_code(const uint8_t * event){
94     return event[2];
95 }
96 /***
97  * @brief Get subevent code for le event
98  * @param event packet
99  * @return subevent_code
100  */
101 static inline uint8_t hci_event_le_meta_get_subevent_code(const uint8_t * event){
102     return event[2];
103 }
104 /**
105  * @brief Get field status from event HCI_EVENT_INQUIRY_COMPLETE
106  * @param event packet
107  * @return status
108  * @note: btstack_type 1
109  */
110 static inline uint8_t hci_event_inquiry_complete_get_status(const uint8_t * event){
111     return event[2];
112 }
113 
114 /**
115  * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT
116  * @param event packet
117  * @return num_responses
118  * @note: btstack_type 1
119  */
120 static inline uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t * event){
121     return event[2];
122 }
123 /**
124  * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT
125  * @param event packet
126  * @param Pointer to storage for bd_addr
127  * @note: btstack_type B
128  */
129 static inline void hci_event_inquiry_result_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
130     reverse_bd_addr(&event[3], bd_addr);
131 }
132 /**
133  * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT
134  * @param event packet
135  * @return page_scan_repetition_mode
136  * @note: btstack_type 1
137  */
138 static inline uint8_t hci_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t * event){
139     return event[9];
140 }
141 /**
142  * @brief Get field reserved1 from event HCI_EVENT_INQUIRY_RESULT
143  * @param event packet
144  * @return reserved1
145  * @note: btstack_type 1
146  */
147 static inline uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t * event){
148     return event[10];
149 }
150 /**
151  * @brief Get field reserved2 from event HCI_EVENT_INQUIRY_RESULT
152  * @param event packet
153  * @return reserved2
154  * @note: btstack_type 1
155  */
156 static inline uint8_t hci_event_inquiry_result_get_reserved2(const uint8_t * event){
157     return event[11];
158 }
159 /**
160  * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT
161  * @param event packet
162  * @return class_of_device
163  * @note: btstack_type 3
164  */
165 static inline uint32_t hci_event_inquiry_result_get_class_of_device(const uint8_t * event){
166     return little_endian_read_24(event, 12);
167 }
168 /**
169  * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT
170  * @param event packet
171  * @return clock_offset
172  * @note: btstack_type 2
173  */
174 static inline uint16_t hci_event_inquiry_result_get_clock_offset(const uint8_t * event){
175     return little_endian_read_16(event, 15);
176 }
177 
178 /**
179  * @brief Get field status from event HCI_EVENT_CONNECTION_COMPLETE
180  * @param event packet
181  * @return status
182  * @note: btstack_type 1
183  */
184 static inline uint8_t hci_event_connection_complete_get_status(const uint8_t * event){
185     return event[2];
186 }
187 /**
188  * @brief Get field connection_handle from event HCI_EVENT_CONNECTION_COMPLETE
189  * @param event packet
190  * @return connection_handle
191  * @note: btstack_type 2
192  */
193 static inline uint16_t hci_event_connection_complete_get_connection_handle(const uint8_t * event){
194     return little_endian_read_16(event, 3);
195 }
196 /**
197  * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_COMPLETE
198  * @param event packet
199  * @param Pointer to storage for bd_addr
200  * @note: btstack_type B
201  */
202 static inline void hci_event_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
203     reverse_bd_addr(&event[5], bd_addr);
204 }
205 /**
206  * @brief Get field link_type from event HCI_EVENT_CONNECTION_COMPLETE
207  * @param event packet
208  * @return link_type
209  * @note: btstack_type 1
210  */
211 static inline uint8_t hci_event_connection_complete_get_link_type(const uint8_t * event){
212     return event[11];
213 }
214 /**
215  * @brief Get field encryption_enabled from event HCI_EVENT_CONNECTION_COMPLETE
216  * @param event packet
217  * @return encryption_enabled
218  * @note: btstack_type 1
219  */
220 static inline uint8_t hci_event_connection_complete_get_encryption_enabled(const uint8_t * event){
221     return event[12];
222 }
223 
224 /**
225  * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_REQUEST
226  * @param event packet
227  * @param Pointer to storage for bd_addr
228  * @note: btstack_type B
229  */
230 static inline void hci_event_connection_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
231     reverse_bd_addr(&event[2], bd_addr);
232 }
233 /**
234  * @brief Get field class_of_device from event HCI_EVENT_CONNECTION_REQUEST
235  * @param event packet
236  * @return class_of_device
237  * @note: btstack_type 3
238  */
239 static inline uint32_t hci_event_connection_request_get_class_of_device(const uint8_t * event){
240     return little_endian_read_24(event, 8);
241 }
242 /**
243  * @brief Get field link_type from event HCI_EVENT_CONNECTION_REQUEST
244  * @param event packet
245  * @return link_type
246  * @note: btstack_type 1
247  */
248 static inline uint8_t hci_event_connection_request_get_link_type(const uint8_t * event){
249     return event[11];
250 }
251 
252 /**
253  * @brief Get field status from event HCI_EVENT_DISCONNECTION_COMPLETE
254  * @param event packet
255  * @return status
256  * @note: btstack_type 1
257  */
258 static inline uint8_t hci_event_disconnection_complete_get_status(const uint8_t * event){
259     return event[2];
260 }
261 /**
262  * @brief Get field connection_handle from event HCI_EVENT_DISCONNECTION_COMPLETE
263  * @param event packet
264  * @return connection_handle
265  * @note: btstack_type 2
266  */
267 static inline uint16_t hci_event_disconnection_complete_get_connection_handle(const uint8_t * event){
268     return little_endian_read_16(event, 3);
269 }
270 /**
271  * @brief Get field reason from event HCI_EVENT_DISCONNECTION_COMPLETE
272  * @param event packet
273  * @return reason
274  * @note: btstack_type 1
275  */
276 static inline uint8_t hci_event_disconnection_complete_get_reason(const uint8_t * event){
277     return event[5];
278 }
279 
280 /**
281  * @brief Get field status from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT
282  * @param event packet
283  * @return status
284  * @note: btstack_type 1
285  */
286 static inline uint8_t hci_event_authentication_complete_event_get_status(const uint8_t * event){
287     return event[2];
288 }
289 /**
290  * @brief Get field connection_handle from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT
291  * @param event packet
292  * @return connection_handle
293  * @note: btstack_type 2
294  */
295 static inline uint16_t hci_event_authentication_complete_event_get_connection_handle(const uint8_t * event){
296     return little_endian_read_16(event, 3);
297 }
298 
299 /**
300  * @brief Get field status from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
301  * @param event packet
302  * @return status
303  * @note: btstack_type 1
304  */
305 //  static inline uint8_t hci_event_remote_name_request_complete_get_status(const uint8_t * event){
306 //      not implemented yet
307 //  }
308 /**
309  * @brief Get field bd_addr from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
310  * @param event packet
311  * @return bd_addr
312  * @note: btstack_type B
313  */
314 //  static inline bd_addr_t hci_event_remote_name_request_complete_get_bd_addr(const uint8_t * event){
315 //      not implemented yet
316 //  }
317 /**
318  * @brief Get field remote_name from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
319  * @param event packet
320  * @return remote_name
321  * @note: btstack_type N
322  */
323 //  static inline String hci_event_remote_name_request_complete_get_remote_name(const uint8_t * event){
324 //      not implemented yet
325 //  }
326 
327 /**
328  * @brief Get field status from event HCI_EVENT_ENCRYPTION_CHANGE
329  * @param event packet
330  * @return status
331  * @note: btstack_type 1
332  */
333 static inline uint8_t hci_event_encryption_change_get_status(const uint8_t * event){
334     return event[2];
335 }
336 /**
337  * @brief Get field connection_handle from event HCI_EVENT_ENCRYPTION_CHANGE
338  * @param event packet
339  * @return connection_handle
340  * @note: btstack_type 2
341  */
342 static inline uint16_t hci_event_encryption_change_get_connection_handle(const uint8_t * event){
343     return little_endian_read_16(event, 3);
344 }
345 /**
346  * @brief Get field encryption_enabled from event HCI_EVENT_ENCRYPTION_CHANGE
347  * @param event packet
348  * @return encryption_enabled
349  * @note: btstack_type 1
350  */
351 static inline uint8_t hci_event_encryption_change_get_encryption_enabled(const uint8_t * event){
352     return event[5];
353 }
354 
355 /**
356  * @brief Get field status from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
357  * @param event packet
358  * @return status
359  * @note: btstack_type 1
360  */
361 static inline uint8_t hci_event_change_connection_link_key_complete_get_status(const uint8_t * event){
362     return event[2];
363 }
364 /**
365  * @brief Get field connection_handle from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
366  * @param event packet
367  * @return connection_handle
368  * @note: btstack_type 2
369  */
370 static inline uint16_t hci_event_change_connection_link_key_complete_get_connection_handle(const uint8_t * event){
371     return little_endian_read_16(event, 3);
372 }
373 
374 /**
375  * @brief Get field status from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
376  * @param event packet
377  * @return status
378  * @note: btstack_type 1
379  */
380 static inline uint8_t hci_event_master_link_key_complete_get_status(const uint8_t * event){
381     return event[2];
382 }
383 /**
384  * @brief Get field connection_handle from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
385  * @param event packet
386  * @return connection_handle
387  * @note: btstack_type 2
388  */
389 static inline uint16_t hci_event_master_link_key_complete_get_connection_handle(const uint8_t * event){
390     return little_endian_read_16(event, 3);
391 }
392 /**
393  * @brief Get field key_flag from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
394  * @param event packet
395  * @return key_flag
396  * @note: btstack_type 1
397  */
398 static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint8_t * event){
399     return event[5];
400 }
401 
402 /**
403  * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_COMPLETE
404  * @param event packet
405  * @return num_hci_command_packets
406  * @note: btstack_type 1
407  */
408 static inline uint8_t hci_event_command_complete_get_num_hci_command_packets(const uint8_t * event){
409     return event[2];
410 }
411 /**
412  * @brief Get field command_opcode from event HCI_EVENT_COMMAND_COMPLETE
413  * @param event packet
414  * @return command_opcode
415  * @note: btstack_type 2
416  */
417 static inline uint16_t hci_event_command_complete_get_command_opcode(const uint8_t * event){
418     return little_endian_read_16(event, 3);
419 }
420 /**
421  * @brief Get field return_parameters from event HCI_EVENT_COMMAND_COMPLETE
422  * @param event packet
423  * @return return_parameters
424  * @note: btstack_type R
425  */
426 static inline const uint8_t * hci_event_command_complete_get_return_parameters(const uint8_t * event){
427     return &event[5];
428 }
429 
430 /**
431  * @brief Get field status from event HCI_EVENT_COMMAND_STATUS
432  * @param event packet
433  * @return status
434  * @note: btstack_type 1
435  */
436 static inline uint8_t hci_event_command_status_get_status(const uint8_t * event){
437     return event[2];
438 }
439 /**
440  * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_STATUS
441  * @param event packet
442  * @return num_hci_command_packets
443  * @note: btstack_type 1
444  */
445 static inline uint8_t hci_event_command_status_get_num_hci_command_packets(const uint8_t * event){
446     return event[3];
447 }
448 /**
449  * @brief Get field command_opcode from event HCI_EVENT_COMMAND_STATUS
450  * @param event packet
451  * @return command_opcode
452  * @note: btstack_type 2
453  */
454 static inline uint16_t hci_event_command_status_get_command_opcode(const uint8_t * event){
455     return little_endian_read_16(event, 4);
456 }
457 
458 /**
459  * @brief Get field hardware_code from event HCI_EVENT_HARDWARE_ERROR
460  * @param event packet
461  * @return hardware_code
462  * @note: btstack_type 1
463  */
464 static inline uint8_t hci_event_hardware_error_get_hardware_code(const uint8_t * event){
465     return event[2];
466 }
467 
468 /**
469  * @brief Get field status from event HCI_EVENT_ROLE_CHANGE
470  * @param event packet
471  * @return status
472  * @note: btstack_type 1
473  */
474 static inline uint8_t hci_event_role_change_get_status(const uint8_t * event){
475     return event[2];
476 }
477 /**
478  * @brief Get field bd_addr from event HCI_EVENT_ROLE_CHANGE
479  * @param event packet
480  * @param Pointer to storage for bd_addr
481  * @note: btstack_type B
482  */
483 static inline void hci_event_role_change_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
484     reverse_bd_addr(&event[3], bd_addr);
485 }
486 /**
487  * @brief Get field role from event HCI_EVENT_ROLE_CHANGE
488  * @param event packet
489  * @return role
490  * @note: btstack_type 1
491  */
492 static inline uint8_t hci_event_role_change_get_role(const uint8_t * event){
493     return event[9];
494 }
495 
496 /**
497  * @brief Get field status from event HCI_EVENT_MODE_CHANGE_EVENT
498  * @param event packet
499  * @return status
500  * @note: btstack_type 1
501  */
502 static inline uint8_t hci_event_mode_change_event_get_status(const uint8_t * event){
503     return event[2];
504 }
505 /**
506  * @brief Get field handle from event HCI_EVENT_MODE_CHANGE_EVENT
507  * @param event packet
508  * @return handle
509  * @note: btstack_type H
510  */
511 static inline hci_con_handle_t hci_event_mode_change_event_get_handle(const uint8_t * event){
512     return little_endian_read_16(event, 3);
513 }
514 /**
515  * @brief Get field mode from event HCI_EVENT_MODE_CHANGE_EVENT
516  * @param event packet
517  * @return mode
518  * @note: btstack_type 1
519  */
520 static inline uint8_t hci_event_mode_change_event_get_mode(const uint8_t * event){
521     return event[5];
522 }
523 /**
524  * @brief Get field interval from event HCI_EVENT_MODE_CHANGE_EVENT
525  * @param event packet
526  * @return interval
527  * @note: btstack_type 2
528  */
529 static inline uint16_t hci_event_mode_change_event_get_interval(const uint8_t * event){
530     return little_endian_read_16(event, 6);
531 }
532 
533 /**
534  * @brief Get field bd_addr from event HCI_EVENT_PIN_CODE_REQUEST
535  * @param event packet
536  * @param Pointer to storage for bd_addr
537  * @note: btstack_type B
538  */
539 static inline void hci_event_pin_code_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
540     reverse_bd_addr(&event[2], bd_addr);
541 }
542 
543 /**
544  * @brief Get field bd_addr from event HCI_EVENT_LINK_KEY_REQUEST
545  * @param event packet
546  * @param Pointer to storage for bd_addr
547  * @note: btstack_type B
548  */
549 static inline void hci_event_link_key_request_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
550     reverse_bd_addr(&event[2], bd_addr);
551 }
552 
553 /**
554  * @brief Get field link_type from event HCI_EVENT_DATA_BUFFER_OVERFLOW
555  * @param event packet
556  * @return link_type
557  * @note: btstack_type 1
558  */
559 static inline uint8_t hci_event_data_buffer_overflow_get_link_type(const uint8_t * event){
560     return event[2];
561 }
562 
563 /**
564  * @brief Get field handle from event HCI_EVENT_MAX_SLOTS_CHANGED
565  * @param event packet
566  * @return handle
567  * @note: btstack_type H
568  */
569 static inline hci_con_handle_t hci_event_max_slots_changed_get_handle(const uint8_t * event){
570     return little_endian_read_16(event, 2);
571 }
572 /**
573  * @brief Get field lmp_max_slots from event HCI_EVENT_MAX_SLOTS_CHANGED
574  * @param event packet
575  * @return lmp_max_slots
576  * @note: btstack_type 1
577  */
578 static inline uint8_t hci_event_max_slots_changed_get_lmp_max_slots(const uint8_t * event){
579     return event[4];
580 }
581 
582 /**
583  * @brief Get field status from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
584  * @param event packet
585  * @return status
586  * @note: btstack_type 1
587  */
588 static inline uint8_t hci_event_read_clock_offset_complete_get_status(const uint8_t * event){
589     return event[2];
590 }
591 /**
592  * @brief Get field handle from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
593  * @param event packet
594  * @return handle
595  * @note: btstack_type H
596  */
597 static inline hci_con_handle_t hci_event_read_clock_offset_complete_get_handle(const uint8_t * event){
598     return little_endian_read_16(event, 3);
599 }
600 /**
601  * @brief Get field clock_offset from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
602  * @param event packet
603  * @return clock_offset
604  * @note: btstack_type 2
605  */
606 static inline uint16_t hci_event_read_clock_offset_complete_get_clock_offset(const uint8_t * event){
607     return little_endian_read_16(event, 5);
608 }
609 
610 /**
611  * @brief Get field status from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
612  * @param event packet
613  * @return status
614  * @note: btstack_type 1
615  */
616 static inline uint8_t hci_event_connection_packet_type_changed_get_status(const uint8_t * event){
617     return event[2];
618 }
619 /**
620  * @brief Get field handle from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
621  * @param event packet
622  * @return handle
623  * @note: btstack_type H
624  */
625 static inline hci_con_handle_t hci_event_connection_packet_type_changed_get_handle(const uint8_t * event){
626     return little_endian_read_16(event, 3);
627 }
628 /**
629  * @brief Get field packet_types from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
630  * @param event packet
631  * @return packet_types
632  * @note: btstack_type 2
633  */
634 static inline uint16_t hci_event_connection_packet_type_changed_get_packet_types(const uint8_t * event){
635     return little_endian_read_16(event, 5);
636 }
637 
638 /**
639  * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
640  * @param event packet
641  * @return num_responses
642  * @note: btstack_type 1
643  */
644 static inline uint8_t hci_event_inquiry_result_with_rssi_get_num_responses(const uint8_t * event){
645     return event[2];
646 }
647 /**
648  * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
649  * @param event packet
650  * @param Pointer to storage for bd_addr
651  * @note: btstack_type B
652  */
653 static inline void hci_event_inquiry_result_with_rssi_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
654     reverse_bd_addr(&event[3], bd_addr);
655 }
656 /**
657  * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
658  * @param event packet
659  * @return page_scan_repetition_mode
660  * @note: btstack_type 1
661  */
662 static inline uint8_t hci_event_inquiry_result_with_rssi_get_page_scan_repetition_mode(const uint8_t * event){
663     return event[9];
664 }
665 /**
666  * @brief Get field reserved from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
667  * @param event packet
668  * @return reserved
669  * @note: btstack_type 1
670  */
671 static inline uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t * event){
672     return event[10];
673 }
674 /**
675  * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
676  * @param event packet
677  * @return class_of_device
678  * @note: btstack_type 3
679  */
680 static inline uint32_t hci_event_inquiry_result_with_rssi_get_class_of_device(const uint8_t * event){
681     return little_endian_read_24(event, 11);
682 }
683 /**
684  * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
685  * @param event packet
686  * @return clock_offset
687  * @note: btstack_type 2
688  */
689 static inline uint16_t hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t * event){
690     return little_endian_read_16(event, 14);
691 }
692 /**
693  * @brief Get field rssi from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
694  * @param event packet
695  * @return rssi
696  * @note: btstack_type 1
697  */
698 static inline uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t * event){
699     return event[16];
700 }
701 
702 /**
703  * @brief Get field status from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
704  * @param event packet
705  * @return status
706  * @note: btstack_type 1
707  */
708 static inline uint8_t hci_event_synchronous_connection_complete_get_status(const uint8_t * event){
709     return event[2];
710 }
711 /**
712  * @brief Get field handle from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
713  * @param event packet
714  * @return handle
715  * @note: btstack_type H
716  */
717 static inline hci_con_handle_t hci_event_synchronous_connection_complete_get_handle(const uint8_t * event){
718     return little_endian_read_16(event, 3);
719 }
720 /**
721  * @brief Get field bd_addr from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
722  * @param event packet
723  * @param Pointer to storage for bd_addr
724  * @note: btstack_type B
725  */
726 static inline void hci_event_synchronous_connection_complete_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
727     reverse_bd_addr(&event[5], bd_addr);
728 }
729 /**
730  * @brief Get field link_type from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
731  * @param event packet
732  * @return link_type
733  * @note: btstack_type 1
734  */
735 static inline uint8_t hci_event_synchronous_connection_complete_get_link_type(const uint8_t * event){
736     return event[11];
737 }
738 /**
739  * @brief Get field transmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
740  * @param event packet
741  * @return transmission_interval
742  * @note: btstack_type 1
743  */
744 static inline uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(const uint8_t * event){
745     return event[12];
746 }
747 /**
748  * @brief Get field retransmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
749  * @param event packet
750  * @return retransmission_interval
751  * @note: btstack_type 1
752  */
753 static inline uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(const uint8_t * event){
754     return event[13];
755 }
756 /**
757  * @brief Get field rx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
758  * @param event packet
759  * @return rx_packet_length
760  * @note: btstack_type 2
761  */
762 static inline uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(const uint8_t * event){
763     return little_endian_read_16(event, 14);
764 }
765 /**
766  * @brief Get field tx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
767  * @param event packet
768  * @return tx_packet_length
769  * @note: btstack_type 2
770  */
771 static inline uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(const uint8_t * event){
772     return little_endian_read_16(event, 16);
773 }
774 /**
775  * @brief Get field air_mode from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
776  * @param event packet
777  * @return air_mode
778  * @note: btstack_type 1
779  */
780 static inline uint8_t hci_event_synchronous_connection_complete_get_air_mode(const uint8_t * event){
781     return event[18];
782 }
783 
784 /**
785  * @brief Get field num_responses from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
786  * @param event packet
787  * @return num_responses
788  * @note: btstack_type 1
789  */
790 static inline uint8_t hci_event_extended_inquiry_response_get_num_responses(const uint8_t * event){
791     return event[2];
792 }
793 /**
794  * @brief Get field bd_addr from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
795  * @param event packet
796  * @param Pointer to storage for bd_addr
797  * @note: btstack_type B
798  */
799 static inline void hci_event_extended_inquiry_response_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
800     reverse_bd_addr(&event[3], bd_addr);
801 }
802 /**
803  * @brief Get field page_scan_repetition_mode from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
804  * @param event packet
805  * @return page_scan_repetition_mode
806  * @note: btstack_type 1
807  */
808 static inline uint8_t hci_event_extended_inquiry_response_get_page_scan_repetition_mode(const uint8_t * event){
809     return event[9];
810 }
811 /**
812  * @brief Get field reserved from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
813  * @param event packet
814  * @return reserved
815  * @note: btstack_type 1
816  */
817 static inline uint8_t hci_event_extended_inquiry_response_get_reserved(const uint8_t * event){
818     return event[10];
819 }
820 /**
821  * @brief Get field class_of_device from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
822  * @param event packet
823  * @return class_of_device
824  * @note: btstack_type 3
825  */
826 static inline uint32_t hci_event_extended_inquiry_response_get_class_of_device(const uint8_t * event){
827     return little_endian_read_24(event, 11);
828 }
829 /**
830  * @brief Get field clock_offset from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
831  * @param event packet
832  * @return clock_offset
833  * @note: btstack_type 2
834  */
835 static inline uint16_t hci_event_extended_inquiry_response_get_clock_offset(const uint8_t * event){
836     return little_endian_read_16(event, 14);
837 }
838 /**
839  * @brief Get field rssi from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
840  * @param event packet
841  * @return rssi
842  * @note: btstack_type 1
843  */
844 static inline uint8_t hci_event_extended_inquiry_response_get_rssi(const uint8_t * event){
845     return event[16];
846 }
847 
848 /**
849  * @brief Get field status from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE
850  * @param event packet
851  * @return status
852  * @note: btstack_type 1
853  */
854 static inline uint8_t hci_event_encryption_key_refresh_complete_get_status(const uint8_t * event){
855     return event[2];
856 }
857 /**
858  * @brief Get field handle from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE
859  * @param event packet
860  * @return handle
861  * @note: btstack_type H
862  */
863 static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_handle(const uint8_t * event){
864     return little_endian_read_16(event, 3);
865 }
866 
867 /**
868  * @brief Get field state from event BTSTACK_EVENT_STATE
869  * @param event packet
870  * @return state
871  * @note: btstack_type 1
872  */
873 static inline uint8_t btstack_event_state_get_state(const uint8_t * event){
874     return event[2];
875 }
876 
877 
878 /**
879  * @brief Get field discoverable from event BTSTACK_EVENT_DISCOVERABLE_ENABLED
880  * @param event packet
881  * @return discoverable
882  * @note: btstack_type 1
883  */
884 static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t * event){
885     return event[2];
886 }
887 
888 /**
889  * @brief Get field handle from event HCI_EVENT_SCO_CAN_SEND_NOW
890  * @param event packet
891  * @param Pointer to storage for handle
892  * @note: btstack_type B
893  */
894 static inline void hci_event_sco_can_send_now_get_handle(const uint8_t * event, bd_addr_t handle){
895     reverse_bd_addr(&event[2], handle);
896 }
897 
898 /**
899  * @brief Get field status from event L2CAP_EVENT_CHANNEL_OPENED
900  * @param event packet
901  * @return status
902  * @note: btstack_type 1
903  */
904 static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t * event){
905     return event[2];
906 }
907 /**
908  * @brief Get field address from event L2CAP_EVENT_CHANNEL_OPENED
909  * @param event packet
910  * @param Pointer to storage for address
911  * @note: btstack_type B
912  */
913 static inline void l2cap_event_channel_opened_get_address(const uint8_t * event, bd_addr_t address){
914     reverse_bd_addr(&event[3], address);
915 }
916 /**
917  * @brief Get field handle from event L2CAP_EVENT_CHANNEL_OPENED
918  * @param event packet
919  * @return handle
920  * @note: btstack_type H
921  */
922 static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t * event){
923     return little_endian_read_16(event, 9);
924 }
925 /**
926  * @brief Get field psm from event L2CAP_EVENT_CHANNEL_OPENED
927  * @param event packet
928  * @return psm
929  * @note: btstack_type 2
930  */
931 static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t * event){
932     return little_endian_read_16(event, 11);
933 }
934 /**
935  * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_OPENED
936  * @param event packet
937  * @return local_cid
938  * @note: btstack_type 2
939  */
940 static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t * event){
941     return little_endian_read_16(event, 13);
942 }
943 /**
944  * @brief Get field remote_cid from event L2CAP_EVENT_CHANNEL_OPENED
945  * @param event packet
946  * @return remote_cid
947  * @note: btstack_type 2
948  */
949 static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t * event){
950     return little_endian_read_16(event, 15);
951 }
952 /**
953  * @brief Get field local_mtu from event L2CAP_EVENT_CHANNEL_OPENED
954  * @param event packet
955  * @return local_mtu
956  * @note: btstack_type 2
957  */
958 static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t * event){
959     return little_endian_read_16(event, 17);
960 }
961 /**
962  * @brief Get field remote_mtu from event L2CAP_EVENT_CHANNEL_OPENED
963  * @param event packet
964  * @return remote_mtu
965  * @note: btstack_type 2
966  */
967 static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t * event){
968     return little_endian_read_16(event, 19);
969 }
970 /**
971  * @brief Get field flush_timeout from event L2CAP_EVENT_CHANNEL_OPENED
972  * @param event packet
973  * @return flush_timeout
974  * @note: btstack_type 2
975  */
976 static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t * event){
977     return little_endian_read_16(event, 21);
978 }
979 
980 /**
981  * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_CLOSED
982  * @param event packet
983  * @return local_cid
984  * @note: btstack_type 2
985  */
986 static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t * event){
987     return little_endian_read_16(event, 2);
988 }
989 
990 /**
991  * @brief Get field address from event L2CAP_EVENT_INCOMING_CONNECTION
992  * @param event packet
993  * @param Pointer to storage for address
994  * @note: btstack_type B
995  */
996 static inline void l2cap_event_incoming_connection_get_address(const uint8_t * event, bd_addr_t address){
997     reverse_bd_addr(&event[2], address);
998 }
999 /**
1000  * @brief Get field handle from event L2CAP_EVENT_INCOMING_CONNECTION
1001  * @param event packet
1002  * @return handle
1003  * @note: btstack_type H
1004  */
1005 static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t * event){
1006     return little_endian_read_16(event, 8);
1007 }
1008 /**
1009  * @brief Get field psm from event L2CAP_EVENT_INCOMING_CONNECTION
1010  * @param event packet
1011  * @return psm
1012  * @note: btstack_type 2
1013  */
1014 static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t * event){
1015     return little_endian_read_16(event, 10);
1016 }
1017 /**
1018  * @brief Get field local_cid from event L2CAP_EVENT_INCOMING_CONNECTION
1019  * @param event packet
1020  * @return local_cid
1021  * @note: btstack_type 2
1022  */
1023 static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t * event){
1024     return little_endian_read_16(event, 12);
1025 }
1026 /**
1027  * @brief Get field remote_cid from event L2CAP_EVENT_INCOMING_CONNECTION
1028  * @param event packet
1029  * @return remote_cid
1030  * @note: btstack_type 2
1031  */
1032 static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t * event){
1033     return little_endian_read_16(event, 14);
1034 }
1035 
1036 /**
1037  * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
1038  * @param event packet
1039  * @return handle
1040  * @note: btstack_type H
1041  */
1042 static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t * event){
1043     return little_endian_read_16(event, 2);
1044 }
1045 /**
1046  * @brief Get field interval_min from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
1047  * @param event packet
1048  * @return interval_min
1049  * @note: btstack_type 2
1050  */
1051 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t * event){
1052     return little_endian_read_16(event, 4);
1053 }
1054 /**
1055  * @brief Get field interval_max from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
1056  * @param event packet
1057  * @return interval_max
1058  * @note: btstack_type 2
1059  */
1060 static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t * event){
1061     return little_endian_read_16(event, 6);
1062 }
1063 /**
1064  * @brief Get field latencey from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
1065  * @param event packet
1066  * @return latencey
1067  * @note: btstack_type 2
1068  */
1069 static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t * event){
1070     return little_endian_read_16(event, 8);
1071 }
1072 /**
1073  * @brief Get field timeout_multiplier from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
1074  * @param event packet
1075  * @return timeout_multiplier
1076  * @note: btstack_type 2
1077  */
1078 static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t * event){
1079     return little_endian_read_16(event, 10);
1080 }
1081 
1082 /**
1083  * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE
1084  * @param event packet
1085  * @return handle
1086  * @note: btstack_type H
1087  */
1088 static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t * event){
1089     return little_endian_read_16(event, 2);
1090 }
1091 
1092 /**
1093  * @brief Get field local_cid from event L2CAP_EVENT_CAN_SEND_NOW
1094  * @param event packet
1095  * @return local_cid
1096  * @note: btstack_type 2
1097  */
1098 static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t * event){
1099     return little_endian_read_16(event, 2);
1100 }
1101 
1102 /**
1103  * @brief Get field status from event RFCOMM_EVENT_CHANNEL_OPENED
1104  * @param event packet
1105  * @return status
1106  * @note: btstack_type 1
1107  */
1108 static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t * event){
1109     return event[2];
1110 }
1111 /**
1112  * @brief Get field bd_addr from event RFCOMM_EVENT_CHANNEL_OPENED
1113  * @param event packet
1114  * @param Pointer to storage for bd_addr
1115  * @note: btstack_type B
1116  */
1117 static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
1118     reverse_bd_addr(&event[3], bd_addr);
1119 }
1120 /**
1121  * @brief Get field con_handle from event RFCOMM_EVENT_CHANNEL_OPENED
1122  * @param event packet
1123  * @return con_handle
1124  * @note: btstack_type 2
1125  */
1126 static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t * event){
1127     return little_endian_read_16(event, 9);
1128 }
1129 /**
1130  * @brief Get field server_channel from event RFCOMM_EVENT_CHANNEL_OPENED
1131  * @param event packet
1132  * @return server_channel
1133  * @note: btstack_type 1
1134  */
1135 static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t * event){
1136     return event[11];
1137 }
1138 /**
1139  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_OPENED
1140  * @param event packet
1141  * @return rfcomm_cid
1142  * @note: btstack_type 2
1143  */
1144 static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t * event){
1145     return little_endian_read_16(event, 12);
1146 }
1147 /**
1148  * @brief Get field max_frame_size from event RFCOMM_EVENT_CHANNEL_OPENED
1149  * @param event packet
1150  * @return max_frame_size
1151  * @note: btstack_type 2
1152  */
1153 static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t * event){
1154     return little_endian_read_16(event, 14);
1155 }
1156 
1157 /**
1158  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_CLOSED
1159  * @param event packet
1160  * @return rfcomm_cid
1161  * @note: btstack_type 2
1162  */
1163 static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t * event){
1164     return little_endian_read_16(event, 2);
1165 }
1166 
1167 /**
1168  * @brief Get field bd_addr from event RFCOMM_EVENT_INCOMING_CONNECTION
1169  * @param event packet
1170  * @param Pointer to storage for bd_addr
1171  * @note: btstack_type B
1172  */
1173 static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t * event, bd_addr_t bd_addr){
1174     reverse_bd_addr(&event[2], bd_addr);
1175 }
1176 /**
1177  * @brief Get field server_channel from event RFCOMM_EVENT_INCOMING_CONNECTION
1178  * @param event packet
1179  * @return server_channel
1180  * @note: btstack_type 1
1181  */
1182 static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t * event){
1183     return event[8];
1184 }
1185 /**
1186  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_INCOMING_CONNECTION
1187  * @param event packet
1188  * @return rfcomm_cid
1189  * @note: btstack_type 2
1190  */
1191 static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t * event){
1192     return little_endian_read_16(event, 9);
1193 }
1194 
1195 /**
1196  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_LINE_STATUS
1197  * @param event packet
1198  * @return rfcomm_cid
1199  * @note: btstack_type 2
1200  */
1201 static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t * event){
1202     return little_endian_read_16(event, 2);
1203 }
1204 /**
1205  * @brief Get field line_status from event RFCOMM_EVENT_REMOTE_LINE_STATUS
1206  * @param event packet
1207  * @return line_status
1208  * @note: btstack_type 1
1209  */
1210 static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t * event){
1211     return event[4];
1212 }
1213 
1214 /**
1215  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_MODEM_STATUS
1216  * @param event packet
1217  * @return rfcomm_cid
1218  * @note: btstack_type 2
1219  */
1220 static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t * event){
1221     return little_endian_read_16(event, 2);
1222 }
1223 /**
1224  * @brief Get field modem_status from event RFCOMM_EVENT_REMOTE_MODEM_STATUS
1225  * @param event packet
1226  * @return modem_status
1227  * @note: btstack_type 1
1228  */
1229 static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t * event){
1230     return event[4];
1231 }
1232 
1233 /**
1234  * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CAN_SEND_NOW
1235  * @param event packet
1236  * @return rfcomm_cid
1237  * @note: btstack_type 2
1238  */
1239 static inline uint16_t rfcomm_event_can_send_now_get_rfcomm_cid(const uint8_t * event){
1240     return little_endian_read_16(event, 2);
1241 }
1242 
1243 /**
1244  * @brief Get field status from event SDP_EVENT_QUERY_COMPLETE
1245  * @param event packet
1246  * @return status
1247  * @note: btstack_type 1
1248  */
1249 static inline uint8_t sdp_event_query_complete_get_status(const uint8_t * event){
1250     return event[2];
1251 }
1252 
1253 /**
1254  * @brief Get field rfcomm_channel from event SDP_EVENT_QUERY_RFCOMM_SERVICE
1255  * @param event packet
1256  * @return rfcomm_channel
1257  * @note: btstack_type 1
1258  */
1259 static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t * event){
1260     return event[2];
1261 }
1262 /**
1263  * @brief Get field name from event SDP_EVENT_QUERY_RFCOMM_SERVICE
1264  * @param event packet
1265  * @return name
1266  * @note: btstack_type T
1267  */
1268 static inline const char * sdp_event_query_rfcomm_service_get_name(const uint8_t * event){
1269     return (const char *) &event[3];
1270 }
1271 
1272 /**
1273  * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
1274  * @param event packet
1275  * @return record_id
1276  * @note: btstack_type 2
1277  */
1278 static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t * event){
1279     return little_endian_read_16(event, 2);
1280 }
1281 /**
1282  * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
1283  * @param event packet
1284  * @return attribute_id
1285  * @note: btstack_type 2
1286  */
1287 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t * event){
1288     return little_endian_read_16(event, 4);
1289 }
1290 /**
1291  * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
1292  * @param event packet
1293  * @return attribute_length
1294  * @note: btstack_type 2
1295  */
1296 static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t * event){
1297     return little_endian_read_16(event, 6);
1298 }
1299 /**
1300  * @brief Get field data_offset from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
1301  * @param event packet
1302  * @return data_offset
1303  * @note: btstack_type 2
1304  */
1305 static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t * event){
1306     return little_endian_read_16(event, 8);
1307 }
1308 /**
1309  * @brief Get field data from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
1310  * @param event packet
1311  * @return data
1312  * @note: btstack_type 1
1313  */
1314 static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t * event){
1315     return event[10];
1316 }
1317 
1318 /**
1319  * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
1320  * @param event packet
1321  * @return record_id
1322  * @note: btstack_type 2
1323  */
1324 static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t * event){
1325     return little_endian_read_16(event, 2);
1326 }
1327 /**
1328  * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
1329  * @param event packet
1330  * @return attribute_id
1331  * @note: btstack_type 2
1332  */
1333 static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t * event){
1334     return little_endian_read_16(event, 4);
1335 }
1336 /**
1337  * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
1338  * @param event packet
1339  * @return attribute_length
1340  * @note: btstack_type L
1341  */
1342 static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t * event){
1343     return little_endian_read_16(event, 6);
1344 }
1345 /**
1346  * @brief Get field attribute_value from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
1347  * @param event packet
1348  * @return attribute_value
1349  * @note: btstack_type V
1350  */
1351 static inline const uint8_t * sdp_event_query_attribute_value_get_attribute_value(const uint8_t * event){
1352     return &event[8];
1353 }
1354 
1355 /**
1356  * @brief Get field total_count from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
1357  * @param event packet
1358  * @return total_count
1359  * @note: btstack_type 2
1360  */
1361 static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t * event){
1362     return little_endian_read_16(event, 2);
1363 }
1364 /**
1365  * @brief Get field record_index from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
1366  * @param event packet
1367  * @return record_index
1368  * @note: btstack_type 2
1369  */
1370 static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t * event){
1371     return little_endian_read_16(event, 4);
1372 }
1373 /**
1374  * @brief Get field record_handle from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
1375  * @param event packet
1376  * @return record_handle
1377  * @note: btstack_type 4
1378  */
1379 static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t * event){
1380     return little_endian_read_32(event, 6);
1381 }
1382 
1383 #ifdef ENABLE_BLE
1384 /**
1385  * @brief Get field handle from event GATT_EVENT_QUERY_COMPLETE
1386  * @param event packet
1387  * @return handle
1388  * @note: btstack_type H
1389  */
1390 static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t * event){
1391     return little_endian_read_16(event, 2);
1392 }
1393 /**
1394  * @brief Get field status from event GATT_EVENT_QUERY_COMPLETE
1395  * @param event packet
1396  * @return status
1397  * @note: btstack_type 1
1398  */
1399 static inline uint8_t gatt_event_query_complete_get_status(const uint8_t * event){
1400     return event[4];
1401 }
1402 #endif
1403 
1404 #ifdef ENABLE_BLE
1405 /**
1406  * @brief Get field handle from event GATT_EVENT_SERVICE_QUERY_RESULT
1407  * @param event packet
1408  * @return handle
1409  * @note: btstack_type H
1410  */
1411 static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t * event){
1412     return little_endian_read_16(event, 2);
1413 }
1414 /**
1415  * @brief Get field service from event GATT_EVENT_SERVICE_QUERY_RESULT
1416  * @param event packet
1417  * @param Pointer to storage for service
1418  * @note: btstack_type X
1419  */
1420 static inline void gatt_event_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){
1421     gatt_client_deserialize_service(event, 4, service);
1422 }
1423 #endif
1424 
1425 #ifdef ENABLE_BLE
1426 /**
1427  * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT
1428  * @param event packet
1429  * @return handle
1430  * @note: btstack_type H
1431  */
1432 static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t * event){
1433     return little_endian_read_16(event, 2);
1434 }
1435 /**
1436  * @brief Get field characteristic from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT
1437  * @param event packet
1438  * @param Pointer to storage for characteristic
1439  * @note: btstack_type Y
1440  */
1441 static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t * event, gatt_client_characteristic_t * characteristic){
1442     gatt_client_deserialize_characteristic(event, 4, characteristic);
1443 }
1444 #endif
1445 
1446 #ifdef ENABLE_BLE
1447 /**
1448  * @brief Get field handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
1449  * @param event packet
1450  * @return handle
1451  * @note: btstack_type H
1452  */
1453 static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t * event){
1454     return little_endian_read_16(event, 2);
1455 }
1456 /**
1457  * @brief Get field include_handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
1458  * @param event packet
1459  * @return include_handle
1460  * @note: btstack_type 2
1461  */
1462 static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t * event){
1463     return little_endian_read_16(event, 4);
1464 }
1465 /**
1466  * @brief Get field service from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
1467  * @param event packet
1468  * @param Pointer to storage for service
1469  * @note: btstack_type X
1470  */
1471 static inline void gatt_event_included_service_query_result_get_service(const uint8_t * event, gatt_client_service_t * service){
1472     gatt_client_deserialize_service(event, 6, service);
1473 }
1474 #endif
1475 
1476 #ifdef ENABLE_BLE
1477 /**
1478  * @brief Get field handle from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT
1479  * @param event packet
1480  * @return handle
1481  * @note: btstack_type H
1482  */
1483 static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t * event){
1484     return little_endian_read_16(event, 2);
1485 }
1486 /**
1487  * @brief Get field characteristic_descriptor from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT
1488  * @param event packet
1489  * @param Pointer to storage for characteristic_descriptor
1490  * @note: btstack_type Z
1491  */
1492 static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t * event, gatt_client_characteristic_descriptor_t * characteristic_descriptor){
1493     gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor);
1494 }
1495 #endif
1496 
1497 #ifdef ENABLE_BLE
1498 /**
1499  * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
1500  * @param event packet
1501  * @return handle
1502  * @note: btstack_type H
1503  */
1504 static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t * event){
1505     return little_endian_read_16(event, 2);
1506 }
1507 /**
1508  * @brief Get field value_handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
1509  * @param event packet
1510  * @return value_handle
1511  * @note: btstack_type 2
1512  */
1513 static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t * event){
1514     return little_endian_read_16(event, 4);
1515 }
1516 /**
1517  * @brief Get field value_length from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
1518  * @param event packet
1519  * @return value_length
1520  * @note: btstack_type L
1521  */
1522 static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t * event){
1523     return little_endian_read_16(event, 6);
1524 }
1525 /**
1526  * @brief Get field value from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
1527  * @param event packet
1528  * @return value
1529  * @note: btstack_type V
1530  */
1531 static inline const uint8_t * gatt_event_characteristic_value_query_result_get_value(const uint8_t * event){
1532     return &event[8];
1533 }
1534 #endif
1535 
1536 #ifdef ENABLE_BLE
1537 /**
1538  * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
1539  * @param event packet
1540  * @return handle
1541  * @note: btstack_type H
1542  */
1543 static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t * event){
1544     return little_endian_read_16(event, 2);
1545 }
1546 /**
1547  * @brief Get field value_handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
1548  * @param event packet
1549  * @return value_handle
1550  * @note: btstack_type 2
1551  */
1552 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t * event){
1553     return little_endian_read_16(event, 4);
1554 }
1555 /**
1556  * @brief Get field value_offset from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
1557  * @param event packet
1558  * @return value_offset
1559  * @note: btstack_type 2
1560  */
1561 static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t * event){
1562     return little_endian_read_16(event, 6);
1563 }
1564 /**
1565  * @brief Get field value_length from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
1566  * @param event packet
1567  * @return value_length
1568  * @note: btstack_type L
1569  */
1570 static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t * event){
1571     return little_endian_read_16(event, 8);
1572 }
1573 /**
1574  * @brief Get field value from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
1575  * @param event packet
1576  * @return value
1577  * @note: btstack_type V
1578  */
1579 static inline const uint8_t * gatt_event_long_characteristic_value_query_result_get_value(const uint8_t * event){
1580     return &event[10];
1581 }
1582 #endif
1583 
1584 #ifdef ENABLE_BLE
1585 /**
1586  * @brief Get field handle from event GATT_EVENT_NOTIFICATION
1587  * @param event packet
1588  * @return handle
1589  * @note: btstack_type H
1590  */
1591 static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t * event){
1592     return little_endian_read_16(event, 2);
1593 }
1594 /**
1595  * @brief Get field value_handle from event GATT_EVENT_NOTIFICATION
1596  * @param event packet
1597  * @return value_handle
1598  * @note: btstack_type 2
1599  */
1600 static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t * event){
1601     return little_endian_read_16(event, 4);
1602 }
1603 /**
1604  * @brief Get field value_length from event GATT_EVENT_NOTIFICATION
1605  * @param event packet
1606  * @return value_length
1607  * @note: btstack_type L
1608  */
1609 static inline int gatt_event_notification_get_value_length(const uint8_t * event){
1610     return little_endian_read_16(event, 6);
1611 }
1612 /**
1613  * @brief Get field value from event GATT_EVENT_NOTIFICATION
1614  * @param event packet
1615  * @return value
1616  * @note: btstack_type V
1617  */
1618 static inline const uint8_t * gatt_event_notification_get_value(const uint8_t * event){
1619     return &event[8];
1620 }
1621 #endif
1622 
1623 #ifdef ENABLE_BLE
1624 /**
1625  * @brief Get field handle from event GATT_EVENT_INDICATION
1626  * @param event packet
1627  * @return handle
1628  * @note: btstack_type H
1629  */
1630 static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t * event){
1631     return little_endian_read_16(event, 2);
1632 }
1633 /**
1634  * @brief Get field value_handle from event GATT_EVENT_INDICATION
1635  * @param event packet
1636  * @return value_handle
1637  * @note: btstack_type 2
1638  */
1639 static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t * event){
1640     return little_endian_read_16(event, 4);
1641 }
1642 /**
1643  * @brief Get field value_length from event GATT_EVENT_INDICATION
1644  * @param event packet
1645  * @return value_length
1646  * @note: btstack_type L
1647  */
1648 static inline int gatt_event_indication_get_value_length(const uint8_t * event){
1649     return little_endian_read_16(event, 6);
1650 }
1651 /**
1652  * @brief Get field value from event GATT_EVENT_INDICATION
1653  * @param event packet
1654  * @return value
1655  * @note: btstack_type V
1656  */
1657 static inline const uint8_t * gatt_event_indication_get_value(const uint8_t * event){
1658     return &event[8];
1659 }
1660 #endif
1661 
1662 #ifdef ENABLE_BLE
1663 /**
1664  * @brief Get field descriptor_handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1665  * @param event packet
1666  * @return descriptor_handle
1667  * @note: btstack_type H
1668  */
1669 static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t * event){
1670     return little_endian_read_16(event, 2);
1671 }
1672 /**
1673  * @brief Get field descriptor_length from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1674  * @param event packet
1675  * @return descriptor_length
1676  * @note: btstack_type 2
1677  */
1678 static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){
1679     return little_endian_read_16(event, 4);
1680 }
1681 /**
1682  * @brief Get field descriptor from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1683  * @param event packet
1684  * @return descriptor
1685  * @note: btstack_type L
1686  */
1687 static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){
1688     return little_endian_read_16(event, 6);
1689 }
1690 #endif
1691 
1692 #ifdef ENABLE_BLE
1693 /**
1694  * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1695  * @param event packet
1696  * @return handle
1697  * @note: btstack_type H
1698  */
1699 static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t * event){
1700     return little_endian_read_16(event, 2);
1701 }
1702 /**
1703  * @brief Get field descriptor_offset from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1704  * @param event packet
1705  * @return descriptor_offset
1706  * @note: btstack_type 2
1707  */
1708 static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t * event){
1709     return little_endian_read_16(event, 4);
1710 }
1711 /**
1712  * @brief Get field descriptor_length from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1713  * @param event packet
1714  * @return descriptor_length
1715  * @note: btstack_type L
1716  */
1717 static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t * event){
1718     return little_endian_read_16(event, 6);
1719 }
1720 /**
1721  * @brief Get field descriptor from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
1722  * @param event packet
1723  * @return descriptor
1724  * @note: btstack_type V
1725  */
1726 static inline const uint8_t * gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t * event){
1727     return &event[8];
1728 }
1729 #endif
1730 
1731 #ifdef ENABLE_BLE
1732 /**
1733  * @brief Get field handle from event GATT_EVENT_MTU
1734  * @param event packet
1735  * @return handle
1736  * @note: btstack_type H
1737  */
1738 static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t * event){
1739     return little_endian_read_16(event, 2);
1740 }
1741 /**
1742  * @brief Get field MTU from event GATT_EVENT_MTU
1743  * @param event packet
1744  * @return MTU
1745  * @note: btstack_type 2
1746  */
1747 static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t * event){
1748     return little_endian_read_16(event, 4);
1749 }
1750 #endif
1751 
1752 /**
1753  * @brief Get field handle from event ATT_EVENT_MTU_EXCHANGE_COMPLETE
1754  * @param event packet
1755  * @return handle
1756  * @note: btstack_type H
1757  */
1758 static inline hci_con_handle_t att_event_mtu_exchange_complete_get_handle(const uint8_t * event){
1759     return little_endian_read_16(event, 2);
1760 }
1761 /**
1762  * @brief Get field MTU from event ATT_EVENT_MTU_EXCHANGE_COMPLETE
1763  * @param event packet
1764  * @return MTU
1765  * @note: btstack_type 2
1766  */
1767 static inline uint16_t att_event_mtu_exchange_complete_get_MTU(const uint8_t * event){
1768     return little_endian_read_16(event, 4);
1769 }
1770 
1771 /**
1772  * @brief Get field status from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
1773  * @param event packet
1774  * @return status
1775  * @note: btstack_type 1
1776  */
1777 static inline uint8_t att_event_handle_value_indication_complete_get_status(const uint8_t * event){
1778     return event[2];
1779 }
1780 /**
1781  * @brief Get field conn_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
1782  * @param event packet
1783  * @return conn_handle
1784  * @note: btstack_type H
1785  */
1786 static inline hci_con_handle_t att_event_handle_value_indication_complete_get_conn_handle(const uint8_t * event){
1787     return little_endian_read_16(event, 3);
1788 }
1789 /**
1790  * @brief Get field attribute_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
1791  * @param event packet
1792  * @return attribute_handle
1793  * @note: btstack_type 2
1794  */
1795 static inline uint16_t att_event_handle_value_indication_complete_get_attribute_handle(const uint8_t * event){
1796     return little_endian_read_16(event, 5);
1797 }
1798 
1799 
1800 /**
1801  * @brief Get field status from event BNEP_EVENT_SERVICE_REGISTERED
1802  * @param event packet
1803  * @return status
1804  * @note: btstack_type 1
1805  */
1806 static inline uint8_t bnep_event_service_registered_get_status(const uint8_t * event){
1807     return event[2];
1808 }
1809 /**
1810  * @brief Get field service_uuid from event BNEP_EVENT_SERVICE_REGISTERED
1811  * @param event packet
1812  * @return service_uuid
1813  * @note: btstack_type 2
1814  */
1815 static inline uint16_t bnep_event_service_registered_get_service_uuid(const uint8_t * event){
1816     return little_endian_read_16(event, 3);
1817 }
1818 
1819 /**
1820  * @brief Get field status from event BNEP_EVENT_CHANNEL_OPENED
1821  * @param event packet
1822  * @return status
1823  * @note: btstack_type 1
1824  */
1825 static inline uint8_t bnep_event_channel_opened_get_status(const uint8_t * event){
1826     return event[2];
1827 }
1828 /**
1829  * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_OPENED
1830  * @param event packet
1831  * @return bnep_cid
1832  * @note: btstack_type 2
1833  */
1834 static inline uint16_t bnep_event_channel_opened_get_bnep_cid(const uint8_t * event){
1835     return little_endian_read_16(event, 3);
1836 }
1837 /**
1838  * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_OPENED
1839  * @param event packet
1840  * @return source_uuid
1841  * @note: btstack_type 2
1842  */
1843 static inline uint16_t bnep_event_channel_opened_get_source_uuid(const uint8_t * event){
1844     return little_endian_read_16(event, 5);
1845 }
1846 /**
1847  * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_OPENED
1848  * @param event packet
1849  * @return destination_uuid
1850  * @note: btstack_type 2
1851  */
1852 static inline uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t * event){
1853     return little_endian_read_16(event, 7);
1854 }
1855 /**
1856  * @brief Get field mtu from event BNEP_EVENT_CHANNEL_OPENED
1857  * @param event packet
1858  * @return mtu
1859  * @note: btstack_type 2
1860  */
1861 static inline uint16_t bnep_event_channel_opened_get_mtu(const uint8_t * event){
1862     return little_endian_read_16(event, 9);
1863 }
1864 /**
1865  * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_OPENED
1866  * @param event packet
1867  * @param Pointer to storage for remote_address
1868  * @note: btstack_type B
1869  */
1870 static inline void bnep_event_channel_opened_get_remote_address(const uint8_t * event, bd_addr_t remote_address){
1871     reverse_bd_addr(&event[11], remote_address);
1872 }
1873 
1874 /**
1875  * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_CLOSED
1876  * @param event packet
1877  * @return bnep_cid
1878  * @note: btstack_type 2
1879  */
1880 static inline uint16_t bnep_event_channel_closed_get_bnep_cid(const uint8_t * event){
1881     return little_endian_read_16(event, 2);
1882 }
1883 /**
1884  * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_CLOSED
1885  * @param event packet
1886  * @return source_uuid
1887  * @note: btstack_type 2
1888  */
1889 static inline uint16_t bnep_event_channel_closed_get_source_uuid(const uint8_t * event){
1890     return little_endian_read_16(event, 4);
1891 }
1892 /**
1893  * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_CLOSED
1894  * @param event packet
1895  * @return destination_uuid
1896  * @note: btstack_type 2
1897  */
1898 static inline uint16_t bnep_event_channel_closed_get_destination_uuid(const uint8_t * event){
1899     return little_endian_read_16(event, 6);
1900 }
1901 /**
1902  * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_CLOSED
1903  * @param event packet
1904  * @param Pointer to storage for remote_address
1905  * @note: btstack_type B
1906  */
1907 static inline void bnep_event_channel_closed_get_remote_address(const uint8_t * event, bd_addr_t remote_address){
1908     reverse_bd_addr(&event[8], remote_address);
1909 }
1910 
1911 /**
1912  * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_TIMEOUT
1913  * @param event packet
1914  * @return bnep_cid
1915  * @note: btstack_type 2
1916  */
1917 static inline uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t * event){
1918     return little_endian_read_16(event, 2);
1919 }
1920 /**
1921  * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT
1922  * @param event packet
1923  * @return source_uuid
1924  * @note: btstack_type 2
1925  */
1926 static inline uint16_t bnep_event_channel_timeout_get_source_uuid(const uint8_t * event){
1927     return little_endian_read_16(event, 4);
1928 }
1929 /**
1930  * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT
1931  * @param event packet
1932  * @return destination_uuid
1933  * @note: btstack_type 2
1934  */
1935 static inline uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t * event){
1936     return little_endian_read_16(event, 6);
1937 }
1938 /**
1939  * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_TIMEOUT
1940  * @param event packet
1941  * @param Pointer to storage for remote_address
1942  * @note: btstack_type B
1943  */
1944 static inline void bnep_event_channel_timeout_get_remote_address(const uint8_t * event, bd_addr_t remote_address){
1945     reverse_bd_addr(&event[8], remote_address);
1946 }
1947 /**
1948  * @brief Get field channel_state from event BNEP_EVENT_CHANNEL_TIMEOUT
1949  * @param event packet
1950  * @return channel_state
1951  * @note: btstack_type 1
1952  */
1953 static inline uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t * event){
1954     return event[14];
1955 }
1956 
1957 /**
1958  * @brief Get field bnep_cid from event BNEP_EVENT_CAN_SEND_NOW
1959  * @param event packet
1960  * @return bnep_cid
1961  * @note: btstack_type 2
1962  */
1963 static inline uint16_t bnep_event_can_send_now_get_bnep_cid(const uint8_t * event){
1964     return little_endian_read_16(event, 2);
1965 }
1966 /**
1967  * @brief Get field source_uuid from event BNEP_EVENT_CAN_SEND_NOW
1968  * @param event packet
1969  * @return source_uuid
1970  * @note: btstack_type 2
1971  */
1972 static inline uint16_t bnep_event_can_send_now_get_source_uuid(const uint8_t * event){
1973     return little_endian_read_16(event, 4);
1974 }
1975 /**
1976  * @brief Get field destination_uuid from event BNEP_EVENT_CAN_SEND_NOW
1977  * @param event packet
1978  * @return destination_uuid
1979  * @note: btstack_type 2
1980  */
1981 static inline uint16_t bnep_event_can_send_now_get_destination_uuid(const uint8_t * event){
1982     return little_endian_read_16(event, 6);
1983 }
1984 /**
1985  * @brief Get field remote_address from event BNEP_EVENT_CAN_SEND_NOW
1986  * @param event packet
1987  * @param Pointer to storage for remote_address
1988  * @note: btstack_type B
1989  */
1990 static inline void bnep_event_can_send_now_get_remote_address(const uint8_t * event, bd_addr_t remote_address){
1991     reverse_bd_addr(&event[8], remote_address);
1992 }
1993 
1994 #ifdef ENABLE_BLE
1995 /**
1996  * @brief Get field handle from event SM_EVENT_JUST_WORKS_REQUEST
1997  * @param event packet
1998  * @return handle
1999  * @note: btstack_type H
2000  */
2001 static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t * event){
2002     return little_endian_read_16(event, 2);
2003 }
2004 /**
2005  * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_REQUEST
2006  * @param event packet
2007  * @return addr_type
2008  * @note: btstack_type 1
2009  */
2010 static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t * event){
2011     return event[4];
2012 }
2013 /**
2014  * @brief Get field address from event SM_EVENT_JUST_WORKS_REQUEST
2015  * @param event packet
2016  * @param Pointer to storage for address
2017  * @note: btstack_type B
2018  */
2019 static inline void sm_event_just_works_request_get_address(const uint8_t * event, bd_addr_t address){
2020     reverse_bd_addr(&event[5], address);
2021 }
2022 #endif
2023 
2024 #ifdef ENABLE_BLE
2025 /**
2026  * @brief Get field handle from event SM_EVENT_JUST_WORKS_CANCEL
2027  * @param event packet
2028  * @return handle
2029  * @note: btstack_type H
2030  */
2031 static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t * event){
2032     return little_endian_read_16(event, 2);
2033 }
2034 /**
2035  * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_CANCEL
2036  * @param event packet
2037  * @return addr_type
2038  * @note: btstack_type 1
2039  */
2040 static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t * event){
2041     return event[4];
2042 }
2043 /**
2044  * @brief Get field address from event SM_EVENT_JUST_WORKS_CANCEL
2045  * @param event packet
2046  * @param Pointer to storage for address
2047  * @note: btstack_type B
2048  */
2049 static inline void sm_event_just_works_cancel_get_address(const uint8_t * event, bd_addr_t address){
2050     reverse_bd_addr(&event[5], address);
2051 }
2052 #endif
2053 
2054 #ifdef ENABLE_BLE
2055 /**
2056  * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
2057  * @param event packet
2058  * @return handle
2059  * @note: btstack_type H
2060  */
2061 static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t * event){
2062     return little_endian_read_16(event, 2);
2063 }
2064 /**
2065  * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
2066  * @param event packet
2067  * @return addr_type
2068  * @note: btstack_type 1
2069  */
2070 static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t * event){
2071     return event[4];
2072 }
2073 /**
2074  * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
2075  * @param event packet
2076  * @param Pointer to storage for address
2077  * @note: btstack_type B
2078  */
2079 static inline void sm_event_passkey_display_number_get_address(const uint8_t * event, bd_addr_t address){
2080     reverse_bd_addr(&event[5], address);
2081 }
2082 /**
2083  * @brief Get field passkey from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
2084  * @param event packet
2085  * @return passkey
2086  * @note: btstack_type 4
2087  */
2088 static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t * event){
2089     return little_endian_read_32(event, 11);
2090 }
2091 #endif
2092 
2093 #ifdef ENABLE_BLE
2094 /**
2095  * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
2096  * @param event packet
2097  * @return handle
2098  * @note: btstack_type H
2099  */
2100 static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t * event){
2101     return little_endian_read_16(event, 2);
2102 }
2103 /**
2104  * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
2105  * @param event packet
2106  * @return addr_type
2107  * @note: btstack_type 1
2108  */
2109 static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t * event){
2110     return event[4];
2111 }
2112 /**
2113  * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
2114  * @param event packet
2115  * @param Pointer to storage for address
2116  * @note: btstack_type B
2117  */
2118 static inline void sm_event_passkey_display_cancel_get_address(const uint8_t * event, bd_addr_t address){
2119     reverse_bd_addr(&event[5], address);
2120 }
2121 #endif
2122 
2123 #ifdef ENABLE_BLE
2124 /**
2125  * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_NUMBER
2126  * @param event packet
2127  * @return handle
2128  * @note: btstack_type H
2129  */
2130 static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t * event){
2131     return little_endian_read_16(event, 2);
2132 }
2133 /**
2134  * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_NUMBER
2135  * @param event packet
2136  * @return addr_type
2137  * @note: btstack_type 1
2138  */
2139 static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t * event){
2140     return event[4];
2141 }
2142 /**
2143  * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_NUMBER
2144  * @param event packet
2145  * @param Pointer to storage for address
2146  * @note: btstack_type B
2147  */
2148 static inline void sm_event_passkey_input_number_get_address(const uint8_t * event, bd_addr_t address){
2149     reverse_bd_addr(&event[5], address);
2150 }
2151 #endif
2152 
2153 #ifdef ENABLE_BLE
2154 /**
2155  * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_CANCEL
2156  * @param event packet
2157  * @return handle
2158  * @note: btstack_type H
2159  */
2160 static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t * event){
2161     return little_endian_read_16(event, 2);
2162 }
2163 /**
2164  * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_CANCEL
2165  * @param event packet
2166  * @return addr_type
2167  * @note: btstack_type 1
2168  */
2169 static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t * event){
2170     return event[4];
2171 }
2172 /**
2173  * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_CANCEL
2174  * @param event packet
2175  * @param Pointer to storage for address
2176  * @note: btstack_type B
2177  */
2178 static inline void sm_event_passkey_input_cancel_get_address(const uint8_t * event, bd_addr_t address){
2179     reverse_bd_addr(&event[5], address);
2180 }
2181 #endif
2182 
2183 #ifdef ENABLE_BLE
2184 /**
2185  * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_STARTED
2186  * @param event packet
2187  * @return handle
2188  * @note: btstack_type H
2189  */
2190 static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t * event){
2191     return little_endian_read_16(event, 2);
2192 }
2193 /**
2194  * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_STARTED
2195  * @param event packet
2196  * @return addr_type
2197  * @note: btstack_type 1
2198  */
2199 static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t * event){
2200     return event[4];
2201 }
2202 /**
2203  * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_STARTED
2204  * @param event packet
2205  * @param Pointer to storage for address
2206  * @note: btstack_type B
2207  */
2208 static inline void sm_event_identity_resolving_started_get_address(const uint8_t * event, bd_addr_t address){
2209     reverse_bd_addr(&event[5], address);
2210 }
2211 #endif
2212 
2213 #ifdef ENABLE_BLE
2214 /**
2215  * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_FAILED
2216  * @param event packet
2217  * @return handle
2218  * @note: btstack_type H
2219  */
2220 static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t * event){
2221     return little_endian_read_16(event, 2);
2222 }
2223 /**
2224  * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_FAILED
2225  * @param event packet
2226  * @return addr_type
2227  * @note: btstack_type 1
2228  */
2229 static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t * event){
2230     return event[4];
2231 }
2232 /**
2233  * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_FAILED
2234  * @param event packet
2235  * @param Pointer to storage for address
2236  * @note: btstack_type B
2237  */
2238 static inline void sm_event_identity_resolving_failed_get_address(const uint8_t * event, bd_addr_t address){
2239     reverse_bd_addr(&event[5], address);
2240 }
2241 #endif
2242 
2243 #ifdef ENABLE_BLE
2244 /**
2245  * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
2246  * @param event packet
2247  * @return handle
2248  * @note: btstack_type H
2249  */
2250 static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t * event){
2251     return little_endian_read_16(event, 2);
2252 }
2253 /**
2254  * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
2255  * @param event packet
2256  * @return addr_type
2257  * @note: btstack_type 1
2258  */
2259 static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t * event){
2260     return event[4];
2261 }
2262 /**
2263  * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
2264  * @param event packet
2265  * @param Pointer to storage for address
2266  * @note: btstack_type B
2267  */
2268 static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t * event, bd_addr_t address){
2269     reverse_bd_addr(&event[5], address);
2270 }
2271 /**
2272  * @brief Get field le_device_db_index from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
2273  * @param event packet
2274  * @return le_device_db_index
2275  * @note: btstack_type 2
2276  */
2277 static inline uint16_t sm_event_identity_resolving_succeeded_get_le_device_db_index(const uint8_t * event){
2278     return little_endian_read_16(event, 11);
2279 }
2280 #endif
2281 
2282 #ifdef ENABLE_BLE
2283 /**
2284  * @brief Get field handle from event SM_EVENT_AUTHORIZATION_REQUEST
2285  * @param event packet
2286  * @return handle
2287  * @note: btstack_type H
2288  */
2289 static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t * event){
2290     return little_endian_read_16(event, 2);
2291 }
2292 /**
2293  * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_REQUEST
2294  * @param event packet
2295  * @return addr_type
2296  * @note: btstack_type 1
2297  */
2298 static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t * event){
2299     return event[4];
2300 }
2301 /**
2302  * @brief Get field address from event SM_EVENT_AUTHORIZATION_REQUEST
2303  * @param event packet
2304  * @param Pointer to storage for address
2305  * @note: btstack_type B
2306  */
2307 static inline void sm_event_authorization_request_get_address(const uint8_t * event, bd_addr_t address){
2308     reverse_bd_addr(&event[5], address);
2309 }
2310 #endif
2311 
2312 #ifdef ENABLE_BLE
2313 /**
2314  * @brief Get field handle from event SM_EVENT_AUTHORIZATION_RESULT
2315  * @param event packet
2316  * @return handle
2317  * @note: btstack_type H
2318  */
2319 static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t * event){
2320     return little_endian_read_16(event, 2);
2321 }
2322 /**
2323  * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_RESULT
2324  * @param event packet
2325  * @return addr_type
2326  * @note: btstack_type 1
2327  */
2328 static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t * event){
2329     return event[4];
2330 }
2331 /**
2332  * @brief Get field address from event SM_EVENT_AUTHORIZATION_RESULT
2333  * @param event packet
2334  * @param Pointer to storage for address
2335  * @note: btstack_type B
2336  */
2337 static inline void sm_event_authorization_result_get_address(const uint8_t * event, bd_addr_t address){
2338     reverse_bd_addr(&event[5], address);
2339 }
2340 /**
2341  * @brief Get field authorization_result from event SM_EVENT_AUTHORIZATION_RESULT
2342  * @param event packet
2343  * @return authorization_result
2344  * @note: btstack_type 1
2345  */
2346 static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t * event){
2347     return event[11];
2348 }
2349 #endif
2350 
2351 /**
2352  * @brief Get field handle from event GAP_EVENT_SECURITY_LEVEL
2353  * @param event packet
2354  * @return handle
2355  * @note: btstack_type H
2356  */
2357 static inline hci_con_handle_t gap_event_security_level_get_handle(const uint8_t * event){
2358     return little_endian_read_16(event, 2);
2359 }
2360 /**
2361  * @brief Get field security_level from event GAP_EVENT_SECURITY_LEVEL
2362  * @param event packet
2363  * @return security_level
2364  * @note: btstack_type 1
2365  */
2366 static inline uint8_t gap_event_security_level_get_security_level(const uint8_t * event){
2367     return event[4];
2368 }
2369 
2370 /**
2371  * @brief Get field status from event GAP_EVENT_DEDICATED_BONDING_COMPLETED
2372  * @param event packet
2373  * @return status
2374  * @note: btstack_type 1
2375  */
2376 static inline uint8_t gap_event_dedicated_bonding_completed_get_status(const uint8_t * event){
2377     return event[2];
2378 }
2379 /**
2380  * @brief Get field address from event GAP_EVENT_DEDICATED_BONDING_COMPLETED
2381  * @param event packet
2382  * @param Pointer to storage for address
2383  * @note: btstack_type B
2384  */
2385 static inline void gap_event_dedicated_bonding_completed_get_address(const uint8_t * event, bd_addr_t address){
2386     reverse_bd_addr(&event[3], address);
2387 }
2388 
2389 /**
2390  * @brief Get field advertising_event_type from event GAP_EVENT_ADVERTISING_REPORT
2391  * @param event packet
2392  * @return advertising_event_type
2393  * @note: btstack_type 1
2394  */
2395 static inline uint8_t gap_event_advertising_report_get_advertising_event_type(const uint8_t * event){
2396     return event[2];
2397 }
2398 /**
2399  * @brief Get field address_type from event GAP_EVENT_ADVERTISING_REPORT
2400  * @param event packet
2401  * @return address_type
2402  * @note: btstack_type 1
2403  */
2404 static inline uint8_t gap_event_advertising_report_get_address_type(const uint8_t * event){
2405     return event[3];
2406 }
2407 /**
2408  * @brief Get field address from event GAP_EVENT_ADVERTISING_REPORT
2409  * @param event packet
2410  * @param Pointer to storage for address
2411  * @note: btstack_type B
2412  */
2413 static inline void gap_event_advertising_report_get_address(const uint8_t * event, bd_addr_t address){
2414     reverse_bd_addr(&event[4], address);
2415 }
2416 /**
2417  * @brief Get field rssi from event GAP_EVENT_ADVERTISING_REPORT
2418  * @param event packet
2419  * @return rssi
2420  * @note: btstack_type 1
2421  */
2422 static inline uint8_t gap_event_advertising_report_get_rssi(const uint8_t * event){
2423     return event[10];
2424 }
2425 /**
2426  * @brief Get field data_length from event GAP_EVENT_ADVERTISING_REPORT
2427  * @param event packet
2428  * @return data_length
2429  * @note: btstack_type J
2430  */
2431 static inline int gap_event_advertising_report_get_data_length(const uint8_t * event){
2432     return event[11];
2433 }
2434 /**
2435  * @brief Get field data from event GAP_EVENT_ADVERTISING_REPORT
2436  * @param event packet
2437  * @return data
2438  * @note: btstack_type V
2439  */
2440 static inline const uint8_t * gap_event_advertising_report_get_data(const uint8_t * event){
2441     return &event[12];
2442 }
2443 
2444 /**
2445  * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2446  * @param event packet
2447  * @return status
2448  * @note: btstack_type 1
2449  */
2450 static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t * event){
2451     return event[3];
2452 }
2453 /**
2454  * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2455  * @param event packet
2456  * @return connection_handle
2457  * @note: btstack_type H
2458  */
2459 static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t * event){
2460     return little_endian_read_16(event, 4);
2461 }
2462 /**
2463  * @brief Get field role from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2464  * @param event packet
2465  * @return role
2466  * @note: btstack_type 1
2467  */
2468 static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t * event){
2469     return event[6];
2470 }
2471 /**
2472  * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2473  * @param event packet
2474  * @return peer_address_type
2475  * @note: btstack_type 1
2476  */
2477 static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t * event){
2478     return event[7];
2479 }
2480 /**
2481  * @brief Get field peer_address from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2482  * @param event packet
2483  * @param Pointer to storage for peer_address
2484  * @note: btstack_type B
2485  */
2486 static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t * event, bd_addr_t peer_address){
2487     reverse_bd_addr(&event[8], peer_address);
2488 }
2489 /**
2490  * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2491  * @param event packet
2492  * @return conn_interval
2493  * @note: btstack_type 2
2494  */
2495 static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t * event){
2496     return little_endian_read_16(event, 14);
2497 }
2498 /**
2499  * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2500  * @param event packet
2501  * @return conn_latency
2502  * @note: btstack_type 2
2503  */
2504 static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t * event){
2505     return little_endian_read_16(event, 16);
2506 }
2507 /**
2508  * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2509  * @param event packet
2510  * @return supervision_timeout
2511  * @note: btstack_type 2
2512  */
2513 static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t * event){
2514     return little_endian_read_16(event, 18);
2515 }
2516 /**
2517  * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2518  * @param event packet
2519  * @return master_clock_accuracy
2520  * @note: btstack_type 1
2521  */
2522 static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t * event){
2523     return event[20];
2524 }
2525 
2526 /**
2527  * @brief Get field status from event HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE
2528  * @param event packet
2529  * @return status
2530  * @note: btstack_type 1
2531  */
2532 static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t * event){
2533     return event[3];
2534 }
2535 
2536 /**
2537  * @brief Get field status from event HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE
2538  * @param event packet
2539  * @return status
2540  * @note: btstack_type 1
2541  */
2542 static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t * event){
2543     return event[3];
2544 }
2545 
2546 /**
2547  * @brief Get field status from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
2548  * @param event packet
2549  * @return status
2550  * @note: btstack_type 1
2551  */
2552 static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t * event){
2553     return event[3];
2554 }
2555 /**
2556  * @brief Get field handle from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
2557  * @param event packet
2558  * @return handle
2559  * @note: btstack_type H
2560  */
2561 static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t * event){
2562     return little_endian_read_16(event, 4);
2563 }
2564 
2565 /**
2566  * @brief Get field status from event HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE
2567  * @param event packet
2568  * @return status
2569  * @note: btstack_type 1
2570  */
2571 static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t * event){
2572     return event[3];
2573 }
2574 
2575 
2576 /**
2577  * @brief Get field gain from event HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED
2578  * @param event packet
2579  * @return gain
2580  * @note: btstack_type 1
2581  */
2582 static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t * event){
2583     return event[3];
2584 }
2585 
2586 /**
2587  * @brief Get field gain from event HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
2588  * @param event packet
2589  * @return gain
2590  * @note: btstack_type 1
2591  */
2592 static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t * event){
2593     return event[3];
2594 }
2595 
2596 /**
2597  * @brief Get field value_length from event HSP_SUBEVENT_HS_COMMAND
2598  * @param event packet
2599  * @return value_length
2600  * @note: btstack_type J
2601  */
2602 static inline int hsp_subevent_hs_command_get_value_length(const uint8_t * event){
2603     return event[3];
2604 }
2605 /**
2606  * @brief Get field value from event HSP_SUBEVENT_HS_COMMAND
2607  * @param event packet
2608  * @return value
2609  * @note: btstack_type V
2610  */
2611 static inline const uint8_t * hsp_subevent_hs_command_get_value(const uint8_t * event){
2612     return &event[4];
2613 }
2614 
2615 /**
2616  * @brief Get field value_length from event HSP_SUBEVENT_AG_INDICATION
2617  * @param event packet
2618  * @return value_length
2619  * @note: btstack_type J
2620  */
2621 static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t * event){
2622     return event[3];
2623 }
2624 /**
2625  * @brief Get field value from event HSP_SUBEVENT_AG_INDICATION
2626  * @param event packet
2627  * @return value
2628  * @note: btstack_type V
2629  */
2630 static inline const uint8_t * hsp_subevent_ag_indication_get_value(const uint8_t * event){
2631     return &event[4];
2632 }
2633 
2634 /**
2635  * @brief Get field status from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED
2636  * @param event packet
2637  * @return status
2638  * @note: btstack_type 1
2639  */
2640 static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t * event){
2641     return event[3];
2642 }
2643 /**
2644  * @brief Get field con_handle from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED
2645  * @param event packet
2646  * @return con_handle
2647  * @note: btstack_type H
2648  */
2649 static inline hci_con_handle_t hfp_subevent_service_level_connection_established_get_con_handle(const uint8_t * event){
2650     return little_endian_read_16(event, 4);
2651 }
2652 
2653 
2654 /**
2655  * @brief Get field status from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED
2656  * @param event packet
2657  * @return status
2658  * @note: btstack_type 1
2659  */
2660 static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t * event){
2661     return event[3];
2662 }
2663 
2664 
2665 /**
2666  * @brief Get field status from event HFP_SUBEVENT_COMPLETE
2667  * @param event packet
2668  * @return status
2669  * @note: btstack_type 1
2670  */
2671 static inline uint8_t hfp_subevent_complete_get_status(const uint8_t * event){
2672     return event[3];
2673 }
2674 
2675 /**
2676  * @brief Get field indicator_index from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
2677  * @param event packet
2678  * @return indicator_index
2679  * @note: btstack_type 1
2680  */
2681 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t * event){
2682     return event[3];
2683 }
2684 /**
2685  * @brief Get field indicator_status from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
2686  * @param event packet
2687  * @return indicator_status
2688  * @note: btstack_type 1
2689  */
2690 static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t * event){
2691     return event[4];
2692 }
2693 /**
2694  * @brief Get field indicator_name from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
2695  * @param event packet
2696  * @return indicator_name
2697  * @note: btstack_type T
2698  */
2699 static inline const char * hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t * event){
2700     return (const char *) &event[5];
2701 }
2702 
2703 /**
2704  * @brief Get field network_operator_mode from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
2705  * @param event packet
2706  * @return network_operator_mode
2707  * @note: btstack_type 1
2708  */
2709 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t * event){
2710     return event[3];
2711 }
2712 /**
2713  * @brief Get field network_operator_format from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
2714  * @param event packet
2715  * @return network_operator_format
2716  * @note: btstack_type 1
2717  */
2718 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t * event){
2719     return event[4];
2720 }
2721 /**
2722  * @brief Get field network_operator_name from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
2723  * @param event packet
2724  * @return network_operator_name
2725  * @note: btstack_type 1
2726  */
2727 static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t * event){
2728     return event[5];
2729 }
2730 
2731 /**
2732  * @brief Get field error from event HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR
2733  * @param event packet
2734  * @return error
2735  * @note: btstack_type 1
2736  */
2737 static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t * event){
2738     return event[3];
2739 }
2740 
2741 /**
2742  * @brief Get field status from event HFP_SUBEVENT_CODECS_CONNECTION_COMPLETE
2743  * @param event packet
2744  * @return status
2745  * @note: btstack_type 1
2746  */
2747 static inline uint8_t hfp_subevent_codecs_connection_complete_get_status(const uint8_t * event){
2748     return event[3];
2749 }
2750 
2751 
2752 
2753 
2754 /**
2755  * @brief Get field number from event HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER
2756  * @param event packet
2757  * @return number
2758  * @note: btstack_type T
2759  */
2760 static inline const char * hfp_subevent_place_call_with_number_get_number(const uint8_t * event){
2761     return (const char *) &event[3];
2762 }
2763 
2764 
2765 /**
2766  * @brief Get field number from event HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG
2767  * @param event packet
2768  * @return number
2769  * @note: btstack_type T
2770  */
2771 static inline const char * hfp_subevent_number_for_voice_tag_get_number(const uint8_t * event){
2772     return (const char *) &event[3];
2773 }
2774 
2775 /**
2776  * @brief Get field dtmf from event HFP_SUBEVENT_TRANSMIT_DTMF_CODES
2777  * @param event packet
2778  * @return dtmf
2779  * @note: btstack_type T
2780  */
2781 static inline const char * hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t * event){
2782     return (const char *) &event[3];
2783 }
2784 
2785 
2786 
2787 
2788 /**
2789  * @brief Get field status from event HFP_SUBEVENT_SPEAKER_VOLUME
2790  * @param event packet
2791  * @return status
2792  * @note: btstack_type 1
2793  */
2794 static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t * event){
2795     return event[3];
2796 }
2797 /**
2798  * @brief Get field gain from event HFP_SUBEVENT_SPEAKER_VOLUME
2799  * @param event packet
2800  * @return gain
2801  * @note: btstack_type 1
2802  */
2803 static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t * event){
2804     return event[4];
2805 }
2806 
2807 /**
2808  * @brief Get field status from event HFP_SUBEVENT_MICROPHONE_VOLUME
2809  * @param event packet
2810  * @return status
2811  * @note: btstack_type 1
2812  */
2813 static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t * event){
2814     return event[3];
2815 }
2816 /**
2817  * @brief Get field gain from event HFP_SUBEVENT_MICROPHONE_VOLUME
2818  * @param event packet
2819  * @return gain
2820  * @note: btstack_type 1
2821  */
2822 static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t * event){
2823     return event[4];
2824 }
2825 
2826 /**
2827  * @brief Get field type from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION
2828  * @param event packet
2829  * @return type
2830  * @note: btstack_type 1
2831  */
2832 static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t * event){
2833     return event[3];
2834 }
2835 /**
2836  * @brief Get field number from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION
2837  * @param event packet
2838  * @return number
2839  * @note: btstack_type T
2840  */
2841 static inline const char * hfp_subevent_call_waiting_notification_get_number(const uint8_t * event){
2842     return (const char *) &event[4];
2843 }
2844 
2845 /**
2846  * @brief Get field type from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION
2847  * @param event packet
2848  * @return type
2849  * @note: btstack_type 1
2850  */
2851 static inline uint8_t hfp_subevent_calling_line_indetification_notification_get_type(const uint8_t * event){
2852     return event[3];
2853 }
2854 /**
2855  * @brief Get field number from event HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION
2856  * @param event packet
2857  * @return number
2858  * @note: btstack_type T
2859  */
2860 static inline const char * hfp_subevent_calling_line_indetification_notification_get_number(const uint8_t * event){
2861     return (const char *) &event[4];
2862 }
2863 
2864 /**
2865  * @brief Get field clcc_idx from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2866  * @param event packet
2867  * @return clcc_idx
2868  * @note: btstack_type 1
2869  */
2870 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t * event){
2871     return event[3];
2872 }
2873 /**
2874  * @brief Get field clcc_dir from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2875  * @param event packet
2876  * @return clcc_dir
2877  * @note: btstack_type 1
2878  */
2879 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t * event){
2880     return event[4];
2881 }
2882 /**
2883  * @brief Get field clcc_status from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2884  * @param event packet
2885  * @return clcc_status
2886  * @note: btstack_type 1
2887  */
2888 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t * event){
2889     return event[5];
2890 }
2891 /**
2892  * @brief Get field clcc_mpty from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2893  * @param event packet
2894  * @return clcc_mpty
2895  * @note: btstack_type 1
2896  */
2897 static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t * event){
2898     return event[6];
2899 }
2900 /**
2901  * @brief Get field bnip_type from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2902  * @param event packet
2903  * @return bnip_type
2904  * @note: btstack_type 1
2905  */
2906 static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t * event){
2907     return event[7];
2908 }
2909 /**
2910  * @brief Get field bnip_number from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
2911  * @param event packet
2912  * @return bnip_number
2913  * @note: btstack_type T
2914  */
2915 static inline const char * hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t * event){
2916     return (const char *) &event[8];
2917 }
2918 
2919 /**
2920  * @brief Get field status from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
2921  * @param event packet
2922  * @return status
2923  * @note: btstack_type 1
2924  */
2925 static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t * event){
2926     return event[3];
2927 }
2928 /**
2929  * @brief Get field bnip_type from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
2930  * @param event packet
2931  * @return bnip_type
2932  * @note: btstack_type 1
2933  */
2934 static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t * event){
2935     return event[4];
2936 }
2937 /**
2938  * @brief Get field bnip_number from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
2939  * @param event packet
2940  * @return bnip_number
2941  * @note: btstack_type T
2942  */
2943 static inline const char * hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t * event){
2944     return (const char *) &event[5];
2945 }
2946 
2947 /**
2948  * @brief Get field value from event HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS
2949  * @param event packet
2950  * @return value
2951  * @note: btstack_type T
2952  */
2953 static inline const char * hfp_subevent_response_and_hold_status_get_value(const uint8_t * event){
2954     return (const char *) &event[3];
2955 }
2956 
2957 #ifdef ENABLE_BLE
2958 /**
2959  * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_CONNECTED
2960  * @param event packet
2961  * @return handle
2962  * @note: btstack_type H
2963  */
2964 static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t * event){
2965     return little_endian_read_16(event, 3);
2966 }
2967 #endif
2968 
2969 #ifdef ENABLE_BLE
2970 /**
2971  * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
2972  * @param event packet
2973  * @return handle
2974  * @note: btstack_type H
2975  */
2976 static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t * event){
2977     return little_endian_read_16(event, 3);
2978 }
2979 /**
2980  * @brief Get field attribute_id from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
2981  * @param event packet
2982  * @return attribute_id
2983  * @note: btstack_type 2
2984  */
2985 static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t * event){
2986     return little_endian_read_16(event, 5);
2987 }
2988 /**
2989  * @brief Get field text from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
2990  * @param event packet
2991  * @return text
2992  * @note: btstack_type T
2993  */
2994 static inline const char * ancs_subevent_client_notification_get_text(const uint8_t * event){
2995     return (const char *) &event[7];
2996 }
2997 #endif
2998 
2999 #ifdef ENABLE_BLE
3000 /**
3001  * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_DISCONNECTED
3002  * @param event packet
3003  * @return handle
3004  * @note: btstack_type H
3005  */
3006 static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t * event){
3007     return little_endian_read_16(event, 3);
3008 }
3009 #endif
3010 
3011 
3012 
3013 /* API_END */
3014 
3015 #if defined __cplusplus
3016 }
3017 #endif
3018 
3019 #endif // __BTSTACK_EVENT_H
3020