xref: /btstack/src/btstack_defines.h (revision 7b782c70a1cff7fb8440b3f63128cc5bc9076402)
1 /*
2  * Copyright (C) 2015 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 BLUEKITCHEN
24  * GMBH 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 definitions, events, and error codes
41  *
42  */
43 
44 #ifndef BTSTACK_DEFINES_H
45 #define BTSTACK_DEFINES_H
46 #include <stdint.h>
47 
48 #include "btstack_linked_list.h"
49 
50 // UNUSED macro
51 #ifndef UNUSED
52 #define UNUSED(x) (void)(x)
53 #endif
54 
55 
56 // Get the number of entries in an array ('x' must NOT be a pointer!)
57 #ifndef ARRAYSIZE
58 #define ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
59 #endif
60 
61 // TYPES
62 
63 // packet handler
64 typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
65 
66 // packet callback supporting multiple registrations
67 typedef struct {
68     btstack_linked_item_t    item;
69     btstack_packet_handler_t callback;
70 } btstack_packet_callback_registration_t;
71 
72 // context callback supporting multiple registrations
73 typedef struct {
74   btstack_linked_item_t * item;
75   void (*callback)(void * context);
76   void * context;
77 } btstack_context_callback_registration_t;
78 
79 /**
80  * @brief 128 bit key used with AES128 in Security Manager
81  */
82 typedef uint8_t sm_key_t[16];
83 
84 // DEFINES
85 
86 // hci con handles (12 bit): 0x0000..0x0fff
87 #define HCI_CON_HANDLE_INVALID  0xffffu
88 
89 
90 #define DAEMON_EVENT_PACKET     0x05u
91 
92 // L2CAP data
93 #define L2CAP_DATA_PACKET       0x06u
94 
95 // RFCOMM data
96 #define RFCOMM_DATA_PACKET      0x07u
97 
98 // Attribute protocol data
99 #define ATT_DATA_PACKET         0x08u
100 
101 // Security Manager protocol data
102 #define SM_DATA_PACKET          0x09u
103 
104 // SDP query result - only used by daemon
105 // format: type (8), record_id (16), attribute_id (16), attribute_length (16), attribute_value (max 1k)
106 #define SDP_CLIENT_PACKET       0x0au
107 
108 // BNEP data
109 #define BNEP_DATA_PACKET        0x0bu
110 
111 // Unicast Connectionless Data
112 #define UCD_DATA_PACKET         0x0cu
113 
114 // GOEP data
115 #define GOEP_DATA_PACKET        0x0du
116 
117 // PBAP data
118 #define PBAP_DATA_PACKET        0x0eu
119 
120 // AVRCP browsing data
121 #define AVRCP_BROWSING_DATA_PACKET     0x0fu
122 
123 // MAP data
124 #define MAP_DATA_PACKET        0x10u
125 
126 // BIP data
127 #define BIP_DATA_PACKET         0x11
128 
129 // Mesh Provisioning PDU
130 #define PROVISIONING_DATA_PACKET 0x12u
131 
132 // Mesh Proxy PDU
133 #define MESH_PROXY_DATA_PACKET   0x12u
134 
135 // Mesh Network PDU
136 #define MESH_NETWORK_PACKET      0x13u
137 
138 // Mesh Network PDU
139 #define MESH_BEACON_PACKET       0x14u
140 
141 // debug log messages
142 #define LOG_MESSAGE_PACKET      0xfcu
143 
144 
145 // DAEMON COMMANDS
146 
147 #define OGF_BTSTACK 0x3du
148 
149 // cmds for BTstack
150 // get state: @return HCI_STATE
151 #define BTSTACK_GET_STATE                                  0x01u
152 
153 // set power mode: param HCI_POWER_MODE
154 #define BTSTACK_SET_POWER_MODE                             0x02u
155 
156 // set capture mode: param on
157 #define BTSTACK_SET_ACL_CAPTURE_MODE                       0x03u
158 
159 // get BTstack version
160 #define BTSTACK_GET_VERSION                                0x04u
161 
162 // get system Bluetooth state
163 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED               0x05u
164 
165 // set system Bluetooth state
166 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED               0x06u
167 
168 // enable inquiry scan for this client
169 #define BTSTACK_SET_DISCOVERABLE                           0x07u
170 
171 // set global Bluetooth state
172 #define BTSTACK_SET_BLUETOOTH_ENABLED                      0x08u
173 
174 // create l2cap channel: param bd_addr(48), psm (16)
175 #define L2CAP_CREATE_CHANNEL                               0x20u
176 
177 // disconnect l2cap disconnect, param channel(16), reason(8)
178 #define L2CAP_DISCONNECT                                   0x21u
179 
180 // register l2cap service: param psm(16), mtu (16)
181 #define L2CAP_REGISTER_SERVICE                             0x22u
182 
183 // unregister l2cap disconnect, param psm(16)
184 #define L2CAP_UNREGISTER_SERVICE                           0x23u
185 
186 // accept connection param bd_addr(48), dest cid (16)
187 #define L2CAP_ACCEPT_CONNECTION                            0x24u
188 
189 // decline l2cap disconnect,param bd_addr(48), dest cid (16), reason(8)
190 #define L2CAP_DECLINE_CONNECTION                           0x25u
191 
192 // create l2cap channel: param bd_addr(48), psm (16), mtu (16)
193 #define L2CAP_CREATE_CHANNEL_MTU                           0x26u
194 
195 // request can send now event: l2cap_cid
196 #define L2CAP_REQUEST_CAN_SEND_NOW                         0x27u
197 
198 // register SDP Service Record: service record (size)
199 #define SDP_REGISTER_SERVICE_RECORD                        0x30u
200 
201 // unregister SDP Service Record
202 #define SDP_UNREGISTER_SERVICE_RECORD                      0x31u
203 
204 // Get remote RFCOMM services
205 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES                   0x32u
206 
207 // Get remote SDP services
208 #define SDP_CLIENT_QUERY_SERVICES                          0x33u
209 
210 // RFCOMM "HCI" Commands
211 #define RFCOMM_CREATE_CHANNEL                              0x40u
212 #define RFCOMM_DISCONNECT                                  0x41u
213 #define RFCOMM_REGISTER_SERVICE                            0x42u
214 #define RFCOMM_UNREGISTER_SERVICE                          0x43u
215 #define RFCOMM_ACCEPT_CONNECTION                           0x44u
216 #define RFCOMM_DECLINE_CONNECTION                          0x45u
217 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS                 0x47u
218 #define RFCOMM_PERSISTENT_CHANNEL                          0x46u
219 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS               0x48u
220 #define RFCOMM_GRANT_CREDITS                               0x49u
221 // request can send now event: rfcomm_cid
222 #define RFCOMM_REQUEST_CAN_SEND_NOW                        0x4Au
223 
224 // GAP Classic 0x50u
225 #define GAP_DISCONNECT                0x50u
226 #define GAP_INQUIRY_START             0x51u
227 #define GAP_INQUIRY_STOP              0x52u
228 #define GAP_REMOTE_NAME_REQUEST       0x53u
229 #define GAP_DROP_LINK_KEY_FOR_BD_ADDR 0x54u
230 #define GAP_DELETE_ALL_LINK_KEYS      0x55u
231 #define GAP_PIN_CODE_RESPONSE         0x56u
232 #define GAP_PIN_CODE_NEGATIVE         0x57u
233 
234 // GAP LE      0x60u
235 #define GAP_LE_SCAN_START           0x60u
236 #define GAP_LE_SCAN_STOP            0x61u
237 #define GAP_LE_CONNECT              0x62u
238 #define GAP_LE_CONNECT_CANCEL       0x63u
239 #define GAP_LE_SET_SCAN_PARAMETERS  0x64u
240 
241 // GATT (Client) 0x70u
242 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES                       0x70u
243 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16                 0x71u
244 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128                0x72u
245 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE                  0x73u
246 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE                0x74u
247 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128     0x75u
248 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS                 0x76u
249 #define GATT_READ_VALUE_OF_CHARACTERISTIC                        0x77u
250 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC                   0x78u
251 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE      0x79u
252 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC                       0x7Au
253 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC                  0x7Bu
254 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC         0x7Cu
255 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR                      0X7Du
256 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR                 0X7Eu
257 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR                     0X7Fu
258 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR                0X80u
259 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION           0X81u
260 #define GATT_GET_MTU                                             0x82u
261 
262 // SM 0x90u
263 #define SM_SET_AUTHENTICATION_REQUIREMENTS 0x90u
264 #define SM_SET_IO_CAPABILITIES             0x92u
265 #define SM_BONDING_DECLINE                 0x93u
266 #define SM_JUST_WORKS_CONFIRM              0x94u
267 #define SM_NUMERIC_COMPARISON_CONFIRM      0x95u
268 #define SM_PASSKEY_INPUT                   0x96u
269 
270 // ATT
271 
272 // ..
273 // Internal properties reuse some GATT Characteristic Properties fields
274 #define ATT_DB_VERSION                                     0x01u
275 
276 // EVENTS
277 
278 // Events from host controller to host
279 
280 /**
281  * @brief Custom NOP Event - used for internal testing
282  */
283 #define HCI_EVENT_NOP                                      0x00u
284 
285 /**
286  * @format 1
287  * @param status
288  */
289 #define HCI_EVENT_INQUIRY_COMPLETE                         0x01u
290 
291 /**
292  * @format 1B11132
293  * @param num_responses
294  * @param bd_addr
295  * @param page_scan_repetition_mode
296  * @param reserved1
297  * @param reserved2
298  * @param class_of_device
299  * @param clock_offset
300  */
301 #define HCI_EVENT_INQUIRY_RESULT                           0x02u
302 
303 /**
304  * @format 12B11
305  * @param status
306  * @param connection_handle
307  * @param bd_addr
308  * @param link_type
309  * @param encryption_enabled
310  */
311 #define HCI_EVENT_CONNECTION_COMPLETE                      0x03u
312 /**
313  * @format B31
314  * @param bd_addr
315  * @param class_of_device
316  * @param link_type
317  */
318 #define HCI_EVENT_CONNECTION_REQUEST                       0x04u
319 /**
320  * @format 121
321  * @param status
322  * @param connection_handle
323  * @param reason
324  */
325 #define HCI_EVENT_DISCONNECTION_COMPLETE                   0x05u
326 /**
327  * @format 12
328  * @param status
329  * @param connection_handle
330  */
331 #define HCI_EVENT_AUTHENTICATION_COMPLETE                 0x06u
332 
333 // HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT is deprecated, use HCI_EVENT_AUTHENTICATION_COMPLETE instead
334 #define HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT HCI_EVENT_AUTHENTICATION_COMPLETE
335 
336 /**
337  * @format 1BN
338  * @param status
339  * @param bd_addr
340  * @param remote_name
341  */
342 #define HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE             0x07u
343 
344 /**
345  * @format 121
346  * @param status
347  * @param connection_handle
348  * @param encryption_enabled
349  */
350 #define HCI_EVENT_ENCRYPTION_CHANGE                        0x08u
351 
352 /**
353  * @format 12
354  * @param status
355  * @param connection_handle
356  */
357 #define HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE      0x09u
358 
359 /**
360  * @format 121
361  * @param status
362  * @param connection_handle
363  * @param key_flag
364  */
365 #define HCI_EVENT_MASTER_LINK_KEY_COMPLETE                 0x0Au
366 
367 #define HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE  0x0Bu
368 
369 /**
370  * @format 12122
371  * @param status
372  * @param connection_handle
373  * @param version
374  * @param manufacturer_name
375  * @param subversion
376  */
377 #define HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE 0x0Cu
378 
379 #define HCI_EVENT_QOS_SETUP_COMPLETE                       0x0Du
380 
381 /**
382  * @format 12R
383  * @param num_hci_command_packets
384  * @param command_opcode
385  * @param return_parameters
386  */
387 #define HCI_EVENT_COMMAND_COMPLETE                         0x0Eu
388 /**
389  * @format 112
390  * @param status
391  * @param num_hci_command_packets
392  * @param command_opcode
393  */
394 #define HCI_EVENT_COMMAND_STATUS                           0x0Fu
395 
396 /**
397  * @format 1
398  * @param hardware_code
399  */
400 #define HCI_EVENT_HARDWARE_ERROR                           0x10u
401 
402 /**
403  * @format H
404  * @param handle
405  */
406 #define HCI_EVENT_FLUSH_OCCURRED                           0x11u
407 
408 /**
409  * @format 1B1
410  * @param status
411  * @param bd_addr
412  * @param role
413  */
414 #define HCI_EVENT_ROLE_CHANGE                              0x12u
415 
416 // TODO: number_of_handles 1, connection_handle[H*i], hc_num_of_completed_packets[2*i]
417 #define HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS              0x13u
418 
419 /**
420  * @format 1H12
421  * @param status
422  * @param handle
423  * @param mode
424  * @param interval
425  */
426 #define HCI_EVENT_MODE_CHANGE                              0x14u
427 
428 // TODO: num_keys, bd_addr[B*i], link_key[16 octets * i]
429 #define HCI_EVENT_RETURN_LINK_KEYS                         0x15u
430 
431 /**
432  * @format B
433  * @param bd_addr
434  */
435 #define HCI_EVENT_PIN_CODE_REQUEST                         0x16u
436 
437 /**
438  * @format B
439  * @param bd_addr
440  */
441 #define HCI_EVENT_LINK_KEY_REQUEST                         0x17u
442 
443 // TODO: bd_addr B, link_key 16octets, key_type 1
444 #define HCI_EVENT_LINK_KEY_NOTIFICATION                    0x18u
445 
446 // event params contains HCI ccommand
447 #define HCI_EVENT_LOOPBACK_COMMAND                         0x19u
448 
449 /**
450  * @format 1
451  * @param link_type
452  */
453 #define HCI_EVENT_DATA_BUFFER_OVERFLOW                     0x1Au
454 
455 /**
456  * @format H1
457  * @param handle
458  * @param lmp_max_slots
459  */
460 #define HCI_EVENT_MAX_SLOTS_CHANGED                        0x1Bu
461 
462 /**
463  * @format 1H2
464  * @param status
465  * @param handle
466  * @param clock_offset
467  */
468 #define HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE               0x1Cu
469 
470 /**
471  * @format 1H2
472  * @param status
473  * @param handle
474  * @param packet_types
475  * @pnote packet_type is in plural to avoid clash with Java binding Packet.getPacketType()
476  */
477 #define HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED           0x1Du
478 
479 /**
480  * @format H
481  * @param handle
482  */
483 #define HCI_EVENT_QOS_VIOLATION                            0x1Eu
484 
485 // 0x1f not defined
486 
487 /**
488  * @format H1
489  * @param handle
490  * @param page_scan_repetition_mode
491  */
492 #define HCI_EVENT_PAGE_SCAN_REPETITION_MODE_CHANGE         0x20u
493 
494 /**
495  * @format 1H1114444
496  * @param status
497  * @param handle
498  * @param unused
499  * @param flow_direction
500  * @param service_type
501  * @param token_rate
502  * @param token_bucket_size
503  * @param peak_bandwidth
504  * @param access_latency
505  *
506  */
507 #define HCI_EVENT_FLOW_SPECIFICATION_COMPLETE              0x21u
508 
509 /**
510  * @format 1B11321
511  * @param num_responses
512  * @param bd_addr
513  * @param page_scan_repetition_mode
514  * @param reserved
515  * @param class_of_device
516  * @param clock_offset
517  * @param rssi
518  */
519 #define HCI_EVENT_INQUIRY_RESULT_WITH_RSSI                 0x22u
520 
521 #define HCI_EVENT_READ_REMOTE_EXTENDED_FEATURES_COMPLETE   0x23u
522 
523 // 0x24..0x2b not defined
524 
525 /**
526  * @format 1HB111221
527  * @param status
528  * @param handle
529  * @param bd_addr
530  * @param link_type
531  * @param transmission_interval
532  * @param retransmission_interval
533  * @param rx_packet_length
534  * @param tx_packet_length
535  * @param air_mode
536  */
537 #define HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE          0x2Cu
538 
539 /**
540  * @format 1H1122
541  * @param status
542  * @param handle
543  * @param transmission_interval
544  * @param retransmission_interval
545  * @param rx_packet_length
546  * @param tx_packet_length
547  */
548 #define HCI_EVENT_SYNCHRONOUS_CONNECTION_CHANGED          0x2Du
549 
550 /**
551  * @format 1H2222
552  * @param status
553  * @param handle
554  * @param max_tx_latency
555  * @param max_rx_latency
556  * @param min_remote_timeout
557  * @param min_local_timeout
558  */
559 #define HCI_EVENT_SNIFF_SUBRATING                         0x2Eu
560 
561 // TODO: serialize extended_inquiry_response and provide parser
562 
563 /**
564  * @format 1B11321
565  * @param num_responses
566  * @param bd_addr
567  * @param page_scan_repetition_mode
568  * @param reserved
569  * @param class_of_device
570  * @param clock_offset
571  * @param rssi
572  */
573 #define HCI_EVENT_EXTENDED_INQUIRY_RESPONSE                0x2Fu
574 
575  /**
576   * @format 1H
577   * @param status
578   * @param handle
579   */
580 #define HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE          0x30u
581 
582  /**
583   * @format B
584   * @param bd_addr
585   */
586 #define HCI_EVENT_IO_CAPABILITY_REQUEST                    0x31u
587 
588 /**
589  * @format B111
590  * @param bd_addr
591  * @param io_capability
592  * @param oob_data_present
593  * @param authentication_requirements
594  */
595 #define HCI_EVENT_IO_CAPABILITY_RESPONSE                   0x32u
596 
597 /**
598  * @format B4
599  * @param bd_addr
600  * @param numeric_value
601  */
602 #define HCI_EVENT_USER_CONFIRMATION_REQUEST                0x33u
603 
604 /**
605  * @format B
606  * @param bd_addr
607  */
608 #define HCI_EVENT_USER_PASSKEY_REQUEST                     0x34u
609 
610 /**
611  * @format B
612  * @param bd_addr
613  */
614 #define HCI_EVENT_REMOTE_OOB_DATA_REQUEST                  0x35u
615 
616 /**
617  * @format 1B
618  * @param status
619  * @param bd_addr
620  */
621 #define HCI_EVENT_SIMPLE_PAIRING_COMPLETE                  0x36u
622 
623 /**
624  * @format H2
625  * @param handle
626  * @param link_supervision_timeout
627  */
628 #define HCI_EVENT_LINK_SUPERVISION_TIMEOUT_CHANGED         0x38u
629 
630 /**
631  * @format H
632  * @param handle
633  */
634 #define HCI_EVENT_ENHANCED_FLUSH_COMPLETE                  0x39u
635 
636 // 0x03a not defined
637 
638 /**
639  * @format B4
640  * @param bd_addr
641  * @param numeric_value
642  */
643 #define HCI_EVENT_USER_PASSKEY_NOTIFICATION                0x3Bu
644 
645 /**
646  * @format B1
647  * @param bd_addr
648  * @param notification_type
649  */
650 #define HCI_EVENT_KEYPRESS_NOTIFICATION                    0x3Cu
651 
652 #define HCI_EVENT_REMOTE_HOST_SUPPORTED_FEATURES           0x3Du
653 
654 #define HCI_EVENT_LE_META                                  0x3Eu
655 
656 // 0x3f..0x47 not defined
657 
658 #define HCI_EVENT_NUMBER_OF_COMPLETED_DATA_BLOCKS          0x48u
659 
660 // 0x49..0x58 not defined
661 
662 /**
663  * @format 1211
664  * @param status
665  * @param connection_handle
666  * @param encryption_enabled
667  * @param encryption_key_size
668  */
669 #define HCI_EVENT_ENCRYPTION_CHANGE_V2                     0x59u
670 
671 // last used HCI_EVENT in 5.3 is 0x59u
672 
673 #define HCI_EVENT_VENDOR_SPECIFIC                          0xFFu
674 
675 /**
676  * @format 11H11B2221
677  * @param subevent_code
678  * @param status
679  * @param connection_handle
680  * @param role
681  * @param peer_address_type
682  * @param peer_address
683  * @param conn_interval
684  * @param conn_latency
685  * @param supervision_timeout
686  * @param master_clock_accuracy
687  */
688 #define HCI_SUBEVENT_LE_CONNECTION_COMPLETE                0x01u
689 
690 // array of advertisements, not handled by event accessor generator
691 #define HCI_SUBEVENT_LE_ADVERTISING_REPORT                 0x02u
692 
693 /**
694  * @format 11H222
695  * @param subevent_code
696  * @param status
697  * @param connection_handle
698  * @param conn_interval
699  * @param conn_latency
700  * @param supervision_timeout
701  */
702  #define HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE         0x03u
703 
704 /**
705  * @format 1HD
706  * @param subevent_code
707  * @param connection_handle
708  * @param le_features
709  */
710 #define HCI_SUBEVENT_LE_READ_REMOTE_FEATURES_COMPLETE 0x04u
711 
712 /**
713  * @format 1HD2
714  * @param subevent_code
715  * @param connection_handle
716  * @param random_number
717  * @param encryption_diversifier
718  */
719 #define HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST              0x05u
720 
721 /**
722  * @format 1H2222
723  * @param subevent_code
724  * @param connection_handle
725  * @param interval_min
726  * @param interval_max
727  * @param latency
728  * @param timeout
729  */
730 #define HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST 0x06u
731 
732 /**
733  * @format 1H2222
734  * @param subevent_code
735  * @param connection_handle
736  * @param max_tx_octets
737  * @param max_tx_time
738  * @param max_rx_octets
739  * @param max_rx_time
740  */
741 #define HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE 0x07u
742 
743 /**
744  * @format 11QQ
745  * @param subevent_code
746  * @param status
747  * @param dhkey_x x coordinate of P256 public key
748  * @param dhkey_y y coordinate of P256 public key
749  */
750 #define HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE 0x08u
751 
752  /**
753  * @format 11Q
754  * @param subevent_code
755  * @param status
756  * @param dhkey Diffie-Hellman key
757  */
758 #define HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE            0x09u
759 
760 /**
761  * @format 11H11BBB2221
762  * @param subevent_code
763  * @param status
764  * @param connection_handle
765  * @param role
766  * @param peer_address_type
767  * @param peer_addresss
768  * @param local_resolvable_private_address
769  * @param peer_resolvable_private_address
770  * @param conn_interval
771  * @param conn_latency
772  * @param supervision_timeout
773  * @param master_clock_accuracy
774  */
775 #define HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE_V1       0x0Au
776 
777 // array of advertisements, not handled by event accessor generator
778 #define HCI_SUBEVENT_LE_DIRECT_ADVERTISING_REPORT          0x0Bu
779 
780 /**
781  * @format 11H1
782  * @param subevent_code
783  * @param status
784  * @param connection_handle
785  * @param tx_phy
786  */
787 #define HCI_SUBEVENT_LE_PHY_UPDATE_COMPLETE                0x0Cu
788 
789 // array of advertisements, not handled by event accessor generator
790 #define HCI_SUBEVENT_LE_EXTENDED_ADVERTISING_REPORT        0x0Du
791 
792 /**
793  * @format 11H11B121
794  * @param subevent_code
795  * @param status
796  * @param sync_handle
797  * @param advertising_sid
798  * @param advertiser_address_type
799  * @param advertiser_address
800  * @param advertiser_phy
801  * @param periodic_advertising_interval
802  * @param advertiser_clock_accuracy
803  */
804 #define HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHMENT 0x0Eu
805 
806 /**
807  * @format 1H1111JV
808  * @param subevent_code
809  * @param sync_handle
810  * @param tx_power
811  * @param rssi
812  * @param cte_type
813  * @param data_status
814  * @param data_length
815  * @param data
816 */
817 #define HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_REPORT             0x0Fu
818 
819 /**
820  * @format 1H
821  * @param subevent_code
822  * @param sync_handle
823  */
824 #define HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_SYNC_LOST          0x10u
825 
826 /**
827  * @format 1
828  * @param subevent_code
829  */
830 #define HCI_SUBEVENT_LE_SCAN_TIMEOUT                            0x11u
831 
832 /**
833  * @format 111H1
834  * @param subevent_code
835  * @param status
836  * @param advertising_handle
837  * @param connection_handle
838  * @param num_completed_exteneded_advertising_events
839  */
840 #define HCI_SUBEVENT_LE_ADVERTISING_SET_TERMINATED              0x12u
841 
842 /**
843  * @format 111B
844  * @param subevent_code
845  * @param advertising_handle
846  * @param scanner_address_type
847  * @param scanner_address
848  */
849 #define HCI_SUBEVENT_LE_SCAN_REQUEST_RECEIVED                   0x13u
850 
851 /**
852  * @format 1H1
853  * @param subevent_code
854  * @param connection_handle
855  * @param channel_selection_algorithm
856  */
857 #define HCI_SUBEVENT_LE_CHANNEL_SELECTION_ALGORITHM             0x14u
858 
859 // array of advertisements, not handled by event accessor generator
860 #define HCI_SUBEVENT_LE_CONNECTIONLESS_IQ_REPORT                0x15u
861 
862 // array of advertisements, not handled by event accessor generator
863 #define HCI_SUBEVENT_LE_CONNECTION_IQ_REPORT                    0x16u
864 
865 /**
866  * @format 11H
867  * @param subevent_code
868  * @param status
869  * @param connection_handle
870  */
871 #define HCI_SUBEVENT_LE_LE_CTE_REQUEST_FAILED                   0x17u
872 
873 /**
874  * @format 11H2H11B121
875  * @param subevent_code
876  * @param status
877  * @param connection_handle
878  * @param service_data
879  * @param sync_handle
880  * @param advertising_sid
881  * @param advertiser_address_type
882  * @param advertiser_address
883  * @param advertiser_phy
884  * @param periodic_advertising_interval
885  * @param advertiser_clock_accuracy
886  */
887 #define HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED 0x18u
888 
889 /**
890  * @format 11H33331111111222
891  * @param subevent_code
892  * @param status
893  * @param connection_handle
894  * @param cig_sync_delay
895  * @param cis_sync_delay
896  * @param transport_latency_c_to_p
897  * @param transport_latency_p_to_c
898  * @param phy_c_to_p
899  * @param phy_p_to_c
900  * @param nse
901  * @param bn_c_to_p
902  * @param bn_p_to_c
903  * @param ft_c_to_p
904  * @param ft_p_to_c
905  * @param max_pdu_c_to_p
906  * @param max_pdu_p_to_c
907  * @param iso_interval
908  */
909 #define HCI_SUBEVENT_LE_CIS_ESTABLISHED                          0x19u
910 
911 /**
912  * @format 1HH11
913  * @param subevent_code
914  * @param acl_connection_handle
915  * @param cis_connection_handle
916  * @param cig_id
917  * @param cis_id
918  */
919 #define HCI_SUBEVENT_LE_CIS_REQUEST                            0x1au
920 
921 // array of advertisements, not handled by event accessor generator
922 #define HCI_SUBEVENT_LE_CREATE_BIG_COMPLETE                     0x1Bu
923 
924 /**
925  * @format 111
926  * @param subevent_code
927  * @param big_handle
928  * @param reason
929  */
930 #define HCI_SUBEVENT_LE_TERMINATE_BIG_COMPLETE                   0x1Cu
931 
932 // array of advertisements, not handled by event accessor generator
933 #define HCI_SUBEVENT_LE_BIG_SYNC_ESTABLISHED                     0x1Du
934 
935 /**
936  * @format 111
937  * @param subevent_code
938  * @param big_handle
939  * @param reason
940  */
941 #define HCI_SUBEVENT_LE_BIG_SYNC_LOST                            0x1Eu
942 
943 /**
944  * @format 11H1
945  * @param subevent_code
946  * @param status
947  * @param connection_handle
948  * @param peer_clock_accuracy
949  */
950 #define HCI_SUBEVENT_LE_REQUEST_PEER_SCA_COMPLETE                0x1Fu
951 
952 /**
953  * @format 11H11111
954  * @param subevent_code
955  * @param status
956  * @param connection_handle
957  * @param reason
958  * @param phy
959  * @param tx_power_level
960  * @param tx_power_level_flag
961  * @param delta
962  */
963 #define HCI_SUBEVENT_LE_TRANSMIT_POWER_REPORTING                 0x21u
964 
965 /**
966  * @format 1H112111232111
967  * @param subevent_code
968  * @param sync_handle
969  * @param num_bis
970  * @param nse
971  * @param iso_interval
972  * @param bn
973  * @param pto
974  * @param irc
975  * @param max_pdu
976  * @param sdu_interval
977  * @param max_sdu
978  * @param phy
979  * @param framing
980  * @param encryption
981  */
982 #define HCI_SUBEVENT_LE_BIGINFO_ADVERTISING_REPORT                0x22u
983 
984 /**
985  * @format 11H2222
986  * @param subevent_code
987  * @param status
988  * @param connection_handle
989  * @param subrate_factor
990  * @param peripheral_latency
991  * @param continuation_number
992  * @param supervision_timeout
993  */
994 #define HCI_SUBEVENT_LE_SUBRATE_CHANGE                            0x23u
995 
996 /**
997  * @format 1111
998  * @param subevent_code
999  * @param advertising_handle
1000  * @param subevent_start
1001  * @param subevent_data_count
1002  */
1003 #define HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_DATA_REQUEST         0x27u
1004 
1005 /**
1006  * @format 11H11BBB22211H
1007  * @param subevent_code
1008  * @param status
1009  * @param connection_handle
1010  * @param role
1011  * @param peer_address_type
1012  * @param peer_addresss
1013  * @param local_resolvable_private_address
1014  * @param peer_resolvable_private_address
1015  * @param conn_interval
1016  * @param conn_latency
1017  * @param supervision_timeout
1018  * @param master_clock_accuracy
1019  * @param advertising_handle
1020  * @param sync_handle
1021  */
1022 #define HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE_V2           0x29u
1023 
1024 /** Internal BTstack events */
1025 #define BTSTACK_EVENT_FIRST                               BTSTACK_EVENT_STATE
1026 
1027 /**
1028  * @format 1
1029  * @param state
1030  */
1031 #define BTSTACK_EVENT_STATE                                0x60u
1032 
1033 /**
1034  * @format 1
1035  * @param number_connections
1036  */
1037 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED               0x61u
1038 
1039 /**
1040  * @format
1041  */
1042 #define BTSTACK_EVENT_POWERON_FAILED                       0x62u
1043 
1044 /**
1045  * @format 11
1046  * @param discoverable
1047  * @param connectable
1048  */
1049 #define BTSTACK_EVENT_SCAN_MODE_CHANGED                    0x66u
1050 
1051 // Daemon Events
1052 
1053 /**
1054  * @format 112
1055  * @param major
1056  * @param minor
1057  @ @param revision
1058  */
1059 #define DAEMON_EVENT_VERSION                               0x63u
1060 
1061 // data: system bluetooth on/off (bool)
1062 /**
1063  * @format 1
1064  * @param system_bluetooth_enabled
1065  */
1066 #define DAEMON_EVENT_SYSTEM_BLUETOOTH_ENABLED              0x64u
1067 
1068 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes)
1069 
1070 /*
1071  * @format 1BT
1072  * @param status == 0 to match read_remote_name_request
1073  * @param address
1074  * @param name
1075  */
1076 #define DAEMON_EVENT_REMOTE_NAME_CACHED                    0x65u
1077 
1078 // internal - data: event(8)
1079 #define DAEMON_EVENT_CONNECTION_OPENED                     0x67u
1080 
1081 // internal - data: event(8)
1082 #define DAEMON_EVENT_CONNECTION_CLOSED                     0x68u
1083 
1084 // data: event(8), len(8), local_cid(16), credits(8)
1085 #define DAEMON_EVENT_L2CAP_CREDITS                         0x74u
1086 
1087 /**
1088  * @format 12
1089  * @param status
1090  * @param psm
1091  */
1092 #define DAEMON_EVENT_L2CAP_SERVICE_REGISTERED              0x75u
1093 
1094 /**
1095  * @format 11
1096  * @param status
1097  * @param channel_id
1098  */
1099 #define DAEMON_EVENT_RFCOMM_SERVICE_REGISTERED             0x85u
1100 
1101 /**
1102  * @format 11
1103  * @param status
1104  * @param server_channel_id
1105  */
1106 #define DAEMON_EVENT_RFCOMM_PERSISTENT_CHANNEL             0x86u
1107 
1108 /**
1109   * @format 14
1110   * @param status
1111   * @param service_record_handle
1112   */
1113 #define DAEMON_EVENT_SDP_SERVICE_REGISTERED                0x90u
1114 
1115 
1116 
1117 // additional HCI events
1118 
1119 /**
1120  * @brief Indicates HCI transport enters/exits Sleep mode
1121  * @format 1
1122  * @param active
1123  */
1124 #define HCI_EVENT_TRANSPORT_SLEEP_MODE                     0x69u
1125 
1126 /**
1127  * @brief Transport USB Bluetooth Controller info
1128  * @format 22JV
1129  * @param vendor_id
1130  * @param product_id
1131  * @param path_len
1132  * @param path
1133  */
1134 #define HCI_EVENT_TRANSPORT_USB_INFO                       0x6Au
1135 
1136 /**
1137  * @brief Transport ready
1138  */
1139 #define HCI_EVENT_TRANSPORT_READY                          0x6Du
1140 
1141 /**
1142  * @brief Outgoing packet
1143  */
1144 #define HCI_EVENT_TRANSPORT_PACKET_SENT                    0x6Eu
1145 
1146 /**
1147  * @format 11H
1148  * @param big_handle
1149  * @param bis_index
1150  * @param con_handle
1151  */
1152 #define HCI_EVENT_BIS_CAN_SEND_NOW                         0x6Bu
1153 
1154 /**
1155  * @format H
1156  * @param cis_con_handle
1157  */
1158 #define HCI_EVENT_CIS_CAN_SEND_NOW                         0x6Cu
1159 
1160 /**
1161  * @format
1162  */
1163 #define HCI_EVENT_SCO_CAN_SEND_NOW                         0x6Fu
1164 
1165 
1166 // L2CAP EVENTS
1167 
1168 /**
1169  * @format 1BH222222111
1170  * @param status
1171  * @param address
1172  * @param handle
1173  * @param psm
1174  * @param local_cid
1175  * @param remote_cid
1176  * @param local_mtu
1177  * @param remote_mtu
1178  * @param flush_timeout
1179  * @param incoming
1180  * @param mode
1181  * @param fcs
1182  */
1183 #define L2CAP_EVENT_CHANNEL_OPENED                         0x70u
1184 
1185 /*
1186  * @format 2
1187  * @param local_cid
1188  */
1189 #define L2CAP_EVENT_CHANNEL_CLOSED                         0x71u
1190 
1191 /**
1192  * @format BH222
1193  * @param address
1194  * @param handle
1195  * @param psm
1196  * @param local_cid
1197  * @param remote_cid
1198  */
1199 #define L2CAP_EVENT_INCOMING_CONNECTION                    0x72u
1200 
1201 // ??
1202 // data: event(8), len(8), handle(16)
1203 #define L2CAP_EVENT_TIMEOUT_CHECK                          0x73u
1204 
1205 /**
1206  * @format H2222
1207  * @param handle
1208  * @param interval_min
1209  * @param interval_max
1210  * @param latency
1211  * @param timeout_multiplier
1212  */
1213 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST    0x76u
1214 
1215 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail)
1216  /**
1217   * @format H2
1218   * @param handle
1219   * @param result
1220   */
1221 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE   0x77u
1222 
1223  /*
1224  * @format H22
1225  * @param con_handle
1226  * @param extended_feature_mask
1227  * @param fixed_channels_supported
1228  */
1229 #define L2CAP_EVENT_INFORMATION_RESPONSE                   0x78u
1230 
1231 /**
1232  * @format 2
1233  * @param local_cid
1234  */
1235 #define L2CAP_EVENT_CAN_SEND_NOW                           0x79u
1236 
1237 /*
1238  * @format 2
1239  * @param local_cid
1240  */
1241 #define L2CAP_EVENT_PACKET_SENT                            0x7au
1242 
1243 /*
1244  * @format 2
1245  * @param local_cid
1246  */
1247 #define L2CAP_EVENT_ERTM_BUFFER_RELEASED                   0x7bu
1248 
1249 // L2CAP Channel in LE Credit-based Flow-Control Mode (CBM)
1250 
1251 /**
1252  * @format 1BH2222
1253  * @param address_type
1254  * @param address
1255  * @param handle
1256  * @param psm
1257  * @param local_cid
1258  * @param remote_cid
1259  * @param remote_mtu
1260  */
1261 #define L2CAP_EVENT_CBM_INCOMING_CONNECTION                 0x7cu
1262 
1263 /**
1264  * @format 11BH122222
1265  * @param status
1266  * @param address_type
1267  * @param address
1268  * @param handle
1269  * @param incoming
1270  * @param psm
1271  * @param local_cid
1272  * @param remote_cid
1273  * @param local_mtu
1274  * @param remote_mtu
1275  */
1276 #define L2CAP_EVENT_CBM_CHANNEL_OPENED                      0x7du
1277 
1278 /*
1279  * @format
1280  */
1281 #define L2CAP_EVENT_TRIGGER_RUN                             0x7eu
1282 
1283 /**
1284  * @format 1BH212
1285  * @param address_type
1286  * @param address
1287  * @param handle
1288  * @param psm
1289  * @param num_channels
1290  * @param local_cid first new cid
1291  */
1292 #define L2CAP_EVENT_ECBM_INCOMING_CONNECTION               0x7fu
1293 
1294 /**
1295  * @format 11BH122222
1296  * @param status
1297  * @param address_type
1298  * @param address
1299  * @param handle
1300  * @param incoming
1301  * @param psm
1302  * @param local_cid
1303  * @param remote_cid
1304  * @param local_mtu
1305  * @param remote_mtu
1306  */
1307 #define L2CAP_EVENT_ECBM_CHANNEL_OPENED              0x8au
1308 
1309 /*
1310  * @format 222
1311  * @param remote_cid
1312  * @param mtu
1313  * @param mps
1314  */
1315 #define L2CAP_EVENT_ECBM_RECONFIGURED                0x8bu
1316 
1317 /*
1318  * @format 22
1319  * @param local_cid
1320  * @param reconfigure_result
1321  */
1322 #define L2CAP_EVENT_ECBM_RECONFIGURATION_COMPLETE    0x8cu
1323 
1324 
1325 // RFCOMM EVENTS
1326 
1327 /**
1328  * @format 1B21221
1329  * @param status
1330  * @param bd_addr
1331  * @param con_handle
1332  * @param server_channel
1333  * @param rfcomm_cid
1334  * @param max_frame_size
1335  * @param incoming
1336  */
1337 #define RFCOMM_EVENT_CHANNEL_OPENED                        0x80u
1338 
1339 /**
1340  * @format 2
1341  * @param rfcomm_cid
1342  */
1343 #define RFCOMM_EVENT_CHANNEL_CLOSED                        0x81u
1344 
1345 /**
1346  * @format B12H
1347  * @param bd_addr
1348  * @param server_channel
1349  * @param rfcomm_cid
1350  * @param con_handle
1351 
1352  */
1353 #define RFCOMM_EVENT_INCOMING_CONNECTION                   0x82u
1354 
1355 /**
1356  * @format 21
1357  * @param rfcomm_cid
1358  * @param line_status
1359  */
1360 #define RFCOMM_EVENT_REMOTE_LINE_STATUS                    0x83u
1361 
1362 /**
1363  * @format 21
1364  * @param rfcomm_cid
1365  * @param modem_status
1366  */
1367 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS                   0x87u
1368 
1369 /**
1370  * note: port configuration not parsed by stack, getters provided by rfcomm.h
1371  * param rfcomm_cid
1372  * param remote - 0 for local port, 1 for remote port
1373  * param baud_rate
1374  * param data_bits
1375  * param stop_bits
1376  * param parity
1377  * param flow_control
1378  * param xon
1379  * param xoff
1380  */
1381 #define RFCOMM_EVENT_PORT_CONFIGURATION                    0x88u
1382 
1383 /**
1384  * @format 2
1385  * @param rfcomm_cid
1386  */
1387 #define RFCOMM_EVENT_CAN_SEND_NOW                          0x89u
1388 
1389 
1390 /**
1391  * @format 1
1392  * @param status
1393  */
1394 #define SDP_EVENT_QUERY_COMPLETE                                 0x91u
1395 
1396 /**
1397  * @format 1T
1398  * @param rfcomm_channel
1399  * @param name
1400  */
1401 #define SDP_EVENT_QUERY_RFCOMM_SERVICE                           0x92u
1402 
1403 /**
1404  * @format 22221
1405  * @param record_id
1406  * @param attribute_id
1407  * @param attribute_length
1408  * @param data_offset
1409  * @param data
1410  */
1411 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE                           0x93u
1412 
1413 /**
1414  * @format 22LV
1415  * @param record_id
1416  * @param attribute_id
1417  * @param attribute_length
1418  * @param attribute_value
1419  */
1420 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE                          0x94u
1421 
1422 /**
1423  * @format 224
1424  * @param total_count
1425  * @param record_index
1426  * @param record_handle
1427  * @note Not provided by daemon, only used for internal testing
1428  */
1429 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE                    0x95u
1430 
1431 /**
1432  * @format H221
1433  * @param handle
1434  * @param service_id
1435  * @param connection_id
1436  * @param att_status  see ATT errors in bluetooth.h
1437  */
1438 #define GATT_EVENT_QUERY_COMPLETE                                0xA0u
1439 
1440 /**
1441  * @format H22X
1442  * @param handle
1443  * @param service_id
1444  * @param connection_id
1445  * @param service
1446  */
1447 #define GATT_EVENT_SERVICE_QUERY_RESULT                          0xA1u
1448 
1449 /**
1450  * @format H22Y
1451  * @param handle
1452  * @param service_id
1453  * @param connection_id
1454  * @param characteristic
1455  */
1456 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT                   0xA2u
1457 
1458 /**
1459  * @format H222X
1460  * @param handle
1461  * @param service_id
1462  * @param connection_id
1463  * @param include_handle
1464  * @param service
1465  */
1466 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT                 0xA3u
1467 
1468 /**
1469  * @format H22Z
1470  * @param handle
1471  * @param service_id
1472  * @param connection_id
1473  * @param characteristic_descriptor
1474  */
1475 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT   0xA4u
1476 
1477 /**
1478  * @format H222LV
1479  * @param handle
1480  * @param service_id
1481  * @param connection_id
1482  * @param value_handle
1483  * @param value_length
1484  * @param value
1485  */
1486 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT             0xA5u
1487 
1488 /**
1489  * @format H2222LV
1490  * @param handle
1491  * @param service_id
1492  * @param connection_id
1493  * @param value_handle
1494  * @param value_offset
1495  * @param value_length
1496  * @param value
1497  */
1498 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT        0xA6u
1499 
1500 /**
1501  * @format H222LV
1502  * @param handle
1503  * @param service_id
1504  * @param connection_id
1505  * @param value_handle
1506  * @param value_length
1507  * @param value
1508  */
1509 #define GATT_EVENT_NOTIFICATION                                  0xA7u
1510 
1511 /**
1512  * @format H222LV
1513  * @param handle
1514  * @param service_id
1515  * @param connection_id
1516  * @param value_handle
1517  * @param value_length
1518  * @param value
1519  */
1520 #define GATT_EVENT_INDICATION                                    0xA8u
1521 
1522 /**
1523  * @format H222LV
1524  * @param handle
1525  * @param service_id
1526  * @param connection_id
1527  * @param descriptor_handle
1528  * @param descriptor_length
1529  * @param descriptor
1530  */
1531 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT        0xA9u
1532 
1533 /**
1534  * @format H2222LV
1535  * @param handle
1536  * @param service_id
1537  * @param connection_id
1538  * @param descriptor_handle
1539  * @param descriptor_offset
1540  * @param descriptor_length
1541  * @param descriptor
1542  */
1543 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT   0xAAu
1544 
1545 /**
1546  * @format H2
1547  * @param handle
1548  * @param MTU
1549  */
1550 #define GATT_EVENT_MTU                                           0xABu
1551 
1552 /**
1553  * @format H
1554  * @param handle
1555  */
1556 #define GATT_EVENT_CAN_WRITE_WITHOUT_RESPONSE                    0xACu
1557 
1558 /**
1559  * @format 11BH
1560  * @param status
1561  * @param address_type
1562  * @param address
1563  * @param handle
1564  */
1565 #define GATT_EVENT_CONNECTED                                     0xADu
1566 
1567 /**
1568  * @format H
1569  * @param handle
1570  */
1571 #define GATT_EVENT_DISCONNECTED                                  0xAEu
1572 
1573 /**
1574  * @format H22
1575  * @param handle
1576  * @param attribute_handle_start
1577  * @param attribute_handle_end
1578  */
1579 #define GATT_EVENT_SERVICE_CHANGED                               0xAFu
1580 
1581 
1582 /**
1583  * @format 1BH
1584  * @param address_type
1585  * @param address
1586  * @param handle
1587  */
1588 #define ATT_EVENT_CONNECTED                                      0xB3u
1589 
1590 /**
1591  * @format H
1592  * @param handle
1593  */
1594 #define ATT_EVENT_DISCONNECTED                                   0xB4u
1595 
1596 /**
1597  * @format H2
1598  * @param handle
1599  * @param MTU
1600  */
1601 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE                          0xB5u
1602 
1603  /**
1604   * @format 1H2
1605   * @param status
1606   * @param conn_handle
1607   * @param attribute_handle
1608   */
1609 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE               0xB6u
1610 
1611 /**
1612  * @format
1613  */
1614 #define ATT_EVENT_CAN_SEND_NOW                                   0xB7u
1615 
1616 // TODO: daemon only event
1617 
1618 /**
1619  * @format 12
1620  * @param status
1621  * @param service_uuid
1622  */
1623  #define BNEP_EVENT_SERVICE_REGISTERED                           0xC0u
1624 
1625 /**
1626  * @format 12222BH
1627  * @param status
1628  * @param bnep_cid
1629  * @param source_uuid
1630  * @param destination_uuid
1631  * @param mtu
1632  * @param remote_address
1633  * @param con_handle
1634  */
1635  #define BNEP_EVENT_CHANNEL_OPENED                               0xC1u
1636 
1637 /**
1638  * @format 222B
1639  * @param bnep_cid
1640  * @param source_uuid
1641  * @param destination_uuid
1642  * @param remote_address
1643  */
1644  #define BNEP_EVENT_CHANNEL_CLOSED                               0xC2u
1645 
1646 /**
1647  * @format 222B1
1648  * @param bnep_cid
1649  * @param source_uuid
1650  * @param destination_uuid
1651  * @param remote_address
1652  * @param channel_state
1653  */
1654 #define BNEP_EVENT_CHANNEL_TIMEOUT                               0xC3u
1655 
1656 /**
1657  * @format 222B
1658  * @param bnep_cid
1659  * @param source_uuid
1660  * @param destination_uuid
1661  * @param remote_address
1662  */
1663  #define BNEP_EVENT_CAN_SEND_NOW                                 0xC4u
1664 
1665  /**
1666   * @format H1B1
1667   * @param handle
1668   * @param addr_type
1669   * @param address
1670   * @param secure_connection - set to 1 if LE Secure Connection pairing will be used
1671   */
1672 #define SM_EVENT_JUST_WORKS_REQUEST                              0xC8u
1673 
1674  /**
1675   * @format H1B14
1676   * @param handle
1677   * @param addr_type
1678   * @param address
1679   * @param secure_connection - set to 1 if LE Secure Connection pairing will be used
1680   * @param passkey
1681   */
1682 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER                          0xC9u
1683 
1684  /**
1685   * @format H1B
1686   * @param handle
1687   * @param addr_type
1688   * @param address
1689   */
1690 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL                          0xCAu
1691 
1692  /**
1693   * @format H1B1
1694   * @param handle
1695   * @param addr_type
1696   * @param address
1697   * @param secure_connection - set to 1 if LE Secure Connection pairing will be used
1698   */
1699 #define SM_EVENT_PASSKEY_INPUT_NUMBER                            0xCBu
1700 
1701  /**
1702   * @format H1B14
1703   * @param handle
1704   * @param addr_type
1705   * @param address
1706   * @param secure_connection - set to 1 if LE Secure Connection pairing will be used
1707   * @param passkey
1708   */
1709 #define SM_EVENT_NUMERIC_COMPARISON_REQUEST                      0xCCu
1710 
1711  /**
1712   * @format H1B
1713   * @param handle
1714   * @param addr_type
1715   * @param address
1716   */
1717 #define SM_EVENT_IDENTITY_RESOLVING_STARTED                      0xCDu
1718 
1719  /**
1720   * @format H1B
1721   * @param handle
1722   * @param addr_type
1723   * @param address
1724   */
1725 #define SM_EVENT_IDENTITY_RESOLVING_FAILED                       0xCEu
1726 
1727  /**
1728   * @brief Identify resolving succeeded
1729   *
1730   * @format H1B1B2
1731   * @param handle
1732   * @param addr_type
1733   * @param address
1734   * @param identity_addr_type
1735   * @param identity_address
1736   * @param index
1737   *
1738   */
1739 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED                    0xCFu
1740 
1741  /**
1742   * @format H1B
1743   * @param handle
1744   * @param addr_type
1745   * @param address
1746   */
1747 #define SM_EVENT_AUTHORIZATION_REQUEST                           0xD0u
1748 
1749  /**
1750   * @format H1B1
1751   * @param handle
1752   * @param addr_type
1753   * @param address
1754   * @param authorization_result
1755   */
1756 #define SM_EVENT_AUTHORIZATION_RESULT                            0xD1u
1757 
1758  /**
1759   * @format H1
1760   * @param handle
1761   * @param action see SM_KEYPRESS_*
1762   */
1763 #define SM_EVENT_KEYPRESS_NOTIFICATION                           0xD2u
1764 
1765  /**
1766   * @brief Emitted during pairing to inform app about address used as identity
1767   *
1768   * @format H1B1B2
1769   * @param handle
1770   * @param addr_type
1771   * @param address
1772   * @param identity_addr_type
1773   * @param identity_address
1774   * @param index
1775   */
1776 #define SM_EVENT_IDENTITY_CREATED                                0xD3u
1777 
1778 /**
1779  * @brief Emitted to inform app that pairing has started.
1780  * @format H1B
1781  * @param handle
1782  * @param addr_type
1783  * @param address
1784  */
1785 #define SM_EVENT_PAIRING_STARTED                                 0xD4u
1786 
1787 /**
1788   * @brief Emitted to inform app that pairing is complete. Possible status values:
1789   *        ERROR_CODE_SUCCESS                            -> pairing success
1790   *        ERROR_CODE_CONNECTION_TIMEOUT                 -> timeout
1791   *        ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION  -> disconnect
1792   *        ERROR_CODE_AUTHENTICATION_FAILURE             -> SM protocol error, see reason field with SM_REASON_* from bluetooth.h
1793   *
1794   * @format H1B11
1795   * @param handle
1796   * @param addr_type
1797   * @param address
1798   * @param status
1799   * @param reason if status == ERROR_CODE_AUTHENTICATION_FAILURE
1800   */
1801 #define SM_EVENT_PAIRING_COMPLETE                                0xD5u
1802 
1803 
1804 /**
1805  * @brief Proactive Authentication for bonded devices started.
1806  * @format H1B
1807  * @param handle
1808  * @param addr_type
1809  * @param address
1810  */
1811 #define SM_EVENT_REENCRYPTION_STARTED                            0xD6u
1812 
1813 /**
1814  * @brief Proactive Authentication for bonded devices complete. Possible status values:
1815  *         ERROR_CODE_SUCCESS                           -> connection secure
1816  *         ERROR_CODE_CONNECTION_TIMEOUT                -> timeout
1817  *         ERROR_CODE_PIN_OR_KEY_MISSING                -> remote did not provide (as Peripheral) or use LTK (as Central)
1818  * @format H1B1
1819  * @param handle
1820  * @param addr_type
1821  * @param address
1822  * @param status
1823  */
1824 #define SM_EVENT_REENCRYPTION_COMPLETE                           0xD7u
1825 
1826 // GAP
1827 
1828 /**
1829  * @format H1
1830  * @param handle
1831  * @param security_level
1832  */
1833 #define GAP_EVENT_SECURITY_LEVEL                                 0xD8u
1834 
1835 /**
1836  * @format 1B
1837  * @param status
1838  * @param address
1839  */
1840 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED                    0xD9u
1841 
1842 /**
1843  * @format 11B1JV
1844  * @param advertising_event_type
1845  * @param address_type
1846  * @param address
1847  * @param rssi
1848  * @param data_length
1849  * @param data
1850  */
1851 #define GAP_EVENT_ADVERTISING_REPORT                             0xDAu
1852 
1853 /**
1854  * @format 21B1111121BJV
1855  * @param advertising_event_type
1856  * @param address_type
1857  * @param address
1858  * @param primary_phy
1859  * @param secondary_phy
1860  * @param advertising_sid
1861  * @param tx_power
1862  * @param rssi
1863  * @param periodic_advertising_interval
1864  * @param direct_address_type
1865  * @param direct_address
1866  * @param data_length
1867  * @param data
1868  */
1869 #define GAP_EVENT_EXTENDED_ADVERTISING_REPORT                    0xDBu
1870 
1871  /**
1872  * @format B13211122221JV
1873  * @param bd_addr
1874  * @param page_scan_repetition_mode
1875  * @param class_of_device
1876  * @param clock_offset
1877  * @param rssi_available
1878  * @param rssi
1879  * @param device_id_available
1880  * @param device_id_vendor_id_source
1881  * @param device_id_vendor_id
1882  * @param device_id_product_id
1883  * @param device_id_version
1884  * @param name_available
1885  * @param name_len
1886  * @param name
1887  */
1888 #define GAP_EVENT_INQUIRY_RESULT                                 0xDCu
1889 
1890 /**
1891  * @format 1
1892  * @param status
1893  */
1894 #define GAP_EVENT_INQUIRY_COMPLETE                               0xDDu
1895 
1896 /**
1897  * @format H1
1898  * @param con_handle
1899  * @param rssi (signed integer -127..127)
1900  * @note Classic: rssi is in dB relative to Golden Receive Power Range
1901  * @note LE: rssi is absolute dBm
1902  */
1903 #define GAP_EVENT_RSSI_MEASUREMENT                               0xDEu
1904 
1905 /**
1906  * @format 1KKKK
1907  * @param oob_data_present 0 = none, 1 = p_192, 2 = p_256, 3 = both
1908  * @param c_192 Simple Pairing Hash C derived from P-192 public key
1909  * @param r_192 Simple Pairing Randomizer derived from P-192 public key
1910  * @param c_256 Simple Pairing Hash C derived from P-256 public key
1911  * @param r_256 Simple Pairing Randomizer derived from P-256 public key
1912  */
1913 #define GAP_EVENT_LOCAL_OOB_DATA                                 0xDFu
1914 
1915 
1916 /**
1917  * @format HB11
1918  * @param con_handle
1919  * @param bd_addr
1920  * @param ssp
1921  * @param initiator
1922  */
1923 #define GAP_EVENT_PAIRING_STARTED                                0xE0u
1924 
1925 /**
1926  * @format HB1
1927  * @param con_handle
1928  * @param bd_addr
1929  * @param status
1930  */
1931 #define GAP_EVENT_PAIRING_COMPLETE                               0xE1u
1932 
1933 // Meta Events, see below for sub events
1934 #define HCI_EVENT_META_GAP                                       0xE7u
1935 #define HCI_EVENT_HSP_META                                       0xE8u
1936 #define HCI_EVENT_HFP_META                                       0xE9u
1937 #define HCI_EVENT_ANCS_META                                      0xEAu
1938 #define HCI_EVENT_AVDTP_META                                     0xEBu
1939 #define HCI_EVENT_AVRCP_META                                     0xECu
1940 #define HCI_EVENT_GOEP_META                                      0xEDu
1941 #define HCI_EVENT_PBAP_META                                      0xEEu
1942 #define HCI_EVENT_HID_META                                       0xEFu
1943 #define HCI_EVENT_A2DP_META                                      0xF0u
1944 #define HCI_EVENT_HIDS_META                                      0xF1u
1945 #define HCI_EVENT_GATTSERVICE_META                               0xF2u
1946 #define HCI_EVENT_BIP_META                                       0xF3u
1947 #define HCI_EVENT_MAP_META                                       0xF4u
1948 #define HCI_EVENT_MESH_META                                      0xF5u
1949 #define HCI_EVENT_LEAUDIO_META                                   0xF6u
1950 
1951 // Potential other meta groups
1952 // #define HCI_EVENT_BNEP_META                                0xxx
1953 // #define HCI_EVENT_GAP_META                                 0xxx
1954 // #define HCI_EVENT_GATT_META                                0xxx
1955 // #define HCI_EVENT_PAN_META                                 0xxx
1956 // #define HCI_EVENT_SDP_META                                 0xxx
1957 // #define HCI_EVENT_SM_META                                  0xxx
1958 
1959 /** GAP Subevent */
1960 
1961 
1962 /**
1963  * @format 1111
1964  * @param subevent_code
1965  * @param advertisement_handle
1966  * @param status
1967  * @param selected_tx_power
1968  */
1969 #define GAP_SUBEVENT_ADVERTISING_SET_INSTALLED                   0x00u
1970 
1971 /**
1972  * @format 11
1973  * @param subevent_code
1974  * @param advertisement_handle
1975  */
1976 #define GAP_SUBEVENT_ADVERTISING_SET_REMOVED                     0x01u
1977 
1978 /**
1979  * @format 1111C
1980  * @param subevent_code
1981  * @param status
1982  * @param big_handle
1983  * @param num_bis
1984  * @param bis_con_handles
1985  */
1986 #define GAP_SUBEVENT_BIG_CREATED                                 0x02u
1987 
1988 /**
1989  * @format 11
1990  * @param subevent_code
1991  * @param big_handle
1992  */
1993 #define GAP_SUBEVENT_BIG_TERMINATED                              0x03u
1994 
1995 /**
1996  * @format 1111C
1997  * @param subevent_code
1998  * @param status
1999  * @param big_handle
2000  * @param num_bis
2001  * @param bis_con_handles
2002  */
2003 #define GAP_SUBEVENT_BIG_SYNC_CREATED                            0x04u
2004 
2005 /**
2006  * @format 11
2007  * @param subevent_code
2008  * @param big_handle
2009  */
2010 #define GAP_SUBEVENT_BIG_SYNC_STOPPED                            0x05u
2011 
2012 /**
2013  * @format 1111C
2014  * @param subevent_code
2015  * @param status
2016  * @param cig_id
2017  * @param num_cis
2018  * @param cis_con_handles
2019  */
2020 #define GAP_SUBEVENT_CIG_CREATED                                 0x06u
2021 
2022 /**
2023  * @format 1111HH211111
2024  * @param subevent_code
2025  * @param status
2026  * @param cig_id
2027  * @param cis_id
2028  * @param cis_con_handle
2029  * @param acl_con_handle
2030  * @param iso_interval_1250us
2031  * @param number_of_subevents
2032  * @param burst_number_c_to_p
2033  * @param burst_number_p_to_c
2034  * @param flush_timeout_c_to_p
2035  * @param flush_timeout_p_to_c
2036  */
2037 
2038 #define GAP_SUBEVENT_CIS_CREATED                                 0x07u
2039 
2040 /**
2041  * Generic version of
2042  * - HCI_SUBEVENT_LE_CONNECTION_COMPLETE
2043  * - HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE_V1
2044  * - HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE_V2
2045  * @format 11H11BBB22211H
2046  * @param subevent_code
2047  * @param status
2048  * @param connection_handle
2049  * @param role
2050  * @param peer_address_type
2051  * @param peer_address
2052  * @param local_resolvable_private_address - 00..00 if not valid
2053  * @param peer_resolvable_private_address  - 00..00 if not valid
2054  * @param conn_interval
2055  * @param conn_latency
2056  * @param supervision_timeout
2057  * @param master_clock_accuracy
2058  * @param advertising_handle - 0xff   if not set
2059  * @param sync_handle        - 0xffff if not set
2060  */
2061 #define GAP_SUBEVENT_LE_CONNECTION_COMPLETE                     0x08u
2062 
2063 /** HSP Subevent */
2064 
2065 /**
2066  * @format 1H1B
2067  * @param subevent_code
2068  * @param acl_handle
2069  * @param status 0 == OK
2070  * @param bd_addr
2071  */
2072 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE             0x01u
2073 
2074 /**
2075  * @format 1H
2076  * @param subevent_code
2077  * @param acl_handle
2078  */
2079 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE           0x02u
2080 
2081 /**
2082  * @format 1H1H
2083  * @param subevent_code
2084  * @param acl_handle
2085  * @param status 0 == OK
2086  * @param sco_handle
2087  */
2088 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE             0x03u
2089 
2090 /**
2091  * @format 1HH
2092  * @param subevent_code
2093  * @param acl_handle
2094  * @param sco_handle
2095  */
2096 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE          0x04u
2097 
2098 /**
2099  * @format 1H
2100  * @param subevent_code
2101  * @param acl_handle
2102  */
2103 #define HSP_SUBEVENT_RING                                  0x05u
2104 
2105 /**
2106  * @format 1H1
2107  * @param subevent_code
2108  * @param acl_handle
2109  * @param gain Valid range: [0,15]
2110  */
2111 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED               0x06u
2112 
2113 /**
2114  * @format 1H1
2115  * @param subevent_code
2116  * @param acl_handle
2117  * @param gain Valid range: [0,15]
2118  */
2119 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED                  0x07u
2120 
2121 /**
2122  * @format 1HJV
2123  * @param subevent_code
2124  * @param acl_handle
2125  * @param value_length
2126  * @param value
2127  */
2128 #define HSP_SUBEVENT_HS_COMMAND                            0x08u
2129 
2130 /**
2131  * @format 1HJV
2132  * @param subevent_code
2133  * @param acl_handle
2134  * @param value_length
2135  * @param value
2136  */
2137 #define HSP_SUBEVENT_AG_INDICATION                         0x09u
2138 
2139 /**
2140  * @format 1H
2141  * @param subevent_code
2142  * @param acl_handle
2143  */
2144 #define HSP_SUBEVENT_BUTTON_PRESSED                        0x0au
2145 
2146 /** HFP Subevent */
2147 
2148 /**
2149  * @format 1H1B
2150  * @param subevent_code
2151  * @param acl_handle
2152  * @param status 0 == OK
2153  * @param bd_addr
2154  */
2155 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED    0x01u
2156 
2157 /**
2158  * @format 1H
2159  * @param subevent_code
2160  * @param acl_handle
2161  */
2162 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED       0x02u
2163 
2164 /**
2165  * @format 1H1HB1222
2166  * @param subevent_code
2167  * @param acl_handle
2168  * @param status 0 == OK
2169  * @param sco_handle
2170  * @param bd_addr
2171  * @param negotiated_codec
2172  * @param sco_packet_types see SCO_PACKET_TYPES_* in btstack_defines.h
2173  * @param rx_packet_length
2174  * @param tx_packet_length
2175  */
2176 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED            0x03u
2177 
2178 /**
2179  * @format 1HH
2180  * @param subevent_code
2181  * @param acl_handle
2182  * @param sco_handle
2183  */
2184 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED               0x04u
2185 
2186 /**
2187  * @format 1H1
2188  * @param subevent_code
2189  * @param acl_handle
2190  * @param status 0 == OK
2191  */
2192 #define HFP_SUBEVENT_COMPLETE                                0x05u
2193 
2194 /**
2195  * @format 1H111T
2196  * @param subevent_code
2197  * @param acl_handle
2198  * @param indicator_index
2199  * @param indicator_min_range
2200  * @param indicator_max_range
2201  * @param indicator_name
2202  */
2203 #define HFP_SUBEVENT_AG_INDICATOR_MAPPING                    0x06u
2204 
2205 /**
2206  * @format 1H1111111T
2207  * @param subevent_code
2208  * @param acl_handle
2209  * @param indicator_index
2210  * @param indicator_status
2211  * @param indicator_min_range
2212  * @param indicator_max_range
2213  * @param indicator_mandatory
2214  * @param indicator_enabled
2215  * @param indicator_status_changed
2216  * @param indicator_name
2217  */
2218 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED              0x07u
2219 
2220 /**
2221  * @format 1H11T
2222  * @param subevent_code
2223  * @param acl_handle
2224  * @param network_operator_mode
2225  * @param network_operator_format
2226  * @param network_operator_name
2227  */
2228 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED                 0x08u
2229 
2230 /**
2231  * @format 1H1
2232  * @param subevent_code
2233  * @param acl_handle
2234  * @param error
2235  */
2236 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR             0x09u
2237 
2238 /**
2239  * @format 1H
2240  * @param subevent_code
2241  * @param acl_handle
2242  */
2243 #define HFP_SUBEVENT_START_RINGING                            0x0Au
2244 
2245 /**
2246  * @format 1H
2247  * @param subevent_code
2248  * @param acl_handle
2249  */
2250 #define HFP_SUBEVENT_RING                                     0x0Bu
2251 
2252 /**
2253  * @format 1H
2254  * @param subevent_code
2255  * @param acl_handle
2256  */
2257 #define HFP_SUBEVENT_STOP_RINGING                             0x0Cu
2258 
2259 /**
2260  * @format 1HT
2261  * @param subevent_code
2262  * @param acl_handle
2263  * @param number
2264  */
2265 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER                   0x0Du
2266 
2267 /**
2268  * @format 1H
2269  * @param subevent_code
2270  * @param acl_handle
2271  */
2272 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG               0x0Eu
2273 
2274 /**
2275  * @format 1HT
2276  * @param subevent_code
2277  * @param acl_handle
2278  * @param number
2279  */
2280 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG                     0x0Fu
2281 
2282 /**
2283  * @format 1HT
2284  * @param subevent_code
2285  * @param acl_handle
2286  * @param dtmf code
2287  */
2288 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES                      0x10u
2289 
2290 /**
2291  * @format 1H
2292  * @param subevent_code
2293  * @param acl_handle
2294  */
2295 #define HFP_SUBEVENT_CALL_ANSWERED                            0x11u
2296 
2297 /**
2298  * @format 1H
2299  * @param subevent_code
2300  * @param acl_handle
2301  */
2302 #define HFP_SUBEVENT_CALL_TERMINATED                          0x12u
2303 
2304 /**
2305  * @format 1H
2306  * @param subevent_code
2307  * @param acl_handle
2308  */
2309 #define HFP_SUBEVENT_CONFERENCE_CALL                          0x13u
2310 
2311 
2312 /**
2313  * @format 1H1
2314  * @param subevent_code
2315  * @param acl_handle
2316  * @param gain
2317  */
2318 #define HFP_SUBEVENT_SPEAKER_VOLUME                           0x14u
2319 
2320 /**
2321  * @format 1H1
2322  * @param subevent_code
2323  * @param acl_handle
2324  * @param gain
2325  */
2326 #define HFP_SUBEVENT_MICROPHONE_VOLUME                        0x15u
2327 
2328 /**
2329  * @format 1H1JVJV
2330  * @param subevent_code
2331  * @param acl_handle
2332  * @param type
2333  * @param number_length
2334  * @param number
2335  * @param alpha_length
2336  * @param alpha
2337  */
2338 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION                0x16u
2339 
2340 /**
2341  * @format 1H1JVJV
2342  * @param subevent_code
2343  * @param acl_handle
2344  * @param type
2345  * @param number_length
2346  * @param number
2347  * @param alpha_length
2348  * @param alpha
2349  */
2350 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17u
2351 
2352 /**
2353  * @format 1H111111T
2354  * @param subevent_code
2355  * @param acl_handle
2356  * @param clcc_idx
2357  * @param clcc_dir
2358  * @param clcc_status
2359  * @param clcc_mode
2360  * @param clcc_mpty
2361  * @param bnip_type
2362  * @param bnip_number
2363  */
2364 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS                     0x18u
2365 
2366 /**
2367  * @format 1H11T
2368  * @param subevent_code
2369  * @param acl_handle
2370  * @param status
2371  * @param bnip_type
2372  * @param bnip_number
2373  */
2374 #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION            0x19u
2375 
2376 /**
2377  * @format 1HT
2378  * @param subevent_code
2379  * @param acl_handle
2380  * @param value
2381  */
2382 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS                 0x1Au
2383 
2384 /**
2385  * @format 1HT
2386  * @param subevent_code
2387  * @param acl_handle
2388  * @param command
2389  */
2390 #define HFP_SUBEVENT_AT_MESSAGE_SENT                          0x1Bu
2391 
2392 /**
2393  * @format 1HT
2394  * @param subevent_code
2395  * @param acl_handle
2396  * @param command
2397  */
2398 #define HFP_SUBEVENT_AT_MESSAGE_RECEIVED                      0x1Cu
2399 
2400 /**
2401  * @format 1H1
2402  * @param subevent_code
2403  * @param acl_handle
2404  * @param status
2405  */
2406 #define HFP_SUBEVENT_IN_BAND_RING_TONE                        0x1Du
2407 
2408 /**
2409  * @format 1H11
2410  * @param subevent_code
2411  * @param acl_handle
2412  * @param status      0-success
2413  * @param enhanced    0-legacy, 1-enhanced
2414  */
2415 #define HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED                0x1Eu
2416 
2417 /**
2418  * @format 1H1
2419  * @param subevent_code
2420  * @param acl_handle
2421  * @param status      0-success
2422  */
2423 #define HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED               0x1Fu
2424 
2425 /**
2426  * @format 1H1
2427  * @param subevent_code
2428  * @param acl_handle
2429  * @param status
2430  */
2431 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_HF_READY_FOR_AUDIO  0x20u
2432 
2433 
2434 /**
2435  * @format 1H1
2436  * @param subevent_code
2437  * @param acl_handle
2438  * @param status
2439  */
2440 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_AG_READY_TO_ACCEPT_AUDIO_INPUT 0x21u
2441 
2442 /**
2443  * @format 1H1
2444  * @param subevent_code
2445  * @param acl_handle
2446  * @param status
2447  */
2448 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_AG_IS_STARTING_SOUND 0x22u
2449 
2450 /**
2451  * @format 1H1
2452  * @param subevent_code
2453  * @param acl_handle
2454  * @param status
2455  */
2456 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_AG_IS_PROCESSING_AUDIO_INPUT 0x23u
2457 
2458 /**
2459  * @format 1H1
2460  * @param subevent_code
2461  * @param acl_handle
2462  * @param status
2463  */
2464 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_AG_MESSAGE_SENT     0x24u
2465 
2466 
2467 /**
2468  * @format 1H211LV
2469  * @param subevent_code
2470  * @param acl_handle
2471  * @param text_id
2472  * @param text_type
2473  * @param text_operation
2474  * @param text_length
2475  * @param text
2476  */
2477 #define HFP_SUBEVENT_ENHANCED_VOICE_RECOGNITION_AG_MESSAGE           0x25u
2478 
2479 /**
2480  * @format 1H1
2481  * @param subevent_code
2482  * @param acl_handle
2483  * @param status
2484  */
2485 #define HFP_SUBEVENT_ECHO_CANCELING_AND_NOISE_REDUCTION_DEACTIVATE   0x26u
2486 
2487 /**
2488  * @format 1H21
2489  * @param subevent_code
2490  * @param acl_handle
2491  * @param uuid
2492  * @param value
2493  */
2494 #define HFP_SUBEVENT_HF_INDICATOR                                    0x27u
2495 
2496 /**
2497  * @format 1H2T
2498  * @param subevent_code
2499  * @param acl_handle
2500  * @param command_id
2501  * @param command_string
2502  */
2503 #define HFP_SUBEVENT_CUSTOM_AT_COMMAND                               0x28u
2504 
2505 /**
2506  * @format 1H1
2507  * @param subevent_code
2508  * @param acl_handle
2509  * @param status 0 == OK
2510  */
2511 #define HFP_SUBEVENT_CUSTOM_AT_MESSAGE_SENT                          0x29u
2512 
2513 /**
2514  * @format 1H1
2515  * @param subevent_code
2516  * @param acl_handle
2517  * @param supported
2518  */
2519 #define HFP_SUBEVENT_APPLE_EXTENSION_SUPPORTED                       0x2Au
2520 
2521 /**
2522  * @format 1H221JV
2523  * @param subevent_code
2524  * @param acl_handle
2525  * @param vendor_id
2526  * @param product_id
2527  * @param features
2528  * @param version_len
2529  * @param version
2530  */
2531 #define HFP_SUBEVENT_APPLE_ACCESSORY_INFORMATION                     0x2Bu
2532 
2533 /**
2534  * @format 1H1
2535  * @param subevent_code
2536  * @param acl_handle
2537  * @param battery_level range:0..9
2538  */
2539 #define HFP_SUBEVENT_APPLE_BATTERY_LEVEL                             0x2Cu
2540 
2541 /**
2542  * @format 1H1
2543  * @param subevent_code
2544  * @param acl_handle
2545  * @param docket 0 = undocked, 1 = docked
2546  */
2547 #define HFP_SUBEVENT_APPLE_DOCKED_STATE                              0x2Du
2548 
2549 
2550 // ANCS Client
2551 
2552 /**
2553  * @format 1H
2554  * @param subevent_code
2555  * @param handle
2556  */
2557 #define ANCS_SUBEVENT_CLIENT_CONNECTED                              0xF0u
2558 
2559 /**
2560  * @format 1H2T
2561  * @param subevent_code
2562  * @param handle
2563  * @param attribute_id
2564  * @param text
2565  */
2566 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION                           0xF1u
2567 
2568 /**
2569  * @format 1H
2570  * @param subevent_code
2571  * @param handle
2572  */
2573 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED                           0xF2u
2574 
2575 
2576 /** AVDTP Subevent */
2577 
2578 /**
2579  * @format 12111
2580  * @param subevent_code
2581  * @param avdtp_cid
2582  * @param local_seid
2583  * @param is_initiator
2584  * @param signal_identifier
2585  */
2586 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT                     0x01u
2587 
2588 /**
2589  * @format 12111
2590  * @param subevent_code
2591  * @param avdtp_cid
2592  * @param local_seid
2593  * @param is_initiator
2594  * @param signal_identifier
2595  */
2596 #define AVDTP_SUBEVENT_SIGNALING_REJECT                     0x02u
2597 
2598 /**
2599  * @format 12111
2600  * @param subevent_code
2601  * @param avdtp_cid
2602  * @param local_seid
2603  * @param is_initiator
2604  * @param signal_identifier
2605  */
2606 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT             0x03u
2607 
2608 /**
2609  * @format 12B21
2610  * @param subevent_code
2611  * @param avdtp_cid
2612  * @param bd_addr
2613  * @param con_handle
2614  * @param status 0 == OK
2615  */
2616 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED     0x04u
2617 
2618 /**
2619  * @format 12
2620  * @param subevent_code
2621  * @param avdtp_cid
2622  */
2623 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED        0x05u
2624 
2625 /**
2626  * @format 121111
2627  * @param subevent_code
2628  * @param avdtp_cid
2629  * @param remote_seid        0x01u – 0x3Eu
2630  * @param in_use      0-not in use, 1-in use
2631  * @param media_type  0-audio, 1-video, 2-multimedia
2632  * @param sep_type    0-source, 1-sink
2633  */
2634 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND                  0x06u
2635 
2636 /**
2637  * @format 12111111111
2638  * @param subevent_code
2639  * @param avdtp_cid
2640  * @param remote_seid
2641  * @param media_type
2642  * @param sampling_frequency_bitmap
2643  * @param channel_mode_bitmap
2644  * @param block_length_bitmap
2645  * @param subbands_bitmap
2646  * @param allocation_method_bitmap
2647  * @param min_bitpool_value
2648  * @param max_bitpool_value
2649  */
2650 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY          0x07u
2651 
2652 /**
2653  * @format 12111111112
2654  * @param subevent_code
2655  * @param avdtp_cid
2656  * @param remote_seid
2657  * @param media_type
2658  * @param layer_bitmap
2659  * @param crc
2660  * @param channel_mode_bitmap
2661  * @param media_payload_format
2662  * @param sampling_frequency_bitmap
2663  * @param vbr
2664  * @param bit_rate_index_bitmap
2665  */
2666 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AUDIO_CAPABILITY   0x08u
2667 
2668 /**
2669  * @format 121112131
2670  * @param subevent_code
2671  * @param avdtp_cid
2672  * @param remote_seid
2673  * @param media_type
2674  * @param object_type_bitmap
2675  * @param sampling_frequency_bitmap
2676  * @param channels_bitmap
2677  * @param bit_rate
2678  * @param vbr
2679  */
2680 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AAC_CAPABILITY     0x09u
2681 
2682 /**
2683  * @format 1211111132
2684  * @param subevent_code
2685  * @param avdtp_cid
2686  * @param remote_seid
2687  * @param media_type
2688  * @param version
2689  * @param channel_mode_bitmap
2690  * @param sampling_frequency_bitmap
2691  * @param vbr
2692  * @param bit_rate_index_bitmap
2693  * @param maximum_sul
2694  */
2695 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_ATRAC_CAPABILITY        0x0Au
2696 
2697 /**
2698  * @format 12112LV
2699  * @param subevent_code
2700  * @param avdtp_cid
2701  * @param remote_seid
2702  * @param media_type
2703  * @param media_codec_type
2704  * @param media_codec_information_len
2705  * @param media_codec_information
2706  */
2707 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY        0x0Bu
2708 
2709 
2710 /**
2711  * @format 121
2712  * @param subevent_code
2713  * @param avdtp_cid
2714  * @param remote_seid
2715  */
2716 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_TRANSPORT_CAPABILITY         0x0Cu
2717 
2718 
2719 /**
2720  * @format 121
2721  * @param subevent_code
2722  * @param avdtp_cid
2723  * @param remote_seid
2724  */
2725 #define AVDTP_SUBEVENT_SIGNALING_REPORTING_CAPABILITY        0x0Du
2726 
2727 
2728 /**
2729  * @format 121111
2730  * @param subevent_code
2731  * @param avdtp_cid
2732  * @param remote_seid
2733  * @param recovery_type
2734  * @param maximum_recovery_window_size
2735  * @param maximum_number_media_packets
2736  */
2737 #define AVDTP_SUBEVENT_SIGNALING_RECOVERY_CAPABILITY        0x0Eu
2738 
2739 
2740 /**
2741  * @format 1212LV
2742  * @param subevent_code
2743  * @param avdtp_cid
2744  * @param remote_seid
2745  * @param cp_type
2746  * @param cp_type_value_len
2747  * @param cp_type_value
2748  */
2749 #define AVDTP_SUBEVENT_SIGNALING_CONTENT_PROTECTION_CAPABILITY        0x0Fu
2750 
2751 
2752 /**
2753  * @format 12111111111
2754  * @param subevent_code
2755  * @param avdtp_cid
2756  * @param remote_seid
2757  * @param fragmentation
2758  * @param transport_identifiers_num
2759  * @param transport_session_identifier_1
2760  * @param transport_session_identifier_2
2761  * @param transport_session_identifier_3
2762  * @param tcid_1
2763  * @param tcid_2
2764  * @param tcid_3
2765  */
2766 #define AVDTP_SUBEVENT_SIGNALING_MULTIPLEXING_CAPABILITY        0x10u
2767 
2768 
2769 /**
2770  * @format 121
2771  * @param subevent_code
2772  * @param avdtp_cid
2773  * @param remote_seid
2774  */
2775 #define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORTING_CAPABILITY        0x11u
2776 
2777 
2778 /**
2779  * @format 121111
2780  * @param subevent_code
2781  * @param avdtp_cid
2782  * @param remote_seid
2783  * @param back_ch
2784  * @param media
2785  * @param recovery
2786  */
2787 #define AVDTP_SUBEVENT_SIGNALING_HEADER_COMPRESSION_CAPABILITY        0x12u
2788 
2789 /**
2790  * @format 121
2791  * @param subevent_code
2792  * @param avdtp_cid
2793  * @param remote_seid
2794  */
2795 #define AVDTP_SUBEVENT_SIGNALING_CAPABILITIES_DONE                    0x13u
2796 
2797 
2798 /**
2799  * @format 12111121111111
2800  * @param subevent_code
2801  * @param avdtp_cid
2802  * @param local_seid
2803  * @param remote_seid
2804  * @param reconfigure
2805  * @param media_type
2806  * @param sampling_frequency
2807  * @param channel_mode
2808  * @param num_channels
2809  * @param block_length
2810  * @param subbands
2811  * @param allocation_method
2812  * @param min_bitpool_value
2813  * @param max_bitpool_value
2814  */
2815 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION        0x14u
2816 
2817 /**
2818  * @format 12111111111211
2819  * @param subevent_code
2820  * @param avdtp_cid
2821  * @param local_seid
2822  * @param remote_seid
2823  * @param reconfigure
2824  * @param media_type
2825  * @param layer
2826  * @param crc
2827  * @param channel_mode
2828  * @param num_channels
2829  * @param media_payload_format
2830  * @param sampling_frequency
2831  * @param vbr
2832  * @param bit_rate_index
2833  */
2834 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AUDIO_CONFIGURATION   0x15u
2835 
2836 /**
2837  * @format 12111113131
2838  * @param subevent_code
2839  * @param avdtp_cid
2840  * @param local_seid
2841  * @param remote_seid
2842  * @param reconfigure
2843  * @param media_type
2844  * @param object_type
2845  * @param sampling_frequency
2846  * @param num_channels
2847  * @param bit_rate
2848  * @param vbr
2849  */
2850 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AAC_CONFIGURATION     0x16u
2851 
2852 /**
2853  * @format 1211111112112
2854  * @param subevent_code
2855  * @param avdtp_cid
2856  * @param local_seid
2857  * @param remote_seid
2858  * @param reconfigure
2859  * @param media_type
2860  * @param version
2861  * @param channel_mode
2862  * @param num_channels
2863  * @param sampling_frequency
2864  * @param vbr
2865  * @param bit_rate_index
2866  * @param maximum_sul
2867  */
2868 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_ATRAC_CONFIGURATION        0x17u
2869 
2870 /**
2871  * @format 1211112LV
2872  * @param subevent_code
2873  * @param avdtp_cid
2874  * @param local_seid
2875  * @param remote_seid
2876  * @param reconfigure
2877  * @param media_type
2878  * @param media_codec_type
2879  * @param media_codec_information_len
2880  * @param media_codec_information
2881  */
2882 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION        0x18u
2883 
2884 /**
2885  * @format 12B111
2886  * @param subevent_code
2887  * @param avdtp_cid
2888  * @param bd_addr
2889  * @param local_seid
2890  * @param remote_seid
2891  * @param status 0 == OK
2892  */
2893 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED     0x19u
2894 
2895 /**
2896  * @format 121
2897  * @param subevent_code
2898  * @param avdtp_cid
2899  * @param local_seid
2900  */
2901 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED        0x1Au
2902 
2903 /**
2904  * @format 1212
2905  * @param subevent_code
2906  * @param avdtp_cid
2907  * @param local_seid
2908  * @param sequence_number
2909  */
2910 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW   0x1Bu
2911 
2912 
2913 /**
2914  * @format 12
2915  * @param subevent_code
2916  * @param avdtp_cid
2917  */
2918 #define AVDTP_SUBEVENT_SIGNALING_SEP_DICOVERY_DONE           0x1Cu
2919 
2920 /**
2921  * @format 1212
2922  * @param subevent_code
2923  * @param avdtp_cid
2924  * @param local_seid
2925  * @param delay_100us
2926  */
2927 #define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT               0x1Du
2928 
2929 
2930 /** A2DP Subevent */
2931 /* Stream goes through following states:
2932  * - OPEN         - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event
2933  * - START        - indicated with A2DP_SUBEVENT_STREAM_STARTED event
2934  * - SUSPEND      - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event
2935  * - ABORT/STOP   - indicated with A2DP_SUBEVENT_STREAM_RELEASED event
2936 
2937  OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started.
2938  START can come only after the stream is OPENED, and indicates that media transfer is started.
2939  SUSPEND is optional, it pauses the stream.
2940  */
2941 
2942 /**
2943  * @format 121            Sent only by A2DP source.
2944  * @param subevent_code
2945  * @param a2dp_cid
2946  * @param local_seid
2947  */
2948 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW         0x01u
2949 
2950 /**
2951  * @format 12111121111111
2952  * @param subevent_code
2953  * @param a2dp_cid
2954  * @param local_seid
2955  * @param remote_seid
2956  * @param reconfigure
2957  * @param media_type
2958  * @param sampling_frequency
2959  * @param channel_mode
2960  * @param num_channels
2961  * @param block_length
2962  * @param subbands
2963  * @param allocation_method
2964  * @param min_bitpool_value
2965  * @param max_bitpool_value
2966  */
2967 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION      0x02u
2968 
2969 /**
2970  * @format 12111111111211
2971  * @param subevent_code
2972  * @param a2dp_cid
2973  * @param local_seid
2974  * @param remote_seid
2975  * @param reconfigure
2976  * @param media_type
2977  * @param layer
2978  * @param crc
2979  * @param channel_mode
2980  * @param num_channels
2981  * @param media_payload_format
2982  * @param sampling_frequency
2983  * @param vbr
2984  * @param bit_rate_index
2985  */
2986 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AUDIO_CONFIGURATION   0x03u
2987 
2988 /**
2989  * @format 12111113131
2990  * @param subevent_code
2991  * @param a2dp_cid
2992  * @param local_seid
2993  * @param remote_seid
2994  * @param reconfigure
2995  * @param media_type
2996  * @param object_type
2997  * @param sampling_frequency
2998  * @param num_channels
2999  * @param bit_rate
3000  * @param vbr
3001  */
3002 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AAC_CONFIGURATION     0x04u
3003 
3004 /**
3005  * @format 1211111112112
3006  * @param subevent_code
3007  * @param a2dp_cid
3008  * @param local_seid
3009  * @param remote_seid
3010  * @param reconfigure
3011  * @param media_type
3012  * @param version
3013  * @param channel_mode
3014  * @param num_channels
3015  * @param sampling_frequency
3016  * @param vbr
3017  * @param bit_rate_index
3018  * @param maximum_sul
3019  */
3020 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_ATRAC_CONFIGURATION        0x05u
3021 
3022 /**
3023  * @format 1211112LV
3024  * @param subevent_code
3025  * @param a2dp_cid
3026  * @param local_seid
3027  * @param remote_seid
3028  * @param reconfigure
3029  * @param media_type
3030  * @param media_codec_type
3031  * @param media_codec_information_len
3032  * @param media_codec_information
3033  */
3034 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION    0x06u
3035 
3036 /**
3037  * @format 12B111          Stream is opened but not started.
3038  * @param subevent_code
3039  * @param a2dp_cid
3040  * @param bd_addr
3041  * @param local_seid
3042  * @param remote_seid
3043  * @param status
3044  */
3045 #define A2DP_SUBEVENT_STREAM_ESTABLISHED                           0x07u
3046 
3047 /**
3048  * @format 121            If ENABLE_AVDTP_ACCEPTOR_EXPLICIT_START_STREAM_CONFIRMATION, user must explicitly accept stream start.
3049  * @param subevent_code
3050  * @param a2dp_cid
3051  * @param local_seid
3052  */
3053 #define A2DP_SUBEVENT_START_STREAM_REQUESTED                       0x08u
3054 
3055 /**
3056  * @format 121            Indicates that media transfer is started.
3057  * @param subevent_code
3058  * @param a2dp_cid
3059  * @param local_seid
3060  */
3061 #define A2DP_SUBEVENT_STREAM_STARTED                               0x09u
3062 
3063 /**
3064  * @format 121           Stream is paused.
3065  * @param subevent_code
3066  * @param a2dp_cid
3067  * @param local_seid
3068  */
3069 #define A2DP_SUBEVENT_STREAM_SUSPENDED                              0x0Au
3070 
3071 /**
3072  * @format 121           Stream is stopped or aborted.
3073  * @param subevent_code
3074  * @param a2dp_cid
3075  * @param local_seid
3076  */
3077 #define A2DP_SUBEVENT_STREAM_STOPPED                                0x0Bu
3078 
3079 /**
3080  * @format 121            Stream is released.
3081  * @param subevent_code
3082  * @param a2dp_cid
3083  * @param local_seid
3084  */
3085 #define A2DP_SUBEVENT_STREAM_RELEASED                               0x0Cu
3086 
3087 /**
3088  * @format 1211
3089  * @param subevent_code
3090  * @param a2dp_cid
3091  * @param local_seid
3092  * @param signal_identifier
3093  */
3094 #define A2DP_SUBEVENT_COMMAND_ACCEPTED                              0x0Du
3095 
3096 /**
3097  * @format 12111
3098  * @param subevent_code
3099  * @param a2dp_cid
3100  * @param local_seid
3101  * @param is_initiator
3102  * @param signal_identifier
3103  */
3104 #define A2DP_SUBEVENT_COMMAND_REJECTED                              0x0Eu
3105 
3106 /**
3107  * @format 12B21
3108  * @param subevent_code
3109  * @param a2dp_cid
3110  * @param bd_addr
3111  * @param con_handle
3112  * @param status 0 == OK
3113  */
3114 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED              0x0Fu
3115 
3116 /**
3117  * @format 12            Signaling channel is released.
3118  * @param subevent_code
3119  * @param a2dp_cid
3120  */
3121 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED                  0x10u
3122 
3123 /**
3124  * @format 1211          Stream was reconfigured
3125  * @param subevent_code
3126  * @param a2dp_cid
3127  * @param local_seid
3128  * @param status
3129  */
3130 #define A2DP_SUBEVENT_STREAM_RECONFIGURED                            0x12u
3131 
3132 /**
3133  * @format 12111111111
3134  * @param subevent_code
3135  * @param a2dp_cid
3136  * @param remote_seid
3137  * @param media_type
3138  * @param sampling_frequency_bitmap
3139  * @param channel_mode_bitmap
3140  * @param block_length_bitmap
3141  * @param subbands_bitmap
3142  * @param allocation_method_bitmap
3143  * @param min_bitpool_value
3144  * @param max_bitpool_value
3145  */
3146 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY          0x13u
3147 
3148 /**
3149  * @format 12111111112
3150  * @param subevent_code
3151  * @param a2dp_cid
3152  * @param remote_seid
3153  * @param media_type
3154  * @param layer_bitmap
3155  * @param crc
3156  * @param channel_mode_bitmap
3157  * @param media_payload_format
3158  * @param sampling_frequency_bitmap
3159  * @param vbr
3160  * @param bit_rate_index_bitmap
3161  */
3162 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AUDIO_CAPABILITY   0x14u
3163 
3164 /**
3165  * @format 121112131
3166  * @param subevent_code
3167  * @param a2dp_cid
3168  * @param remote_seid
3169  * @param media_type
3170  * @param object_type_bitmap
3171  * @param sampling_frequency_bitmap
3172  * @param channels_bitmap
3173  * @param bit_rate
3174  * @param vbr
3175  */
3176 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_MPEG_AAC_CAPABILITY     0x15u
3177 
3178 /**
3179  * @format 1211111132
3180  * @param subevent_code
3181  * @param a2dp_cid
3182  * @param remote_seid
3183  * @param media_type
3184  * @param version
3185  * @param channel_mode_bitmap
3186  * @param sampling_frequency_bitmap
3187  * @param vbr
3188  * @param bit_rate_index_bitmap
3189  * @param maximum_sul
3190  */
3191 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_ATRAC_CAPABILITY        0x16u
3192 
3193 /**
3194  * @format 12112LV
3195  * @param subevent_code
3196  * @param a2dp_cid
3197  * @param remote_seid
3198  * @param media_type
3199  * @param media_codec_type
3200  * @param media_codec_information_len
3201  * @param media_codec_information
3202  */
3203 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY        0x17u
3204 
3205 /**
3206  * @format 121
3207  * @param subevent_code
3208  * @param a2dp_cid
3209  * @param remote_seid
3210  */
3211 #define A2DP_SUBEVENT_SIGNALING_DELAY_REPORTING_CAPABILITY           0x18u
3212 
3213 
3214 /**
3215  * @format 1212
3216  * @param subevent_code
3217  * @param a2dp_cid
3218  * @param local_seid
3219  * @param delay_100us
3220  */
3221 #define A2DP_SUBEVENT_SIGNALING_DELAY_REPORT                         0x19u
3222 
3223 /**
3224  * @format 121
3225  * @param subevent_code
3226  * @param a2dp_cid
3227  * @param remote_seid
3228  */
3229 #define A2DP_SUBEVENT_SIGNALING_CAPABILITIES_DONE                    0x1Au
3230 
3231 /**
3232  * @format 12
3233  * @param subevent_code
3234  * @param a2dp_cid
3235  */
3236 #define A2DP_SUBEVENT_SIGNALING_CAPABILITIES_COMPLETE                0x1Bu
3237 
3238 
3239 /** AVRCP Subevent */
3240 
3241 /**
3242  * @format 1211
3243  * @param subevent_code
3244  * @param avrcp_cid
3245  * @param command_type
3246  * @param play_status
3247  */
3248 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED                         0x01u
3249 
3250 /**
3251  * @format 121
3252  * @param subevent_code
3253  * @param avrcp_cid
3254  * @param command_type
3255  */
3256 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED                                   0x02u
3257 
3258 /**
3259  * @format 121
3260  * @param subevent_code
3261  * @param avrcp_cid
3262  * @param command_type
3263  */
3264 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_TRACK_REACHED_END                         0x03u
3265 
3266 /**
3267  * @format 121
3268  * @param subevent_code
3269  * @param avrcp_cid
3270  * @param command_type
3271  */
3272 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_TRACK_REACHED_START                       0x04u
3273 
3274 /**
3275  * @format 1214
3276  * @param subevent_code
3277  * @param avrcp_cid
3278  * @param command_type
3279  * @param playback_position  If no track currently selected, then return 0xFFuFFFFFF in the INTERIM response.
3280  */
3281 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_PLAYBACK_POS_CHANGED                      0x05u
3282 
3283 /**
3284  * @format 1211
3285  * @param subevent_code
3286  * @param avrcp_cid
3287  * @param command_type
3288  * @param battery_status  see avrcp_battery_status_t
3289  */
3290 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_BATT_STATUS_CHANGED                       0x06u
3291 
3292 /**
3293  * @format 1211
3294  * @param subevent_code
3295  * @param avrcp_cid
3296  * @param command_type
3297  * @param system_status  see avrcp_system_status_t
3298  */
3299 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_SYSTEM_STATUS_CHANGED                     0x07u
3300 
3301 
3302 // Recquires 1 byte for num_attributes, followed by num_attributes tuples [attribute_id(1), value_id(1)], see avrcp_player_application_setting_attribute_id_t
3303 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_PLAYER_APPLICATION_SETTING_CHANGED        0x08u
3304 
3305 /**
3306  * @format 121
3307  * @param subevent_code
3308  * @param avrcp_cid
3309  * @param command_type
3310  */
3311 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED                     0x09u
3312 
3313 /**
3314  * @format 121
3315  * @param subevent_code
3316  * @param avrcp_cid
3317  * @param command_type
3318  */
3319 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED                       0x0Au
3320 
3321 // AVRCP_SUBEVENT_NOTIFICATION_EVENT_ADDRESSED_PLAYER_CHANGED = 0x0bu,           -- The Addressed Player has been changed, see 6.9.2.
3322 
3323 /**
3324  * @format 1212
3325  * @param subevent_code
3326  * @param avrcp_cid
3327  * @param command_type
3328  * @param uid_counter of the currently browsed player
3329  */
3330 #define AVRCP_SUBEVENT_NOTIFICATION_EVENT_UIDS_CHANGED                              0x0Cu
3331 
3332 /**
3333  * @format 1211
3334  * @param subevent_code
3335  * @param avrcp_cid
3336  * @param command_type
3337  * @param absolute_volume
3338  */
3339 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED                                  0x0Du
3340 
3341 
3342 /**
3343  * @format 1211
3344  * @param subevent_code
3345  * @param avrcp_cid
3346  * @param command_type
3347  * @param absolute_volume
3348  */
3349 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE                      0x10u
3350 
3351 /**
3352  * @format 12111
3353  * @param subevent_code
3354  * @param avrcp_cid
3355  * @param status
3356  * @param enabled      1 enabled, 0 disabled
3357  * @param event_id
3358  */
3359 #define AVRCP_SUBEVENT_NOTIFICATION_STATE                               0x11u
3360 
3361 /**
3362  * @format 112B2
3363  * @param subevent_code
3364  * @param status 0 == OK
3365  * @param avrcp_cid
3366  * @param bd_addr
3367  * @param con_handle
3368  */
3369 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED                           0x12u
3370 
3371 /**
3372  * @format 12
3373  * @param subevent_code
3374  * @param avrcp_cid
3375  */
3376 #define AVRCP_SUBEVENT_CONNECTION_RELEASED                              0x13u
3377 
3378 /**
3379  * @format 12111
3380  * @param subevent_code
3381  * @param avrcp_cid
3382  * @param command_type
3383  * @param repeat_mode
3384  * @param shuffle_mode
3385  */
3386 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE                          0x14u
3387 
3388 /**
3389  * @format 121441
3390  * @param subevent_code
3391  * @param avrcp_cid
3392  * @param command_type
3393  * @param song_length
3394  * @param song_position
3395  * @param play_status
3396  */
3397  #define AVRCP_SUBEVENT_PLAY_STATUS                                     0x15u
3398 
3399 /**
3400  * @format 1211
3401  * @param subevent_code
3402  * @param avrcp_cid
3403  * @param command_type
3404  * @param operation_id
3405  */
3406 #define AVRCP_SUBEVENT_OPERATION_START                                    0x16u
3407 
3408 /**
3409  * @format 1211
3410  * @param subevent_code
3411  * @param avrcp_cid
3412  * @param command_type
3413  * @param operation_id
3414  */
3415 #define AVRCP_SUBEVENT_OPERATION_COMPLETE                                 0x17u
3416 
3417 /**
3418  * @format 121
3419  * @param subevent_code
3420  * @param avrcp_cid
3421  * @param command_type
3422  */
3423 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE                   0x18u
3424 
3425 /**
3426  * @format 12
3427  * @param subevent_code
3428  * @param avrcp_cid
3429  */
3430 #define AVRCP_SUBEVENT_PLAY_STATUS_QUERY                                    0x19u
3431 
3432 /**
3433  * @format 121111
3434  * @param subevent_code
3435  * @param avrcp_cid
3436  * @param operation_id
3437  * @param button_pressed
3438  * @param operands_length
3439  * @param operand
3440  */
3441 #define AVRCP_SUBEVENT_OPERATION                                            0x1Au
3442 
3443 /**
3444  * @format 1211
3445  * @param subevent_code
3446  * @param avrcp_cid
3447  * @param command_type
3448  * @param track
3449  */
3450 #define AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO                               0x1Bu
3451 
3452 /**
3453  * @format 1211
3454  * @param subevent_code
3455  * @param avrcp_cid
3456  * @param command_type
3457  * @param total_tracks
3458  */
3459 #define AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO                        0x1Cu
3460 
3461 /**
3462  * @format 1214
3463  * @param subevent_code
3464  * @param avrcp_cid
3465  * @param command_type
3466  * @param song_length in ms
3467  */
3468 #define AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO                      0x1Du
3469 
3470 /**
3471  * @format 121JV
3472  * @param subevent_code
3473  * @param avrcp_cid
3474  * @param command_type
3475  * @param value_len
3476  * @param value
3477  */
3478 #define AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO                                 0x1Eu
3479 
3480  /*
3481  * @format 121JV
3482  * @param subevent_code
3483  * @param avrcp_cid
3484  * @param command_type
3485  * @param value_len
3486  * @param value
3487  */
3488 #define AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO                                0x1Fu
3489 
3490  /*
3491  * @format 121JV
3492  * @param subevent_code
3493  * @param avrcp_cid
3494  * @param command_type
3495  * @param value_len
3496  * @param value
3497  */
3498 #define AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO                                 0x20u
3499 
3500  /*
3501  * @format 121JV
3502  * @param subevent_code
3503  * @param avrcp_cid
3504  * @param command_type
3505  * @param value_len
3506  * @param value
3507  */
3508 #define AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO                                 0x21u
3509 
3510 /*
3511 * @format 121JV
3512 * @param subevent_code
3513 * @param avrcp_cid
3514 * @param command_type
3515 * @param value_len
3516 * @param value
3517 */
3518 #define AVRCP_SUBEVENT_NOW_PLAYING_COVER_ART_INFO                             0x22u
3519 
3520 /*
3521  * @format 1211
3522  * @param subevent_code
3523  * @param avrcp_cid
3524  * @param command_type
3525  * @param status
3526  */
3527 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE                                  0x23u
3528 
3529 /**
3530  * @format 1214
3531  * @param subevent_code
3532  * @param avrcp_cid
3533  * @param command_type
3534  * @param playback_position_ms
3535  */
3536 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_POS_CHANGED                      0x24u
3537 
3538 /*
3539  * @format 12111
3540  * @param subevent_code
3541  * @param avrcp_cid
3542  * @param command_type
3543  * @param status
3544  * @param event_id
3545  */
3546 #define AVRCP_SUBEVENT_GET_CAPABILITY_EVENT_ID                                0x25u
3547 /*
3548  * @format 1211
3549  * @param subevent_code
3550  * @param avrcp_cid
3551  * @param command_type
3552  * @param status
3553  */
3554 #define AVRCP_SUBEVENT_GET_CAPABILITY_EVENT_ID_DONE                           0x26u
3555 
3556 /*
3557  * @format 12113
3558  * @param subevent_code
3559  * @param avrcp_cid
3560  * @param command_type
3561  * @param status
3562  * @param company_id
3563  */
3564 #define AVRCP_SUBEVENT_GET_CAPABILITY_COMPANY_ID                              0x27u
3565 /*
3566  * @format 1211
3567  * @param subevent_code
3568  * @param avrcp_cid
3569  * @param command_type
3570  * @param status
3571  */
3572 #define AVRCP_SUBEVENT_GET_CAPABILITY_COMPANY_ID_DONE                         0x28u
3573 
3574 /**
3575  * @format 1211LV
3576  * @param subevent_code
3577  * @param avrcp_cid
3578  * @param command_type
3579  * @param pdu_id
3580  * @param params_len
3581  * @param params
3582 */
3583 #define AVRCP_SUBEVENT_CUSTOM_COMMAND_RESPONSE                               0x29u
3584 
3585 
3586 /**
3587  * @format 1B2
3588  * @param subevent_code
3589  * @param bd_addr
3590  * @param browsing_cid
3591  */
3592 #define AVRCP_SUBEVENT_INCOMING_BROWSING_CONNECTION                          0x30u
3593 
3594 /**
3595  * @format 11B2
3596  * @param subevent_code
3597  * @param status 0 == OK
3598  * @param bd_addr
3599  * @param browsing_cid
3600  */
3601 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_ESTABLISHED                        0x31u
3602 
3603 /**
3604  * @format 12
3605  * @param subevent_code
3606  * @param browsing_cid
3607  */
3608 #define AVRCP_SUBEVENT_BROWSING_CONNECTION_RELEASED                           0x32u
3609 
3610 /**
3611  * @format 12211
3612  * @param subevent_code
3613  * @param browsing_cid
3614  * @param uid_counter
3615  * @param browsing_status
3616  * @param bluetooth_status
3617  */
3618 #define AVRCP_SUBEVENT_BROWSING_DONE                                          0x33u
3619 
3620 /**
3621  * @format 121444
3622  * @param subevent_code
3623  * @param browsing_cid
3624  * @param scope
3625  * @param start_item
3626  * @param end_item
3627  * @param attr_bitmap
3628  */
3629 #define AVRCP_SUBEVENT_BROWSING_GET_FOLDER_ITEMS                              0x34u
3630 
3631 /**
3632  * @format 121
3633  * @param subevent_code
3634  * @param browsing_cid
3635  * @param scope
3636  */
3637 #define AVRCP_SUBEVENT_BROWSING_GET_TOTAL_NUM_ITEMS                           0x35u
3638 
3639 /**
3640  * @format 122
3641  * @param subevent_code
3642  * @param browsing_cid
3643  * @param player_id
3644  */
3645 #define AVRCP_SUBEVENT_BROWSING_SET_BROWSED_PLAYER                            0x36u
3646 
3647 /**
3648  * @format 11B22
3649  * @param subevent_code
3650  * @param status 0 == OK
3651  * @param bd_addr
3652  * @param avrcp_cid
3653  * @param cover_art_cid
3654  */
3655 #define AVRCP_SUBEVENT_COVER_ART_CONNECTION_ESTABLISHED                       0x37u
3656 
3657 /**
3658  * @format 121
3659  * @param subevent_code
3660  * @param cover_art_cid
3661  * @param status
3662  */
3663 #define AVRCP_SUBEVENT_COVER_ART_OPERATION_COMPLETE                           0x38u
3664 
3665 /**
3666  * @format 12
3667  * @param subevent_code
3668  * @param cover_art_cid
3669  */
3670 #define AVRCP_SUBEVENT_COVER_ART_CONNECTION_RELEASED                          0x39u
3671 
3672 /**
3673  * @format 1221D
3674  * @param subevent_code
3675  * @param browsing_cid
3676  * @param uid_counter
3677  * @param direction
3678  * @param folder_id
3679  */
3680 #define AVRCP_SUBEVENT_BROWSING_CHANGE_PATH                                   0x40u
3681 
3682 /**
3683  * @format 1221DJV
3684  * @param subevent_code
3685  * @param browsing_cid
3686  * @param uid_counter
3687  * @param scope
3688  * @param item_id
3689  * @param attributes_len
3690  * @param attributes
3691  */
3692 #define AVRCP_SUBEVENT_BROWSING_GET_ITEM_ATTRIBUTES                                   0x41u
3693 
3694 /**
3695  * @format 122JV
3696  * @param subevent_code
3697  * @param browsing_cid
3698  * @param characterset
3699  * @param value_length
3700  * @param value
3701  */
3702 
3703 #define AVRCP_SUBEVENT_BROWSING_SEARCH                                                 0x42u
3704 
3705 /**
3706  * @format 1221D
3707  * @param subevent_code
3708  * @param avrcp_cid
3709  * @param uid_counter
3710  * @param scope
3711  * @param item_id
3712  */
3713 #define AVRCP_SUBEVENT_PLAY_ITEM                                                       0x42u
3714 
3715 /**
3716  * @format 1221D
3717  * @param subevent_code
3718  * @param avrcp_cid
3719  * @param uid_counter
3720  * @param scope
3721  * @param item_id
3722  */
3723 #define AVRCP_SUBEVENT_ADD_TO_NOW_PLAYING                                              0x43u
3724 
3725 /**
3726  * @format 12BH
3727  * @param subevent_code
3728  * @param goep_cid
3729  * @param address
3730  * @param handle
3731  */
3732 #define GOEP_SUBEVENT_INCOMING_CONNECTION                                  0x01u
3733 
3734 /**
3735  * @format 121BH1
3736  * @param subevent_code
3737  * @param goep_cid
3738  * @param status
3739  * @param bd_addr
3740  * @param con_handle
3741  * @param incoming
3742  */
3743 #define GOEP_SUBEVENT_CONNECTION_OPENED                                    0x02u
3744 
3745 /**
3746  * @format 12
3747  * @param subevent_code
3748  * @param goep_cid
3749 */
3750 #define GOEP_SUBEVENT_CONNECTION_CLOSED                                    0x03u
3751 
3752 /**
3753  * @format 12
3754  * @param subevent_code
3755  * @param goep_cid
3756 */
3757 #define GOEP_SUBEVENT_CAN_SEND_NOW                                         0x04u
3758 
3759 /**
3760  * @format 121BH1
3761  * @param subevent_code
3762  * @param pbap_cid
3763  * @param status
3764  * @param bd_addr
3765  * @param con_handle
3766  * @param incoming
3767  */
3768 #define PBAP_SUBEVENT_CONNECTION_OPENED                                    0x01u
3769 
3770 /**
3771  * @format 12
3772  * @param subevent_code
3773  * @param goep_cid
3774 */
3775 #define PBAP_SUBEVENT_CONNECTION_CLOSED                                    0x02u
3776 
3777 /**
3778  * @format 121
3779  * @param subevent_code
3780  * @param goep_cid
3781  * @param status
3782  */
3783 #define PBAP_SUBEVENT_OPERATION_COMPLETED                                  0x03u
3784 
3785 /**
3786  * @format 1212
3787  * @param subevent_code
3788  * @param goep_cid
3789  * @param status
3790  * @param phonebook_size
3791  */
3792 #define PBAP_SUBEVENT_PHONEBOOK_SIZE                                       0x04u
3793 
3794 /**
3795  * @format 1211
3796  * @param subevent_code
3797  * @param goep_cid
3798  * @param user_id_required
3799  * @param full_access
3800  */
3801 #define PBAP_SUBEVENT_AUTHENTICATION_REQUEST                               0x05u
3802 
3803 /**
3804  * @format 12JVJV
3805  * @param subevent_code
3806  * @param goep_cid
3807  * @param name_len
3808  * @param name
3809  * @param handle_len
3810  * @param handle
3811  */
3812 #define PBAP_SUBEVENT_CARD_RESULT                                          0x06u
3813 
3814 /**
3815  * @format 121
3816  * @param subevent_code
3817  * @param goep_cid
3818  * @param phonebook
3819  */
3820 #define PBAP_SUBEVENT_RESET_MISSED_CALLS                                   0x0Au
3821 
3822 /**
3823  * @format 12411
3824  * @param subevent_code
3825  * @param goep_cid
3826  * @param vcard_selector
3827  * @param vcard_selector_operator
3828  * @param phonebook
3829  */
3830 #define PBAP_SUBEVENT_QUERY_PHONEBOOK_SIZE                                 0x0Bu
3831 
3832 /**
3833  * @format 1244122411
3834  * @param subevent_code
3835  * @param goep_cid
3836  * @param continuation - value provided by caller of pbap_server_send_pull_response
3837  * @param property_selector
3838  * @param format
3839  * @param max_list_count 0xffff for unlimited
3840  * @param list_start_offset
3841  * @param vcard_selector
3842  * @param vcard_selector_operator
3843  * @param phonebook
3844  */
3845 #define PBAP_SUBEVENT_PULL_PHONEBOOK                                      0x0Cu
3846 
3847 /**
3848  * @format 124122411JV1
3849  * @param subevent_code
3850  * @param goep_cid
3851  * @param continuation - value provided by caller of pbap_server_send_pull_response
3852  * @param order
3853  * @param max_list_count 0xffff for unlimited
3854  * @param list_start_offset
3855  * @param vcard_selector
3856  * @param vcard_selector_operator
3857  * @param search_property
3858  * @param search_value_len
3859  * @param search_value
3860  * @param phonebook
3861  */
3862 #define PBAP_SUBEVENT_PULL_VCARD_LISTING                                   0x0Du
3863 
3864 /**
3865  * @format 124411T
3866  * @param subevent_code
3867  * @param goep_cid
3868  * @param continuation - value provided by caller of pbap_server_send_pull_response
3869  * @param property_selector
3870  * @param format
3871  * @param phonebook
3872  * @param name
3873  */
3874 #define PBAP_SUBEVENT_PULL_VCARD_ENTRY                                     0x0Eu
3875 
3876 
3877 // HID Meta Event Group
3878 
3879 /**
3880  * @format 12BH
3881  * @param subevent_code
3882  * @param hid_cid
3883  * @param address
3884  * @param handle
3885  */
3886 #define HID_SUBEVENT_INCOMING_CONNECTION                                   0x01u
3887 
3888 /**
3889  * @format 121BH1
3890  * @param subevent_code
3891  * @param hid_cid
3892  * @param status
3893  * @param bd_addr
3894  * @param con_handle
3895  * @param incoming
3896  */
3897 #define HID_SUBEVENT_CONNECTION_OPENED                                     0x02u
3898 
3899 /**
3900  * @format 12
3901  * @param subevent_code
3902  * @param hid_cid
3903 */
3904 #define HID_SUBEVENT_CONNECTION_CLOSED                                     0x03u
3905 
3906 /**
3907  * @format 12
3908  * @param subevent_code
3909  * @param hid_cid
3910 */
3911 #define HID_SUBEVENT_CAN_SEND_NOW                                          0x04u
3912 
3913 /**
3914  * @format 12
3915  * @param subevent_code
3916  * @param hid_cid
3917 */
3918 #define HID_SUBEVENT_SUSPEND                                               0x05u
3919 
3920 /**
3921  * @format 12
3922  * @param subevent_code
3923  * @param hid_cid
3924 */
3925 #define HID_SUBEVENT_EXIT_SUSPEND                                          0x06u
3926 
3927 /**
3928  * @format 12
3929  * @param subevent_code
3930  * @param hid_cid
3931 */
3932 #define HID_SUBEVENT_VIRTUAL_CABLE_UNPLUG                                  0x07u
3933 
3934 /**
3935  * @format 121LV
3936  * @param subevent_code
3937  * @param hid_cid
3938  * @param handshake_status
3939  * @param report_len
3940  * @param report
3941 */
3942 #define HID_SUBEVENT_GET_REPORT_RESPONSE                                   0x08u
3943 
3944 /**
3945  * @format 121
3946  * @param subevent_code
3947  * @param hid_cid
3948  * @param handshake_status
3949 */
3950 #define HID_SUBEVENT_SET_REPORT_RESPONSE                                   0x09u
3951 
3952 /**
3953  * @format 1211
3954  * @param subevent_code
3955  * @param hid_cid
3956  * @param handshake_status
3957  * @param protocol_mode
3958 */
3959 #define HID_SUBEVENT_GET_PROTOCOL_RESPONSE                                 0x0Au
3960 
3961 /**
3962  * @format 1211
3963  * @param subevent_code
3964  * @param hid_cid
3965  * @param handshake_status
3966  * @param protocol_mode
3967 */
3968 #define HID_SUBEVENT_SET_PROTOCOL_RESPONSE                                 0x0Bu
3969 
3970 /**
3971  * @format 12LV
3972  * @param subevent_code
3973  * @param hid_cid
3974  * @param report_len
3975  * @param report
3976 */
3977 #define HID_SUBEVENT_REPORT                                                0x0Cu
3978 
3979 /**
3980  * @format 121
3981  * @param subevent_code
3982  * @param hid_cid
3983  * @param status
3984  */
3985 #define HID_SUBEVENT_DESCRIPTOR_AVAILABLE                                  0x0Du
3986 
3987 /**
3988  * @format 1222
3989  * @param subevent_code
3990  * @param hid_cid
3991  * @param host_max_latency
3992  * @param host_min_timeout
3993  */
3994 #define HID_SUBEVENT_SNIFF_SUBRATING_PARAMS                                0x0Eu
3995 
3996 // HIDS Meta Event Group
3997 
3998 /**
3999  * @format 12
4000  * @param subevent_code
4001  * @param con_handle
4002 */
4003 #define HIDS_SUBEVENT_CAN_SEND_NOW                                          0x01u
4004 
4005 /**
4006  * @format 121
4007  * @param subevent_code
4008  * @param con_handle
4009  * @param protocol_mode
4010 */
4011 #define HIDS_SUBEVENT_PROTOCOL_MODE                                         0x02u
4012 
4013 /**
4014  * @format 121
4015  * @param subevent_code
4016  * @param con_handle
4017  * @param enable
4018 */
4019 #define HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE                        0x03u
4020 
4021 /**
4022  * @format 121
4023  * @param subevent_code
4024  * @param con_handle
4025  * @param enable
4026 */
4027 #define HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE                     0x04u
4028 
4029 /**
4030  * @format 1211
4031  * @param subevent_code
4032  * @param con_handle
4033  * @param report_id
4034  * @param enable
4035 */
4036 #define HIDS_SUBEVENT_INPUT_REPORT_ENABLE                                   0x05u
4037 
4038 /**
4039  * @format 1211
4040  * @param subevent_code
4041  * @param con_handle
4042  * @param report_id
4043  * @param enable
4044 */
4045 #define HIDS_SUBEVENT_OUTPUT_REPORT_ENABLE                                  0x06u
4046 
4047 /**
4048  * @format 1211
4049  * @param subevent_code
4050  * @param con_handle
4051  * @param report_id
4052  * @param enable
4053 */
4054 #define HIDS_SUBEVENT_FEATURE_REPORT_ENABLE                                 0x07u
4055 
4056 /**
4057  * @format 12
4058  * @param subevent_code
4059  * @param con_handle
4060 */
4061 #define HIDS_SUBEVENT_SUSPEND                                               0x08u
4062 
4063 /**
4064  * @format 12
4065  * @param subevent_code
4066  * @param con_handle
4067 */
4068 #define HIDS_SUBEVENT_EXIT_SUSPEND                                          0x09u
4069 
4070 /**
4071  * @format 1211JV
4072  * @param subevent_code
4073  * @param con_handle
4074  * @param report_id
4075  * @param report_type
4076  * @param report_length
4077  * @param report_data
4078 */
4079 #define HIDS_SUBEVENT_SET_REPORT                                            0x0au
4080 
4081 /**
4082  * @format 1211
4083  * @param subevent_code
4084  * @param con_handle
4085  * @param measurement_type 0 - force magnitude, 1 - torque magnitude, see cycling_power_sensor_measurement_context_t
4086  * @param is_enhanced
4087 */
4088 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_START_CALIBRATION               0x01u
4089 
4090 /**
4091  * @format 12
4092  * @param subevent_code
4093  * @param con_handle
4094 */
4095 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_BROADCAST_START                 0x02u
4096 
4097 /**
4098  * @format 12
4099  * @param subevent_code
4100  * @param con_handle
4101 */
4102 #define GATTSERVICE_SUBEVENT_CYCLING_POWER_BROADCAST_STOP                  0x03u
4103 
4104 /**
4105  * @format 12111
4106  * @param subevent_code
4107  * @param hids_cid
4108  * @param status
4109  * @param num_instances
4110  * @param poll_bitmap
4111 */
4112 #define GATTSERVICE_SUBEVENT_BATTERY_SERVICE_CONNECTED                     0x04u
4113 
4114 /**
4115  * @format 12111
4116  * @param subevent_code
4117  * @param hids_cid
4118  * @param service_index
4119  * @param att_status  see ATT errors in bluetooth.h
4120  * @param level
4121 */
4122 #define GATTSERVICE_SUBEVENT_BATTERY_SERVICE_LEVEL                         0x05u
4123 
4124 /**
4125  * @format 12
4126  * @param subevent_code
4127  * @param service_id
4128 */
4129 #define GATTSERVICE_SUBEVENT_BATTERY_SERVICE_LEVEL_BROADCAST_START           0x06u
4130 
4131 /**
4132  * @format 12
4133  * @param subevent_code
4134  * @param service_id
4135 */
4136 #define GATTSERVICE_SUBEVENT_BATTERY_SERVICE_LEVEL_BROADCAST_STOP            0x07u
4137 
4138 /**
4139  * @format 1H1
4140  * @param subevent_code
4141  * @param con_handle
4142  * @param att_status
4143  */
4144 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_DONE                       0x08u
4145 
4146 /**
4147  * @format 1H1T
4148  * @param subevent_code
4149  * @param con_handle
4150  * @param att_status
4151  * @param value
4152  */
4153 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_MANUFACTURER_NAME          0x09u
4154 
4155 /**
4156  * @format 1H1T
4157  * @param subevent_code
4158  * @param con_handle
4159  * @param att_status
4160  * @param value
4161  */
4162 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_MODEL_NUMBER               0x0Au
4163 
4164 /**
4165  * @format 1H1T
4166  * @param subevent_code
4167  * @param con_handle
4168  * @param att_status
4169  * @param value
4170  */
4171 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_SERIAL_NUMBER              0x0Bu
4172 
4173 /**
4174  * @format 1H1T
4175  * @param subevent_code
4176  * @param con_handle
4177  * @param att_status
4178  * @param value
4179  */
4180 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_HARDWARE_REVISION          0x0Cu
4181 
4182 /**
4183  * @format 1H1T
4184  * @param subevent_code
4185  * @param con_handle
4186  * @param att_status
4187  * @param value
4188  */
4189 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_FIRMWARE_REVISION          0x0Du
4190 
4191 /**
4192  * @format 1H1T
4193  * @param subevent_code
4194  * @param con_handle
4195  * @param att_status
4196  * @param value
4197  */
4198 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_SOFTWARE_REVISION          0x0Eu
4199 
4200 /**
4201  * @format 1H1413
4202  * @param subevent_code
4203  * @param con_handle
4204  * @param att_status
4205  * @param manufacturer_id_low
4206  * @param manufacturer_id_high
4207  * @param organizationally_unique_id
4208  */
4209 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_SYSTEM_ID                  0x0Fu
4210 
4211 /**
4212  * @format 1H122
4213  * @param subevent_code
4214  * @param con_handle
4215  * @param att_status
4216  * @param value_a
4217  * @param value_b
4218  */
4219 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_IEEE_REGULATORY_CERTIFICATION     0x10u
4220 
4221 /**
4222  * @format 1H11222
4223  * @param subevent_code
4224  * @param con_handle
4225  * @param att_status
4226  * @param vendor_source_id
4227  * @param vendor_id
4228  * @param product_id
4229  * @param product_version
4230  */
4231 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_PNP_ID                    0x11u
4232 
4233 /**
4234  * @format 1H1TTTT
4235  * @param subevent_code
4236  * @param con_handle
4237  * @param att_status
4238  * @param label
4239  * @param device_id
4240  * @param issuer
4241  * @param authority
4242  */
4243 #define GATTSERVICE_SUBEVENT_DEVICE_INFORMATION_UDI_FOR_MEDICAL_DEVICES   0x12u
4244 
4245 /**
4246  * @format 1H1
4247  * @param subevent_code
4248  * @param con_handle
4249  * @param status
4250  */
4251 #define GATTSERVICE_SUBEVENT_SCAN_PARAMETERS_SERVICE_CONNECTED            0x13u
4252 
4253 /**
4254  * @format 1H
4255  * @param subevent_code
4256  * @param con_handle
4257  */
4258 #define GATTSERVICE_SUBEVENT_SCAN_PARAMETERS_SERVICE_DISCONNECTED         0x14u
4259 
4260 /**
4261  * @format 1H
4262  * @param subevent_code
4263  * @param con_handle
4264  */
4265 #define GATTSERVICE_SUBEVENT_SPP_SERVICE_CONNECTED                        0x15u
4266 
4267 /**
4268  * @format 1H
4269  * @param subevent_code
4270  * @param con_handle
4271  */
4272 #define GATTSERVICE_SUBEVENT_SPP_SERVICE_DISCONNECTED                     0x16u
4273 
4274 /**
4275  * @format 12111
4276  * @param subevent_code
4277  * @param hids_cid
4278  * @param status
4279  * @param protocol_mode
4280  * @param num_instances
4281 */
4282 #define GATTSERVICE_SUBEVENT_HID_SERVICE_CONNECTED                        0x17u
4283 
4284 /**
4285  * @format 12
4286  * @param subevent_code
4287  * @param hids_cid
4288 */
4289 #define GATTSERVICE_SUBEVENT_HID_SERVICE_DISCONNECTED                     0x18u
4290 
4291 /**
4292  * @format 1211LV
4293  * @param subevent_code
4294  * @param hids_cid
4295  * @param service_index
4296  * @param report_id
4297  * @param report_len
4298  * @param report
4299 */
4300 #define GATTSERVICE_SUBEVENT_HID_REPORT                                   0x19u
4301 
4302 /**
4303  * @format 1212111
4304  * @param subevent_code
4305  * @param hids_cid
4306  * @param service_index
4307  * @param base_usb_hid_version      Version number of base USB HID Specification implemented by HID Device
4308  * @param country_code              Country HID Device hardware is localized for (not localized: 0x00)
4309  * @param remote_wake               Indicates whether HID Device is capable of sending a wake-signal to a HID Host
4310  * @param normally_connectable      Indicates whether HID Device will be advertising when bonded but not connected.
4311 */
4312 #define GATTSERVICE_SUBEVENT_HID_INFORMATION                              0x1Au
4313 
4314 /**
4315  * @format 1211
4316  * @param subevent_code
4317  * @param hids_cid
4318  * @param service_index
4319  * @param protocol_mode    see hid_protocol_mode_t in btstack_hid.h
4320 */
4321 #define GATTSERVICE_SUBEVENT_HID_PROTOCOL_MODE                            0x1Bu
4322 
4323 /**
4324  * @format 121
4325  * @param subevent_code
4326  * @param hids_cid
4327  * @param configuration
4328 */
4329 #define GATTSERVICE_SUBEVENT_HID_SERVICE_REPORTS_NOTIFICATION             0x1Cu
4330 
4331 /**
4332  * @format 1211
4333  * @param subevent_code
4334  * @param hids_cid
4335  * @param service_index
4336  * @param report_id
4337 */
4338 #define GATTSERVICE_SUBEVENT_HID_REPORT_WRITTEN                           0x1Du
4339 
4340 /**
4341  * @format 1H22
4342  * @param subevent_code
4343  * @param con_handle
4344  * @param max_scan_interval
4345  * @param min_scan_window
4346  */
4347 #define GATTSERVICE_SUBEVENT_SCAN_PARAMETERS_SERVICE_SCAN_INTERVAL_UPDATE 0x1Eu
4348 
4349 /**
4350  * @format 1H22
4351  * @param subevent_code
4352  * @param con_handle
4353  * @param attribute_handle_start
4354  * @param attribute_handle_end
4355  */
4356 #define GATTSERVICE_SUBEVENT_GATT_SERVICE_CHANGED                          0x1Fu
4357 
4358 /**
4359  * @format 1HK
4360  * @param subevent_code
4361  * @param con_handle
4362  * @param database_hash
4363  */
4364 #define GATTSERVICE_SUBEVENT_GATT_DATABASE_HASH                            0x20u
4365 
4366 /**
4367  * @format 1H211
4368  * @param subevent_code
4369  * @param con_handle
4370  * @param cid
4371  * @param num_included_services
4372  * @param status
4373 */
4374 #define GATTSERVICE_SUBEVENT_CLIENT_CONNECTED                              0x21u
4375 
4376 /**
4377  * @format 1H2
4378  * @param subevent_code
4379  * @param con_handle
4380  * @param cid
4381 */
4382 #define GATTSERVICE_SUBEVENT_CLIENT_DISCONNECTED                           0x22u
4383 
4384 /**
4385  * @format 1H21
4386  * @param subevent_code
4387  * @param con_handle
4388  * @param lls_cid
4389  * @param status
4390 */
4391 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_CONNECTED                          0x23u
4392 
4393 /**
4394  * @format 12
4395  * @param subevent_code
4396  * @param lls_cid
4397 */
4398 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_DISCONNECTED                       0x24u
4399 
4400 /**
4401  * @format 1221
4402  * @param subevent_code
4403  * @param lls_cid
4404  * @param characteristic_uuid
4405  * @param att_status
4406  */
4407 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_WRITE_DONE                         0x25u
4408 
4409 /**
4410  * @format 12
4411  * @param subevent_code
4412  * @param lls_cid
4413  */
4414 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_START_ALERTING                     0x26u
4415 
4416 /**
4417  * @format 121
4418  * @param subevent_code
4419  * @param lls_cid
4420  * @param timeout
4421  */
4422 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_STOP_ALERTING                      0x27u
4423 
4424 /**
4425  * @format 121
4426  * @param subevent_code
4427  * @param lls_cid
4428  * @param value
4429  */
4430 #define GATTSERVICE_SUBEVENT_LLS_CLIENT_ALERT_LEVEL                        0x28u
4431 
4432 /**
4433  * @format 1H21
4434  * @param subevent_code
4435  * @param con_handle
4436  * @param ias_cid
4437  * @param status
4438 */
4439 #define GATTSERVICE_SUBEVENT_IAS_CLIENT_CONNECTED                          0x29u
4440 
4441 /**
4442  * @format 12
4443  * @param subevent_code
4444  * @param ias_cid
4445 */
4446 #define GATTSERVICE_SUBEVENT_IAS_CLIENT_DISCONNECTED                       0x2Au
4447 
4448 /**
4449  * @format 12
4450  * @param subevent_code
4451  * @param ias_cid
4452  */
4453 #define GATTSERVICE_SUBEVENT_IAS_CLIENT_START_ALERTING                     0x2Bu
4454 
4455 /**
4456  * @format 121
4457  * @param subevent_code
4458  * @param ias_cid
4459  * @param timeout
4460  */
4461 #define GATTSERVICE_SUBEVENT_IAS_CLIENT_STOP_ALERTING                      0x2Cu
4462 
4463 /**
4464  * @format 1H21
4465  * @param subevent_code
4466  * @param con_handle
4467  * @param tpxs_cid
4468  * @param status
4469 */
4470 #define GATTSERVICE_SUBEVENT_TXPS_CLIENT_CONNECTED                         0x2Du
4471 
4472 /**
4473  * @format 12
4474  * @param subevent_code
4475  * @param tpxs_cid
4476 */
4477 #define GATTSERVICE_SUBEVENT_TXPS_CLIENT_DISCONNECTED                      0x2Eu
4478 
4479 /**
4480  * @format 121
4481  * @param subevent_code
4482  * @param tpxs_cid
4483  * @param value
4484  */
4485 #define GATTSERVICE_SUBEVENT_TXPS_CLIENT_TX_POWER_LEVEL                    0x2Fu
4486 
4487 /**
4488  * @format 11
4489  * @param subevent_code
4490  * @param alert_level
4491  */
4492 #define GATTSERVICE_SUBEVENT_LLS_SERVER_START_ALERTING                     0x30u
4493 
4494 /**
4495  * @format 111
4496  * @param subevent_code
4497  * @param alert_level
4498  * @param timeout
4499  */
4500 #define GATTSERVICE_SUBEVENT_LLS_SERVER_STOP_ALERTING                      0x31u
4501 
4502 /**
4503  * @format 11
4504  * @param subevent_code
4505  * @param alert_level
4506  */
4507 #define GATTSERVICE_SUBEVENT_IAS_SERVER_START_ALERTING                     0x32u
4508 
4509 /**
4510  * @format 111
4511  * @param subevent_code
4512  * @param alert_level
4513  * @param timeout
4514  */
4515 #define GATTSERVICE_SUBEVENT_IAS_SERVER_STOP_ALERTING                      0x33u
4516 
4517 
4518 
4519 // LE Audio
4520 
4521 /**
4522  * @format 1H1
4523  * @param subevent_code
4524  * @param con_handle
4525  * @param status
4526 */
4527 #define LEAUDIO_SUBEVENT_BASS_SERVER_CONNECTED                              0x01u
4528 
4529 /**
4530  * @format 1H
4531  * @param subevent_code
4532  * @param con_handle
4533 */
4534 #define LEAUDIO_SUBEVENT_BASS_SERVER_DISCONNECTED                           0x02u
4535 
4536 /**
4537  * @format 1H
4538  * @param subevent_code
4539  * @param con_handle
4540 */
4541 #define LEAUDIO_SUBEVENT_BASS_SERVER_SCAN_STOPPED                         0x03u
4542 
4543 /**
4544  * @format 1H
4545  * @param subevent_code
4546  * @param con_handle
4547 */
4548 #define LEAUDIO_SUBEVENT_BASS_SERVER_SCAN_STARTED                          0x04u
4549 
4550 /**
4551  * @format 1H1K
4552  * @param subevent_code
4553  * @param con_handle
4554  * @param source_id
4555  * @param broadcast_code
4556 */
4557 #define LEAUDIO_SUBEVENT_BASS_SERVER_BROADCAST_CODE                         0x05u
4558 
4559 /**
4560  * @format 1H11
4561  * @param subevent_code
4562  * @param con_handle
4563  * @param source_id
4564  * @param pa_sync
4565  */
4566 #define LEAUDIO_SUBEVENT_BASS_SERVER_SOURCE_ADDED                            0x06u
4567 
4568 /**
4569  * @format 1H11
4570  * @param subevent_code
4571  * @param con_handle
4572  * @param source_id
4573  * @param pa_sync
4574  */
4575 #define LEAUDIO_SUBEVENT_BASS_SERVER_SOURCE_MODIFIED                         0x07u
4576 
4577 /**
4578  * @format 1H11
4579  * @param subevent_code
4580  * @param con_handle
4581  * @param source_id
4582  * @param pa_sync
4583  */
4584 #define LEAUDIO_SUBEVENT_BASS_SERVER_SOURCE_DELETED                          0x08u
4585 
4586 /**
4587  * @format 1H21
4588  * @param subevent_code
4589  * @param con_handle
4590  * @param bass_cid
4591  * @param status
4592 */
4593 #define LEAUDIO_SUBEVENT_BASS_CLIENT_CONNECTED                                0x09u
4594 
4595 /**
4596  * @format 12
4597  * @param subevent_code
4598  * @param bass_cid
4599 */
4600 #define LEAUDIO_SUBEVENT_BASS_CLIENT_DISCONNECTED                             0x0Au
4601 
4602 /**
4603  * @format 1211
4604  * @param subevent_code
4605  * @param bass_cid
4606  * @param status
4607  * @param opcode
4608 */
4609 #define LEAUDIO_SUBEVENT_BASS_CLIENT_SCAN_OPERATION_COMPLETE                   0x0Bu
4610 
4611 /**
4612  * @format 1211B1311P1
4613  * @param subevent_code
4614  * @param bass_cid
4615  * @param source_id
4616  * @param source_address_type
4617  * @param source_address
4618  * @param source_adv_sid
4619  * @param broadcast_id
4620  * @param pa_sync_state
4621  * @param big_encryption
4622  * @param bad_code
4623  * @param subgroups_num
4624 */
4625 #define LEAUDIO_SUBEVENT_BASS_CLIENT_NOTIFY_RECEIVE_STATE_BASE                  0x0Cu
4626 
4627 /**
4628  * @format 1214122JV3JV1JV2JV2JV
4629  * @param subevent_code
4630  * @param bass_cid
4631  * @param source_id
4632  * @param bis_sync_state
4633  * @param metadata_mask
4634  * @param preferred_audio_contexts_mask
4635  * @param streaming_audio_contexts_mask
4636  * @param program_info_length
4637  * @param program_info
4638  * @param language_code
4639  * @param ccids_num
4640  * @param ccids
4641  * @param parental_rating
4642  * @param program_info_uri_length
4643  * @param program_info_uri
4644  * @param extended_metadata_type
4645  * @param extended_metadata_value_length
4646  * @param extended_metadata_value
4647  * @param vendor_specific_metadata_type
4648  * @param vendor_specific_metadata_value_length
4649  * @param vendor_specific_metadata_value
4650 */
4651 #define LEAUDIO_SUBEVENT_BASS_CLIENT_NOTIFY_RECEIVE_STATE_SUBGROUP                 0x0Du
4652 
4653 /**
4654  * @format 121
4655  * @param subevent_code
4656  * @param bass_cid
4657  * @param source_id
4658 */
4659 #define LEAUDIO_SUBEVENT_BASS_CLIENT_NOTIFICATION_COMPLETE                         0x0Eu
4660 
4661 /**
4662  * @format 12111
4663  * @param subevent_code
4664  * @param bass_cid
4665  * @param status
4666  * @param opcode
4667  * @param source_id
4668 */
4669 #define LEAUDIO_SUBEVENT_BASS_CLIENT_SOURCE_OPERATION_COMPLETE                     0x0Fu
4670 
4671 
4672 // MESH Meta Event Group
4673 
4674 /**
4675  * @format 1
4676  * @param subevent_code
4677  */
4678 #define MESH_SUBEVENT_CAN_SEND_NOW                                          0x01u
4679 
4680 /**
4681  * @format 11
4682  * @param subevent_code
4683  * @param status
4684  */
4685 #define MESH_SUBEVENT_PB_TRANSPORT_PDU_SENT                                          0x02u
4686 
4687 /**
4688  * @format 1121
4689  * @param subevent_code
4690  * @param status
4691  * @param pb_transport_cid
4692  * @param pb_type
4693  */
4694 #define MESH_SUBEVENT_PB_TRANSPORT_LINK_OPEN                                         0x03u
4695 
4696 /**
4697  * @format 112
4698  * @param subevent_code
4699  * @param pb_transport_cid
4700  * @param reason
4701  */
4702 #define MESH_SUBEVENT_PB_TRANSPORT_LINK_CLOSED                                       0x04u
4703 
4704 /**
4705  * @format 121
4706  * @param subevent_code
4707  * @param pb_transport_cid
4708  * @param attention_time in seconds
4709  */
4710 #define MESH_SUBEVENT_PB_PROV_ATTENTION_TIMER                                        0x10u
4711 
4712 /**
4713  * Device Role
4714  * @format 12
4715  * @param subevent_code
4716  * @param pb_transport_cid
4717  */
4718 #define MESH_SUBEVENT_PB_PROV_START_EMIT_PUBLIC_KEY_OOB                              0x11u
4719 
4720 /**
4721  * Device Role
4722  * @format 12
4723  * @param subevent_code
4724  * @param pb_transport_cid
4725  */
4726 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_PUBLIC_KEY_OOB                               0x12u
4727 
4728 /**
4729  * Device Role
4730  * @format 12
4731  * @param subevent_code
4732  * @param pb_transport_cid
4733  */
4734 #define MESH_SUBEVENT_PB_PROV_INPUT_OOB_REQUEST                                      0x13u
4735 
4736 /**
4737  * Device Role
4738  * @format 124
4739  * @param subevent_code
4740  * @param pb_transport_cid
4741  * @param output_oob number
4742  */
4743 #define MESH_SUBEVENT_PB_PROV_START_EMIT_OUTPUT_OOB                                  0x15u
4744 
4745 /**
4746  * Device Role
4747  * @format 12
4748  * @param subevent_code
4749  * @param pb_transport_cid
4750  */
4751 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_OUTPUT_OOB                                   0x16u
4752 
4753 /**
4754  * Provisioner Role
4755  * @format 12
4756  * @param subevent_code
4757  * @param pb_transport_cid
4758  */
4759 #define MESH_SUBEVENT_PB_PROV_START_RECEIVE_PUBLIC_KEY_OOB                           0x17u
4760 
4761 /**
4762  * Provisioner Role
4763  * @format 12
4764  * @param subevent_code
4765  * @param pb_transport_cid
4766  */
4767 #define MESH_SUBEVENT_PB_PROV_STOP_RECEIVE_PUBLIC_KEY_OOB                            0x18u
4768 
4769 /**
4770  * Provisioner Role
4771  * @format 12
4772  * @param subevent_code
4773  * @param pb_transport_cid
4774  */
4775 #define MESH_SUBEVENT_PB_PROV_OUTPUT_OOB_REQUEST                                     0x19u
4776 
4777 /**
4778  * Provisioner Role
4779  * @format 124
4780  * @param subevent_code
4781  * @param pb_transport_cid
4782  * @param output_oob number
4783  */
4784 #define MESH_SUBEVENT_PB_PROV_START_EMIT_INPUT_OOB                                   0x1au
4785 
4786 /**
4787  * Provisioner Role
4788  * @format 12
4789  * @param subevent_code
4790  * @param pb_transport_cid
4791  */
4792 #define MESH_SUBEVENT_PB_PROV_STOP_EMIT_INPUT_OOB                                    0x1bu
4793 
4794 /**
4795  * Provisioner Role
4796  * @format 1212111212
4797  * @param subevent_code
4798  * @param pb_transport_cid
4799  * @param num_elements
4800  * @param algorithms
4801  * @param public_key
4802  * @param static_oob_type
4803  * @param output_oob_size
4804  * @param output_oob_action
4805  * @param input_oob_size
4806  * @param input_oob_action
4807  */
4808 #define MESH_SUBEVENT_PB_PROV_CAPABILITIES                                           0x1cu
4809 
4810 /**
4811  * @format 12
4812  * @param subevent_code
4813  * @param pb_transport_cid
4814  */
4815 #define MESH_SUBEVENT_PB_PROV_COMPLETE                                               0x1du
4816 
4817 /**
4818  * @format 11
4819  * @param subevent_code
4820  * @param attention_time in seconds
4821  */
4822 #define MESH_SUBEVENT_ATTENTION_TIMER                                                0x1eu
4823 
4824 /**
4825  * @format 1H
4826  * @param subevent_code
4827  * @param con_handle
4828  */
4829 #define MESH_SUBEVENT_PROXY_CONNECTED                                                0x20u
4830 
4831 /**
4832  * @format 1H
4833  * @param subevent_code
4834  * @param con_handle
4835  */
4836 #define MESH_SUBEVENT_PROXY_PDU_SENT                                                 0x21u
4837 
4838 /**
4839  * @format 1H
4840  * @param subevent_code
4841  * @param con_handle
4842  */
4843 #define MESH_SUBEVENT_PROXY_DISCONNECTED                                             0x22u
4844 
4845 /**
4846  * @format 1H
4847  * @param subevent_code
4848  * @param con_handle
4849  */
4850 #define MESH_SUBEVENT_MESSAGE_SENT                                                   0x23u
4851 
4852 /**
4853  * @format 114411
4854  * @param subevent_code
4855  * @param element_index
4856  * @param model_identifier
4857  * @param state_identifier
4858  * @param reason
4859  * @param value
4860  */
4861 #define MESH_SUBEVENT_STATE_UPDATE_BOOL                                              0x24u
4862 
4863 /**
4864  * @format 114412
4865  * @param subevent_code
4866  * @param element_index
4867  * @param model_identifier
4868  * @param state_identifier
4869  * @param reason
4870  * @param value
4871  */
4872 #define MESH_SUBEVENT_STATE_UPDATE_INT16                                              0x25u
4873 
4874 // Mesh Client Events
4875 /**
4876  * @format 11442
4877  * @param subevent_code
4878  * @param element_index
4879  * @param model_identifier
4880  * @param opcode
4881  * @param dest
4882  */
4883 #define MESH_SUBEVENT_MESSAGE_NOT_ACKNOWLEDGED                                        0x30u
4884 
4885 /**
4886  * @format 121114
4887  * @param subevent_code
4888  * @param dest
4889  * @param status
4890  * @param present_value
4891  * @param target_value       optional, if value > 0, than remaining_time_ms must be read
4892  * @param remaining_time_ms
4893  */
4894 #define MESH_SUBEVENT_GENERIC_ON_OFF                                                  0x31u
4895 
4896 /**
4897  * @format 121224
4898  * @param subevent_code
4899  * @param dest
4900  * @param status
4901  * @param present_value
4902  * @param target_value       optional, if value > 0, than remaining_time_ms must be read
4903  * @param remaining_time_ms
4904  */
4905 #define MESH_SUBEVENT_GENERIC_LEVEL                                                   0x32u
4906 
4907 /**
4908  * @format 1222211
4909  * @param subevent_code
4910  * @param dest
4911  * @param netkey_index
4912  * @param appkey_index
4913  * @param company_id
4914  * @param test_id
4915  * @param acknowledged
4916  */
4917 #define MESH_SUBEVENT_HEALTH_PERFORM_TEST                                            0x33u
4918 
4919 /**
4920  * @format 11
4921  * @param subevent_code
4922  * @param element_index
4923  */
4924 #define MESH_SUBEVENT_HEALTH_ATTENTION_TIMER_CHANGED                                 0x34u
4925 
4926 /**
4927  * @format 1211
4928  * @param subevent_code
4929  * @param dest
4930  * @param status
4931  * @param transition_time_gdtt
4932  */
4933 #define MESH_SUBEVENT_GENERIC_DEFAULT_TRANSITION_TIME                                0x35u
4934 
4935 /**
4936  * @format 1211
4937  * @param subevent_code
4938  * @param dest
4939  * @param foundation_status
4940  * @param secure_network_beacon_state
4941  */
4942 #define MESH_SUBEVENT_CONFIGURATION_BEACON                                           0x36u
4943 
4944 // Composition Data has variable of element descriptions, with two lists of model lists
4945 // Use .. getters to access data
4946 #define MESH_SUBEVENT_CONFIGURATION_COMPOSITION_DATA                                 0x37u
4947 
4948 /**
4949  * @format 1211
4950  * @param subevent_code
4951  * @param dest
4952  * @param foundation_status
4953  * @param default_ttl
4954  */
4955 #define MESH_SUBEVENT_CONFIGURATION_DEFAULT_TTL                                      0x38u
4956 
4957 /**
4958  * @format 1211
4959  * @param subevent_code
4960  * @param dest
4961  * @param foundation_status
4962  * @param gatt_proxy_state
4963  */
4964 #define MESH_SUBEVENT_CONFIGURATION_GATT_PROXY                                       0x39u
4965 
4966 /**
4967  * @format 121111
4968  * @param subevent_code
4969  * @param dest
4970  * @param foundation_status
4971  * @param relay
4972  * @param retransmit_count                          the number of times that packet is transmitted for each packet that is relayed.
4973  * @param retransmit_interval_ms                    retransmission interval in ms
4974  */
4975 #define MESH_SUBEVENT_CONFIGURATION_RELAY                                            0x40u
4976 
4977 
4978 /**
4979  * @format 12122111114
4980  * @param subevent_code
4981  * @param dest                                      element_address
4982  * @param foundation_status
4983  * @param publish_address
4984  * @param appkey_index
4985  * @param credential_flag
4986  * @param publish_ttl
4987  * @param publish_period
4988  * @param publish_retransmit_count
4989  * @param publish_retransmit_interval_steps
4990  * @param model_identifier
4991  */
4992 #define MESH_SUBEVENT_CONFIGURATION_MODEL_PUBLICATION                                0x41u
4993 
4994 /**
4995  * @format 12124
4996  * @param subevent_code
4997  * @param dest
4998  * @param foundation_status
4999  * @param address
5000  * @param model_identifier
5001  */
5002 #define MESH_SUBEVENT_CONFIGURATION_MODEL_SUBSCRIPTION                               0x42u
5003 
5004 /**
5005  * @format 1214112
5006  * @param subevent_code
5007  * @param dest
5008  * @param foundation_status
5009  * @param model_identifier
5010  * @param num_subscription_addresses
5011  * @param subscription_address_pos
5012  * @param subscription_address_item
5013  */
5014 #define MESH_SUBEVENT_CONFIGURATION_MODEL_SUBSCRIPTION_LIST_ITEM                     0x43u
5015 
5016 
5017 /**
5018  * @format 121
5019  * @param subevent_code
5020  * @param dest
5021  * @param foundation_status
5022  */
5023 #define MESH_SUBEVENT_CONFIGURATION_NETKEY_INDEX                                      0x44u
5024 
5025 /**
5026  * @format 121112
5027  * @param subevent_code
5028  * @param dest
5029  * @param foundation_status
5030  * @param num_netkey_indexes
5031  * @param netkey_index_pos
5032  * @param netkey_index_item
5033  */
5034 #define MESH_SUBEVENT_CONFIGURATION_NETKEY_INDEX_LIST_ITEM                             0x45u
5035 
5036 /**
5037  * @format 12122
5038  * @param subevent_code
5039  * @param dest
5040  * @param foundation_status
5041  * @param netkey_index_item
5042  * @param appkey_index_item
5043  */
5044 #define MESH_SUBEVENT_CONFIGURATION_APPKEY_INDEX                                       0x46u
5045 
5046 /**
5047  * @format 12121122
5048  * @param subevent_code
5049  * @param dest
5050  * @param foundation_status
5051  * @param netkey_index
5052  * @param num_appkey_indexes
5053  * @param appkey_index_pos
5054  * @param netkey_index_item
5055  * @param appkey_index_item
5056  */
5057  #define MESH_SUBEVENT_CONFIGURATION_APPKEY_INDEX_LIST_ITEM                            0x47u
5058 
5059 /**
5060  * @format 12121
5061  * @param subevent_code
5062  * @param dest
5063  * @param foundation_status
5064  * @param netkey_index_item
5065  * @param identity_status
5066  */
5067 #define MESH_SUBEVENT_CONFIGURATION_NODE_IDENTITY                                      0x48u
5068 
5069 /**
5070  * @format 12124
5071  * @param subevent_code
5072  * @param dest
5073  * @param foundation_status
5074  * @param appkey_index
5075  * @param model_identifier
5076  */
5077 #define MESH_SUBEVENT_CONFIGURATION_MODEL_APP                                           0x49u
5078 
5079 /**
5080  * @format 1214112
5081  * @param subevent_code
5082  * @param dest
5083  * @param foundation_status
5084  * @param model_id
5085  * @param num_appkey_indexes
5086  * @param appkey_index_pos
5087  * @param appkey_index_item
5088  */
5089 #define MESH_SUBEVENT_CONFIGURATION_MODEL_APP_LIST_ITEM                                 0x50u
5090 
5091 /**
5092  * @format 121
5093  * @param subevent_code
5094  * @param dest
5095  * @param foundation_status
5096  */
5097 #define MESH_SUBEVENT_CONFIGURATION_NODE_RESET                                          0x51u
5098 
5099 /**
5100  * @format 1211
5101  * @param subevent_code
5102  * @param dest
5103  * @param foundation_status
5104  * @param friend_state
5105  */
5106 #define MESH_SUBEVENT_CONFIGURATION_FRIEND                                              0x52u
5107 
5108 /**
5109  * @format 12121
5110  * @param subevent_code
5111  * @param dest
5112  * @param foundation_status
5113  * @param netkey_index
5114  * @param phase
5115  */
5116 #define MESH_SUBEVENT_CONFIGURATION_KEY_REFRESH_PHASE                                   0x53u
5117 
5118 /**
5119  * @format 121222122
5120  * @param subevent_code
5121  * @param dest
5122  * @param foundation_status
5123  * @param heartbeat_destination
5124  * @param count_S
5125  * @param period_S
5126  * @param ttl
5127  * @param features
5128  * @param netkey_index
5129  */
5130 #define MESH_SUBEVENT_CONFIGURATION_HEARTBEAT_PUBLICATION                               0x54u
5131 
5132 /**
5133  * @format 121222211
5134  * @param subevent_code
5135  * @param dest
5136  * @param foundation_status
5137  * @param heartbeat_destination
5138  * @param heartbeat_source
5139  * @param count_S
5140  * @param period_S
5141  * @param min_hops
5142  * @param max_hops
5143  */
5144 #define MESH_SUBEVENT_CONFIGURATION_HEARTBEAT_SUBSCRIPTION                              0x55u
5145 
5146 /**
5147  * @format 12123
5148  * @param subevent_code
5149  * @param dest
5150  * @param foundation_status
5151  * @param lpn_address
5152  * @param poll_timeout
5153  */
5154 #define MESH_SUBEVENT_CONFIGURATION_LOW_POWER_NODE_POLL_TIMEOUT                         0x56u
5155 
5156 /**
5157  * @format 12112
5158  * @param subevent_code
5159  * @param dest
5160  * @param foundation_status
5161  * @param transmit_count
5162  * @param transmit_interval_steps_ms
5163  */
5164 #define MESH_SUBEVENT_CONFIGURATION_NETWORK_TRANSMIT                                    0x57u
5165 
5166 
5167 #endif
5168