1 Android HAL protocol for Bluetooth
2 ==================================
4 The Android HAL daemon for Bluetooth functionality implements the Unix socket
5 server protocol around /run/bluetooth/daemon (tentative location) or Linux
6 abstract sockets (tentative name).
8 The daemon is single threaded and uses a mainloop for scheduling and general
11 The protocol is SOCK_SEQPACKET based and follows a strict PDU specification
12 with a generic header and initial registration exchange. The communication
13 is driven from the HAL with command/response exchanges. The daemon will use
14 notification to signal events. The protocol is single PDU exchanged based,
15 meaning every command requires a response. Notification does not require
16 any confirmation. Not handling this PDU exchange leads to a disconnection of
19 Command/response and notification use separate sockets. First connected socket
20 is used for command/response, second for notification. All services are
21 multi-plexed over same pair of sockets. Separation is done to ease
22 implementation of simple HAL library with dedicated thread for handling
25 This strict protocol requirement is done to match C based callbacks and
26 callout functions that are running in a thread inside the HAL and might
29 .--Android--. .--Android--.
32 | | <-------------------------- | |
34 | | --------------------------> | |
39 | | --------------------------> | |
41 '-----------' '-----------'
43 Every packet will follow the basic header to support simple multi-plexing
44 over the same socket. It will also support a basic control channel with service
48 +--------------+--------------+--------------+--------------+
49 | Service ID | Opcode | Data Length |
50 +--------------+--------------+-----------------------------+
53 The unique service ID is assigned by this specification for each HAL.
55 As general rule of thumb, the opcode for command matches the opcode for a
56 response. Or the opcode 0x00 for an error is returned.
58 Notification opcodes start from 0x81.
60 Opcode 0x80 is reserved and shall not be used.
62 All command/response opcodes have the least significant bit not set. And all
63 notifications have the least significant bit set.
65 The HAL modules only have the job to map the callback and event functions
66 to the protocol. They do not need to do anything else. Below is an example
67 of a sample transaction for the Bluetooth Core HAL and enabling of an
71 ----------------------------------------------------
73 call enable() --> command 0x01
74 return enable() <-- response 0x01
76 call adapter_state_changed() <-- notification 0x81
77 return adapter_state_changed()
79 When the Android hardware framework calls into the Bluetooth Core HAL
80 and executes the enable() callback, the HAL module sends the enable
81 command with opcode 0x01 to the daemon. As soon as the daemon responds,
82 the callback will return with the appropriate result.
84 After the daemon switched on the adapter, it will send a notification
85 with opcode 0x81 to the HAL module.
87 The Bluetooth Core HAL and Bluetooth Socket HAL are guaranteed to be
88 available from the daemon. All other HAL modules are optional.
90 When the Bluetooth Core HAL init() function is called, it should open
91 the socket and register both "bluetooth" and "socket" service modules. It is
92 required to register "socket" service at the same time since the HAL module
93 does not have its own init() function.
95 It is possible to send Configure command before registering any services to
96 customize stack. This step is optional.
98 When new profiles are initiated, the get_profile_interface() callback
99 will load the profile and during init() of the profile, it should register the
102 Bluetooth main thread Daemon
103 -------------------------------------------------------
105 init() --> open command socket
106 --> open notification socket
107 --> register module "bluetooth"
108 --> register module "socket"
110 get_profile_interface() --> return profile struct
111 --> continue on Handsfree thread
114 Handsfree thread Daemon
115 --------------------------------------------------------
117 init() --> register module handsfree
120 Error response is common for all services and has fixed structure:
122 Opcode 0x00 - Error response
124 Response parameters: Status (1 octet)
126 Valid status values: 0x01 = Fail
130 0x05 = Done (already completed)
132 0x07 = Parameter invalid
134 0x09 = Authentication failure
135 0x0a = Remote device down
136 0x0b = Authentication rejected
142 Opcode 0x00 - Error response
144 Opcode 0x01 - Register module command/response
146 Command parameters: Service id (1 octet)
148 Max Clients (4 octets)
149 Response parameters: <none>
151 In case a command is sent for an undeclared service ID, it will
152 be rejected. Also there will be no notifications for undeclared
155 Valid Mode values: 0x00 = Default Mode
156 0xXX = as defined by service
158 In case of an error, the error response will be returned.
160 Opcode 0x02 - Unregister module command/response
162 Command parameters: Service id (1 octet)
163 Response parameters: <none>
165 In case of an error, the error response will be returned.
167 Opcode 0x03 - Configuration
169 Command parameters: Num options (1 octet)
170 Option Type # (1 octet)
171 Option Length # (2 octets)
172 Option Value # (variable)
174 Response parameters: <none>
176 Valid configure option types: 0x00 = Vendor
185 In case of an error, the error response will be returned.
187 Bluetooth Core HAL (ID 1)
188 =========================
190 Android HAL name: "bluetooth" (BT_HARDWARE_MODULE_ID)
192 Service modes: 0x00 = Enable BR/EDR/LE if supported (default)
193 0x01 = Enable BR/EDR only
194 0x02 = Enable LE only
196 Commands and responses:
198 Opcode 0x00 - Error response
200 Opcode 0x01 - Enable command/response
202 Command parameters: <none>
203 Response parameters: <none>
205 In case of an error, the error response will be returned.
207 Opcode 0x02 - Disable command/response
209 Command parameters: <none>
210 Response parameters: <none>
212 In case of an error, the error response will be returned.
214 Opcode 0x03 - Get Adapter Properties command/response
216 Command parameters: <none>
217 Response parameters: <none>
219 In case of an error, the error response will be returned.
221 Opcode 0x04 - Get Adapter Property command/response
223 Command parameters: Property type (1 octet)
224 Response parameters: <none>
226 In case of an error, the error response will be returned.
228 Opcode 0x05 - Set Adapter Property command/response
230 Command parameters: Property type (1 octet)
231 Property length (2 octets)
232 Property value (variable)
233 Response parameters: <none>
235 In case of an error, the error response will be returned.
237 Opcode 0x06 - Get Remote Device Properties command/response
239 Command parameters: Remote address (6 octets)
240 Response parameters: <none>
242 In case of an error, the error response will be returned.
244 Opcode 0x07 - Get Remote Device Property command/response
246 Command parameters: Remote address (6 octets)
247 Property type (1 octet)
248 Response parameters: <none>
250 In case of an error, the error response will be returned.
252 Opcode 0x08 - Set Remote Device Property command/response
254 Command parameters: Remote address (6 octets)
255 Property type (1 octet)
256 Property length (2 octets)
257 Property value (variable)
258 Response parameters: <none>
260 In case of an error, the error response will be returned.
262 Opcode 0x09 - Get Remote Service Record command/response
264 Command parameters: Remote address (6 octets)
266 Response parameters: <none>
268 In case of an error, the error response will be returned.
270 Opcode 0x0a - Get Remote Services command/response
272 Command parameters: Remote address (6 octets)
273 Response parameters: <none>
275 In case of an error, the error response will be returned.
277 Opcode 0x0b - Start Discovery command/response
279 Command parameters: <none>
280 Response parameters: <none>
282 In case of an error, the error response will be returned.
284 Opcode 0x0c - Cancel Discovery command/response
286 Command parameters: <none>
287 Response parameters: <none>
289 In case of an error, the error response will be returned.
291 Opcode 0x0d - Create Bond command/response
293 Command parameters: Remote address (6 octets)
295 Response parameters: <none>
297 In case of an error, the error response will be returned.
299 Opcode 0x0e - Remove Bond command/response
301 Command parameters: Remote address (6 octets)
302 Response parameters: <none>
304 In case of an error, the error response will be returned.
306 Opcode 0x0f - Cancel Bond command/response
308 Command parameters: Remote address (6 octets)
309 Response parameters: <none>
311 In case of an error, the error response will be returned.
313 Opcode 0x10 - PIN Reply command/response
315 Command parameters: Remote address (6 octets)
319 Response parameters: <none>
321 In case of an error, the error response will be returned.
323 Opcode 0x11 - SSP Reply command/response
325 Command parameters: Remote address (6 octets)
326 SSP variant (1 octet)
329 Response parameters: <none>
331 Valid SSP variant values: 0x00 = Passkey Confirmation
333 0x02 = Consent (for Just Works)
334 0x03 = Passkey Notification
336 In case of an error, the error response will be returned.
338 Opcode 0x12 - DUT Mode Configure command/response
340 Command parameters: Enable (1 octet)
341 Response parameters: <none>
343 In case of an error, the error response will be returned.
345 Opcode 0x13 - DUT Mode Send command/response
347 Command parameters: Opcode (2 octets)
350 Response parameters: <none>
352 In case of an error, the error response will be returned.
354 Opcode 0x14 - LE Test Mode command/response
356 Command parameters: Opcode (2 octets)
359 Response parameters: <none>
361 In case of an error, the error response will be returned.
365 Opcode 0x81 - Adapter State Changed notification
367 Notifications parameters: State (1 octet)
369 Valid state values: 0x00 = Off
372 Opcode 0x82 - Adapter Properties Changed notification
374 Notification parameters: Status (1 octet)
375 Num properties (1 octet)
381 Opcode 0x83 - Remote Device Properties notification
383 Notification parameters: Status (1 octet)
384 Remote address (6 octets)
385 Num properties (1 octet)
391 Opcode 0x84 - Device Found notification
393 Notification parameters: Num properties (1 octet)
399 Opcode 0x85 - Discovery State Changed notification
401 Notifications parameters: State (1 octet)
403 Opcode 0x86 - PIN Request notification
405 Notification parameters: Remote address (6 octets)
406 Remote name (249 octets)
407 Class of device (4 octets)
409 Opcode 0x87 - SSP Request notification
411 Notification parameters: Remote address (6 octets)
412 Remote name (249 octets)
413 Class of device (4 octets)
414 Pairing variant (1 octet)
417 Opcode 0x88 - Bond State Changed notification
419 Notification parameters: Status (1 octet)
420 Remote address (6 octets)
423 Valid bond state values: 0x00 = None
427 Opcode 0x89 - ACL State Changed notification
429 Notification parameters: Status (1 octet)
430 Remote address (6 octets)
433 Opcode 0x8a - DUT Mode Receive notification
435 Notification parameters: Opcode (2 octets)
439 Opcode 0x8b - LE Test Mode notification
441 Notification parameters: Status (1 octet)
442 Num packets (2 octets)
445 Bluetooth Socket HAL (ID 2)
446 ===========================
448 Android HAL name:: "socket" (BT_PROFILE_SOCKETS_ID)
450 Commands and responses:
452 Opcode 0x00 - Error response
454 Opcode 0x01 - Listen command/response
456 Command parameters: Socket type (1 octet)
457 Service name (256 octets)
458 Service UUID (16 octets)
460 Socket flags (1 octet)
461 Response parameters: File descriptor (inline)
463 Valid socket types: 0x01 = RFCOMM
467 Valid socket flags: 0x01 = Encrypt
470 In case of an error, the error response will be returned.
472 Opcode 0x02 - Connect command/response
474 Command parameters: Remote address (6 octets)
475 Socket type (1 octet)
476 Service UUID (16 octets)
478 Socket flags (1 octet)
479 Response parameters: File descriptor (inline)
481 Valid socket types: 0x01 = RFCOMM
485 Valid socket flags: 0x01 = Encrypt
488 In case of an error, the error response will be returned.
491 Bluetooth HID Host HAL (ID 3)
492 ============================
494 Android HAL name: "hidhost" (BT_PROFILE_HIDHOST_ID)
496 Commands and responses:
498 Opcode 0x00 - Error response
500 Opcode 0x01 - Connect command/response
502 Command parameters: Remote address (6 octets)
503 Response parameters: <none>
505 In case of an error, the error response will be returned.
507 Opcode 0x02 - Disconnect command/response
509 Command parameters: Remote address (6 octets)
510 Response parameters: <none>
512 In case of an error, the error response will be returned.
514 Opcode 0x03 - Virtual Unplug command/response
516 Command parameters: Remote address (6 octets)
517 Response parameters: <none>
519 In case of an error, the error response will be returned.
521 Opcode 0x04 - Set Info command/response
523 Command parameters: Remote address (6 octets)
524 Attribute mask (2 octets)
526 Application ID (1 octet)
528 Product ID (2 octets)
530 Country code (1 octet)
531 Descriptor length (2 octet)
532 Descriptor value (884 octets)
533 Response parameters: <none>
535 In case of an error, the error response will be returned.
537 Opcode 0x05 - Get Protocol command/response
539 Command parameters: Remote address (6 octets)
540 Protocol mode (1 octet)
541 Response parameters: <none>
543 Valid protocol modes: 0x00 = Report
547 In case of an error, the error response will be returned.
549 Opcode 0x06 - Set Protocol command/response
551 Command parameters: Remote address (6 octets)
552 Protocol mode (1 octet)
553 Response parameters: <none>
555 Valid protocol modes: 0x00 = Report
559 In case of an error, the error response will be returned.
561 Opcode 0x07 - Get Report command/response
563 Command parameters: Remote address (6 octets)
564 Report type (1 octet)
566 Buffer size (2 octet)
567 Response parameters: <none>
569 Valid report types: 0x01 = Input
573 In case of an error, the error response will be returned.
575 Opcode 0x08 - Set Report command/response
577 Command parameters: Remote address (6 octets)
578 Report type (1 octet)
579 Report length (2 octets)
580 Report data (Report length)
582 Response parameters: <none>
584 Valid report types: 0x01 = Input
588 In case of an error, the error response will be returned.
590 Opcode 0x09 - Send Data command/response
592 Command parameters: Remote address (6 octets)
593 Data length (2 octets)
596 Response parameters: <none>
598 In case of an error, the error response will be returned.
602 Status is common for many notifications and has fixed value range:
604 Status values: 0x00 = Ok
605 0x01 = Handshake - Device not ready
606 0x02 = Handshake - Invalid report ID
607 0x03 = Handshake - Transaction not SPT
608 0x04 = Handshake - Invalid parameter
609 0x05 = Handshake - Generic error
612 0x08 = Set protocol error
613 0x09 = Device database full
614 0x0a = Device type not supported
616 0x0c = Authentication failed
619 Opcode 0x81 - Connection State notification
621 Notification parameters: Remote address (6 octets)
622 Connection State (1 octets)
624 Valid connection states: 0x00 = Connected
628 0x04 = Failed - Mouse from host
629 0x05 = Failed - Keyboard from host
630 0x06 = Failed - Too many devices
631 0x07 = Failed - No HID driver
632 0x08 = Failed - generic
635 Opcode 0x82 - HID Info notification
637 Notification parameters: Remote address (6 octets)
638 Attribute mask (2 octets)
640 Application ID (1 octet)
642 Product ID (2 octets)
644 Country code (1 octet)
645 Descriptor length (2 octet)
646 Descriptor value (884 octets)
648 Opcode 0x83 - Protocol Mode notification
650 Notification parameters: Remote address (6 octets)
652 Protocol mode (1 octet)
654 Valid protocol modes: 0x00 = Report
658 Opcode 0x84 - Idle Time notification
660 Notification parameters: Remote address (6 octets)
664 Opcode 0x85 - Get Report notification
666 Notification parameters: Remote address (6 octets)
668 Report length (2 octets)
669 Report data (variable)
671 Opcode 0x86 - Virtual Unplug notification
673 Notification parameters: Remote address (6 octets)
676 Opcode 0x87 - Handshake notification
678 Notification parameters: Remote address (6 octets)
681 Only status values from 0x00 to 0x05 are valid as handshake
685 Bluetooth PAN HAL (ID 4)
686 ========================
688 Android HAL name: "pan" (BT_PROFILE_PAN_ID)
690 Commands and responses:
692 Opcode 0x00 - Error response
694 Opcode 0x01 - Enable command/response
696 Command parameters: Local role (1 octet)
697 Response parameters: <none>
699 Valid role values: 0x00 = None
703 In case of an error, the error response will be returned.
705 Opcode 0x02 - Get Local Role command/response
707 Command parameters: <none>
708 Response parameters: Local role (1 octet)
710 Valid role values: 0x00 = None
714 In case of an error, the error response will be returned.
716 Opcode 0x03 - Connect command/response
718 Command parameters: Remote address (6 octets)
720 Remote role (1 octet)
721 Response parameters: <none>
723 Valid role values: 0x01 = NAP
726 In case of an error, the error response will be returned.
728 Opcode 0x04 - Disconnect command/response
730 Command parameters: Remote address (6 octets)
731 Response parameters: <none>
733 In case of an error, the error response will be returned.
737 Opcode 0x81 - Control State notification
739 Notification parameters: Control state (1 octet)
742 Interface name (17 octet)
744 Valid control states: 0x00 = Enabled
747 Valid role values: 0x00 = None
751 Opcode 0x82 - Connection State notification
753 Notification parameters: Connection state (1 octet)
755 Remote address (6 octets)
757 Remote role (1 octet)
759 Valid connection states: 0x00 = Connected
764 Valid role values: 0x01 = NAP
768 Bluetooth Handsfree HAL (ID 5)
769 ==============================
771 Android HAL name: "handsfree" (BT_PROFILE_HANDSFREE_ID)
773 Service modes: 0x00 = Headset Profile only mode (default)
774 0x01 = Handsfree Profile (narrowband speech)
775 0x02 = Handsfree Profile (narrowband and wideband speech)
777 Commands and responses:
779 Opcode 0x00 - Error response
781 Opcode 0x01 - Connect command/response
783 Command parameters: Remote address (6 octets)
784 Response parameters: <none>
786 In case of an error, the error response will be returned.
788 Opcode 0x02 - Disconnect command/response
790 Command parameters: Remote address (6 octets)
791 Response parameters: <none>
793 In case of an error, the error response will be returned.
795 Opcode 0x03 - Connect Audio command/response
797 Command parameters: Remote address (6 octets)
798 Response parameters: <none>
800 In case of an error, the error response will be returned.
802 Opcode 0x04 - Disconnect Audio command/response
804 Command parameters: Remote address (6 octets)
805 Response parameters: <none>
807 In case of an error, the error response will be returned.
809 Opcode 0x05 - Start Voice Recognition command/response
811 Command parameters: Remote address (6 octets)
812 Response parameters: <none>
814 In case of an error, the error response will be returned.
816 Opcode 0x06 - Stop Voice Recognition command/response
818 Command parameters: Remote address (6 octets)
819 Response parameters: <none>
821 In case of an error, the error response will be returned.
823 Opcode 0x07 - Volume Control command/response
825 Command parameters: Volume type (1 octet)
827 Remote address (6 octets)
828 Response parameters: <none>
830 Valid volume types: 0x00 = Speaker
833 In case of an error, the error response will be returned.
835 Opcode 0x08 - Device Status Notification command/response
837 Command parameters: Network state (1 octet)
838 Service type (1 octet)
839 Signal strength (1 octet)
840 Battery level (1 octet)
841 Response parameters: <none>
843 Valid network states: 0x00 = Not available
846 Valid service types: 0x00 = Home network
847 0x01 = Roaming network
849 In case of an error, the error response will be returned.
851 Opcode 0x09 - COPS Response command/response
853 Command parameters: COPS command response (string)
854 Remote address (6 octets)
855 Response parameters: <none>
857 In case of an error, the error response will be returned.
859 Opcode 0x0a - CIND Response command/response
861 Command parameters: Service (1 octet)
862 Number of active calls (1 octet)
863 Number of held calls (1 octet)
864 Call setup state (1 octet)
865 Signal strength (1 octet)
866 Roaming indicator (1 octet)
867 Battery level (1 octet)
868 Remote address (6 octets)
869 Response parameters: <none>
871 Valid call setup states: 0x00 = Active
879 In case of an error, the error response will be returned.
881 Opcode 0x0b - Formatted AT Response command/response
883 Command parameters: Pre-formatted AT response (string)
884 Remote address (6 octets)
885 Response parameters: <none>
887 In case of an error, the error response will be returned.
889 Opcode 0x0c - AT Response command/response
891 Command parameters: Response code (1 octet)
893 Remote address (6 octets)
894 Response parameters: <none>
896 Valid response codes: 0x00 = ERROR
899 In case of an error, the error response will be returned.
901 Opcode 0x0d - CLCC Response command/response
903 Command parameters: Call index (1 octet)
904 Call direction (1 octet)
907 Call multiparty type (1 octet)
908 Call number type (1 octet)
910 Remote address (6 octets)
911 Response parameters: <none>
913 Valid call directions: 0x00 = Outgoing
916 Valid call states: 0x00 = Active
924 Valid call modes: 0x00 = Voice
928 Valid multiparty types: 0x00 = Single call
929 0x01 = Multiparty call
931 Valid number types: 0x81 = Unknown
934 In case of an error, the error response will be returned.
936 Opcode 0x0e - Phone Status Change command/response
938 Command parameters: Number of active calls (1 octet)
939 Number of held calls (1 octet)
940 Call setup state (1 octet)
941 Call number type (1 octet)
943 Response parameters: <none>
945 Valid call setup states: 0x00 = Active
953 Valid number types: 0x81 = Unknown
956 In case of an error, the error response will be returned.
958 Opcode 0x0f - Configure WBS command/response
960 Command parameters: Remote address (6 octets)
962 Response parameters: <none>
964 Valid config values: 0x00 = None
968 In case of an error, the error response will be returned.
972 Opcode 0x81 - Connection State notification
974 Notification parameters: Connection state (1 octet)
975 Remote address (6 octets)
977 Valid connection states: 0x00 = Disconnected
983 Opcode 0x82 - Audio State notification
985 Notification parameters: Audio state (1 octet)
986 Remote address (6 octets)
988 Valid audio states: 0x00 = Disconnected
993 Opcode 0x83 - Voice Recognition Command notification
995 Notification parameters: Voice recognition state (1 octet)
996 Remote address (6 octets)
998 Valid voice recognition states: 0x00 = Stopped
1001 Opcode 0x84 - Answer Call Command notification
1003 Notification parameters: Remote address (6 octets)
1005 Opcode 0x85 - Hangup Call Command notification
1007 Notification parameters: Remote address (6 octets)
1009 Opcode 0x86 - Volume Command notification
1011 Notification parameters: Volume type (1 octet)
1013 Remote address (6 octets)
1015 Valid volume types: 0x00 = Speaker
1018 Opcode 0x87 - Dial Call Command notification
1020 Notification parameters: Remote address (6 octets)
1023 Opcode 0x88 - DTMF Command notification
1025 Notification parameters: Tone (1 octet)
1026 Remote address (6 octets)
1028 Opcode 0x89 - NREC Command notification
1030 Notification parameters: NREC types (1 octet)
1031 Remote address (6 octets)
1033 Valid NREC types: 0x00 = Stop
1036 Opcode 0x8a - CHLD Command notification
1038 Notification parameters: NREC types (1 octet)
1039 Remote address (6 octets)
1041 Valid CHLD types: 0x00 = Release and hold
1042 0x01 = Release active and accept held
1043 0x02 = Hold active and accept held
1044 0x03 = Add held call to conference
1046 Opcode 0x8b - CNUM Command notification
1048 Notification parameters: Remote address (6 octets)
1050 Opcode 0x8c - CIND Command notification
1052 Notification parameters: Remote address (6 octets)
1054 Opcode 0x8d - COPS Command notification
1056 Notification parameters: Remote address (6 octets)
1058 Opcode 0x8e - CLCC Command notification
1060 Notification parameters: Remote address (6 octets)
1062 Opcode 0x8f - Unknown AT Command notification
1064 Notification parameters: Remote address (6 octets)
1067 Opcode 0x90 - Key Pressed Command notification
1069 Notification parameters: Remote address (6 octets)
1071 Opcode 0x91 - WBS Command notification
1073 Notification parameters: WBS types (1 octet)
1074 Remote address (6 octets)
1076 Valid WBS types: 0x00 = None
1080 Bluetooth Advanced Audio HAL (ID 6)
1081 Bluetooth Advanced Audio Sink HAL (ID 13)
1082 =========================================
1084 Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID)
1085 Android HAL name: "a2dp_sink" (BT_PROFILE_ADVANCED_AUDIO__SINK_ID)
1087 Commands and responses:
1089 Opcode 0x00 - Error response
1091 Opcode 0x01 - Connect command/response
1093 Command parameters: Remote address (6 octets)
1094 Response parameters: <none>
1096 In case of an error, the error response will be returned.
1098 Opcode 0x02 - Disconnect command/response
1100 Command parameters: Remote address (6 octets)
1101 Response parameters: <none>
1103 In case of an error, the error response will be returned.
1107 Opcode 0x81 - Connection State notification
1109 Notification parameters: Connection state (1 octet)
1110 Remote address (6 octets)
1112 Valid connection states: 0x00 = Disconnected
1115 0x03 = Disconnecting
1117 Opcode 0x82 - Audio State notification
1119 Notification parameters: Audio state (1 octet)
1120 Remote address (6 octets)
1122 Valid connection states: 0x00 = Remote suspend
1126 Opcode 0x83 - Audio Configuration notification
1128 Notification parameters: Remote address (6 octets)
1129 Sample Rate in Hz (4 octets)
1130 Channel Count (1 octet)
1132 Valid channel count: 0x01 = Mono
1135 Bluetooth Health HAL (ID 7)
1136 ===========================
1138 Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
1140 Commands and responses:
1142 Opcode 0x00 - Error response
1144 Opcode 0x01 - Register Application command/response
1146 Command parameters: Number of MDEP (1 octet)
1147 Application name offset (2 octets)
1148 Provider name offset (2 octets)
1149 Service name offset (2 octets)
1150 Service description offset (2 octets)
1151 Data length (2 octets)
1153 Response parameters: Application ID (2 octets)
1155 Strings are null terminated.
1156 In case of an error, the error response will be returned.
1158 Opcode 0x02 - Register Application MDEP data command/response
1160 Command parameters: Application ID (2 octets)
1162 Data type (2 octets)
1163 Channel type (1 octet)
1164 MDEP description length (2 octets)
1165 MDEP description (MDEP desciption length)
1166 Response parameters: <none>
1168 In case of an error, the error response will be returned.
1170 Opcode 0x03 - Unregister Application command/response
1172 Command parameters: Application ID (2 octets)
1173 Response parameters: <none>
1175 In case of an error, the error response will be returned.
1177 Opcode 0x04 - Connect Channel command/response
1179 Command parameters: Application ID (2 octets)
1180 Remote address (6 octets)
1181 MDEP index (1 octet)
1182 Response parameters: Channel ID (2 octets)
1184 In case of an error, the error response will be returned.
1186 Opcode 0x05 - Destroy Channel command/response
1188 Command parameters: Channel ID (2 octets)
1189 Response parameters: <none>
1191 In case of an error, the error response will be returned.
1195 Opcode 0x81 - Application Registration State notification
1197 Notification parameters: Application ID (2 octets)
1198 Application state (1 octet)
1200 Valid application states: 0x00 = Registration success
1201 0x01 = Registration failed
1202 0x02 = Deregistration success
1203 0x03 = Deregistration failed
1205 Opcode 0x82 - Channel State notification
1207 Notification parameters: Application ID (2 octets)
1208 Remote address (6 octets)
1209 MDEP index (1 octet)
1210 Channel ID (2 octets)
1211 Channel state (1 octet)
1212 File descriptor (inline)
1214 Valid channel states: 0x00 = Connecting
1216 0x02 = Disconnecting
1221 Bluetooth Remote Control Target HAL (ID 8)
1222 ===================================
1224 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
1226 Commands and responses:
1228 Opcode 0x00 - Error response
1230 Opcode 0x01 - Get Play Status Response command/response
1232 Command parameters: Status (1 octet)
1236 In case of an error, the error response will be returned.
1238 Valid status values: 0x00 = Stopped
1245 Opcode 0x02 - List Player Attributes Response command/response
1247 Command parameters: Number of attributes (1 octet)
1248 Attribute # (1 octet)
1251 In case of an error, the error response will be returned.
1253 Valid attributes: 0x01 = Equalizer
1258 Opcode 0x03 - List Player Values Response command/response
1260 Command parameters: Number of values (1 octet)
1264 In case of an error, the error response will be returned.
1266 Opcode 0x04 - Get Player Values Response command/response
1268 Command parameters: Number of attributes (1 octet)
1269 Attribute # (1 octet)
1273 In case of an error, the error response will be returned.
1275 Valid attributes: Same as in List Player Attributes
1277 Opcode 0x05 - Get Player Attributes Text Response command/response
1279 Command parameters: Number of attributes (1 octet)
1280 Attribute # (1 octet)
1281 Attribute # text length (1 octet)
1282 Attribute # text (variable)
1285 In case of an error, the error response will be returned.
1287 Valid attributes: Same as in List Player Attributes
1289 Opcode 0x06 - Get Player Values Text Response command/response
1291 Command parameters: Number of values (1 octet)
1293 Value # text length (1 octet)
1294 Value # text (variable)
1297 In case of an error, the error response will be returned.
1299 Opcode 0x07 - Get Element Attributes Text Response command/response
1301 Command parameters: Number of elements (1 octet)
1303 Element # text length (1 octet)
1304 Element # text (variable)
1307 In case of an error, the error response will be returned.
1309 Valid elements: 0x01 = Title
1313 0x05 = Number of Tracks
1317 Opcode 0x08 - Set Player Attributes Value Response command/response
1319 Command parameters: Status (1 octet)
1321 In case of an error, the error response will be returned.
1323 Valid status values: Same as in Get Play Status Response
1325 Opcode 0x09 - Register Notification Response command/response
1327 Command parameters: Event (1 octet)
1329 Data length (1 octet)
1332 In case of an error, the error response will be returned.
1334 Valid event values: 0x01 = Status Changed
1335 0x02 = Track Changed
1336 0x03 = Track Reached End
1337 0x04 = Track Reached Start
1338 0x05 = Position Changed
1339 0x08 = Setting Changed
1341 Valid type values : 0x00 = Interim
1344 Opcode 0x0a - Set Volume command/response
1346 Command parameters: Value (1 octet)
1348 In case of an error, the error response will be returned.
1352 Opcode 0x81 - Remote Features notification
1354 Notification parameters: Remote address (6 octets)
1357 Valid features values : 0x00 = None
1359 0x02 = Absolute Volume
1362 Opcode 0x82 - Get Play Status notification
1364 Notification parameters: <none>
1366 Opcode 0x83 - List Player Attributes notification
1368 Notification parameters: <none>
1370 Opcode 0x84 - List Player Values notification
1372 Notification parameters: Attribute (1 octet)
1374 Valid attribute values: Same as in List Player Attributes
1376 Opcode 0x85 - Get Player Values notification
1378 Notification parameters: Number of attributes (1 octet)
1379 Attribute # (1 octet)
1382 Valid attribute values: Same as in List Player Attributes
1384 Opcode 0x86 - Get Player Attributes Text notification
1386 Notification parameters: Number of attributes (1 octet)
1387 Attribute # (1 octet)
1390 Valid attribute values: Same as in List Player Attributes
1392 Opcode 0x87 - Get Player Values Text notification
1394 Notification parameters: Attribute (1 octet)
1395 Number of values (1 octet)
1399 Valid attribute values: Same as in List Player Attributes
1401 Opcode 0x88 - Set Player Values notification
1403 Notification parameters: Number of attributes (1 octet)
1404 Attribute # (1 octet)
1408 Valid attribute values: Same as in List Player Attributes
1410 Opcode 0x89 - Get Element Attributes notification
1412 Notification parameters: Number of attributes (1 octet)
1413 Attribute # (1 octet)
1416 Valid attribute values: Same as in Get Element Attribute
1418 Opcode 0x8a - Register Notification notification
1420 Notification parameters: Event (1 octet)
1421 Parameter (4 octets)
1423 Valid event values: Same as in Register Notification
1425 Opcode 0x8b - Volume Changed notification
1427 Notification parameters: Volume (1 octet)
1430 Valid type values: Same as in Register Notification
1432 Opcode 0x8c - Passthrough Command notification
1434 Notification parameters: ID (1 octet)
1437 Bluetooth GATT HAL (ID 9)
1438 =========================
1440 Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
1444 GATT Service ID: UUID (16 octets)
1445 Instance ID (1 octet)
1446 Is Primary (1 octet)
1448 GATT Included Service ID: UUID (16 octets)
1449 Instance ID (1 octet)
1450 Is Primary (1 octet)
1452 GATT Characteristic ID: UUID (16 octets)
1453 Instance ID (1 octet)
1455 GATT Descriptor ID: UUID (16 octets)
1456 Instance ID (1 octet)
1458 Commands and responses:
1460 Opcode 0x00 - Error response
1462 Opcode 0x01 - Client Register command/response
1464 Command parameters: Service UUID (16 octets)
1465 Response parameters: <none>
1467 In case of an error, the error response will be returned.
1469 Opcode 0x02 - Client Unregister command/response
1471 Command parameters: Client Interface (4 octets)
1472 Response parameters: <none>
1474 In case of an error, the error response will be returned.
1476 Opcode 0x03 - Client Scan command/response
1478 Command parameters: Client Interface (4 octets)
1480 Response parameters: <none>
1482 In case of an error, the error response will be returned.
1484 Opcode 0x04 - Client Connect Device command/response
1486 Command parameters: Client Interface (4 octets)
1487 Remote address (6 octets)
1489 Transport (4 octets)
1490 Response parameters: <none>
1492 Valid transport value: 0x00 = Auto
1496 In case of an error, the error response will be returned.
1498 Opcode 0x05 - Client Disconnect Device command/response
1500 Command parameters: Client Interface (4 octets)
1501 Remote address (6 octets)
1502 Connection ID (4 octets)
1503 Response parameters: <none>
1505 In case of an error, the error response will be returned.
1507 Opcode 0x06 - Client Listen command/response
1509 Command parameters: Client Interface (4 octets)
1511 Response parameters: <none>
1513 In case of an error, the error response will be returned.
1515 Opcode 0x07 - Client Refresh command/response
1517 Command parameters: Client Interface (4 octets)
1518 Remote address (6 octets)
1519 Response parameters: <none>
1521 In case of an error, the error response will be returned.
1523 Opcode 0x08 - Client Search Service command/response
1525 Command parameters: Connection ID (4 octets)
1527 Filter UUID (16 octets)
1528 Response parameters: <none>
1530 Filter UUID shall only be present when Filtered is non-zero.
1532 In case of an error, the error response will be returned.
1534 Opcode 0x09 - Client Get Included Service command/response
1536 Command parameters: Connection ID (4 octets)
1537 GATT Service ID (18 octets)
1538 Continuation (1 octet)
1539 GATT Included Service ID (18 octets)
1541 Response parameters: <none>
1543 GATT Included Service ID shall only be present when Continuation
1546 In case of an error, the error response will be returned.
1548 Opcode 0x0a - Client Get Characteristic command/response
1550 Command parameters: Connection ID (4 octets)
1551 GATT Service ID (18 octets)
1552 Continuation (1 octet)
1553 GATT Characteristic ID (17 octets)
1555 Response parameters: <none>
1557 GATT Characteristic ID shall only be present when Continuation
1560 In case of an error, the error response will be returned.
1562 Opcode 0x0b - Client Get Descriptor command/response
1564 Command parameters: Connection ID (4 octets)
1565 GATT Service ID (18 octets)
1566 GATT Characteristic ID (17 octets)
1567 Continuation (1 octet)
1568 GATT Descriptor ID (17 octets)
1570 Response parameters: <none>
1572 GATT Descriptor ID shall only be present when Continuation is
1575 In case of an error, the error response will be returned.
1577 Opcode 0x0c - Client Read Characteristic command/response
1579 Command parameters: Connection ID (4 octets)
1580 GATT Service ID (18 octets)
1581 GATT Characteristic ID (17 octets)
1582 Authorization (4 octets)
1583 Response parameters: <none>
1585 In case of an error, the error response will be returned.
1587 Opcode 0x0d - Client Write Characteristic command/response
1589 Command parameters: Connection ID (4 octets)
1590 GATT Service ID (18 octets)
1591 GATT Characteristic ID (17 octets)
1592 Write Type (4 octets)
1594 Authorization Req. (4 octets)
1596 Response parameters: <none>
1598 Valid Write Type: 0x01 = No response
1603 In case of an error, the error response will be returned.
1605 Opcode 0x0e - Client Read Descriptor command/response
1607 Command parameters: Connection ID (4 octets)
1608 GATT Service ID (18 octets)
1609 GATT Characteristic ID (17 octets)
1610 GATT Descriptor ID (17 octets)
1611 Authorization Req. (4 octets)
1612 Response parameters: <none>
1614 In case of an error, the error response will be returned.
1616 Opcode 0x0f - Client Write Descriptor command/response
1618 Command parameters: Connection ID (4 octets)
1619 GATT Service ID (18 octets)
1620 GATT Characteristic ID (17 octets)
1621 GATT Descriptor ID (17 octets)
1622 Write Type (4 octets)
1624 Authorization Req. (4 octets)
1626 Response parameters: <none>
1628 Valid Write Type: 0x01 = No response
1633 In case of an error, the error response will be returned.
1635 Opcode 0x10 - Client Execute Write command/response
1637 Command parameters: Connection ID (4 octets)
1639 Response parameters: <none>
1641 In case of an error, the error response will be returned.
1643 Opcode 0x11 - Client Register For Notification command/response
1645 Command parameters: Client Interface (4 octets)
1646 Remote address (6 octets)
1647 GATT Service ID (18 octets)
1648 GATT Characteristic ID (17 octets)
1649 Response parameters: <none>
1651 In case of an error, the error response will be returned.
1653 Opcode 0x12 - Client Deregister For Notification command/response
1655 Command parameters: Client Interface (4 octets)
1656 Remote address (6 octets)
1657 GATT Service ID (18 octets)
1658 GATT Characteristic ID (17 octets)
1659 Response parameters: <none>
1661 In case of an error, the error response will be returned.
1663 Opcode 0x13 - Client Read Remote RSSI command/response
1665 Command parameters: Client Interface (4 octets)
1666 Remote address (6 octets)
1667 Response parameters: <none>
1669 In case of an error, the error response will be returned.
1671 Opcode 0x14 - Client Get Device Type command/response
1673 Command parameters: Remote address (6 octets)
1674 Response parameters: Device Type
1676 Valid Device Type: 0x01 = BREDR
1680 In case of an error, the error response will be returned.
1682 Opcode 0x15 - Client Set Advertising data command/response
1684 Command parameters: Server Interface (4 octets)
1685 Set Scan Resp. (1 octet)
1686 Include Name (1 octet)
1687 Include TX Power (1 octet)
1688 Min. Interval (4 octets)
1689 Max. Interval (4 octets)
1690 Appearance (4 octets)
1691 Manufacturer Len. (2 octets)
1692 Manufacturer Data (variable)
1693 Response parameters: <none>
1695 In case of an error, the error response will be returned.
1697 Opcode 0x16 - Client Test Command command/response
1699 Command parameters: Command (4 octets)
1707 Response parameters: <none>
1709 In case of an error, the error response will be returned.
1711 Opcode 0x17 - Server Register command/response
1713 Command parameters: UUID (16 octets)
1714 Response parameters: <none>
1716 In case of an error, the error response will be returned.
1718 Opcode 0x18 - Server Unregister command/response
1720 Command parameters: Server (4 octets)
1721 Response parameters: <none>
1723 In case of an error, the error response will be returned.
1725 Opcode 0x19 - Server Connect Peripheral command/response
1727 Command parameters: Server (4 octets)
1728 Remote address (6 octets)
1730 Transport (4 octets)
1731 Response parameters: <none>
1733 In case of an error, the error response will be returned.
1735 Opcode 0x1a - Server Disconnect Peripheral command/response
1737 Command parameters: Server (4 octets)
1738 Remote address (6 octets)
1739 Connection ID (1 octet)
1740 Response parameters: <none>
1742 In case of an error, the error response will be returned.
1744 Opcode 0x1b - Server Add Service command/response
1746 Command parameters: Server (4 octets)
1747 GATT Service ID (18 octets)
1748 Number of Handles (4 octet)
1749 Response parameters: <none>
1751 Valid GATT Service ID: UUID (16 octets)
1752 Instance ID (1 octet)
1753 Is Primary (1 octet)
1755 In case of an error, the error response will be returned.
1757 Opcode 0x1c - Server Add Included Service command/response
1759 Command parameters: Server (4 octets)
1760 Service handle (4 octets)
1761 Included handle (4 octets)
1762 Response parameters: <none>
1764 In case of an error, the error response will be returned.
1766 Opcode 0x1d - Server Add Characteristic command/response
1768 Command parameters: Server (4 octets)
1769 Service handle (4 octets)
1771 Properties (4 octets)
1772 Permissions (4 octets)
1773 Response parameters: <none>
1775 In case of an error, the error response will be returned.
1777 Opcode 0x1e - Server Add Descriptor command/response
1779 Command parameters: Server (4 octets)
1780 Service handle (4 octets)
1782 Permissions (4 octets)
1783 Response parameters: <none>
1785 In case of an error, the error response will be returned.
1787 Opcode 0x1f - Server Start Service command/response
1789 Command parameters: Server (4 octets)
1790 Service handle (4 octets)
1791 Transport (4 octets)
1792 Response parameters: <none>
1794 In case of an error, the error response will be returned.
1796 Opcode 0x20 - Server Stop Service command/response
1798 Command parameters: Server (4 octets)
1799 Service handle (4 octets)
1800 Response parameters: <none>
1802 In case of an error, the error response will be returned.
1804 Opcode 0x21 - Server Delete Service command/response
1806 Command parameters: Server (4 octets)
1807 Service handle (4 octets)
1808 Response parameters: <none>
1810 In case of an error, the error response will be returned.
1812 Opcode 0x22 - Server Send Indication command/response
1814 Command parameters: Server (4 octets)
1815 Attribute handle (4 octets)
1816 Connection ID (4 octets)
1818 Confirmation (4 octets)
1820 Response parameters: <none>
1822 In case of an error, the error response will be returned.
1824 Opcode 0x23 - Server Send Response command/response
1826 Command parameters: Connection ID (4 octets)
1827 Transaction ID (4 octets)
1830 Auth Request (1 octect)
1832 GATT Response (4 octets)
1833 Response parameters: <none>
1835 Valid GATT Response: GATT Value (607 octets)
1838 Valid GATT Value: Value (600 octets)
1842 Authentication Request (1 octet)
1844 In case of an error, the error response will be returned.
1846 Opcode 0x24 - Client Scan Filter Params Setup command/response
1848 Command parameters: Client Interface (4 octets)
1850 Filter Index (4 octets)
1852 List Type (4 octets)
1853 Filter Type (4 octets)
1854 RSSI High Threshold (4 octets)
1855 RSSI Low Threshold (4 octets)
1856 Delivery Mode (4 octets)
1857 Found Timeout (4 octets)
1858 Lost Timeout (4 octets)
1859 Found Timeout Count (4 octets)
1860 Response parameters: <none>
1862 In case of an error, the error response will be returned.
1864 Opcode 0x25 - Client Scan Filter Add Remove command/response
1866 Command parameters: Client Interface (4 octets)
1868 Filter Type (4 octets)
1869 Filter Index (4 octets)
1870 Company ID (4 octets)
1871 Company ID Mask (4 octets)
1873 UUID Mask (16 octets)
1875 Address Type (1 octet)
1876 Data Length (4 octets)
1878 Mask Length (4 octets)
1880 Response parameters: <none>
1882 In case of an error, the error response will be returned.
1884 Opcode 0x26 - Client Scan Filter Clear command/response
1886 Command parameters: Client Interface (4 octets)
1887 Filter Index (4 octets)
1888 Response parameters: <none>
1890 In case of an error, the error response will be returned.
1892 Opcode 0x27 - Client Scan Filter Enable command/response
1894 Command parameters: Client Interface (4 octets)
1896 Response parameters: <none>
1898 In case of an error, the error response will be returned.
1900 Opcode 0x28 - Client Configure MTU command/response
1902 Command parameters: Connection ID (4 octets)
1904 Response parameters: <none>
1906 In case of an error, the error response will be returned.
1908 Opcode 0x29 - Client Connection Parameter Update command/response
1910 Command parameters: Address (6 octets)
1911 Min Interval (4 octets)
1912 Max Interval (4 octets)
1915 Response parameters: <none>
1917 In case of an error, the error response will be returned.
1919 Opcode 0x2a - Client Set Scan Parameters command/response
1921 Command parameters: Scan Interval (4 octets)
1922 Scan Window (4 octets)
1923 Response parameters: <none>
1925 In case of an error, the error response will be returned.
1927 Opcode 0x2b - Client Setup Multi Advertising command/response
1929 Command parameters: Client ID (4 octets)
1930 Min Interval (4 octets)
1931 Max Interval (4 octets)
1933 Channel Map (4 octets)
1936 Response parameters: <none>
1938 In case of an error, the error response will be returned.
1940 Opcode 0x2c - Client Update Multi Advertising command/response
1942 Command parameters: Client ID (4 octets)
1943 Min Interval (4 octets)
1944 Max Interval (4 octets)
1946 Channel Map (4 octets)
1949 Response parameters: <none>
1951 In case of an error, the error response will be returned.
1953 Opcode 0x2d - Client Setup Multi Advertising Instance command/response
1955 Command parameters: Client ID (4 octets)
1956 Set Scan Response (1 octet)
1957 Include Name (1 octet)
1958 Include TX Power (1 octet)
1959 Appearance (4 octets)
1960 Manufacturer Data Length (4 octets)
1961 Manufacturer Data (variable)
1962 Service Data Length (4 octets)
1963 Service Data (variable)
1964 Service UUID Length (4 octets)
1965 Service UUID (variable)
1966 Response parameters: <none>
1968 In case of an error, the error response will be returned.
1970 Opcode 0x2e - Client Disable Multi Advertising Instance command/response
1972 Command parameters: Client ID (4 octets)
1973 Response parameters: <none>
1975 In case of an error, the error response will be returned.
1977 Opcode 0x2f - Client Configure Batchscan command/response
1979 Command parameters: Client ID (4 octets)
1981 Trunc Max (4 octets)
1982 Notify Threshold (4 octets)
1983 Response parameters: <none>
1985 In case of an error, the error response will be returned.
1987 Opcode 0x30 - Client Enable Batchscan command/response
1989 Command parameters: Client ID (4 octets)
1990 Scan Mode (4 octets)
1991 Scan Interval (4 octets)
1992 Scan Window (4 octets)
1993 Address Type (4 octets)
1994 Discard Rule (4 octets)
1995 Response parameters: <none>
1997 In case of an error, the error response will be returned.
1999 Opcode 0x31 - Client Disable Batchscan command/response
2001 Command parameters: Client ID (4 octets)
2002 Response parameters: <none>
2004 In case of an error, the error response will be returned.
2006 Opcode 0x32 - Client Read Batchscan Resports command/response
2008 Command parameters: Client ID (4 octets)
2009 Scan Mode (4 octets)
2010 Response parameters: <none>
2012 In case of an error, the error response will be returned.
2016 Opcode 0x81 - Client Register notification
2018 Notification parameters: Status (4 octets)
2019 Client Interface (4 octets)
2022 Opcode 0x82 - Client Scan Result notification
2024 Notification parameters: Address (6 octets)
2029 Opcode 0x83 - Client Connect Device notification
2031 Notification parameters: Connection ID (4 octets)
2033 Client Interface (4 octets)
2036 Opcode 0x84 - Client Disconnect Device notification
2038 Notification parameters: Connection ID (4 octets)
2040 Client Interface (4 octets)
2043 Opcode 0x85 - Client Search Complete notification
2045 Notification parameters: Connection ID (4 octets)
2048 Opcode 0x86 - Client Search Result notification
2050 Notification parameters: Connection ID (4 octets)
2051 GATT Service ID (18 octets)
2053 Opcode 0x87 - Client Get Characteristic notification
2055 Notification parameters: Connection ID (4 octets)
2057 GATT Service ID (18 octets)
2058 GATT Characteristic ID (17 octets)
2059 Char Prop. (4 octets)
2061 Opcode 0x88 - Client Get Descriptor notification
2063 Notification parameters: Connection ID (4 octets)
2065 GATT Service ID (18 octets)
2066 GATT Characteristic ID (17 octets)
2067 GATT Descriptor ID (17 octets)
2069 Opcode 0x89 - Client Get Included Service notification
2071 Notification parameters: Connection ID (4 octets)
2073 GATT Service ID (18 octets)
2074 GATT Included Service ID (18 octets)
2076 Opcode 0x8a - Client Register For Notification notification
2078 Notification parameters: Connection ID (4 octets)
2079 Registered (4 octets)
2081 GATT Service ID (18 octets)
2082 GATT Characteristic ID (17 octets)
2084 Opcode 0x8b - Client Notify notification
2086 Notification parameters: Connection ID (4 octets)
2088 GATT Service ID (18 octets)
2089 GATT Characteristic ID (17 octets)
2094 Opcode 0x8c - Client Read Characteristic notification
2096 Notification parameters: Connection ID (4 octets)
2098 GATT Read Parameters (variable)
2100 Valid GATT Read Parameters: GATT Service ID (18 octets)
2101 GATT Characteristic ID (17 octets)
2102 GATT Descriptor ID (17 octets)
2103 Value Type (4 octets)
2108 Opcode 0x8d - Client Write Characteristic notification
2110 Notification parameters: Connection ID (4 octets)
2112 GATT Write Parameters (53 octets)
2114 Valid GATT Write Parameters: GATT Service ID (18 octets)
2115 GATT Characteristic ID (17 octets)
2116 GATT Description ID (17 octets)
2119 Opcode 0x8e - Client Read Descriptor notification
2121 Notification parameters: Connection ID (4 octets)
2123 GATT Read Parameters (variable)
2125 Valid GATT Read Parameters: As described in Read Characteristic
2127 Opcode 0x8f - Client Write Descriptor notification
2129 Notification parameters: Connection ID (4 octets)
2131 GATT Write Parameters (53 octets)
2133 Valid GATT Write Parameters: As described in Write Characteristic
2135 Opcode 0x90 - Client Execute Write notification
2137 Notification parameters: Connection ID (4 octets)
2140 Opcode 0x91 - Client Read Remote RSSI notification
2142 Notification parameters: Client (4 octets)
2147 Opcode 0x92 - Client Listen notification
2149 Notification parameters: Status (4 octets)
2150 Server Interface (4 octets)
2152 Opcode 0x93 - Server Register notification
2154 Notification parameters: Status (4 octets)
2158 Opcode 0x94 - Server Connection notification
2160 Notification parameters: Connection ID (4 octets)
2162 Connected (4 octets)
2165 Opcode 0x95 - Server Service Added notification
2167 Notification parameters: Status (4 octets)
2169 GATT Service ID (18 octets)
2170 Service Handle (4 octets)
2172 Opcode 0x96 - Server Included Service Added notification
2174 Notification patemeters: Status (4 octets)
2176 Service Handle (4 octets)
2177 Included Service Handle (4 octets)
2179 Opcode 0x97 - Server Characteristic Added notification
2181 Notification parameters: Status (4 octets)
2184 Service Handle (4 octets)
2185 Characteristic Handle (4 octets)
2187 Opcode 0x98 - Server Descriptor Added notification
2189 Notification parameters: Status (4 octets)
2192 Service Handle (4 octets)
2193 Descriptor Handle (4 octets)
2195 Opcode 0x99 - Server Service Started notification
2197 Notification parameters: Status (4 octets)
2199 Service Handle (4 octets)
2201 Opcode 0x9a - Server Service Stopped notification
2203 Notification parameters: Status (4 octets)
2205 Service Handle (4 octets)
2207 Opcode 0x9b - Server Service Deleted notification
2209 Notification parameters: Status (4 octets)
2211 Service Handle (4 octets)
2213 Opcode 0x9c - Server Request Read notification
2215 Notification parameters: Connection ID (4 octets)
2218 Attribute Handle (4 octets)
2222 Opcode 0x9d - Server Request Write notification
2224 Notification parameters: Connection ID (4 octets)
2227 Attribute Handle (4 octets)
2230 Need Response (4 octets)
2231 Is Prepare (1 octet)
2234 Opcode 0x9e - Server Request Execute Write notification
2236 Notification parameters: Connection ID (4 octets)
2239 Execute Write (4 octets)
2241 Opcode 0x9f - Server Response Confirmation notification
2243 Notification parameters: Status (4 octets)
2246 Opcode 0xa0 - Client Configure MTU notification
2248 Notification parameters: Connection ID (4 octets)
2252 Opcode 0xa1 - Client Filter Configuration notification
2254 Notification parameters: Action (4 octets)
2255 Client ID (4 octets)
2257 Filter Type (4 octets)
2258 Available Space (4 octets)
2260 Opcode 0xa2 - Client Filter Parameters notification
2262 Notification parameters: Action (4 octets)
2263 Client ID (4 octets)
2265 Available Space (4 octets)
2267 Opcode 0xa3 - Client Filter Status notification
2269 Notification parameters: Enable (4 octets)
2270 Client ID (4 octets)
2273 Opcode 0xa4 - Client Multi Advertising Enable notification
2275 Notification parameters: Client ID (4 octets)
2278 Opcode 0xa5 - Client Multi Advertising Update notification
2280 Notification parameters: Client ID (4 octets)
2283 Opcode 0xa6 - Client Multi Advertising Data notification
2285 Notification parameters: Client ID (4 octets)
2288 Opcode 0xa7 - Client Multi Advertising Disable notification
2290 Notification parameters: Client ID (4 octets)
2293 Opcode 0xa8 - Client Congestion notification
2295 Notification parameters: Connection ID (4 octets)
2298 Opcode 0xa9 - Client Configure Batchscan notification
2300 Notification parameters: Client ID (4 octets)
2303 Opcode 0xaa - Client Enable Batchscan notification
2305 Notification parameters: Action (4 octets)
2306 Client ID (4 octets)
2309 Opcode 0xab - Client Batchscan Reports notification
2311 Notification parameters: Client ID (4 octets)
2313 Report Format (4 octets)
2314 Num Reports (4 octets)
2315 Data Length (4 octets)
2318 Opcode 0xac - Client Batchscan Threshold notification
2320 Notification parameters: Client ID (4 octets)
2322 Opcode 0xad - Client Track ADV notification
2324 Notification parameters: Client ID (4 octets)
2325 Filter Index (4 octets)
2326 Address Type (4 octets)
2330 Opcode 0xae - Server Indication Sent notification
2332 Notification parameters: Connection ID (4 octets)
2335 Opcode 0xaf - Server Congestion notification
2337 Notification parameters: Connection ID (4 octets)
2340 Opcode 0xb0 - Server MTU Changed notification
2342 Notification parameters: Connection ID (4 octets)
2346 Bluetooth Handsfree Client HAL (ID 10)
2347 ======================================
2349 Android HAL name: "hf_client" (BT_PROFILE_HANDSFREE_CLIENT_ID)
2351 Commands and response:
2353 Opcode 0x00 - Error response
2355 Opcode 0x01 - Connect command/respose
2357 Command parameters: Remote address (6 octects)
2358 Response parameters: <none>
2360 In case of an error, the error response will be returned.
2362 Opcode 0x02 - Disonnect command/response
2364 Command parameters: Remote address (6 octetcs)
2365 Response parameters: <none>
2367 In case of an error, the error response will be returned.
2369 Opcode 0x03 - Connect Audio command/response
2371 Command parameters: Remote address (6 octets)
2372 Response parameters: <none>
2374 In case of an error, the error response will be returned.
2376 Opcode 0x04 - Disconnect Audio command/response
2378 Command parameters: Remote address (6 octets)
2379 Response parameters: <none>
2381 In case of an error, the error response will be returned.
2383 Opcode 0x05 - Start Voice Recognition command/response
2385 Command parameters: <none>
2386 Response parameters: <none>
2388 In case of an error, the error response will be returned.
2390 Opcode 0x06 - Stop Voice Recognition command/response
2392 Command parameters: <none>
2393 Response parameters: <none>
2395 In case of an error, the error response will be returned.
2397 Opcode 0x07 - Volume Control command/response
2399 Command parameters: Volume type (1 octet)
2401 Response parameters: <none>
2403 Valid volume types: 0x00 = Speaker
2406 In case of an error, the error response will be returned.
2408 Opcode 0x08 - Dial command/response
2410 Command parameters: Number (string)
2411 Response parameters: <none>
2413 In case of an error, the error response will be returned.
2415 Opcode 0x09 - Dial Memory command/response
2417 Command parameters: Location (4 octet)
2418 Response parameters: <none>
2420 In case of an error, the error response will be returned.
2422 Opcode 0x10 - Handle Call Action command/response
2424 Command parameters: Action (1 octet)
2425 Call Index (1 octet)
2426 Response parameters: <none>
2428 Valid actions: 0x00 = CHLD_0
2441 In case of an error, the error response will be returned.
2443 Opcode 0x11 - Query Current Calls commad/response
2445 Command parameters: <none>
2446 Response parameters: <none>
2448 In case of an error, the error response will be returned.
2450 Opcode 0x12 - Query Current Operator Name
2452 Command parameters: <none>
2453 Response parameters: <none>
2455 In case of an error, the error response will be returned.
2457 Opcode 0x13 - Retrieve Subscriber Info command/response
2459 Command parameters: <none>
2460 Response parameters: <none>
2462 In case of an error, the error response will be returned.
2464 Opcode 0x14 - Send DTMF Tone command/response
2466 Command parameters: Tone (1 octet)
2467 Response parameters: <none>
2469 In case of an error, the error response will be returned.
2471 Opcode 0x15 - Request Last Voice Tag Number command/response
2473 Command parameters: <none>
2474 Response parameters: <none>
2476 In case of an error, the error response will be returned.
2480 Opcode 0x81 - Connection State Changed notification
2482 Notification parameters: State (1 octet)
2483 Peer Features (4 octets)
2484 CHLD Features (4 octets)
2487 Valid State values: 0x00 = Disconnected
2490 0x03 = SLC Connected
2491 0x04 = Disconnecting
2493 Peer Features is a bitmask of the supported features. Currently
2497 1 Echo cancellation and/or noise reduction
2500 4 Attach a number to a voice tag
2501 5 Ability to reject a call
2502 6 Enhanced call status
2503 7 Enhanced call control
2504 8 Extended Error Result Codes
2505 9 Codec negotiations
2506 10-31 Reserved for future use
2508 CHLD Features is a bitmask of the supported features. Currently
2511 0 Release waiting call or held calls
2512 1 Release active calls and accept other call
2513 2 Release specified active call only
2514 3 Place all active calls on hold and accept other call
2515 4 Request private mode with secified call
2516 5 Add a held call to the multiparty
2517 6 Connect two calls and leave multiparty
2518 7-31 Reserved for future use
2520 Note: Peer and CHLD Features are valid only in SCL Connected state
2523 Opcode 0x82 - Audio State Changed notification
2525 Notification parameters: State (1 octet)
2528 Valid State values: 0x00 = Disconnected
2531 0x03 = Connected mSBC
2533 Opcode 0x83 - Voice Recognition State Changed notification
2535 Notification parameters: State (1 octet)
2537 Valid State values: 0x00 = VR Stopped
2540 Opcode 0x84 - Network State Changed notification
2542 Notification parameters: State (1 octet)
2544 Valid State values: 0x00 = Network Not Available
2545 0x01 = Network Available
2547 Opcode 0x85 - Network Roaming Type Changed notification
2549 Notification parameters: Type (1 octet)
2551 Valid Type values: 0x00 = Home
2554 Opcode 0x86 - Network Signal Strength notification
2556 Notification parameters: Signal Strength (1 octet)
2558 Opcode 0x87 - Battery Level notification
2560 Notification parameters: Battery Level (1 octet)
2562 Opcode 0x88 - Current Operator Name notification
2564 Notification parameters: Name (string)
2566 Opcode 0x89 - Call Indicatior notification
2568 Notification parameters: Call (1 octet)
2570 Valid Call values: 0x00 = No Call In Progress
2571 0x01 = Call In Progress
2573 Opcode 0x8a - Call Setup Indicator notification
2575 Notification parameters: Call Setup (1 octet)
2577 Valid Call Setup values: 0x00 = None
2582 Opcode 0x8b - Call Held Indicator notification
2584 Notification parameters: Call Held (1 octet)
2586 Valid Call Held values: 0x00 = None
2587 0x01 = Hold and Active
2590 Opcode 0x8c - Resposne and Hold Status notification
2592 Notification parameters: Status (1 octet)
2594 Valid Status values: 0x00 = Held
2598 Opcode 0x8d - Calling Line Identification notification
2600 Notification parameters: Number (string)
2602 Note: This will be called only on incoming call if number is
2605 Opcode 0x8e - Call Waiting notification
2607 Notification parameters: Nunmber (string)
2609 Opcode 0x8f - Current Calls List notification
2611 Notification parameters: Index (1 octet)
2613 Call State (1 octet)
2614 Multiparty (1 octet)
2617 Valid Direction values: 0x00 = Outgoing
2620 Valid Call Sate values: 0x00 = Active
2626 0x06 = Call held by Response and Hold
2628 Valid Multiparty values: 0x00 = Single Call
2629 0x01 = Multiparty (conference) Call
2631 Note: Number might be empty
2633 Opcode 0x90 - Volume Changed notification
2635 Notification parameters: Type (1 octet)
2638 Valid Type values: 0x00 = Speaker
2641 Opcode 0x91 - Command Complete Callback notification
2643 Notification parameters: Type (1 octet)
2646 Valid Type values: 0x00 = OK
2648 0x02 = Error no carrier
2650 0x04 = Error no answer
2651 0x05 = Error delayed
2652 0x06 = Error blacklisted
2655 Note: CME parameter is valid only for Error CME type
2657 Opcode 0x92 - Subscriber Service Info Callback notification
2659 Notification parameters: Name (string)
2662 Valid Type values: 0x00 = Service unknown
2663 0x01 = Service voice
2666 Opcode 0x93 - In Band Ring Settings Callback notification
2668 Notification parameters: State (1 octet)
2670 Valid State values: 0x00 = In band ringtone not provided
2671 0x01 = In band ringtone provided
2673 Opcode 0x94 - Last Voice Call Tag Number Callback notification
2675 Notification parameters: Number (string)
2677 Opcode 0x95 - Ring Indication notification
2679 Notification parameters: <none>
2682 Bluetooth Map Client HAL (ID 11)
2683 =========================
2685 Android HAL name: "map_client" (BT_PROFILE_MAP_CLIENT_ID)
2687 Commands and responses:
2689 Opcode 0x00 - Error response
2691 Opcode 0x01 - Get Remote MAS Instances
2693 Command parameters: Remote address (6 octets)
2694 Response parameters: <none>
2696 In case of an error, the error response will be returned.
2700 Opcode 0x81 - Remote MAS Instances notification
2702 Notification parameters: Status (1 octet)
2703 Remote address (6 octets)
2704 Number of instances (4 octets)
2705 Instance ID # (4 octets)
2706 Channel # (4 octets)
2707 Message types (4 octets)
2710 Bluetooth Remote Control Controller HAL (ID 12)
2711 ===================================
2713 Android HAL name: "avrcp-ctrl" (BT_PROFILE_AV_RC_CTRL_ID)
2715 Commands and responses:
2717 Opcode 0x00 - Error response
2719 Opcode 0x01 - Send Pass Through command/response
2721 Command parameters: Remote Address (6 octets)
2725 In case of an error, the error response will be returned.
2729 Opcode 0x81 - Passthrough Response Notification
2731 Notification parameters: ID (1 octet)
2734 Opcode 0x82 - Connection State Notification
2736 Notification parameters: State (1 octet)
2737 Remote Address (6 octets)