xref: /btstack/src/btstack_defines.h (revision 28a59cc137f96de76e910aa140e13d095ab9f0e6)
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 
985 // Potential other meta groups
986 // #define HCI_EVENT_BNEP_META                                0xxx
987 // #define HCI_EVENT_GAP_META                                 0xxx
988 // #define HCI_EVENT_GATT_META                                0xxx
989 // #define HCI_EVENT_PAN_META                                 0xxx
990 // #define HCI_EVENT_SDP_META                                 0xxx
991 // #define HCI_EVENT_SM_META                                  0xxx
992 
993 
994 /** HSP Subevent */
995 
996 /**
997  * @format 11
998  * @param subevent_code
999  * @param status 0 == OK
1000  */
1001 #define HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE             0x01
1002 
1003 /**
1004  * @format 11
1005  * @param subevent_code
1006  * @param status 0 == OK
1007  */
1008 #define HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE           0x02
1009 
1010 
1011 /**
1012  * @format 11H
1013  * @param subevent_code
1014  * @param status 0 == OK
1015  * @param handle
1016  */
1017 #define HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE             0x03
1018 
1019 /**
1020  * @format 11
1021  * @param subevent_code
1022  * @param status 0 == OK
1023  */
1024 #define HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE          0x04
1025 
1026 /**
1027  * @format 1
1028  * @param subevent_code
1029  */
1030 #define HSP_SUBEVENT_RING                                  0x05
1031 
1032 /**
1033  * @format 11
1034  * @param subevent_code
1035  * @param gain Valid range: [0,15]
1036  */
1037 #define HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED               0x06
1038 
1039 /**
1040  * @format 11
1041  * @param subevent_code
1042  * @param gain Valid range: [0,15]
1043  */
1044 #define HSP_SUBEVENT_SPEAKER_GAIN_CHANGED                  0x07
1045 
1046 /**
1047  * @format 1JV
1048  * @param subevent_code
1049  * @param value_length
1050  * @param value
1051  */
1052 #define HSP_SUBEVENT_HS_COMMAND                            0x08
1053 
1054 /**
1055  * @format 1JV
1056  * @param subevent_code
1057  * @param value_length
1058  * @param value
1059  */
1060 #define HSP_SUBEVENT_AG_INDICATION                         0x09
1061 
1062 
1063 /** HFP Subevent */
1064 
1065 /**
1066  * @format 11HB
1067  * @param subevent_code
1068  * @param status 0 == OK
1069  * @param con_handle
1070  * @param bd_addr
1071  */
1072 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED  0x01
1073 
1074 /**
1075  * @format 1
1076  * @param subevent_code
1077  */
1078 #define HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED     0x02
1079 
1080 /**
1081  * @format 11HB1
1082  * @param subevent_code
1083  * @param status 0 == OK
1084  * @param handle
1085  * @param bd_addr
1086  * @param negotiated_codec
1087  */
1088 #define HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED          0x03
1089 
1090 /**
1091  * @format 1
1092  * @param subevent_code
1093  */
1094 #define HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED             0x04
1095 
1096 /**
1097  * @format 11
1098  * @param subevent_code
1099  * @param status 0 == OK
1100  */
1101 #define HFP_SUBEVENT_COMPLETE                              0x05
1102 
1103 /**
1104  * @format 111T
1105  * @param subevent_code
1106  * @param indicator_index
1107  * @param indicator_status
1108  * @param indicator_name
1109  */
1110 #define HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED           0x06
1111 
1112 /**
1113  * @format 111T
1114  * @param subevent_code
1115  * @param network_operator_mode
1116  * @param network_operator_format
1117  * @param network_operator_name
1118  */
1119 #define HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED              0x07
1120 
1121 /**
1122  * @format 11
1123  * @param subevent_code
1124  * @param error
1125  */
1126 #define HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR             0x08
1127 
1128 /**
1129  * @format 1
1130  * @param subevent_code
1131  */
1132 #define HFP_SUBEVENT_START_RINGINIG                           0x0A
1133 
1134 /**
1135  * @format 1
1136  * @param subevent_code
1137  */
1138 #define HFP_SUBEVENT_STOP_RINGINIG                            0x0B
1139 
1140 /**
1141  * @format 1
1142  * @param subevent_code
1143  */
1144 #define HFP_SUBEVENT_CALL_TERMINATED                          0x0C
1145 
1146 /**
1147  * @format 1T
1148  * @param subevent_code
1149  * @param number
1150  */
1151 #define HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER                   0x0D
1152 
1153 /**
1154  * @format 1
1155  * @param subevent_code
1156  */
1157 #define HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG               0x0E
1158 
1159 /**
1160  * @format 1T
1161  * @param subevent_code
1162  * @param number
1163  */
1164 #define HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG                     0x0F
1165 
1166 /**
1167  * @format 1T
1168  * @param subevent_code
1169  * @param dtmf code
1170  */
1171 #define HFP_SUBEVENT_TRANSMIT_DTMF_CODES                      0x10
1172 
1173 /**
1174  * @format 1
1175  * @param subevent_code
1176  */
1177  #define HFP_SUBEVENT_CALL_ANSWERED                            0x11
1178 
1179 /**
1180  * @format 1
1181  * @param subevent_code
1182  */
1183 #define HFP_SUBEVENT_CONFERENCE_CALL                          0x12
1184 
1185 /**
1186  * @format 1
1187  * @param subevent_code
1188  */
1189 #define HFP_SUBEVENT_RING                                     0x13
1190 
1191 /**
1192  * @format 111
1193  * @param subevent_code
1194  * @param status
1195  * @param gain
1196  */
1197  #define HFP_SUBEVENT_SPEAKER_VOLUME                           0x14
1198 
1199 /**
1200  * @format 111
1201  * @param subevent_code
1202  * @param status
1203  * @param gain
1204  */
1205 #define HFP_SUBEVENT_MICROPHONE_VOLUME                        0x15
1206 
1207 /**
1208  * @format 11T
1209  * @param subevent_code
1210  * @param type
1211  * @param number
1212  */
1213 #define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION                0x16
1214 
1215 /**
1216  * @format 11T
1217  * @param subevent_code
1218  * @param type
1219  * @param number
1220  */
1221 #define HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION 0x17
1222 
1223 /**
1224  * @format 111111T
1225  * @param subevent_code
1226  * @param clcc_idx
1227  * @param clcc_dir
1228  * @param clcc_status
1229  * @param clcc_mpty
1230  * @param bnip_type
1231  * @param bnip_number
1232  */
1233 #define HFP_SUBEVENT_ENHANCED_CALL_STATUS                     0x18
1234 
1235 /**
1236  * @format 111T
1237  * @param subevent_code
1238  * @param status
1239  * @param bnip_type
1240  * @param bnip_number
1241  */
1242  #define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION            0x19
1243 
1244 /**
1245  * @format 1T
1246  * @param subevent_code
1247  * @param value
1248  */
1249 #define HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS                 0x1A
1250 
1251 // ANCS Client
1252 
1253 /**
1254  * @format 1H
1255  * @param subevent_code
1256  * @param handle
1257  */
1258 #define ANCS_SUBEVENT_CLIENT_CONNECTED                              0xF0
1259 
1260 /**
1261  * @format 1H2T
1262  * @param subevent_code
1263  * @param handle
1264  * @param attribute_id
1265  * @param text
1266  */
1267 #define ANCS_SUBEVENT_CLIENT_NOTIFICATION                           0xF1
1268 
1269 /**
1270  * @format 1H
1271  * @param subevent_code
1272  * @param handle
1273  */
1274 #define ANCS_SUBEVENT_CLIENT_DISCONNECTED                           0xF2
1275 
1276 
1277 /** AVDTP Subevent */
1278 
1279 /**
1280  * @format 1211
1281  * @param subevent_code
1282  * @param avdtp_cid
1283  * @param local_seid
1284  * @param signal_identifier
1285  */
1286 #define AVDTP_SUBEVENT_SIGNALING_ACCEPT                     0x01
1287 
1288 /**
1289  * @format 1211
1290  * @param subevent_code
1291  * @param avdtp_cid
1292  * @param local_seid
1293  * @param signal_identifier
1294  */
1295 #define AVDTP_SUBEVENT_SIGNALING_REJECT                     0x02
1296 
1297 /**
1298  * @format 1211
1299  * @param subevent_code
1300  * @param avdtp_cid
1301  * @param local_seid
1302  * @param signal_identifier
1303  */
1304 #define AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT             0x03
1305 
1306 /**
1307  * @format 12B1
1308  * @param subevent_code
1309  * @param avdtp_cid
1310  * @param bd_addr
1311  * @param status 0 == OK
1312  */
1313 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED     0x04
1314 
1315 /**
1316  * @format 12
1317  * @param subevent_code
1318  * @param avdtp_cid
1319  */
1320 #define AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED        0x05
1321 
1322 /**
1323  * @format 121111
1324  * @param subevent_code
1325  * @param avdtp_cid
1326  * @param remote_seid        0x01 – 0x3E
1327  * @param in_use      0-not in use, 1-in use
1328  * @param media_type  0-audio, 1-video, 2-multimedia
1329  * @param sep_type    0-source, 1-sink
1330  */
1331 #define AVDTP_SUBEVENT_SIGNALING_SEP_FOUND                  0x06
1332 
1333 /**
1334  * @format 121111111111
1335  * @param subevent_code
1336  * @param avdtp_cid
1337  * @param local_seid
1338  * @param remote_seid
1339  * @param media_type
1340  * @param sampling_frequency_bitmap
1341  * @param channel_mode_bitmap
1342  * @param block_length_bitmap
1343  * @param subbands_bitmap
1344  * @param allocation_method_bitmap
1345  * @param min_bitpool_value
1346  * @param max_bitpool_value
1347  */
1348 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY          0x07
1349 
1350 /**
1351  * @format 121112LV
1352  * @param subevent_code
1353  * @param avdtp_cid
1354  * @param local_seid
1355  * @param remote_seid
1356  * @param media_type
1357  * @param media_codec_type
1358  * @param media_codec_information_len
1359  * @param media_codec_information
1360  */
1361 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY        0x08
1362 
1363 /**
1364  * @format 12111121111111
1365  * @param subevent_code
1366  * @param avdtp_cid
1367  * @param local_seid
1368  * @param remote_seid
1369  * @param reconfigure
1370  * @param media_type
1371  * @param sampling_frequency
1372  * @param channel_mode
1373  * @param num_channels
1374  * @param block_length
1375  * @param subbands
1376  * @param allocation_method
1377  * @param min_bitpool_value
1378  * @param max_bitpool_value
1379  */
1380 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION        0x09
1381 
1382 /**
1383  * @format 1211112LV
1384  * @param subevent_code
1385  * @param avdtp_cid
1386  * @param local_seid
1387  * @param remote_seid
1388  * @param reconfigure
1389  * @param media_type
1390  * @param media_codec_type
1391  * @param media_codec_information_len
1392  * @param media_codec_information
1393  */
1394 #define AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION        0x0A
1395 
1396 /**
1397  * @format 12B111
1398  * @param subevent_code
1399  * @param avdtp_cid
1400  * @param bd_addr
1401  * @param local_seid
1402  * @param remote_seid
1403  * @param status 0 == OK
1404  */
1405 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED     0x0B
1406 
1407 /**
1408  * @format 121
1409  * @param subevent_code
1410  * @param avdtp_cid
1411  * @param local_seid
1412  */
1413 #define AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED        0x0C
1414 
1415 /**
1416  * @format 1212
1417  * @param subevent_code
1418  * @param avdtp_cid
1419  * @param local_seid
1420  * @param sequence_number
1421  */
1422 #define AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW   0x0D
1423 
1424 
1425 /** A2DP Subevent */
1426 /* Stream goes through following states:
1427  * - OPEN         - indicated with A2DP_SUBEVENT_STREAM_ESTABLISHED event
1428  * - START        - indicated with A2DP_SUBEVENT_STREAM_STARTED event
1429  * - SUSPEND      - indicated with A2DP_SUBEVENT_STREAM_SUSPENDED event
1430  * - ABORT/STOP   - indicated with A2DP_SUBEVENT_STREAM_RELEASED event
1431 
1432  OPEN state will be followed by ABORT/STOP. Stream is ready but media transfer is not started.
1433  START can come only after the stream is OPENED, and indicates that media transfer is started.
1434  SUSPEND is optional, it pauses the stream.
1435  */
1436 
1437 /**
1438  * @format 121            Sent only by A2DP source.
1439  * @param subevent_code
1440  * @param a2dp_cid
1441  * @param local_seid
1442  */
1443 #define A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW         0x01
1444 
1445 /**
1446  * @format 12111121111111
1447  * @param subevent_code
1448  * @param a2dp_cid
1449  * @param int_seid
1450  * @param acp_seid
1451  * @param reconfigure
1452  * @param media_type
1453  * @param sampling_frequency
1454  * @param channel_mode
1455  * @param num_channels
1456  * @param block_length
1457  * @param subbands
1458  * @param allocation_method
1459  * @param min_bitpool_value
1460  * @param max_bitpool_value
1461  */
1462 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION      0x02
1463 
1464 /**
1465  * @format 1211112LV
1466  * @param subevent_code
1467  * @param a2dp_cid
1468  * @param int_seid
1469  * @param acp_seid
1470  * @param reconfigure
1471  * @param media_type
1472  * @param media_codec_type
1473  * @param media_codec_information_len
1474  * @param media_codec_information
1475  */
1476 #define A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION    0x03
1477 
1478 /**
1479  * @format 12B111          Stream is opened byt not started.
1480  * @param subevent_code
1481  * @param a2dp_cid
1482  * @param bd_addr
1483  * @param local_seid
1484  * @param remote_seid
1485  * @param status
1486  */
1487 #define A2DP_SUBEVENT_STREAM_ESTABLISHED                           0x04
1488 
1489 /**
1490  * @format 121            Indicates that media transfer is started.
1491  * @param subevent_code
1492  * @param a2dp_cid
1493  * @param local_seid
1494  */
1495 #define A2DP_SUBEVENT_STREAM_STARTED                               0x05
1496 
1497 /**
1498  * @format 121           Stream is paused.
1499  * @param subevent_code
1500  * @param a2dp_cid
1501  * @param local_seid
1502  */
1503 #define A2DP_SUBEVENT_STREAM_SUSPENDED                              0x06
1504 
1505 /**
1506  * @format 121           Stream is stoped or aborted.
1507  * @param subevent_code
1508  * @param a2dp_cid
1509  * @param local_seid
1510  */
1511 #define A2DP_SUBEVENT_STREAM_STOPPED                                0x07
1512 
1513 /**
1514  * @format 121            Stream is released.
1515  * @param subevent_code
1516  * @param a2dp_cid
1517  * @param local_seid
1518  */
1519 #define A2DP_SUBEVENT_STREAM_RELEASED                               0x08
1520 
1521 /**
1522  * @format 1211
1523  * @param subevent_code
1524  * @param a2dp_cid
1525  * @param local_seid
1526  * @param signal_identifier
1527  */
1528 #define A2DP_SUBEVENT_COMMAND_ACCEPTED                              0x09
1529 
1530 /**
1531  * @format 1211
1532  * @param subevent_code
1533  * @param a2dp_cid
1534  * @param local_seid
1535  * @param signal_identifier
1536  */
1537 #define A2DP_SUBEVENT_COMMAND_REJECTED                              0x0A
1538 
1539 /**
1540  * @format 12B          Signaling channel is opened.
1541  * @param subevent_code
1542  * @param a2dp_cid
1543  * @param bd_addr
1544  */
1545 #define A2DP_SUBEVENT_INCOMING_CONNECTION_ESTABLISHED               0x0B
1546 
1547 /**
1548  * @format 12            Signaling channel is released.
1549  * @param subevent_code
1550  * @param a2dp_cid
1551  */
1552 #define A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED                  0x0C
1553 
1554 
1555 /** AVRCP Subevent */
1556 
1557 /**
1558  * @format 11B2
1559  * @param subevent_code
1560  * @param status 0 == OK
1561  * @param bd_addr
1562  * @param avrcp_cid
1563  */
1564 #define AVRCP_SUBEVENT_CONNECTION_ESTABLISHED                           0x01
1565 
1566 /**
1567  * @format 12
1568  * @param subevent_code
1569  * @param avrcp_cid
1570  */
1571 #define AVRCP_SUBEVENT_CONNECTION_RELEASED                              0x02
1572 
1573 /**
1574  * @format 121114JVJVJVJV
1575  * @param subevent_code
1576  * @param avrcp_cid
1577  * @param command_type
1578  * @param track
1579  * @param total_tracks
1580  * @param song_length in ms
1581  * @param title_len
1582  * @param title
1583  * @param artist_len
1584  * @param artist
1585  * @param album_len
1586  * @param album
1587  * @param genre_len
1588  * @param genre
1589  */
1590 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO                                 0x03
1591 
1592 /**
1593  * @format 12111
1594  * @param subevent_code
1595  * @param avrcp_cid
1596  * @param command_type
1597  * @param repeat_mode
1598  * @param shuffle_mode
1599  */
1600 #define AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE                          0x04
1601 
1602 /**
1603  * @format 121441
1604  * @param subevent_code
1605  * @param avrcp_cid
1606  * @param command_type
1607  * @param song_length
1608  * @param song_position
1609  * @param play_status
1610  */
1611  #define AVRCP_SUBEVENT_PLAY_STATUS                                     0x05
1612 
1613 /**
1614  * @format 1211
1615  * @param subevent_code
1616  * @param avrcp_cid
1617  * @param command_type
1618  * @param play_status
1619  */
1620 #define AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED             0x06
1621 
1622 /**
1623  * @format 121
1624  * @param subevent_code
1625  * @param avrcp_cid
1626  * @param command_type
1627  */
1628 #define AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED                       0x07
1629 
1630 /**
1631  * @format 121
1632  * @param subevent_code
1633  * @param avrcp_cid
1634  * @param command_type
1635  */
1636 #define AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED          0x08
1637 
1638 /**
1639  * @format 121
1640  * @param subevent_code
1641  * @param avrcp_cid
1642  * @param command_type
1643  */
1644 #define AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED            0x09
1645 
1646 /**
1647  * @format 1211
1648  * @param subevent_code
1649  * @param avrcp_cid
1650  * @param command_type
1651  * @param absolute_volume
1652  */
1653 #define AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED                       0x0A
1654 
1655 /**
1656  * @format 1211
1657  * @param subevent_code
1658  * @param avrcp_cid
1659  * @param command_type
1660  * @param absolute_volume
1661  */
1662 #define AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE                      0x0B
1663 
1664 /**
1665  * @format 1211
1666  * @param subevent_code
1667  * @param avrcp_cid
1668  * @param command_type
1669  * @param notification_id
1670  */
1671 #define AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE                       0x0C
1672 
1673 /**
1674  * @format 1211
1675  * @param subevent_code
1676  * @param avrcp_cid
1677  * @param command_type
1678  * @param operation_id
1679  */
1680 #define AVRCP_SUBEVENT_OPERATION_START                                    0x0D
1681 
1682 /**
1683  * @format 1211
1684  * @param subevent_code
1685  * @param avrcp_cid
1686  * @param command_type
1687  * @param operation_id
1688  */
1689 #define AVRCP_SUBEVENT_OPERATION_COMPLETE                                 0x0E
1690 
1691 /**
1692  * @format 121
1693  * @param subevent_code
1694  * @param avrcp_cid
1695  * @param command_type
1696  */
1697 #define AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE                   0x0F
1698 
1699 /**
1700  * @format 12
1701  * @param subevent_code
1702  * @param avrcp_cid
1703  */
1704 #define AVRCP_SUBEVENT_UNIT_INFO_QUERY                                     0x10
1705 
1706 /**
1707  * @format 121
1708  * @param subevent_code
1709  * @param avrcp_cid
1710  * @param offset      page*4
1711  */
1712 #define AVRCP_SUBEVENT_SUBUNIT_INFO_QUERY                                   0x11
1713 
1714 /**
1715  * @format 12
1716  * @param subevent_code
1717  * @param avrcp_cid
1718  */
1719 #define AVRCP_SUBEVENT_COMPANY_IDS_QUERY                                    0x12
1720 
1721 /**
1722  * @format 12
1723  * @param subevent_code
1724  * @param avrcp_cid
1725  */
1726 #define AVRCP_SUBEVENT_EVENT_IDS_QUERY                                      0x13
1727 
1728 /**
1729  * @format 12
1730  * @param subevent_code
1731  * @param avrcp_cid
1732  */
1733 #define AVRCP_SUBEVENT_PLAY_STATUS_QUERY                                    0x14
1734 
1735 /**
1736  * @format 12
1737  * @param subevent_code
1738  * @param avrcp_cid
1739  */
1740 #define AVRCP_SUBEVENT_NOW_PLAYING_INFO_QUERY                               0x15
1741 
1742 /**
1743  * @format 12111
1744  * @param subevent_code
1745  * @param avrcp_cid
1746  * @param operation_id
1747  * @param operands_length
1748  * @param operand
1749  */
1750 #define AVRCP_SUBEVENT_OPERATION                               0x16
1751 
1752 /**
1753  * @format 121BH1
1754  * @param subevent_code
1755  * @param goep_cid
1756  * @param status
1757  * @param bd_addr
1758  * @param con_handle
1759  * @param incoming
1760  */
1761 #define GOEP_SUBEVENT_CONNECTION_OPENED                                    0x01
1762 
1763 /**
1764  * @format 12
1765  * @param subevent_code
1766  * @param goep_cid
1767 */
1768 #define GOEP_SUBEVENT_CONNECTION_CLOSED                                    0x02
1769 
1770 /**
1771  * @format 12
1772  * @param subevent_code
1773  * @param goep_cid
1774 */
1775 #define GOEP_SUBEVENT_CAN_SEND_NOW                                         0x03
1776 
1777 /**
1778  * @format 121BH1
1779  * @param subevent_code
1780  * @param pbap_cid
1781  * @param status
1782  * @param bd_addr
1783  * @param con_handle
1784  * @param incoming
1785  */
1786 #define PBAP_SUBEVENT_CONNECTION_OPENED                                    0x01
1787 
1788 /**
1789  * @format 12
1790  * @param subevent_code
1791  * @param goep_cid
1792 */
1793 #define PBAP_SUBEVENT_CONNECTION_CLOSED                                    0x02
1794 
1795 /**
1796  * @format 121
1797  * @param subevent_code
1798  * @param goep_cid
1799  * @param status
1800  */
1801 #define PBAP_SUBEVENT_OPERATION_COMPLETED                                  0x03
1802 
1803 /**
1804  * @format 121BH1
1805  * @param subevent_code
1806  * @param hid_cid
1807  * @param status
1808  * @param bd_addr
1809  * @param con_handle
1810  * @param incoming
1811  */
1812 #define HID_SUBEVENT_CONNECTION_OPENED                                     0x01
1813 
1814 /**
1815  * @format 12
1816  * @param subevent_code
1817  * @param hid_cid
1818 */
1819 #define HID_SUBEVENT_CONNECTION_CLOSED                                     0x02
1820 
1821 /**
1822  * @format 12
1823  * @param subevent_code
1824  * @param hid_cid
1825 */
1826 #define HID_SUBEVENT_CAN_SEND_NOW                                          0x03
1827 
1828 #endif
1829