xref: /btstack/src/btstack_defines.h (revision dc01ccc6b23fb84d78b2e6c1f4a02f3559d9bd6a)
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 MATTHIAS
24  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * Please inquire about commercial licensing options at
34  * [email protected]
35  *
36  */
37 
38 /*
39  * btstack-defines.h
40  *
41  * BTstack definitions, events, and error codes */
42 
43 #ifndef __BTSTACK_DEFINES_H
44 #define __BTSTACK_DEFINES_H
45 
46 #include <stdint.h>
47 #include "btstack_linked_list.h"
48 
49 
50 // UNUSED macro
51 #ifndef UNUSED
52 #define UNUSED(x) (void)(sizeof(x))
53 #endif
54 
55 // TYPES
56 
57 // packet handler
58 typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
59 
60 // packet callback supporting multiple registrations
61 typedef struct {
62     btstack_linked_item_t    item;
63     btstack_packet_handler_t callback;
64 } btstack_packet_callback_registration_t;
65 
66 // context callback supporting multiple registrations
67 typedef struct {
68   btstack_linked_item_t * item;
69   void (*callback)(void * context);
70   void * context;
71 } btstack_context_callback_registration_t;
72 
73 /**
74  * @brief 128 bit key used with AES128 in Security Manager
75  */
76 typedef uint8_t sm_key_t[16];
77 
78 // DEFINES
79 
80 // hci con handles (12 bit): 0x0000..0x0fff
81 #define HCI_CON_HANDLE_INVALID 0xffff
82 
83 
84 #define DAEMON_EVENT_PACKET     0x05
85 
86 // L2CAP data
87 #define L2CAP_DATA_PACKET       0x06
88 
89 // RFCOMM data
90 #define RFCOMM_DATA_PACKET      0x07
91 
92 // Attribute protocol data
93 #define ATT_DATA_PACKET         0x08
94 
95 // Security Manager protocol data
96 #define SM_DATA_PACKET          0x09
97 
98 // SDP query result - only used by daemon
99 // format: type (8), record_id (16), attribute_id (16), attribute_length (16), attribute_value (max 1k)
100 #define SDP_CLIENT_PACKET       0x0a
101 
102 // BNEP data
103 #define BNEP_DATA_PACKET        0x0b
104 
105 // Unicast Connectionless Data
106 #define UCD_DATA_PACKET         0x0c
107 
108 // GOEP data
109 #define GOEP_DATA_PACKET        0x0d
110 
111 // PBAP data
112 #define PBAP_DATA_PACKET        0x0e
113 
114 // debug log messages
115 #define LOG_MESSAGE_PACKET      0xfc
116 
117 
118 // ERRORS
119 // last error code in 2.1 is 0x38 - we start with 0x50 for BTstack errors
120 
121 /* ENUM_START: BTSTACK_ERROR_CODE */
122 #define BTSTACK_CONNECTION_TO_BTDAEMON_FAILED              0x50
123 #define BTSTACK_ACTIVATION_FAILED_SYSTEM_BLUETOOTH         0x51
124 #define BTSTACK_ACTIVATION_POWERON_FAILED                  0x52
125 #define BTSTACK_ACTIVATION_FAILED_UNKNOWN                  0x53
126 #define BTSTACK_NOT_ACTIVATED                              0x54
127 #define BTSTACK_BUSY                                       0x55
128 #define BTSTACK_MEMORY_ALLOC_FAILED                        0x56
129 #define BTSTACK_ACL_BUFFERS_FULL                           0x57
130 
131 // l2cap errors - enumeration by the command that created them
132 #define L2CAP_COMMAND_REJECT_REASON_COMMAND_NOT_UNDERSTOOD 0x60
133 #define L2CAP_COMMAND_REJECT_REASON_SIGNALING_MTU_EXCEEDED 0x61
134 #define L2CAP_COMMAND_REJECT_REASON_INVALID_CID_IN_REQUEST 0x62
135 
136 #define L2CAP_CONNECTION_RESPONSE_RESULT_SUCCESSFUL        0x63
137 #define L2CAP_CONNECTION_RESPONSE_RESULT_PENDING           0x64
138 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_PSM       0x65
139 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_SECURITY  0x66
140 #define L2CAP_CONNECTION_RESPONSE_RESULT_REFUSED_RESOURCES 0x67
141 #define L2CAP_CONNECTION_RESPONSE_RESULT_ERTM_NOT_SUPPORTED 0x68
142 // should be L2CAP_CONNECTION_RTX_TIMEOUT
143 #define L2CAP_CONNECTION_RESPONSE_RESULT_RTX_TIMEOUT       0x69
144 #define L2CAP_CONNECTION_BASEBAND_DISCONNECT               0x6A
145 #define L2CAP_SERVICE_ALREADY_REGISTERED                   0x6B
146 #define L2CAP_DATA_LEN_EXCEEDS_REMOTE_MTU                  0x6C
147 #define L2CAP_SERVICE_DOES_NOT_EXIST                       0x6D
148 #define L2CAP_LOCAL_CID_DOES_NOT_EXIST                     0x6E
149 
150 #define RFCOMM_MULTIPLEXER_STOPPED                         0x70
151 #define RFCOMM_CHANNEL_ALREADY_REGISTERED                  0x71
152 #define RFCOMM_NO_OUTGOING_CREDITS                         0x72
153 #define RFCOMM_AGGREGATE_FLOW_OFF                          0x73
154 #define RFCOMM_DATA_LEN_EXCEEDS_MTU                        0x74
155 
156 #define SDP_HANDLE_ALREADY_REGISTERED                      0x80
157 #define SDP_QUERY_INCOMPLETE                               0x81
158 #define SDP_SERVICE_NOT_FOUND                              0x82
159 #define SDP_HANDLE_INVALID                                 0x83
160 #define SDP_QUERY_BUSY                                     0x84
161 
162 #define ATT_HANDLE_VALUE_INDICATION_IN_PROGRESS            0x90
163 #define ATT_HANDLE_VALUE_INDICATION_TIMEOUT                0x91
164 
165 #define GATT_CLIENT_NOT_CONNECTED                          0x93
166 #define GATT_CLIENT_BUSY                                   0x94
167 #define GATT_CLIENT_IN_WRONG_STATE                         0x95
168 #define GATT_CLIENT_DIFFERENT_CONTEXT_FOR_ADDRESS_ALREADY_EXISTS 0x96
169 #define GATT_CLIENT_VALUE_TOO_LONG                         0x97
170 #define GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED 0x98
171 #define GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED   0x99
172 
173 #define BNEP_SERVICE_ALREADY_REGISTERED                    0xA0
174 #define BNEP_CHANNEL_NOT_CONNECTED                         0xA1
175 #define BNEP_DATA_LEN_EXCEEDS_MTU                          0xA2
176 
177 // OBEX ERRORS
178 #define OBEX_UNKNOWN_ERROR                                 0xB0
179 #define OBEX_CONNECT_FAILED                                0xB1
180 #define OBEX_DISCONNECTED                                  0xB2
181 #define OBEX_NOT_FOUND                                     0xB3
182 
183 #define AVDTP_SEID_DOES_NOT_EXIST                          0xC0
184 #define AVDTP_CONNECTION_DOES_NOT_EXIST                    0xC1
185 #define AVDTP_CONNECTION_IN_WRONG_STATE                    0xC2
186 #define AVDTP_STREAM_ENDPOINT_IN_WRONG_STATE               0xC3
187 #define AVDTP_MEDIA_CONNECTION_DOES_NOT_EXIST              0xC4
188 
189 /* ENUM_END */
190 
191 // DAEMON COMMANDS
192 
193 #define OGF_BTSTACK 0x3d
194 
195 // cmds for BTstack
196 // get state: @returns HCI_STATE
197 #define BTSTACK_GET_STATE                                  0x01
198 
199 // set power mode: param HCI_POWER_MODE
200 #define BTSTACK_SET_POWER_MODE                             0x02
201 
202 // set capture mode: param on
203 #define BTSTACK_SET_ACL_CAPTURE_MODE                       0x03
204 
205 // get BTstack version
206 #define BTSTACK_GET_VERSION                                0x04
207 
208 // get system Bluetooth state
209 #define BTSTACK_GET_SYSTEM_BLUETOOTH_ENABLED               0x05
210 
211 // set system Bluetooth state
212 #define BTSTACK_SET_SYSTEM_BLUETOOTH_ENABLED               0x06
213 
214 // enable inquiry scan for this client
215 #define BTSTACK_SET_DISCOVERABLE                           0x07
216 
217 // set global Bluetooth state
218 #define BTSTACK_SET_BLUETOOTH_ENABLED                      0x08
219 
220 // create l2cap channel: param bd_addr(48), psm (16)
221 #define L2CAP_CREATE_CHANNEL                               0x20
222 
223 // disconnect l2cap disconnect, param channel(16), reason(8)
224 #define L2CAP_DISCONNECT                                   0x21
225 
226 // register l2cap service: param psm(16), mtu (16)
227 #define L2CAP_REGISTER_SERVICE                             0x22
228 
229 // unregister l2cap disconnect, param psm(16)
230 #define L2CAP_UNREGISTER_SERVICE                           0x23
231 
232 // accept connection param bd_addr(48), dest cid (16)
233 #define L2CAP_ACCEPT_CONNECTION                            0x24
234 
235 // decline l2cap disconnect,param bd_addr(48), dest cid (16), reason(8)
236 #define L2CAP_DECLINE_CONNECTION                           0x25
237 
238 // create l2cap channel: param bd_addr(48), psm (16), mtu (16)
239 #define L2CAP_CREATE_CHANNEL_MTU                           0x26
240 
241 // register SDP Service Record: service record (size)
242 #define SDP_REGISTER_SERVICE_RECORD                        0x30
243 
244 // unregister SDP Service Record
245 #define SDP_UNREGISTER_SERVICE_RECORD                      0x31
246 
247 // Get remote RFCOMM services
248 #define SDP_CLIENT_QUERY_RFCOMM_SERVICES                   0x32
249 
250 // Get remote SDP services
251 #define SDP_CLIENT_QUERY_SERVICES                          0x33
252 
253 // RFCOMM "HCI" Commands
254 #define RFCOMM_CREATE_CHANNEL       0x40
255 #define RFCOMM_DISCONNECT     0x41
256 #define RFCOMM_REGISTER_SERVICE     0x42
257 #define RFCOMM_UNREGISTER_SERVICE   0x43
258 #define RFCOMM_ACCEPT_CONNECTION    0x44
259 #define RFCOMM_DECLINE_CONNECTION   0x45
260 #define RFCOMM_PERSISTENT_CHANNEL   0x46
261 #define RFCOMM_CREATE_CHANNEL_WITH_CREDITS   0x47
262 #define RFCOMM_REGISTER_SERVICE_WITH_CREDITS 0x48
263 #define RFCOMM_GRANT_CREDITS                 0x49
264 
265 // GAP Classic 0x50
266 #define GAP_DISCONNECT              0x50
267 
268 // GAP LE      0x60
269 #define GAP_LE_SCAN_START           0x60
270 #define GAP_LE_SCAN_STOP            0x61
271 #define GAP_LE_CONNECT              0x62
272 #define GAP_LE_CONNECT_CANCEL       0x63
273 #define GAP_LE_SET_SCAN_PARAMETERS  0x64
274 
275 // GATT (Client) 0x70
276 #define GATT_DISCOVER_ALL_PRIMARY_SERVICES                       0x70
277 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID16                 0x71
278 #define GATT_DISCOVER_PRIMARY_SERVICES_BY_UUID128                0x72
279 #define GATT_FIND_INCLUDED_SERVICES_FOR_SERVICE                  0x73
280 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE                0x74
281 #define GATT_DISCOVER_CHARACTERISTICS_FOR_SERVICE_BY_UUID128     0x75
282 #define GATT_DISCOVER_CHARACTERISTIC_DESCRIPTORS                 0x76
283 #define GATT_READ_VALUE_OF_CHARACTERISTIC                        0x77
284 #define GATT_READ_LONG_VALUE_OF_CHARACTERISTIC                   0x78
285 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC_WITHOUT_RESPONSE      0x79
286 #define GATT_WRITE_VALUE_OF_CHARACTERISTIC                       0x7A
287 #define GATT_WRITE_LONG_VALUE_OF_CHARACTERISTIC                  0x7B
288 #define GATT_RELIABLE_WRITE_LONG_VALUE_OF_CHARACTERISTIC         0x7C
289 #define GATT_READ_CHARACTERISTIC_DESCRIPTOR                      0X7D
290 #define GATT_READ_LONG_CHARACTERISTIC_DESCRIPTOR                 0X7E
291 #define GATT_WRITE_CHARACTERISTIC_DESCRIPTOR                     0X7F
292 #define GATT_WRITE_LONG_CHARACTERISTIC_DESCRIPTOR                0X80
293 #define GATT_WRITE_CLIENT_CHARACTERISTIC_CONFIGURATION           0X81
294 #define GATT_GET_MTU                                             0x82
295 
296 // ATT
297 
298 // ..
299 // Internal properties reuse some GATT Characteristic Properties fields
300 #define ATT_DB_FLAGS_READ_WITHOUT_AUTHENTICATION 0x0001
301 
302 
303 // EVENTS
304 
305 /**
306  * @format 1
307  * @param state
308  */
309 #define BTSTACK_EVENT_STATE                                0x60
310 
311 /**
312  * @format 1
313  * @param number_connections
314  */
315 #define BTSTACK_EVENT_NR_CONNECTIONS_CHANGED               0x61
316 
317 /**
318  * @format
319  */
320 #define BTSTACK_EVENT_POWERON_FAILED                       0x62
321 
322 /**
323  * @format 1
324  * @param discoverable
325  */
326 #define BTSTACK_EVENT_DISCOVERABLE_ENABLED                 0x66
327 
328 // Daemon Events
329 
330 /**
331  * @format 112
332  * @param major
333  * @param minor
334  @ @param revision
335  */
336 #define DAEMON_EVENT_VERSION                               0x63
337 
338 // data: system bluetooth on/off (bool)
339 /**
340  * @format 1
341  * param system_bluetooth_enabled
342  */
343 #define DAEMON_EVENT_SYSTEM_BLUETOOTH_ENABLED              0x64
344 
345 // data: event (8), len(8), status (8) == 0, address (48), name (1984 bits = 248 bytes)
346 
347 /*
348  * @format 1BT
349  * @param status == 0 to match read_remote_name_request
350  * @param address
351  * @param name
352  */
353 #define DAEMON_EVENT_REMOTE_NAME_CACHED                    0x65
354 
355 // internal - data: event(8)
356 #define DAEMON_EVENT_CONNECTION_OPENED                     0x67
357 
358 // internal - data: event(8)
359 #define DAEMON_EVENT_CONNECTION_CLOSED                     0x68
360 
361 // data: event(8), len(8), local_cid(16), credits(8)
362 #define DAEMON_EVENT_L2CAP_CREDITS                         0x74
363 
364 /**
365  * @format 12
366  * @param status
367  * @param psm
368  */
369 #define DAEMON_EVENT_L2CAP_SERVICE_REGISTERED              0x75
370 
371 /**
372  * @format 21
373  * @param rfcomm_cid
374  * @param credits
375  */
376 #define DAEMON_EVENT_RFCOMM_CREDITS                        0x84
377 
378 /**
379  * @format 11
380  * @param status
381  * @param channel_id
382  */
383 #define DAEMON_EVENT_RFCOMM_SERVICE_REGISTERED             0x85
384 
385 /**
386  * @format 11
387  * @param status
388  * @param server_channel_id
389  */
390 #define DAEMON_EVENT_RFCOMM_PERSISTENT_CHANNEL             0x86
391 
392 /**
393   * @format 14
394   * @param status
395   * @param service_record_handle
396   */
397 #define DAEMON_EVENT_SDP_SERVICE_REGISTERED                0x90
398 
399 
400 
401 // additional HCI events
402 
403 /**
404  * @brief Indicates HCI transport enters/exits Sleep mode
405  * @format 1
406  * @param active
407  */
408 #define HCI_EVENT_TRANSPORT_SLEEP_MODE                     0x69
409 
410 /**
411  * @brief Outgoing packet
412  */
413 #define HCI_EVENT_TRANSPORT_PACKET_SENT                    0x6E
414 
415 /**
416  * @format B
417  * @param handle
418  */
419 #define HCI_EVENT_SCO_CAN_SEND_NOW                         0x6F
420 
421 
422 // L2CAP EVENTS
423 
424 /**
425  * @format 1BH2222221
426  * @param status
427  * @param address
428  * @param handle
429  * @param psm
430  * @param local_cid
431  * @param remote_cid
432  * @param local_mtu
433  * @param remote_mtu
434  * @param flush_timeout
435  * @param incoming
436  */
437 #define L2CAP_EVENT_CHANNEL_OPENED                         0x70
438 
439 /*
440  * @format 2
441  * @param local_cid
442  */
443 #define L2CAP_EVENT_CHANNEL_CLOSED                         0x71
444 
445 /**
446  * @format BH222
447  * @param address
448  * @param handle
449  * @param psm
450  * @param local_cid
451  * @param remote_cid
452  */
453 #define L2CAP_EVENT_INCOMING_CONNECTION                    0x72
454 
455 // ??
456 // data: event(8), len(8), handle(16)
457 #define L2CAP_EVENT_TIMEOUT_CHECK                          0x73
458 
459 /**
460  * @format H2222
461  * @param handle
462  * @param interval_min
463  * @param interval_max
464  * @param latencey
465  * @param timeout_multiplier
466  */
467 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST    0x76
468 
469 // data: event(8), len(8), handle(16), result (16) (0 == ok, 1 == fail)
470  /**
471   * @format H2
472   * @param handle
473   * @param result
474   */
475 #define L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE   0x77
476 
477 /**
478  * @format 2
479  * @param local_cid
480  */
481 #define L2CAP_EVENT_CAN_SEND_NOW                           0x78
482 
483 // LE Data Channels
484 
485 /**
486  * @format 1BH2222
487  * @param address_type
488  * @param address
489  * @param handle
490  * @param psm
491  * @param local_cid
492  * @param remote_cid
493  * @param remote_mtu
494  */
495 #define L2CAP_EVENT_LE_INCOMING_CONNECTION                 0x79
496 
497 /**
498  * @format 11BH122222
499  * @param status
500  * @param address_type
501  * @param address
502  * @param handle
503  * @param incoming
504  * @param psm
505  * @param local_cid
506  * @param remote_cid
507  * @param local_mtu
508  * @param remote_mtu
509  */
510 #define L2CAP_EVENT_LE_CHANNEL_OPENED                      0x7a
511 
512 /*
513  * @format 2
514  * @param local_cid
515  */
516 #define L2CAP_EVENT_LE_CHANNEL_CLOSED                      0x7b
517 
518 /*
519  * @format 2
520  * @param local_cid
521  */
522 #define L2CAP_EVENT_LE_CAN_SEND_NOW                        0x7c
523 
524 /*
525  * @format 2
526  * @param local_cid
527  */
528 #define L2CAP_EVENT_LE_PACKET_SENT                         0x7d
529 
530 
531 // RFCOMM EVENTS
532 
533 /**
534  * @format 1B21221
535  * @param status
536  * @param bd_addr
537  * @param con_handle
538  * @param server_channel
539  * @param rfcomm_cid
540  * @param max_frame_size
541  * @param incoming
542  */
543 #define RFCOMM_EVENT_CHANNEL_OPENED                        0x80
544 
545 /**
546  * @format 2
547  * @param rfcomm_cid
548  */
549 #define RFCOMM_EVENT_CHANNEL_CLOSED                        0x81
550 
551 /**
552  * @format B12
553  * @param bd_addr
554  * @param server_channel
555  * @param rfcomm_cid
556  */
557 #define RFCOMM_EVENT_INCOMING_CONNECTION                   0x82
558 
559 /**
560  * @format 21
561  * @param rfcomm_cid
562  * @param line_status
563  */
564 #define RFCOMM_EVENT_REMOTE_LINE_STATUS                    0x83
565 
566 /**
567  * @format 21
568  * @param rfcomm_cid
569  * @param modem_status
570  */
571 #define RFCOMM_EVENT_REMOTE_MODEM_STATUS                   0x87
572 
573  /**
574   * TODO: format for variable data 2?
575   * param rfcomm_cid
576   * param rpn_data
577   */
578 #define RFCOMM_EVENT_PORT_CONFIGURATION                    0x88
579 
580 /**
581  * @format 2
582  * @param rfcomm_cid
583  */
584 #define RFCOMM_EVENT_CAN_SEND_NOW                          0x89
585 
586 
587 /**
588  * @format 1
589  * @param status
590  */
591 #define SDP_EVENT_QUERY_COMPLETE                                 0x91
592 
593 /**
594  * @format 1T
595  * @param rfcomm_channel
596  * @param name
597  */
598 #define SDP_EVENT_QUERY_RFCOMM_SERVICE                           0x92
599 
600 /**
601  * @format 22221
602  * @param record_id
603  * @param attribute_id
604  * @param attribute_length
605  * @param data_offset
606  * @param data
607  */
608 #define SDP_EVENT_QUERY_ATTRIBUTE_BYTE                           0x93
609 
610 /**
611  * @format 22LV
612  * @param record_id
613  * @param attribute_id
614  * @param attribute_length
615  * @param attribute_value
616  */
617 #define SDP_EVENT_QUERY_ATTRIBUTE_VALUE                          0x94
618 
619 /**
620  * @format 224
621  * @param total_count
622  * @param record_index
623  * @param record_handle
624  * @note Not provided by daemon, only used for internal testing
625  */
626 #define SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE                    0x95
627 
628 /**
629  * @format H1
630  * @param handle
631  * @param status
632  */
633 #define GATT_EVENT_QUERY_COMPLETE                                0xA0
634 
635 /**
636  * @format HX
637  * @param handle
638  * @param service
639  */
640 #define GATT_EVENT_SERVICE_QUERY_RESULT                          0xA1
641 
642 /**
643  * @format HY
644  * @param handle
645  * @param characteristic
646  */
647 #define GATT_EVENT_CHARACTERISTIC_QUERY_RESULT                   0xA2
648 
649 /**
650  * @format H2X
651  * @param handle
652  * @param include_handle
653  * @param service
654  */
655 #define GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT                 0xA3
656 
657 /**
658  * @format HZ
659  * @param handle
660  * @param characteristic_descriptor
661  */
662 #define GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT   0xA4
663 
664 /**
665  * @format H2LV
666  * @param handle
667  * @param value_handle
668  * @param value_length
669  * @param value
670  */
671 #define GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT             0xA5
672 
673 /**
674  * @format H22LV
675  * @param handle
676  * @param value_handle
677  * @param value_offset
678  * @param value_length
679  * @param value
680  */
681 #define GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT        0xA6
682 
683 /**
684  * @format H2LV
685  * @param handle
686  * @param value_handle
687  * @param value_length
688  * @param value
689  */
690 #define GATT_EVENT_NOTIFICATION                                  0xA7
691 
692 /**
693  * @format H2LV
694  * @param handle
695  * @param value_handle
696  * @param value_length
697  * @param value
698  */
699 #define GATT_EVENT_INDICATION                                    0xA8
700 
701 /**
702  * @format H2LV
703  * @param handle
704  * @param descriptor_handle
705  * @param descriptor_length
706  * @param descriptor
707  */
708 #define GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT        0xA9
709 
710 /**
711  * @format H2LV
712  * @param handle
713  * @param descriptor_offset
714  * @param descriptor_length
715  * @param descriptor
716  */
717 #define GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT   0xAA
718 
719 /**
720  * @format H2
721  * @param handle
722  * @param MTU
723  */
724 #define GATT_EVENT_MTU                                           0xAB
725 
726 /**
727  * @format H2
728  * @param handle
729  * @param MTU
730  */
731 #define ATT_EVENT_MTU_EXCHANGE_COMPLETE                          0xB5
732 
733  /**
734   * @format 1H2
735   * @param status
736   * @param conn_handle
737   * @param attribute_handle
738   */
739 #define ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE               0xB6
740 
741 /**
742  * @format
743  */
744 #define ATT_EVENT_CAN_SEND_NOW                                   0xB7
745 
746 // TODO: daemon only event
747 
748 /**
749  * @format 12
750  * @param status
751  * @param service_uuid
752  */
753  #define BNEP_EVENT_SERVICE_REGISTERED                      0xC0
754 
755 /**
756  * @format 12222B
757  * @param status
758  * @param bnep_cid
759  * @param source_uuid
760  * @param destination_uuid
761  * @param mtu
762  * @param remote_address
763  */
764  #define BNEP_EVENT_CHANNEL_OPENED                   0xC1
765 
766 /**
767  * @format 222B
768  * @param bnep_cid
769  * @param source_uuid
770  * @param destination_uuid
771  * @param remote_address
772  */
773  #define BNEP_EVENT_CHANNEL_CLOSED                          0xC2
774 
775 /**
776  * @format 222B1
777  * @param bnep_cid
778  * @param source_uuid
779  * @param destination_uuid
780  * @param remote_address
781  * @param channel_state
782  */
783 #define BNEP_EVENT_CHANNEL_TIMEOUT                         0xC3
784 
785 /**
786  * @format 222B
787  * @param bnep_cid
788  * @param source_uuid
789  * @param destination_uuid
790  * @param remote_address
791  */
792  #define BNEP_EVENT_CAN_SEND_NOW                           0xC4
793 
794  /**
795   * @format H1B
796   * @param handle
797   * @param addr_type
798   * @param address
799   */
800 #define SM_EVENT_JUST_WORKS_REQUEST                              0xD0
801 
802  /**
803   * @format H1B
804   * @param handle
805   * @param addr_type
806   * @param address
807   */
808 #define SM_EVENT_JUST_WORKS_CANCEL                               0xD1
809 
810  /**
811   * @format H1B4
812   * @param handle
813   * @param addr_type
814   * @param address
815   * @param passkey
816   */
817 #define SM_EVENT_PASSKEY_DISPLAY_NUMBER                          0xD2
818 
819  /**
820   * @format H1B
821   * @param handle
822   * @param addr_type
823   * @param address
824   */
825 #define SM_EVENT_PASSKEY_DISPLAY_CANCEL                          0xD3
826 
827  /**
828   * @format H1B
829   * @param handle
830   * @param addr_type
831   * @param address
832   */
833 #define SM_EVENT_PASSKEY_INPUT_NUMBER                            0xD4
834 
835  /**
836   * @format H1B
837   * @param handle
838   * @param addr_type
839   * @param address
840   */
841 #define SM_EVENT_PASSKEY_INPUT_CANCEL                            0xD5
842 
843  /**
844   * @format H1B4
845   * @param handle
846   * @param addr_type
847   * @param address
848   * @param passkey
849   */
850 #define SM_EVENT_NUMERIC_COMPARISON_REQUEST                      0xD6
851 
852  /**
853   * @format H1B
854   * @param handle
855   * @param addr_type
856   * @param address
857   */
858 #define SM_EVENT_NUMERIC_COMPARISON_CANCEL                       0xD7
859 
860  /**
861   * @format H1B
862   * @param handle
863   * @param addr_type
864   * @param address
865   */
866 #define SM_EVENT_IDENTITY_RESOLVING_STARTED                      0xD8
867 
868  /**
869   * @format H1B
870   * @param handle
871   * @param addr_type
872   * @param address
873   */
874 #define SM_EVENT_IDENTITY_RESOLVING_FAILED                       0xD9
875 
876  /**
877   * @brief Identify resolving succeeded
878   *
879   * @format H1B1B2
880   * @param handle
881   * @param addr_type
882   * @param address
883   * @param identity_addr_type
884   * @param identity_address
885   * @param index_internal
886   *
887   */
888 #define SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED                    0xDA
889 
890  /**
891   * @format H1B
892   * @param handle
893   * @param addr_type
894   * @param address
895   */
896 #define SM_EVENT_AUTHORIZATION_REQUEST                           0xDB
897 
898  /**
899   * @format H1B1
900   * @param handle
901   * @param addr_type
902   * @param address
903   * @param authorization_result
904   */
905 #define SM_EVENT_AUTHORIZATION_RESULT                            0xDC
906 
907  /**
908   * @format H1
909   * @param handle
910   * @param action see SM_KEYPRESS_*
911   */
912 #define SM_EVENT_KEYPRESS_NOTIFICATION                           0xDD
913 
914  /**
915   * @brief Emitted during pairing to inform app about address used as identity
916   *
917   * @format H1B1B
918   * @param handle
919   * @param addr_type
920   * @param address
921   * @param identity_addr_type
922   * @param identity_address
923   */
924 #define SM_EVENT_IDENTITY_CREATED                                0xDE
925 
926 // GAP
927 
928 /**
929  * @format H1
930  * @param handle
931  * @param security_level
932  */
933 #define GAP_EVENT_SECURITY_LEVEL                                 0xE0
934 
935 /**
936  * @format 1B
937  * @param status
938  * @param address
939  */
940 #define GAP_EVENT_DEDICATED_BONDING_COMPLETED                    0xE1
941 
942 /**
943  * @format 11B1JV
944  * @param advertising_event_type
945  * @param address_type
946  * @param address
947  * @param rssi
948  * @param data_length
949  * @param data
950  */
951 #define GAP_EVENT_ADVERTISING_REPORT                          0xE2
952 
953  /**
954  * @format B132111JV
955  * @param bd_addr
956  * @param page_scan_repetition_mode
957  * @param class_of_device
958  * @param clock_offset
959  * @param rssi_available
960  * @param rssi
961  * @param name_available
962  * @param name_len
963  * @param name
964  */
965 #define GAP_EVENT_INQUIRY_RESULT                              0xE3
966 
967 /**
968  * @format 1
969  * @param status
970  */
971 #define GAP_EVENT_INQUIRY_COMPLETE                            0xE4
972 
973 
974 // Meta Events, see below for sub events
975 #define HCI_EVENT_HSP_META                                 0xE8
976 #define HCI_EVENT_HFP_META                                 0xE9
977 #define HCI_EVENT_ANCS_META                                0xEA
978 #define HCI_EVENT_AVDTP_META                               0xEB
979 #define HCI_EVENT_AVRCP_META                               0xEC
980 #define HCI_EVENT_GOEP_META                                0xED
981 #define HCI_EVENT_PBAP_META                                0xEE
982 #define HCI_EVENT_HID_META                                 0xEF
983 #define HCI_EVENT_A2DP_META                                0xF0
984 #define HCI_EVENT_HIDS_META                                0xF1
985 
986 // Potential other meta groups
987 // #define HCI_EVENT_BNEP_META                                0xxx
988 // #define HCI_EVENT_GAP_META                                 0xxx
989 // #define HCI_EVENT_GATT_META                                0xxx
990 // #define HCI_EVENT_PAN_META                                 0xxx
991 // #define HCI_EVENT_SDP_META                                 0xxx
992 // #define HCI_EVENT_SM_META                                  0xxx
993 
994 
995 /** HSP Subevent */
996 
997 /**
998  * @format 11
999  * @param subevent_code
1000  * @param status 0 == OK
1001  */
1002 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE             0x01
1003 
1004 /**
1005  * @format 11
1006  * @param subevent_code
1007  * @param status 0 == OK
1008  */
1009 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE           0x02
1010 
1011 
1012 /**
1013  * @format 11H
1014  * @param subevent_code
1015  * @param status 0 == OK
1016  * @param handle
1017  */
1018 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE             0x03
1019 
1020 /**
1021  * @format 11
1022  * @param subevent_code
1023  * @param status 0 == OK
1024  */
1025 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE          0x04
1026 
1027 /**
1028  * @format 1
1029  * @param subevent_code
1030  */
1031 #define HSP_SUBEVENT_RING                                  0x05
1032 
1033 /**
1034  * @format 11
1035  * @param subevent_code
1036  * @param gain Valid range: [0,15]
1037  */
1038 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED               0x06
1039 
1040 /**
1041  * @format 11
1042  * @param subevent_code
1043  * @param gain Valid range: [0,15]
1044  */
1045 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED                  0x07
1046 
1047 /**
1048  * @format 1JV
1049  * @param subevent_code
1050  * @param value_length
1051  * @param value
1052  */
1053 #define HSP_SUBEVENT_HS_COMMAND                            0x08
1054 
1055 /**
1056  * @format 1JV
1057  * @param subevent_code
1058  * @param value_length
1059  * @param value
1060  */
1061 #define HSP_SUBEVENT_AG_INDICATION                         0x09
1062 
1063 
1064 /** HFP Subevent */
1065 
1066 /**
1067  * @format 11HB
1068  * @param subevent_code
1069  * @param status 0 == OK
1070  * @param con_handle
1071  * @param bd_addr
1072  */
1073 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED  0x01
1074 
1075 /**
1076  * @format 1
1077  * @param subevent_code
1078  */
1079 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED     0x02
1080 
1081 /**
1082  * @format 11HB1
1083  * @param subevent_code
1084  * @param status 0 == OK
1085  * @param handle
1086  * @param bd_addr
1087  * @param negotiated_codec
1088  */
1089 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED          0x03
1090 
1091 /**
1092  * @format 1
1093  * @param subevent_code
1094  */
1095 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED             0x04
1096 
1097 /**
1098  * @format 11
1099  * @param subevent_code
1100  * @param status 0 == OK
1101  */
1102 #define HFP_SUBEVENT_COMPLETE                              0x05
1103 
1104 /**
1105  * @format 111T
1106  * @param subevent_code
1107  * @param indicator_index
1108  * @param indicator_status
1109  * @param indicator_name
1110  */
1111 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED           0x06
1112 
1113 /**
1114  * @format 111T
1115  * @param subevent_code
1116  * @param network_operator_mode
1117  * @param network_operator_format
1118  * @param network_operator_name
1119  */
1120 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED              0x07
1121 
1122 /**
1123  * @format 11
1124  * @param subevent_code
1125  * @param error
1126  */
1127 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR             0x08
1128 
1129 /**
1130  * @format 1
1131  * @param subevent_code
1132  */
1133 #define HFP_SUBEVENT_START_RINGINIG                           0x0A
1134 
1135 /**
1136  * @format 1
1137  * @param subevent_code
1138  */
1139 #define HFP_SUBEVENT_STOP_RINGINIG                            0x0B
1140 
1141 /**
1142  * @format 1
1143  * @param subevent_code
1144  */
1145 #define HFP_SUBEVENT_CALL_TERMINATED                          0x0C
1146 
1147 /**
1148  * @format 1T
1149  * @param subevent_code
1150  * @param number
1151  */
1152 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER                   0x0D
1153 
1154 /**
1155  * @format 1
1156  * @param subevent_code
1157  */
1158 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG               0x0E
1159 
1160 /**
1161  * @format 1T
1162  * @param subevent_code
1163  * @param number
1164  */
1165 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG                     0x0F
1166 
1167 /**
1168  * @format 1T
1169  * @param subevent_code
1170  * @param dtmf code
1171  */
1172 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES                      0x10
1173 
1174 /**
1175  * @format 1
1176  * @param subevent_code
1177  */
1178  #define HFP_SUBEVENT_CALL_ANSWERED                            0x11
1179 
1180 /**
1181  * @format 1
1182  * @param subevent_code
1183  */
1184 #define HFP_SUBEVENT_CONFERENCE_CALL                          0x12
1185 
1186 /**
1187  * @format 1
1188  * @param subevent_code
1189  */
1190 #define HFP_SUBEVENT_RING                                     0x13
1191 
1192 /**
1193  * @format 111
1194  * @param subevent_code
1195  * @param status
1196  * @param gain
1197  */
1198  #define HFP_SUBEVENT_SPEAKER_VOLUME                           0x14
1199 
1200 /**
1201  * @format 111
1202  * @param subevent_code
1203  * @param status
1204  * @param gain
1205  */
1206 #define HFP_SUBEVENT_MICROPHONE_VOLUME                        0x15
1207 
1208 /**
1209  * @format 11T
1210  * @param subevent_code
1211  * @param type
1212  * @param number
1213  */
1214 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION                0x16
1215 
1216 /**
1217  * @format 11T
1218  * @param subevent_code
1219  * @param type
1220  * @param number
1221  */
1222 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17
1223 
1224 /**
1225  * @format 111111T
1226  * @param subevent_code
1227  * @param clcc_idx
1228  * @param clcc_dir
1229  * @param clcc_status
1230  * @param clcc_mpty
1231  * @param bnip_type
1232  * @param bnip_number
1233  */
1234 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS                     0x18
1235 
1236 /**
1237  * @format 111T
1238  * @param subevent_code
1239  * @param status
1240  * @param bnip_type
1241  * @param bnip_number
1242  */
1243  #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION            0x19
1244 
1245 /**
1246  * @format 1T
1247  * @param subevent_code
1248  * @param value
1249  */
1250 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS                 0x1A
1251 
1252 // ANCS Client
1253 
1254 /**
1255  * @format 1H
1256  * @param subevent_code
1257  * @param handle
1258  */
1259 #define ANCS_SUBEVENT_CLIENT_CONNECTED                              0xF0
1260 
1261 /**
1262  * @format 1H2T
1263  * @param subevent_code
1264  * @param handle
1265  * @param attribute_id
1266  * @param text
1267  */
1268 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION                           0xF1
1269 
1270 /**
1271  * @format 1H
1272  * @param subevent_code
1273  * @param handle
1274  */
1275 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED                           0xF2
1276 
1277 
1278 /** AVDTP Subevent */
1279 
1280 /**
1281  * @format 1211
1282  * @param subevent_code
1283  * @param avdtp_cid
1284  * @param local_seid
1285  * @param signal_identifier
1286  */
1287 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT                     0x01
1288 
1289 /**
1290  * @format 1211
1291  * @param subevent_code
1292  * @param avdtp_cid
1293  * @param local_seid
1294  * @param signal_identifier
1295  */
1296 #define AVDTP_SUBEVENT_SIGNALING_REJECT                     0x02
1297 
1298 /**
1299  * @format 1211
1300  * @param subevent_code
1301  * @param avdtp_cid
1302  * @param local_seid
1303  * @param signal_identifier
1304  */
1305 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT             0x03
1306 
1307 /**
1308  * @format 12B1
1309  * @param subevent_code
1310  * @param avdtp_cid
1311  * @param bd_addr
1312  * @param status 0 == OK
1313  */
1314 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED     0x04
1315 
1316 /**
1317  * @format 12
1318  * @param subevent_code
1319  * @param avdtp_cid
1320  */
1321 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED        0x05
1322 
1323 /**
1324  * @format 121111
1325  * @param subevent_code
1326  * @param avdtp_cid
1327  * @param remote_seid        0x01 – 0x3E
1328  * @param in_use      0-not in use, 1-in use
1329  * @param media_type  0-audio, 1-video, 2-multimedia
1330  * @param sep_type    0-source, 1-sink
1331  */
1332 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND                  0x06
1333 
1334 /**
1335  * @format 121111111111
1336  * @param subevent_code
1337  * @param avdtp_cid
1338  * @param local_seid
1339  * @param remote_seid
1340  * @param media_type
1341  * @param sampling_frequency_bitmap
1342  * @param channel_mode_bitmap
1343  * @param block_length_bitmap
1344  * @param subbands_bitmap
1345  * @param allocation_method_bitmap
1346  * @param min_bitpool_value
1347  * @param max_bitpool_value
1348  */
1349 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY          0x07
1350 
1351 /**
1352  * @format 121112LV
1353  * @param subevent_code
1354  * @param avdtp_cid
1355  * @param local_seid
1356  * @param remote_seid
1357  * @param media_type
1358  * @param media_codec_type
1359  * @param media_codec_information_len
1360  * @param media_codec_information
1361  */
1362 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY        0x08
1363 
1364 /**
1365  * @format 12111121111111
1366  * @param subevent_code
1367  * @param avdtp_cid
1368  * @param local_seid
1369  * @param remote_seid
1370  * @param reconfigure
1371  * @param media_type
1372  * @param sampling_frequency
1373  * @param channel_mode
1374  * @param num_channels
1375  * @param block_length
1376  * @param subbands
1377  * @param allocation_method
1378  * @param min_bitpool_value
1379  * @param max_bitpool_value
1380  */
1381 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION        0x09
1382 
1383 /**
1384  * @format 1211112LV
1385  * @param subevent_code
1386  * @param avdtp_cid
1387  * @param local_seid
1388  * @param remote_seid
1389  * @param reconfigure
1390  * @param media_type
1391  * @param media_codec_type
1392  * @param media_codec_information_len
1393  * @param media_codec_information
1394  */
1395 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION        0x0A
1396 
1397 /**
1398  * @format 12B111
1399  * @param subevent_code
1400  * @param avdtp_cid
1401  * @param bd_addr
1402  * @param local_seid
1403  * @param remote_seid
1404  * @param status 0 == OK
1405  */
1406 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED     0x0B
1407 
1408 /**
1409  * @format 121
1410  * @param subevent_code
1411  * @param avdtp_cid
1412  * @param local_seid
1413  */
1414 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED        0x0C
1415 
1416 /**
1417  * @format 1212
1418  * @param subevent_code
1419  * @param avdtp_cid
1420  * @param local_seid
1421  * @param sequence_number
1422  */
1423 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW   0x0D
1424 
1425 
1426 /** A2DP Subevent */
1427 /* Stream goes through following states:
1428  * - OPEN         - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event
1429  * - START        - indicated with A2DP_SUBEVENT_STREAM_STARTED event
1430  * - SUSPEND      - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event
1431  * - ABORT/STOP   - indicated with A2DP_SUBEVENT_STREAM_RELEASED event
1432 
1433  OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started.
1434  START can come only after the stream is OPENED, and indicates that media transfer is started.
1435  SUSPEND is optional, it pauses the stream.
1436  */
1437 
1438 /**
1439  * @format 121            Sent only by A2DP source.
1440  * @param subevent_code
1441  * @param a2dp_cid
1442  * @param local_seid
1443  */
1444 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW         0x01
1445 
1446 /**
1447  * @format 12111121111111
1448  * @param subevent_code
1449  * @param a2dp_cid
1450  * @param int_seid
1451  * @param acp_seid
1452  * @param reconfigure
1453  * @param media_type
1454  * @param sampling_frequency
1455  * @param channel_mode
1456  * @param num_channels
1457  * @param block_length
1458  * @param subbands
1459  * @param allocation_method
1460  * @param min_bitpool_value
1461  * @param max_bitpool_value
1462  */
1463 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION      0x02
1464 
1465 /**
1466  * @format 1211112LV
1467  * @param subevent_code
1468  * @param a2dp_cid
1469  * @param int_seid
1470  * @param acp_seid
1471  * @param reconfigure
1472  * @param media_type
1473  * @param media_codec_type
1474  * @param media_codec_information_len
1475  * @param media_codec_information
1476  */
1477 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION    0x03
1478 
1479 /**
1480  * @format 12B111          Stream is opened byt not started.
1481  * @param subevent_code
1482  * @param a2dp_cid
1483  * @param bd_addr
1484  * @param local_seid
1485  * @param remote_seid
1486  * @param status
1487  */
1488 #define A2DP_SUBEVENT_STREAM_ESTABLISHED                           0x04
1489 
1490 /**
1491  * @format 121            Indicates that media transfer is started.
1492  * @param subevent_code
1493  * @param a2dp_cid
1494  * @param local_seid
1495  */
1496 #define A2DP_SUBEVENT_STREAM_STARTED                               0x05
1497 
1498 /**
1499  * @format 121           Stream is paused.
1500  * @param subevent_code
1501  * @param a2dp_cid
1502  * @param local_seid
1503  */
1504 #define A2DP_SUBEVENT_STREAM_SUSPENDED                              0x06
1505 
1506 /**
1507  * @format 121           Stream is stoped or aborted.
1508  * @param subevent_code
1509  * @param a2dp_cid
1510  * @param local_seid
1511  */
1512 #define A2DP_SUBEVENT_STREAM_STOPPED                                0x07
1513 
1514 /**
1515  * @format 121            Stream is released.
1516  * @param subevent_code
1517  * @param a2dp_cid
1518  * @param local_seid
1519  */
1520 #define A2DP_SUBEVENT_STREAM_RELEASED                               0x08
1521 
1522 /**
1523  * @format 1211
1524  * @param subevent_code
1525  * @param a2dp_cid
1526  * @param local_seid
1527  * @param signal_identifier
1528  */
1529 #define A2DP_SUBEVENT_COMMAND_ACCEPTED                              0x09
1530 
1531 /**
1532  * @format 1211
1533  * @param subevent_code
1534  * @param a2dp_cid
1535  * @param local_seid
1536  * @param signal_identifier
1537  */
1538 #define A2DP_SUBEVENT_COMMAND_REJECTED                              0x0A
1539 
1540 /**
1541  * @format 12B          Signaling channel is opened.
1542  * @param subevent_code
1543  * @param a2dp_cid
1544  * @param bd_addr
1545  */
1546 #define A2DP_SUBEVENT_INCOMING_CONNECTION_ESTABLISHED               0x0B
1547 
1548 /**
1549  * @format 12            Signaling channel is released.
1550  * @param subevent_code
1551  * @param a2dp_cid
1552  */
1553 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED                  0x0C
1554 
1555 
1556 /** AVRCP Subevent */
1557 
1558 /**
1559  * @format 11B2
1560  * @param subevent_code
1561  * @param status 0 == OK
1562  * @param bd_addr
1563  * @param avrcp_cid
1564  */
1565 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED                           0x01
1566 
1567 /**
1568  * @format 12
1569  * @param subevent_code
1570  * @param avrcp_cid
1571  */
1572 #define AVRCP_SUBEVENT_CONNECTION_RELEASED                              0x02
1573 
1574 /**
1575  * @format 12111
1576  * @param subevent_code
1577  * @param avrcp_cid
1578  * @param command_type
1579  * @param repeat_mode
1580  * @param shuffle_mode
1581  */
1582 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE                          0x03
1583 
1584 /**
1585  * @format 121441
1586  * @param subevent_code
1587  * @param avrcp_cid
1588  * @param command_type
1589  * @param song_length
1590  * @param song_position
1591  * @param play_status
1592  */
1593  #define AVRCP_SUBEVENT_PLAY_STATUS                                     0x04
1594 
1595 /**
1596  * @format 1211
1597  * @param subevent_code
1598  * @param avrcp_cid
1599  * @param command_type
1600  * @param play_status
1601  */
1602 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED             0x05
1603 
1604 /**
1605  * @format 121
1606  * @param subevent_code
1607  * @param avrcp_cid
1608  * @param command_type
1609  */
1610 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED                       0x06
1611 
1612 /**
1613  * @format 121
1614  * @param subevent_code
1615  * @param avrcp_cid
1616  * @param command_type
1617  */
1618 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED          0x07
1619 
1620 /**
1621  * @format 121
1622  * @param subevent_code
1623  * @param avrcp_cid
1624  * @param command_type
1625  */
1626 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED            0x08
1627 
1628 /**
1629  * @format 1211
1630  * @param subevent_code
1631  * @param avrcp_cid
1632  * @param command_type
1633  * @param absolute_volume
1634  */
1635 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED                       0x09
1636 
1637 /**
1638  * @format 1211
1639  * @param subevent_code
1640  * @param avrcp_cid
1641  * @param command_type
1642  * @param absolute_volume
1643  */
1644 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE                      0x0A
1645 
1646 /**
1647  * @format 1211
1648  * @param subevent_code
1649  * @param avrcp_cid
1650  * @param command_type
1651  * @param notification_id
1652  */
1653 #define AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE                       0x0B
1654 
1655 /**
1656  * @format 1211
1657  * @param subevent_code
1658  * @param avrcp_cid
1659  * @param command_type
1660  * @param operation_id
1661  */
1662 #define AVRCP_SUBEVENT_OPERATION_START                                    0x0C
1663 
1664 /**
1665  * @format 1211
1666  * @param subevent_code
1667  * @param avrcp_cid
1668  * @param command_type
1669  * @param operation_id
1670  */
1671 #define AVRCP_SUBEVENT_OPERATION_COMPLETE                                 0x0D
1672 
1673 /**
1674  * @format 121
1675  * @param subevent_code
1676  * @param avrcp_cid
1677  * @param command_type
1678  */
1679 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE                   0x0E
1680 
1681 /**
1682  * @format 12
1683  * @param subevent_code
1684  * @param avrcp_cid
1685  */
1686 #define AVRCP_SUBEVENT_COMPANY_IDS_QUERY                                    0x0F
1687 
1688 /**
1689  * @format 12
1690  * @param subevent_code
1691  * @param avrcp_cid
1692  */
1693 #define AVRCP_SUBEVENT_EVENT_IDS_QUERY                                      0x10
1694 
1695 /**
1696  * @format 12
1697  * @param subevent_code
1698  * @param avrcp_cid
1699  */
1700 #define AVRCP_SUBEVENT_PLAY_STATUS_QUERY                                    0x11
1701 
1702 /**
1703  * @format 12111
1704  * @param subevent_code
1705  * @param avrcp_cid
1706  * @param operation_id
1707  * @param operands_length
1708  * @param operand
1709  */
1710 #define AVRCP_SUBEVENT_OPERATION                                            0x12
1711 
1712 /**
1713  * @format 1211
1714  * @param subevent_code
1715  * @param avrcp_cid
1716  * @param command_type
1717  * @param track
1718  */
1719 #define AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO                                 0x13
1720 
1721 /**
1722  * @format 1211
1723  * @param subevent_code
1724  * @param avrcp_cid
1725  * @param command_type
1726  * @param total_tracks
1727  */
1728 #define AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO                          0x14
1729 
1730 /**
1731  * @format 1214
1732  * @param subevent_code
1733  * @param avrcp_cid
1734  * @param command_type
1735  * @param song_length in ms
1736  */
1737 #define AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO                        0x15
1738 
1739 /**
1740  * @format 121JV
1741  * @param subevent_code
1742  * @param avrcp_cid
1743  * @param command_type
1744  * @param value_len
1745  * @param value
1746  */
1747 #define AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO                                 0x16
1748 
1749  /*
1750  * @format 121JV
1751  * @param subevent_code
1752  * @param avrcp_cid
1753  * @param command_type
1754  * @param value_len
1755  * @param value
1756  */
1757 #define AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO                                0x17
1758 
1759  /*
1760  * @format 121JV
1761  * @param subevent_code
1762  * @param avrcp_cid
1763  * @param command_type
1764  * @param value_len
1765  * @param value
1766  */
1767 #define AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO                                 0x18
1768 
1769  /*
1770  * @format 121JV
1771  * @param subevent_code
1772  * @param avrcp_cid
1773  * @param command_type
1774  * @param value_len
1775  * @param value
1776  */
1777 #define AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO                                 0x19
1778 
1779 /*
1780  * @format 1211
1781  * @param subevent_code
1782  * @param avrcp_cid
1783  * @param command_type
1784  * @param status
1785  */
1786 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE                                  0x1A
1787 
1788 
1789 /**
1790  * @format 121BH1
1791  * @param subevent_code
1792  * @param goep_cid
1793  * @param status
1794  * @param bd_addr
1795  * @param con_handle
1796  * @param incoming
1797  */
1798 #define GOEP_SUBEVENT_CONNECTION_OPENED                                    0x01
1799 
1800 /**
1801  * @format 12
1802  * @param subevent_code
1803  * @param goep_cid
1804 */
1805 #define GOEP_SUBEVENT_CONNECTION_CLOSED                                    0x02
1806 
1807 /**
1808  * @format 12
1809  * @param subevent_code
1810  * @param goep_cid
1811 */
1812 #define GOEP_SUBEVENT_CAN_SEND_NOW                                         0x03
1813 
1814 /**
1815  * @format 121BH1
1816  * @param subevent_code
1817  * @param pbap_cid
1818  * @param status
1819  * @param bd_addr
1820  * @param con_handle
1821  * @param incoming
1822  */
1823 #define PBAP_SUBEVENT_CONNECTION_OPENED                                    0x01
1824 
1825 /**
1826  * @format 12
1827  * @param subevent_code
1828  * @param goep_cid
1829 */
1830 #define PBAP_SUBEVENT_CONNECTION_CLOSED                                    0x02
1831 
1832 /**
1833  * @format 121
1834  * @param subevent_code
1835  * @param goep_cid
1836  * @param status
1837  */
1838 #define PBAP_SUBEVENT_OPERATION_COMPLETED                                  0x03
1839 
1840 // HID Meta Event Group
1841 
1842 /**
1843  * @format 121BH1
1844  * @param subevent_code
1845  * @param hid_cid
1846  * @param status
1847  * @param bd_addr
1848  * @param con_handle
1849  * @param incoming
1850  */
1851 #define HID_SUBEVENT_CONNECTION_OPENED                                     0x01
1852 
1853 /**
1854  * @format 12
1855  * @param subevent_code
1856  * @param hid_cid
1857 */
1858 #define HID_SUBEVENT_CONNECTION_CLOSED                                     0x02
1859 
1860 /**
1861  * @format 12
1862  * @param subevent_code
1863  * @param hid_cid
1864 */
1865 #define HID_SUBEVENT_CAN_SEND_NOW                                          0x03
1866 
1867 // HIDS Meta Event Group
1868 
1869 /**
1870  * @format 12
1871  * @param subevent_code
1872  * @param con_handle
1873 */
1874 #define HIDS_SUBEVENT_CAN_SEND_NOW                                          0x01
1875 
1876 /**
1877  * @format 121
1878  * @param subevent_code
1879  * @param con_handle
1880  * @param protocol_mode
1881 */
1882 #define HIDS_SUBEVENT_PROTOCOL_MODE                                         0x02
1883 
1884 /**
1885  * @format 121
1886  * @param subevent_code
1887  * @param con_handle
1888  * @param enable
1889 */
1890 #define HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE                        0x03
1891 
1892 /**
1893  * @format 121
1894  * @param subevent_code
1895  * @param con_handle
1896  * @param enable
1897 */
1898 #define HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE                     0x04
1899 
1900 /**
1901  * @format 121
1902  * @param subevent_code
1903  * @param con_handle
1904  * @param enable
1905 */
1906 #define HIDS_SUBEVENT_INPUT_REPORT_ENABLE                                   0x05
1907 
1908 #endif
1909