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)
1072 Bluetooth Advanced Audio HAL (ID 6)
1073 Bluetooth Advanced Audio Sink HAL (ID 13)
1074 =========================================
1076 Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID)
1077 Android HAL name: "a2dp_sink" (BT_PROFILE_ADVANCED_AUDIO__SINK_ID)
1079 Commands and responses:
1081 Opcode 0x00 - Error response
1083 Opcode 0x01 - Connect command/response
1085 Command parameters: Remote address (6 octets)
1086 Response parameters: <none>
1088 In case of an error, the error response will be returned.
1090 Opcode 0x02 - Disconnect command/response
1092 Command parameters: Remote address (6 octets)
1093 Response parameters: <none>
1095 In case of an error, the error response will be returned.
1099 Opcode 0x81 - Connection State notification
1101 Notification parameters: Connection state (1 octet)
1102 Remote address (6 octets)
1104 Valid connection states: 0x00 = Disconnected
1107 0x03 = Disconnecting
1109 Opcode 0x82 - Audio State notification
1111 Notification parameters: Audio state (1 octet)
1112 Remote address (6 octets)
1114 Valid connection states: 0x00 = Remote suspend
1118 Opcode 0x83 - Audio Configuration notification
1120 Notification parameters: Remote address (6 octets)
1121 Sample Rate in Hz (4 octets)
1122 Channel Count (1 octet)
1124 Valid channel count: 0x01 = Mono
1127 Bluetooth Health HAL (ID 7)
1128 ===========================
1130 Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
1132 Commands and responses:
1134 Opcode 0x00 - Error response
1136 Opcode 0x01 - Register Application command/response
1138 Command parameters: Number of MDEP (1 octet)
1139 Application name offset (2 octets)
1140 Provider name offset (2 octets)
1141 Service name offset (2 octets)
1142 Service description offset (2 octets)
1143 Data length (2 octets)
1145 Response parameters: Application ID (2 octets)
1147 Strings are null terminated.
1148 In case of an error, the error response will be returned.
1150 Opcode 0x02 - Register Application MDEP data command/response
1152 Command parameters: Application ID (2 octets)
1154 Data type (2 octets)
1155 Channel type (1 octet)
1156 MDEP description length (2 octets)
1157 MDEP description (MDEP desciption length)
1158 Response parameters: <none>
1160 In case of an error, the error response will be returned.
1162 Opcode 0x03 - Unregister Application command/response
1164 Command parameters: Application ID (2 octets)
1165 Response parameters: <none>
1167 In case of an error, the error response will be returned.
1169 Opcode 0x04 - Connect Channel command/response
1171 Command parameters: Application ID (2 octets)
1172 Remote address (6 octets)
1173 MDEP index (1 octet)
1174 Response parameters: Channel ID (2 octets)
1176 In case of an error, the error response will be returned.
1178 Opcode 0x05 - Destroy Channel command/response
1180 Command parameters: Channel ID (2 octets)
1181 Response parameters: <none>
1183 In case of an error, the error response will be returned.
1187 Opcode 0x81 - Application Registration State notification
1189 Notification parameters: Application ID (2 octets)
1190 Application state (1 octet)
1192 Valid application states: 0x00 = Registration success
1193 0x01 = Registration failed
1194 0x02 = Deregistration success
1195 0x03 = Deregistration failed
1197 Opcode 0x82 - Channel State notification
1199 Notification parameters: Application ID (2 octets)
1200 Remote address (6 octets)
1201 MDEP index (1 octet)
1202 Channel ID (2 octets)
1203 Channel state (1 octet)
1204 File descriptor (inline)
1206 Valid channel states: 0x00 = Connecting
1208 0x02 = Disconnecting
1213 Bluetooth Remote Control Target HAL (ID 8)
1214 ===================================
1216 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
1218 Commands and responses:
1220 Opcode 0x00 - Error response
1222 Opcode 0x01 - Get Play Status Response command/response
1224 Command parameters: Status (1 octet)
1228 In case of an error, the error response will be returned.
1230 Valid status values: 0x00 = Stopped
1237 Opcode 0x02 - List Player Attributes Response command/response
1239 Command parameters: Number of attributes (1 octet)
1240 Attribute # (1 octet)
1243 In case of an error, the error response will be returned.
1245 Valid attributes: 0x01 = Equalizer
1250 Opcode 0x03 - List Player Values Response command/response
1252 Command parameters: Number of values (1 octet)
1256 In case of an error, the error response will be returned.
1258 Opcode 0x04 - Get Player Values Response command/response
1260 Command parameters: Number of attributes (1 octet)
1261 Attribute # (1 octet)
1265 In case of an error, the error response will be returned.
1267 Valid attributes: Same as in List Player Attributes
1269 Opcode 0x05 - Get Player Attributes Text Response command/response
1271 Command parameters: Number of attributes (1 octet)
1272 Attribute # (1 octet)
1273 Attribute # text length (1 octet)
1274 Attribute # text (variable)
1277 In case of an error, the error response will be returned.
1279 Valid attributes: Same as in List Player Attributes
1281 Opcode 0x06 - Get Player Values Text Response command/response
1283 Command parameters: Number of values (1 octet)
1285 Value # text length (1 octet)
1286 Value # text (variable)
1289 In case of an error, the error response will be returned.
1291 Opcode 0x07 - Get Element Attributes Text Response command/response
1293 Command parameters: Number of elements (1 octet)
1295 Element # text length (1 octet)
1296 Element # text (variable)
1299 In case of an error, the error response will be returned.
1301 Valid elements: 0x01 = Title
1305 0x05 = Number of Tracks
1309 Opcode 0x08 - Set Player Attributes Value Response command/response
1311 Command parameters: Status (1 octet)
1313 In case of an error, the error response will be returned.
1315 Valid status values: Same as in Get Play Status Response
1317 Opcode 0x09 - Register Notification Response command/response
1319 Command parameters: Event (1 octet)
1321 Data length (1 octet)
1324 In case of an error, the error response will be returned.
1326 Valid event values: 0x01 = Status Changed
1327 0x02 = Track Changed
1328 0x03 = Track Reached End
1329 0x04 = Track Reached Start
1330 0x05 = Position Changed
1331 0x08 = Setting Changed
1333 Valid type values : 0x00 = Interim
1336 Opcode 0x0a - Set Volume command/response
1338 Command parameters: Value (1 octet)
1340 In case of an error, the error response will be returned.
1344 Opcode 0x81 - Remote Features notification
1346 Notification parameters: Remote address (6 octets)
1349 Valid features values : 0x00 = None
1351 0x02 = Absolute Volume
1354 Opcode 0x82 - Get Play Status notification
1356 Notification parameters: <none>
1358 Opcode 0x83 - List Player Attributes notification
1360 Notification parameters: <none>
1362 Opcode 0x84 - List Player Values notification
1364 Notification parameters: Attribute (1 octet)
1366 Valid attribute values: Same as in List Player Attributes
1368 Opcode 0x85 - Get Player Values notification
1370 Notification parameters: Number of attributes (1 octet)
1371 Attribute # (1 octet)
1374 Valid attribute values: Same as in List Player Attributes
1376 Opcode 0x86 - Get Player Attributes Text 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 0x87 - Get Player Values Text notification
1386 Notification parameters: Attribute (1 octet)
1387 Number of values (1 octet)
1391 Valid attribute values: Same as in List Player Attributes
1393 Opcode 0x88 - Set Player Values notification
1395 Notification parameters: Number of attributes (1 octet)
1396 Attribute # (1 octet)
1400 Valid attribute values: Same as in List Player Attributes
1402 Opcode 0x89 - Get Element Attributes notification
1404 Notification parameters: Number of attributes (1 octet)
1405 Attribute # (1 octet)
1408 Valid attribute values: Same as in Get Element Attribute
1410 Opcode 0x8a - Register Notification notification
1412 Notification parameters: Event (1 octet)
1413 Parameter (4 octets)
1415 Valid event values: Same as in Register Notification
1417 Opcode 0x8b - Volume Changed notification
1419 Notification parameters: Volume (1 octet)
1422 Valid type values: Same as in Register Notification
1424 Opcode 0x8c - Passthrough Command notification
1426 Notification parameters: ID (1 octet)
1429 Bluetooth GATT HAL (ID 9)
1430 =========================
1432 Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
1436 GATT Service ID: UUID (16 octets)
1437 Instance ID (1 octet)
1438 Is Primary (1 octet)
1440 GATT Included Service ID: UUID (16 octets)
1441 Instance ID (1 octet)
1442 Is Primary (1 octet)
1444 GATT Characteristic ID: UUID (16 octets)
1445 Instance ID (1 octet)
1447 GATT Descriptor ID: UUID (16 octets)
1448 Instance ID (1 octet)
1450 Commands and responses:
1452 Opcode 0x00 - Error response
1454 Opcode 0x01 - Client Register command/response
1456 Command parameters: Service UUID (16 octets)
1457 Response parameters: <none>
1459 In case of an error, the error response will be returned.
1461 Opcode 0x02 - Client Unregister command/response
1463 Command parameters: Client Interface (4 octets)
1464 Response parameters: <none>
1466 In case of an error, the error response will be returned.
1468 Opcode 0x03 - Client Scan command/response
1470 Command parameters: Client Interface (4 octets)
1472 Response parameters: <none>
1474 In case of an error, the error response will be returned.
1476 Opcode 0x04 - Client Connect Device command/response
1478 Command parameters: Client Interface (4 octets)
1479 Remote address (6 octets)
1481 Transport (4 octets)
1482 Response parameters: <none>
1484 Valid transport value: 0x00 = Auto
1488 In case of an error, the error response will be returned.
1490 Opcode 0x05 - Client Disconnect Device command/response
1492 Command parameters: Client Interface (4 octets)
1493 Remote address (6 octets)
1494 Connection ID (4 octets)
1495 Response parameters: <none>
1497 In case of an error, the error response will be returned.
1499 Opcode 0x06 - Client Listen command/response
1501 Command parameters: Client Interface (4 octets)
1503 Response parameters: <none>
1505 In case of an error, the error response will be returned.
1507 Opcode 0x07 - Client Refresh command/response
1509 Command parameters: Client Interface (4 octets)
1510 Remote address (6 octets)
1511 Response parameters: <none>
1513 In case of an error, the error response will be returned.
1515 Opcode 0x08 - Client Search Service command/response
1517 Command parameters: Connection ID (4 octets)
1519 Filter UUID (16 octets)
1520 Response parameters: <none>
1522 Filter UUID shall only be present when Filtered is non-zero.
1524 In case of an error, the error response will be returned.
1526 Opcode 0x09 - Client Get Included Service command/response
1528 Command parameters: Connection ID (4 octets)
1529 GATT Service ID (18 octets)
1530 Continuation (1 octet)
1531 GATT Included Service ID (18 octets)
1533 Response parameters: <none>
1535 GATT Included Service ID shall only be present when Continuation
1538 In case of an error, the error response will be returned.
1540 Opcode 0x0a - Client Get Characteristic command/response
1542 Command parameters: Connection ID (4 octets)
1543 GATT Service ID (18 octets)
1544 Continuation (1 octet)
1545 GATT Characteristic ID (17 octets)
1547 Response parameters: <none>
1549 GATT Characteristic ID shall only be present when Continuation
1552 In case of an error, the error response will be returned.
1554 Opcode 0x0b - Client Get Descriptor command/response
1556 Command parameters: Connection ID (4 octets)
1557 GATT Service ID (18 octets)
1558 GATT Characteristic ID (17 octets)
1559 Continuation (1 octet)
1560 GATT Descriptor ID (17 octets)
1562 Response parameters: <none>
1564 GATT Descriptor ID shall only be present when Continuation is
1567 In case of an error, the error response will be returned.
1569 Opcode 0x0c - Client Read Characteristic command/response
1571 Command parameters: Connection ID (4 octets)
1572 GATT Service ID (18 octets)
1573 GATT Characteristic ID (17 octets)
1574 Authorization (4 octets)
1575 Response parameters: <none>
1577 In case of an error, the error response will be returned.
1579 Opcode 0x0d - Client Write Characteristic command/response
1581 Command parameters: Connection ID (4 octets)
1582 GATT Service ID (18 octets)
1583 GATT Characteristic ID (17 octets)
1584 Write Type (4 octets)
1586 Authorization Req. (4 octets)
1588 Response parameters: <none>
1590 Valid Write Type: 0x01 = No response
1595 In case of an error, the error response will be returned.
1597 Opcode 0x0e - Client Read Descriptor command/response
1599 Command parameters: Connection ID (4 octets)
1600 GATT Service ID (18 octets)
1601 GATT Characteristic ID (17 octets)
1602 GATT Descriptor ID (17 octets)
1603 Authorization Req. (4 octets)
1604 Response parameters: <none>
1606 In case of an error, the error response will be returned.
1608 Opcode 0x0f - Client Write Descriptor command/response
1610 Command parameters: Connection ID (4 octets)
1611 GATT Service ID (18 octets)
1612 GATT Characteristic ID (17 octets)
1613 GATT Descriptor ID (17 octets)
1614 Write Type (4 octets)
1616 Authorization Req. (4 octets)
1618 Response parameters: <none>
1620 Valid Write Type: 0x01 = No response
1625 In case of an error, the error response will be returned.
1627 Opcode 0x10 - Client Execute Write command/response
1629 Command parameters: Connection ID (4 octets)
1631 Response parameters: <none>
1633 In case of an error, the error response will be returned.
1635 Opcode 0x11 - Client Register For Notification command/response
1637 Command parameters: Client Interface (4 octets)
1638 Remote address (6 octets)
1639 GATT Service ID (18 octets)
1640 GATT Characteristic ID (17 octets)
1641 Response parameters: <none>
1643 In case of an error, the error response will be returned.
1645 Opcode 0x12 - Client Deregister For Notification command/response
1647 Command parameters: Client Interface (4 octets)
1648 Remote address (6 octets)
1649 GATT Service ID (18 octets)
1650 GATT Characteristic ID (17 octets)
1651 Response parameters: <none>
1653 In case of an error, the error response will be returned.
1655 Opcode 0x13 - Client Read Remote RSSI command/response
1657 Command parameters: Client Interface (4 octets)
1658 Remote address (6 octets)
1659 Response parameters: <none>
1661 In case of an error, the error response will be returned.
1663 Opcode 0x14 - Client Get Device Type command/response
1665 Command parameters: Remote address (6 octets)
1666 Response parameters: Device Type
1668 Valid Device Type: 0x01 = BREDR
1672 In case of an error, the error response will be returned.
1674 Opcode 0x15 - Client Set Advertising data command/response
1676 Command parameters: Server Interface (4 octets)
1677 Set Scan Resp. (1 octet)
1678 Include Name (1 octet)
1679 Include TX Power (1 octet)
1680 Min. Interval (4 octets)
1681 Max. Interval (4 octets)
1682 Appearance (4 octets)
1683 Manufacturer Len. (2 octets)
1684 Manufacturer Data (variable)
1685 Response parameters: <none>
1687 In case of an error, the error response will be returned.
1689 Opcode 0x16 - Client Test Command command/response
1691 Command parameters: Command (4 octets)
1699 Response parameters: <none>
1701 In case of an error, the error response will be returned.
1703 Opcode 0x17 - Server Register command/response
1705 Command parameters: UUID (16 octets)
1706 Response parameters: <none>
1708 In case of an error, the error response will be returned.
1710 Opcode 0x18 - Server Unregister command/response
1712 Command parameters: Server (4 octets)
1713 Response parameters: <none>
1715 In case of an error, the error response will be returned.
1717 Opcode 0x19 - Server Connect Peripheral command/response
1719 Command parameters: Server (4 octets)
1720 Remote address (6 octets)
1722 Transport (4 octets)
1723 Response parameters: <none>
1725 In case of an error, the error response will be returned.
1727 Opcode 0x1a - Server Disconnect Peripheral command/response
1729 Command parameters: Server (4 octets)
1730 Remote address (6 octets)
1731 Connection ID (1 octet)
1732 Response parameters: <none>
1734 In case of an error, the error response will be returned.
1736 Opcode 0x1b - Server Add Service command/response
1738 Command parameters: Server (4 octets)
1739 GATT Service ID (18 octets)
1740 Number of Handles (4 octet)
1741 Response parameters: <none>
1743 Valid GATT Service ID: UUID (16 octets)
1744 Instance ID (1 octet)
1745 Is Primary (1 octet)
1747 In case of an error, the error response will be returned.
1749 Opcode 0x1c - Server Add Included Service command/response
1751 Command parameters: Server (4 octets)
1752 Service handle (4 octets)
1753 Included handle (4 octets)
1754 Response parameters: <none>
1756 In case of an error, the error response will be returned.
1758 Opcode 0x1d - Server Add Characteristic command/response
1760 Command parameters: Server (4 octets)
1761 Service handle (4 octets)
1763 Properties (4 octets)
1764 Permissions (4 octets)
1765 Response parameters: <none>
1767 In case of an error, the error response will be returned.
1769 Opcode 0x1e - Server Add Descriptor command/response
1771 Command parameters: Server (4 octets)
1772 Service handle (4 octets)
1774 Permissions (4 octets)
1775 Response parameters: <none>
1777 In case of an error, the error response will be returned.
1779 Opcode 0x1f - Server Start Service command/response
1781 Command parameters: Server (4 octets)
1782 Service handle (4 octets)
1783 Transport (4 octets)
1784 Response parameters: <none>
1786 In case of an error, the error response will be returned.
1788 Opcode 0x20 - Server Stop Service command/response
1790 Command parameters: Server (4 octets)
1791 Service handle (4 octets)
1792 Response parameters: <none>
1794 In case of an error, the error response will be returned.
1796 Opcode 0x21 - Server Delete 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 0x22 - Server Send Indication command/response
1806 Command parameters: Server (4 octets)
1807 Attribute handle (4 octets)
1808 Connection ID (4 octets)
1810 Confirmation (4 octets)
1812 Response parameters: <none>
1814 In case of an error, the error response will be returned.
1816 Opcode 0x23 - Server Send Response command/response
1818 Command parameters: Connection ID (4 octets)
1819 Transaction ID (4 octets)
1822 Auth Request (1 octect)
1824 GATT Response (4 octets)
1825 Response parameters: <none>
1827 Valid GATT Response: GATT Value (607 octets)
1830 Valid GATT Value: Value (600 octets)
1834 Authentication Request (1 octet)
1836 In case of an error, the error response will be returned.
1838 Opcode 0x24 - Client Scan Filter Params Setup command/response
1840 Command parameters: Client Interface (4 octets)
1842 Filter Index (4 octets)
1844 List Type (4 octets)
1845 Filter Type (4 octets)
1846 RSSI High Threshold (4 octets)
1847 RSSI Low Threshold (4 octets)
1848 Delivery Mode (4 octets)
1849 Found Timeout (4 octets)
1850 Lost Timeout (4 octets)
1851 Found Timeout Count (4 octets)
1852 Response parameters: <none>
1854 In case of an error, the error response will be returned.
1856 Opcode 0x25 - Client Scan Filter Add Remove command/response
1858 Command parameters: Client Interface (4 octets)
1860 Filter Type (4 octets)
1861 Filter Index (4 octets)
1862 Company ID (4 octets)
1863 Company ID Mask (4 octets)
1865 UUID Mask (16 octets)
1867 Address Type (1 octet)
1868 Data Length (4 octets)
1870 Mask Length (4 octets)
1872 Response parameters: <none>
1874 In case of an error, the error response will be returned.
1876 Opcode 0x26 - Client Scan Filter Clear command/response
1878 Command parameters: Client Interface (4 octets)
1879 Filter Index (4 octets)
1880 Response parameters: <none>
1882 In case of an error, the error response will be returned.
1884 Opcode 0x27 - Client Scan Filter Enable command/response
1886 Command parameters: Client Interface (4 octets)
1888 Response parameters: <none>
1890 In case of an error, the error response will be returned.
1892 Opcode 0x28 - Client Configure MTU command/response
1894 Command parameters: Connection ID (4 octets)
1896 Response parameters: <none>
1898 In case of an error, the error response will be returned.
1900 Opcode 0x29 - Client Connection Parameter Update command/response
1902 Command parameters: Address (6 octets)
1903 Min Interval (4 octets)
1904 Max Interval (4 octets)
1907 Response parameters: <none>
1909 In case of an error, the error response will be returned.
1911 Opcode 0x2a - Client Set Scan Parameters command/response
1913 Command parameters: Scan Interval (4 octets)
1914 Scan Window (4 octets)
1915 Response parameters: <none>
1917 In case of an error, the error response will be returned.
1919 Opcode 0x2b - Client Setup Multi Advertising command/response
1921 Command parameters: Client ID (4 octets)
1922 Min Interval (4 octets)
1923 Max Interval (4 octets)
1925 Channel Map (4 octets)
1928 Response parameters: <none>
1930 In case of an error, the error response will be returned.
1932 Opcode 0x2c - Client Update Multi Advertising command/response
1934 Command parameters: Client ID (4 octets)
1935 Min Interval (4 octets)
1936 Max Interval (4 octets)
1938 Channel Map (4 octets)
1941 Response parameters: <none>
1943 In case of an error, the error response will be returned.
1945 Opcode 0x2d - Client Setup Multi Advertising Instance command/response
1947 Command parameters: Client ID (4 octets)
1948 Set Scan Response (1 octet)
1949 Include Name (1 octet)
1950 Include TX Power (1 octet)
1951 Appearance (4 octets)
1952 Manufacturer Data Length (4 octets)
1953 Manufacturer Data (variable)
1954 Service Data Length (4 octets)
1955 Service Data (variable)
1956 Service UUID Length (4 octets)
1957 Service UUID (variable)
1958 Response parameters: <none>
1960 In case of an error, the error response will be returned.
1962 Opcode 0x2e - Client Disable Multi Advertising Instance command/response
1964 Command parameters: Client ID (4 octets)
1965 Response parameters: <none>
1967 In case of an error, the error response will be returned.
1969 Opcode 0x2f - Client Configure Batchscan command/response
1971 Command parameters: Client ID (4 octets)
1973 Trunc Max (4 octets)
1974 Notify Threshold (4 octets)
1975 Response parameters: <none>
1977 In case of an error, the error response will be returned.
1979 Opcode 0x30 - Client Enable Batchscan command/response
1981 Command parameters: Client ID (4 octets)
1982 Scan Mode (4 octets)
1983 Scan Interval (4 octets)
1984 Scan Window (4 octets)
1985 Address Type (4 octets)
1986 Discard Rule (4 octets)
1987 Response parameters: <none>
1989 In case of an error, the error response will be returned.
1991 Opcode 0x31 - Client Disable Batchscan command/response
1993 Command parameters: Client ID (4 octets)
1994 Response parameters: <none>
1996 In case of an error, the error response will be returned.
1998 Opcode 0x32 - Client Read Batchscan Resports command/response
2000 Command parameters: Client ID (4 octets)
2001 Scan Mode (4 octets)
2002 Response parameters: <none>
2004 In case of an error, the error response will be returned.
2008 Opcode 0x81 - Client Register notification
2010 Notification parameters: Status (4 octets)
2011 Client Interface (4 octets)
2014 Opcode 0x82 - Client Scan Result notification
2016 Notification parameters: Address (6 octets)
2021 Opcode 0x83 - Client Connect Device notification
2023 Notification parameters: Connection ID (4 octets)
2025 Client Interface (4 octets)
2028 Opcode 0x84 - Client Disconnect Device notification
2030 Notification parameters: Connection ID (4 octets)
2032 Client Interface (4 octets)
2035 Opcode 0x85 - Client Search Complete notification
2037 Notification parameters: Connection ID (4 octets)
2040 Opcode 0x86 - Client Search Result notification
2042 Notification parameters: Connection ID (4 octets)
2043 GATT Service ID (18 octets)
2045 Opcode 0x87 - Client Get Characteristic notification
2047 Notification parameters: Connection ID (4 octets)
2049 GATT Service ID (18 octets)
2050 GATT Characteristic ID (17 octets)
2051 Char Prop. (4 octets)
2053 Opcode 0x88 - Client Get Descriptor notification
2055 Notification parameters: Connection ID (4 octets)
2057 GATT Service ID (18 octets)
2058 GATT Characteristic ID (17 octets)
2059 GATT Descriptor ID (17 octets)
2061 Opcode 0x89 - Client Get Included Service notification
2063 Notification parameters: Connection ID (4 octets)
2065 GATT Service ID (18 octets)
2066 GATT Included Service ID (18 octets)
2068 Opcode 0x8a - Client Register For Notification notification
2070 Notification parameters: Connection ID (4 octets)
2071 Registered (4 octets)
2073 GATT Service ID (18 octets)
2074 GATT Characteristic ID (17 octets)
2076 Opcode 0x8b - Client Notify notification
2078 Notification parameters: Connection ID (4 octets)
2080 GATT Service ID (18 octets)
2081 GATT Characteristic ID (17 octets)
2086 Opcode 0x8c - Client Read Characteristic notification
2088 Notification parameters: Connection ID (4 octets)
2090 GATT Read Parameters (variable)
2092 Valid GATT Read Parameters: GATT Service ID (18 octets)
2093 GATT Characteristic ID (17 octets)
2094 GATT Descriptor ID (17 octets)
2095 Value Type (4 octets)
2100 Opcode 0x8d - Client Write Characteristic notification
2102 Notification parameters: Connection ID (4 octets)
2104 GATT Write Parameters (53 octets)
2106 Valid GATT Write Parameters: GATT Service ID (18 octets)
2107 GATT Characteristic ID (17 octets)
2108 GATT Description ID (17 octets)
2111 Opcode 0x8e - Client Read Descriptor notification
2113 Notification parameters: Connection ID (4 octets)
2115 GATT Read Parameters (variable)
2117 Valid GATT Read Parameters: As described in Read Characteristic
2119 Opcode 0x8f - Client Write Descriptor notification
2121 Notification parameters: Connection ID (4 octets)
2123 GATT Write Parameters (53 octets)
2125 Valid GATT Write Parameters: As described in Write Characteristic
2127 Opcode 0x90 - Client Execute Write notification
2129 Notification parameters: Connection ID (4 octets)
2132 Opcode 0x91 - Client Read Remote RSSI notification
2134 Notification parameters: Client (4 octets)
2139 Opcode 0x92 - Client Listen notification
2141 Notification parameters: Status (4 octets)
2142 Server Interface (4 octets)
2144 Opcode 0x93 - Server Register notification
2146 Notification parameters: Status (4 octets)
2150 Opcode 0x94 - Server Connection notification
2152 Notification parameters: Connection ID (4 octets)
2154 Connected (4 octets)
2157 Opcode 0x95 - Server Service Added notification
2159 Notification parameters: Status (4 octets)
2161 GATT Service ID (18 octets)
2162 Service Handle (4 octets)
2164 Opcode 0x96 - Server Included Service Added notification
2166 Notification patemeters: Status (4 octets)
2168 Service Handle (4 octets)
2169 Included Service Handle (4 octets)
2171 Opcode 0x97 - Server Characteristic Added notification
2173 Notification parameters: Status (4 octets)
2176 Service Handle (4 octets)
2177 Characteristic Handle (4 octets)
2179 Opcode 0x98 - Server Descriptor Added notification
2181 Notification parameters: Status (4 octets)
2184 Service Handle (4 octets)
2185 Descriptor Handle (4 octets)
2187 Opcode 0x99 - Server Service Started notification
2189 Notification parameters: Status (4 octets)
2191 Service Handle (4 octets)
2193 Opcode 0x9a - Server Service Stopped notification
2195 Notification parameters: Status (4 octets)
2197 Service Handle (4 octets)
2199 Opcode 0x9b - Server Service Deleted notification
2201 Notification parameters: Status (4 octets)
2203 Service Handle (4 octets)
2205 Opcode 0x9c - Server Request Read notification
2207 Notification parameters: Connection ID (4 octets)
2210 Attribute Handle (4 octets)
2214 Opcode 0x9d - Server Request Write notification
2216 Notification parameters: Connection ID (4 octets)
2219 Attribute Handle (4 octets)
2222 Need Response (4 octets)
2223 Is Prepare (1 octet)
2226 Opcode 0x9e - Server Request Execute Write notification
2228 Notification parameters: Connection ID (4 octets)
2231 Execute Write (4 octets)
2233 Opcode 0x9f - Server Response Confirmation notification
2235 Notification parameters: Status (4 octets)
2238 Opcode 0xa0 - Client Configure MTU notification
2240 Notification parameters: Connection ID (4 octets)
2244 Opcode 0xa1 - Client Filter Configuration notification
2246 Notification parameters: Action (4 octets)
2247 Client ID (4 octets)
2249 Filter Type (4 octets)
2250 Available Space (4 octets)
2252 Opcode 0xa2 - Client Filter Parameters notification
2254 Notification parameters: Action (4 octets)
2255 Client ID (4 octets)
2257 Available Space (4 octets)
2259 Opcode 0xa3 - Client Filter Status notification
2261 Notification parameters: Enable (4 octets)
2262 Client ID (4 octets)
2265 Opcode 0xa4 - Client Multi Advertising Enable notification
2267 Notification parameters: Client ID (4 octets)
2270 Opcode 0xa5 - Client Multi Advertising Update notification
2272 Notification parameters: Client ID (4 octets)
2275 Opcode 0xa6 - Client Multi Advertising Data notification
2277 Notification parameters: Client ID (4 octets)
2280 Opcode 0xa7 - Client Multi Advertising Disable notification
2282 Notification parameters: Client ID (4 octets)
2285 Opcode 0xa8 - Client Congestion notification
2287 Notification parameters: Connection ID (4 octets)
2290 Opcode 0xa9 - Client Configure Batchscan notification
2292 Notification parameters: Client ID (4 octets)
2295 Opcode 0xaa - Client Enable Batchscan notification
2297 Notification parameters: Action (4 octets)
2298 Client ID (4 octets)
2301 Opcode 0xab - Client Batchscan Reports notification
2303 Notification parameters: Client ID (4 octets)
2305 Report Format (4 octets)
2306 Num Reports (4 octets)
2307 Data Length (4 octets)
2310 Opcode 0xac - Client Batchscan Threshold notification
2312 Notification parameters: Client ID (4 octets)
2314 Opcode 0xad - Client Track ADV notification
2316 Notification parameters: Client ID (4 octets)
2317 Filter Index (4 octets)
2318 Address Type (4 octets)
2322 Opcode 0xae - Server Indication Sent notification
2324 Notification parameters: Connection ID (4 octets)
2327 Opcode 0xaf - Server Congestion notification
2329 Notification parameters: Connection ID (4 octets)
2332 Opcode 0xb0 - Server MTU Changed notification
2334 Notification parameters: Connection ID (4 octets)
2338 Bluetooth Handsfree Client HAL (ID 10)
2339 ======================================
2341 Android HAL name: "hf_client" (BT_PROFILE_HANDSFREE_CLIENT_ID)
2343 Commands and response:
2345 Opcode 0x00 - Error response
2347 Opcode 0x01 - Connect command/respose
2349 Command parameters: Remote address (6 octects)
2350 Response parameters: <none>
2352 In case of an error, the error response will be returned.
2354 Opcode 0x02 - Disonnect command/response
2356 Command parameters: Remote address (6 octetcs)
2357 Response parameters: <none>
2359 In case of an error, the error response will be returned.
2361 Opcode 0x03 - Connect Audio command/response
2363 Command parameters: Remote address (6 octets)
2364 Response parameters: <none>
2366 In case of an error, the error response will be returned.
2368 Opcode 0x04 - Disconnect Audio command/response
2370 Command parameters: Remote address (6 octets)
2371 Response parameters: <none>
2373 In case of an error, the error response will be returned.
2375 Opcode 0x05 - Start Voice Recognition command/response
2377 Command parameters: <none>
2378 Response parameters: <none>
2380 In case of an error, the error response will be returned.
2382 Opcode 0x06 - Stop Voice Recognition command/response
2384 Command parameters: <none>
2385 Response parameters: <none>
2387 In case of an error, the error response will be returned.
2389 Opcode 0x07 - Volume Control command/response
2391 Command parameters: Volume type (1 octet)
2393 Response parameters: <none>
2395 Valid volume types: 0x00 = Speaker
2398 In case of an error, the error response will be returned.
2400 Opcode 0x08 - Dial command/response
2402 Command parameters: Number (string)
2403 Response parameters: <none>
2405 In case of an error, the error response will be returned.
2407 Opcode 0x09 - Dial Memory command/response
2409 Command parameters: Location (4 octet)
2410 Response parameters: <none>
2412 In case of an error, the error response will be returned.
2414 Opcode 0x10 - Handle Call Action command/response
2416 Command parameters: Action (1 octet)
2417 Call Index (1 octet)
2418 Response parameters: <none>
2420 Valid actions: 0x00 = CHLD_0
2433 In case of an error, the error response will be returned.
2435 Opcode 0x11 - Query Current Calls commad/response
2437 Command parameters: <none>
2438 Response parameters: <none>
2440 In case of an error, the error response will be returned.
2442 Opcode 0x12 - Query Current Operator Name
2444 Command parameters: <none>
2445 Response parameters: <none>
2447 In case of an error, the error response will be returned.
2449 Opcode 0x13 - Retrieve Subscriber Info command/response
2451 Command parameters: <none>
2452 Response parameters: <none>
2454 In case of an error, the error response will be returned.
2456 Opcode 0x14 - Send DTMF Tone command/response
2458 Command parameters: Tone (1 octet)
2459 Response parameters: <none>
2461 In case of an error, the error response will be returned.
2463 Opcode 0x15 - Request Last Voice Tag Number command/response
2465 Command parameters: <none>
2466 Response parameters: <none>
2468 In case of an error, the error response will be returned.
2472 Opcode 0x81 - Connection State Changed notification
2474 Notification parameters: State (1 octet)
2475 Peer Features (4 octets)
2476 CHLD Features (4 octets)
2479 Valid State values: 0x00 = Disconnected
2482 0x03 = SLC Connected
2483 0x04 = Disconnecting
2485 Peer Features is a bitmask of the supported features. Currently
2489 1 Echo cancellation and/or noise reduction
2492 4 Attach a number to a voice tag
2493 5 Ability to reject a call
2494 6 Enhanced call status
2495 7 Enhanced call control
2496 8 Extended Error Result Codes
2497 9 Codec negotiations
2498 10-31 Reserved for future use
2500 CHLD Features is a bitmask of the supported features. Currently
2503 0 Release waiting call or held calls
2504 1 Release active calls and accept other call
2505 2 Release specified active call only
2506 3 Place all active calls on hold and accept other call
2507 4 Request private mode with secified call
2508 5 Add a held call to the multiparty
2509 6 Connect two calls and leave multiparty
2510 7-31 Reserved for future use
2512 Note: Peer and CHLD Features are valid only in SCL Connected state
2515 Opcode 0x82 - Audio State Changed notification
2517 Notification parameters: State (1 octet)
2520 Valid State values: 0x00 = Disconnected
2523 0x03 = Connected mSBC
2525 Opcode 0x83 - Voice Recognition State Changed notification
2527 Notification parameters: State (1 octet)
2529 Valid State values: 0x00 = VR Stopped
2532 Opcode 0x84 - Network State Changed notification
2534 Notification parameters: State (1 octet)
2536 Valid State values: 0x00 = Network Not Available
2537 0x01 = Network Available
2539 Opcode 0x85 - Network Roaming Type Changed notification
2541 Notification parameters: Type (1 octet)
2543 Valid Type values: 0x00 = Home
2546 Opcode 0x86 - Network Signal Strength notification
2548 Notification parameters: Signal Strength (1 octet)
2550 Opcode 0x87 - Battery Level notification
2552 Notification parameters: Battery Level (1 octet)
2554 Opcode 0x88 - Current Operator Name notification
2556 Notification parameters: Name (string)
2558 Opcode 0x89 - Call Indicatior notification
2560 Notification parameters: Call (1 octet)
2562 Valid Call values: 0x00 = No Call In Progress
2563 0x01 = Call In Progress
2565 Opcode 0x8a - Call Setup Indicator notification
2567 Notification parameters: Call Setup (1 octet)
2569 Valid Call Setup values: 0x00 = None
2574 Opcode 0x8b - Call Held Indicator notification
2576 Notification parameters: Call Held (1 octet)
2578 Valid Call Held values: 0x00 = None
2579 0x01 = Hold and Active
2582 Opcode 0x8c - Resposne and Hold Status notification
2584 Notification parameters: Status (1 octet)
2586 Valid Status values: 0x00 = Held
2590 Opcode 0x8d - Calling Line Identification notification
2592 Notification parameters: Number (string)
2594 Note: This will be called only on incoming call if number is
2597 Opcode 0x8e - Call Waiting notification
2599 Notification parameters: Nunmber (string)
2601 Opcode 0x8f - Current Calls List notification
2603 Notification parameters: Index (1 octet)
2605 Call State (1 octet)
2606 Multiparty (1 octet)
2609 Valid Direction values: 0x00 = Outgoing
2612 Valid Call Sate values: 0x00 = Active
2618 0x06 = Call held by Response and Hold
2620 Valid Multiparty values: 0x00 = Single Call
2621 0x01 = Multiparty (conference) Call
2623 Note: Number might be empty
2625 Opcode 0x90 - Volume Changed notification
2627 Notification parameters: Type (1 octet)
2630 Valid Type values: 0x00 = Speaker
2633 Opcode 0x91 - Command Complete Callback notification
2635 Notification parameters: Type (1 octet)
2638 Valid Type values: 0x00 = OK
2640 0x02 = Error no carrier
2642 0x04 = Error no answer
2643 0x05 = Error delayed
2644 0x06 = Error blacklisted
2647 Note: CME parameter is valid only for Error CME type
2649 Opcode 0x92 - Subscriber Service Info Callback notification
2651 Notification parameters: Name (string)
2654 Valid Type values: 0x00 = Service unknown
2655 0x01 = Service voice
2658 Opcode 0x93 - In Band Ring Settings Callback notification
2660 Notification parameters: State (1 octet)
2662 Valid State values: 0x00 = In band ringtone not provided
2663 0x01 = In band ringtone provided
2665 Opcode 0x94 - Last Voice Call Tag Number Callback notification
2667 Notification parameters: Number (string)
2669 Opcode 0x95 - Ring Indication notification
2671 Notification parameters: <none>
2674 Bluetooth Map Client HAL (ID 11)
2675 =========================
2677 Android HAL name: "map_client" (BT_PROFILE_MAP_CLIENT_ID)
2679 Commands and responses:
2681 Opcode 0x00 - Error response
2683 Opcode 0x01 - Get Remote MAS Instances
2685 Command parameters: Remote address (6 octets)
2686 Response parameters: <none>
2688 In case of an error, the error response will be returned.
2692 Opcode 0x81 - Remote MAS Instances notification
2694 Notification parameters: Status (1 octet)
2695 Remote address (6 octets)
2696 Number of instances (4 octets)
2697 Instance ID # (4 octets)
2698 Channel # (4 octets)
2699 Message types (4 octets)
2702 Bluetooth Remote Control Controller HAL (ID 12)
2703 ===================================
2705 Android HAL name: "avrcp-ctrl" (BT_PROFILE_AV_RC_CTRL_ID)
2707 Commands and responses:
2709 Opcode 0x00 - Error response
2711 Opcode 0x01 - Send Pass Through command/response
2713 Command parameters: Remote Address (6 octets)
2717 In case of an error, the error response will be returned.
2721 Opcode 0x81 - Passthrough Response Notification
2723 Notification parameters: ID (1 octet)
2726 Opcode 0x82 - Connection State Notification
2728 Notification parameters: State (1 octet)
2729 Remote Address (6 octets)