tizen 2.3.1 release
[framework/connectivity/bluez.git] / android / hal-ipc-api.txt
1 Android HAL protocol for Bluetooth
2 ==================================
3
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).
7
8 The daemon is single threaded and uses a mainloop for scheduling and general
9 operation.
10
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
17 the socket.
18
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
23 notification.
24
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
27 block.
28
29         .--Android--.                             .--Android--.
30         |  daemon   |                             |  HAL      |
31         |           |          Command            |           |
32         |           | <-------------------------- |           |
33         |           |                             |           |
34         |           | --------------------------> |           |
35         |           |          Response           |           |
36         |           |                             |           |
37         |           |                             |           |
38         |           |        Notification         |           |
39         |           | --------------------------> |           |
40         |           |                             |           |
41         '-----------'                             '-----------'
42
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
45 id 0.
46
47         0              8              16             24            31
48         +--------------+--------------+--------------+--------------+
49         | Service ID   | Opcode       | Data Length                 |
50         +--------------+--------------+-----------------------------+
51         |                                                           |
52
53 The unique service ID is assigned by this specification for each HAL.
54
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.
57
58 Notification opcodes start from 0x81.
59
60 Opcode 0x80 is reserved and shall not be used.
61
62 All command/response opcodes have the least significant bit not set. And all
63 notifications have the least significant bit set.
64
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
68 adapter.
69
70         HAL                                Daemon
71         ----------------------------------------------------
72
73         call enable()                  --> command 0x01
74         return enable()                <-- response 0x01
75
76         call adapter_state_changed()   <-- notification 0x81
77         return adapter_state_changed()
78
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.
83
84 After the daemon switched on the adapter, it will send a notification
85 with opcode 0x81 to the HAL module.
86
87 The Bluetooth Core HAL and Bluetooth Socket HAL are guaranteed to be
88 available from the daemon. All other HAL modules are optional.
89
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.
94
95 It is possible to send Configure command before registering any services to
96 customize stack. This step is optional.
97
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
100 specific service.
101
102         Bluetooth main thread       Daemon
103         -------------------------------------------------------
104
105         init()                  --> open command socket
106                                 --> open notification socket
107                                 --> register module "bluetooth"
108                                 --> register module "socket"
109
110         get_profile_interface() --> return profile struct
111                                 --> continue on Handsfree thread
112
113
114         Handsfree thread            Daemon
115         --------------------------------------------------------
116
117         init()                  --> register module handsfree
118
119
120 Error response is common for all services and has fixed structure:
121
122         Opcode 0x00 - Error response
123
124                 Response parameters: Status (1 octet)
125
126                 Valid status values: 0x01 = Fail
127                                      0x02 = Not ready
128                                      0x03 = No memory
129                                      0x04 = Busy
130                                      0x05 = Done (already completed)
131                                      0x06 = Unsupported
132                                      0x07 = Parameter invalid
133                                      0x08 = Unhandled
134                                      0x09 = Authentication failure
135                                      0x0a = Remote device down
136                                      0x0b = Authentication rejected
137
138
139 Core Service (ID 0)
140 ===================
141
142         Opcode 0x00 - Error response
143
144         Opcode 0x01 - Register module command/response
145
146                 Command parameters: Service id (1 octet)
147                                     Mode (1 octet)
148                                     Max Clients (4 octets)
149                 Response parameters: <none>
150
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
153                 service ID.
154
155                 Valid Mode values: 0x00 = Default Mode
156                                    0xXX = as defined by service
157
158                 In case of an error, the error response will be returned.
159
160         Opcode 0x02 - Unregister module command/response
161
162                 Command parameters: Service id (1 octet)
163                 Response parameters: <none>
164
165                 In case of an error, the error response will be returned.
166
167         Opcode 0x03 - Configuration
168
169                 Command parameters: Num options (1 octet)
170                                     Option Type # (1 octet)
171                                     Option Length # (2 octets)
172                                     Option Value # (variable)
173
174                 Response parameters: <none>
175
176                 Valid configure option types: 0x00 = Vendor
177                                               0x01 = Model
178                                               0x02 = Name
179                                               0x03 = Serial Number
180                                               0x04 = System ID
181                                               0x05 = PnP ID
182                                               0x06 = Firmware Rev
183                                               0x07 = Hardware Rev
184
185                 In case of an error, the error response will be returned.
186
187 Bluetooth Core HAL (ID 1)
188 =========================
189
190 Android HAL name: "bluetooth" (BT_HARDWARE_MODULE_ID)
191
192         Service modes: 0x00 = Enable BR/EDR/LE if supported (default)
193                        0x01 = Enable BR/EDR only
194                        0x02 = Enable LE only
195
196 Commands and responses:
197
198         Opcode 0x00 - Error response
199
200         Opcode 0x01 - Enable command/response
201
202                 Command parameters: <none>
203                 Response parameters: <none>
204
205                 In case of an error, the error response will be returned.
206
207         Opcode 0x02 - Disable command/response
208
209                 Command parameters: <none>
210                 Response parameters: <none>
211
212                 In case of an error, the error response will be returned.
213
214         Opcode 0x03 - Get Adapter Properties command/response
215
216                 Command parameters: <none>
217                 Response parameters: <none>
218
219                 In case of an error, the error response will be returned.
220
221         Opcode 0x04 - Get Adapter Property command/response
222
223                 Command parameters: Property type (1 octet)
224                 Response parameters: <none>
225
226                 In case of an error, the error response will be returned.
227
228         Opcode 0x05 - Set Adapter Property command/response
229
230                 Command parameters: Property type (1 octet)
231                                     Property length (2 octets)
232                                     Property value (variable)
233                 Response parameters: <none>
234
235                 In case of an error, the error response will be returned.
236
237         Opcode 0x06 - Get Remote Device Properties command/response
238
239                 Command parameters: Remote address (6 octets)
240                 Response parameters: <none>
241
242                 In case of an error, the error response will be returned.
243
244         Opcode 0x07 - Get Remote Device Property command/response
245
246                 Command parameters: Remote address (6 octets)
247                                     Property type (1 octet)
248                 Response parameters: <none>
249
250                 In case of an error, the error response will be returned.
251
252         Opcode 0x08 - Set Remote Device Property command/response
253
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>
259
260                 In case of an error, the error response will be returned.
261
262         Opcode 0x09 - Get Remote Service Record command/response
263
264                 Command parameters: Remote address (6 octets)
265                                     UUID (16 octets)
266                 Response parameters: <none>
267
268                 In case of an error, the error response will be returned.
269
270         Opcode 0x0a - Get Remote Services command/response
271
272                 Command parameters: Remote address (6 octets)
273                 Response parameters: <none>
274
275                 In case of an error, the error response will be returned.
276
277         Opcode 0x0b - Start Discovery command/response
278
279                 Command parameters: <none>
280                 Response parameters: <none>
281
282                 In case of an error, the error response will be returned.
283
284         Opcode 0x0c - Cancel Discovery command/response
285
286                 Command parameters: <none>
287                 Response parameters: <none>
288
289                 In case of an error, the error response will be returned.
290
291         Opcode 0x0d - Create Bond command/response
292
293                 Command parameters: Remote address (6 octets)
294                                     Transport (1 octet)
295                 Response parameters: <none>
296
297                 In case of an error, the error response will be returned.
298
299         Opcode 0x0e - Remove Bond command/response
300
301                 Command parameters: Remote address (6 octets)
302                 Response parameters: <none>
303
304                 In case of an error, the error response will be returned.
305
306         Opcode 0x0f - Cancel Bond command/response
307
308                 Command parameters: Remote address (6 octets)
309                 Response parameters: <none>
310
311                 In case of an error, the error response will be returned.
312
313         Opcode 0x10 - PIN Reply command/response
314
315                 Command parameters: Remote address (6 octets)
316                                     Accept (1 octet)
317                                     PIN length (1 octet)
318                                     PIN code (16 octets)
319                 Response parameters: <none>
320
321                 In case of an error, the error response will be returned.
322
323         Opcode 0x11 - SSP Reply command/response
324
325                 Command parameters: Remote address (6 octets)
326                                     SSP variant (1 octet)
327                                     Accept (1 octet)
328                                     Passkey (4 octets)
329                 Response parameters: <none>
330
331                 Valid SSP variant values: 0x00 = Passkey Confirmation
332                                           0x01 = Passkey Entry
333                                           0x02 = Consent (for Just Works)
334                                           0x03 = Passkey Notification
335
336                 In case of an error, the error response will be returned.
337
338         Opcode 0x12 - DUT Mode Configure command/response
339
340                 Command parameters: Enable (1 octet)
341                 Response parameters: <none>
342
343                 In case of an error, the error response will be returned.
344
345         Opcode 0x13 - DUT Mode Send command/response
346
347                 Command parameters: Opcode (2 octets)
348                                     Length (1 octet)
349                                     Data (variable)
350                 Response parameters: <none>
351
352                 In case of an error, the error response will be returned.
353
354         Opcode 0x14 - LE Test Mode command/response
355
356                 Command parameters: Opcode (2 octets)
357                                     Length (1 octet)
358                                     Data (variable)
359                 Response parameters: <none>
360
361                 In case of an error, the error response will be returned.
362
363 Notifications:
364
365         Opcode 0x81 - Adapter State Changed notification
366
367                 Notifications parameters: State (1 octet)
368
369                 Valid state values: 0x00 = Off
370                                     0x01 = On
371
372         Opcode 0x82 - Adapter Properties Changed notification
373
374                 Notification parameters: Status (1 octet)
375                                          Num properties (1 octet)
376                                          Type # (1 octet)
377                                          Length # (2 octets)
378                                          Value # (variable)
379                                          ...
380
381         Opcode 0x83 - Remote Device Properties notification
382
383                 Notification parameters: Status (1 octet)
384                                          Remote address (6 octets)
385                                          Num properties (1 octet)
386                                          Type # (1 octet)
387                                          Length # (2 octets)
388                                          Value # (variable)
389                                          ...
390
391         Opcode 0x84 - Device Found notification
392
393                 Notification parameters: Num properties (1 octet)
394                                          Type # (1 octet)
395                                          Length # (2 octets)
396                                          Value # (variable)
397                                          ...
398
399         Opcode 0x85 - Discovery State Changed notification
400
401                 Notifications parameters: State (1 octet)
402
403         Opcode 0x86 - PIN Request notification
404
405                 Notification parameters: Remote address (6 octets)
406                                          Remote name (249 octets)
407                                          Class of device (4 octets)
408
409         Opcode 0x87 - SSP Request notification
410
411                 Notification parameters: Remote address (6 octets)
412                                          Remote name (249 octets)
413                                          Class of device (4 octets)
414                                          Pairing variant (1 octet)
415                                          Passkey (4 octets)
416
417         Opcode 0x88 - Bond State Changed notification
418
419                 Notification parameters: Status (1 octet)
420                                          Remote address (6 octets)
421                                          Bond state (1 octet)
422
423                 Valid bond state values: 0x00 = None
424                                          0x01 = Bonding
425                                          0x02 = Bonded
426
427         Opcode 0x89 - ACL State Changed notification
428
429                 Notification parameters: Status (1 octet)
430                                          Remote address (6 octets)
431                                          ACL state (1 octet)
432
433         Opcode 0x8a - DUT Mode Receive notification
434
435                 Notification parameters: Opcode (2 octets)
436                                          Length  (1 octet)
437                                          Data (variable)
438
439         Opcode 0x8b - LE Test Mode notification
440
441                 Notification parameters: Status (1 octet)
442                                          Num packets (2 octets)
443
444
445 Bluetooth Socket HAL (ID 2)
446 ===========================
447
448 Android HAL name:: "socket" (BT_PROFILE_SOCKETS_ID)
449
450 Commands and responses:
451
452         Opcode 0x00 - Error response
453
454         Opcode 0x01 - Listen command/response
455
456                 Command parameters: Socket type (1 octet)
457                                     Service name (256 octets)
458                                     Service UUID (16 octets)
459                                     Channel (4 octets)
460                                     Socket flags (1 octet)
461                 Response parameters: File descriptor (inline)
462
463                 Valid socket types: 0x01 = RFCOMM
464                                     0x02 = SCO
465                                     0x03 = L2CAP
466
467                 Valid socket flags: 0x01 = Encrypt
468                                     0x02 = Auth
469
470                 In case of an error, the error response will be returned.
471
472         Opcode 0x02 - Connect command/response
473
474                 Command parameters: Remote address (6 octets)
475                                     Socket type (1 octet)
476                                     Service UUID (16 octets)
477                                     Channel (4 octets)
478                                     Socket flags (1 octet)
479                 Response parameters: File descriptor (inline)
480
481                 Valid socket types: 0x01 = RFCOMM
482                                     0x02 = SCO
483                                     0x03 = L2CAP
484
485                 Valid socket flags: 0x01 = Encrypt
486                                     0x02 = Auth
487
488                 In case of an error, the error response will be returned.
489
490
491 Bluetooth HID Host HAL (ID 3)
492 ============================
493
494 Android HAL name: "hidhost" (BT_PROFILE_HIDHOST_ID)
495
496 Commands and responses:
497
498         Opcode 0x00 - Error response
499
500         Opcode 0x01 - Connect command/response
501
502                 Command parameters: Remote address (6 octets)
503                 Response parameters: <none>
504
505                 In case of an error, the error response will be returned.
506
507         Opcode 0x02 - Disconnect command/response
508
509                 Command parameters: Remote address (6 octets)
510                 Response parameters: <none>
511
512                 In case of an error, the error response will be returned.
513
514         Opcode 0x03 - Virtual Unplug command/response
515
516                 Command parameters: Remote address (6 octets)
517                 Response parameters: <none>
518
519                 In case of an error, the error response will be returned.
520
521         Opcode 0x04 - Set Info command/response
522
523                 Command parameters: Remote address (6 octets)
524                                     Attribute mask (2 octets)
525                                     Subclass (1 octet)
526                                     Application ID (1 octet)
527                                     Vendor ID (2 octets)
528                                     Product ID (2 octets)
529                                     Version (2 octets)
530                                     Country code (1 octet)
531                                     Descriptor length (2 octet)
532                                     Descriptor value (884 octets)
533                 Response parameters: <none>
534
535                 In case of an error, the error response will be returned.
536
537         Opcode 0x05 - Get Protocol command/response
538
539                 Command parameters: Remote address (6 octets)
540                                     Protocol mode (1 octet)
541                 Response parameters: <none>
542
543                 Valid protocol modes: 0x00 = Report
544                                       0x01 = Boot
545                                       0xff = Unsupported
546
547                 In case of an error, the error response will be returned.
548
549         Opcode 0x06 - Set Protocol command/response
550
551                 Command parameters: Remote address (6 octets)
552                                     Protocol mode (1 octet)
553                 Response parameters: <none>
554
555                 Valid protocol modes: 0x00 = Report
556                                       0x01 = Boot
557                                       0xff = Unsupported
558
559                 In case of an error, the error response will be returned.
560
561         Opcode 0x07 - Get Report command/response
562
563                 Command parameters: Remote address (6 octets)
564                                     Report type (1 octet)
565                                     Report ID (1 octet)
566                                     Buffer size (2 octet)
567                 Response parameters: <none>
568
569                 Valid report types: 0x01 = Input
570                                     0x02 = Output
571                                     0x03 = Feature
572
573                 In case of an error, the error response will be returned.
574
575         Opcode 0x08 - Set Report command/response
576
577                 Command parameters: Remote address (6 octets)
578                                     Report type (1 octet)
579                                     Report length (2 octets)
580                                     Report data (Report length)
581
582                 Response parameters: <none>
583
584                 Valid report types: 0x01 = Input
585                                     0x02 = Output
586                                     0x03 = Feature
587
588                 In case of an error, the error response will be returned.
589
590         Opcode 0x09 - Send Data command/response
591
592                 Command parameters: Remote address (6 octets)
593                                     Data length (2 octets)
594                                     Data (Data length)
595
596                 Response parameters: <none>
597
598                 In case of an error, the error response will be returned.
599
600 Notifications:
601
602         Status is common for many notifications and has fixed value range:
603
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
610                                0x06 = General error
611                                0x07 = SDP error
612                                0x08 = Set protocol error
613                                0x09 = Device database full
614                                0x0a = Device type not supported
615                                0x0b = No resources
616                                0x0c = Authentication failed
617                                0x0d = HDL
618
619         Opcode 0x81 - Connection State notification
620
621                 Notification parameters: Remote address (6 octets)
622                                          Connection State (1 octets)
623
624                 Valid connection states: 0x00 = Connected
625                                          0x01 = Connecting
626                                          0x02 = Disconnected
627                                          0x03 = Disconnecting
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
633                                          0x09 = Unknown
634
635         Opcode 0x82 - HID Info notification
636
637                 Notification parameters: Remote address (6 octets)
638                                          Attribute mask (2 octets)
639                                          Subclass (1 octet)
640                                          Application ID (1 octet)
641                                          Vendor ID (2 octets)
642                                          Product ID (2 octets)
643                                          Version (2 octets)
644                                          Country code (1 octet)
645                                          Descriptor length (2 octet)
646                                          Descriptor value (884 octets)
647
648         Opcode 0x83 - Protocol Mode notification
649
650                 Notification parameters: Remote address (6 octets)
651                                          Status (1 octet)
652                                          Protocol mode (1 octet)
653
654                 Valid protocol modes: 0x00 = Report
655                                       0x01 = Boot
656                                       0xff = Unsupported
657
658         Opcode 0x84 - Idle Time notification
659
660                 Notification parameters: Remote address (6 octets)
661                                          Status (1 octet)
662                                          Idle time (2 octets)
663
664         Opcode 0x85 - Get Report notification
665
666                 Notification parameters: Remote address (6 octets)
667                                          Status (1 octet)
668                                          Report length (2 octets)
669                                          Report data (variable)
670
671         Opcode 0x86 - Virtual Unplug notification
672
673                 Notification parameters: Remote address (6 octets)
674                                          Status (1 octet)
675
676         Opcode 0x87 - Handshake notification
677
678                 Notification parameters: Remote address (6 octets)
679                                          Status (1 octet)
680
681                 Only status values from 0x00 to 0x05 are valid as handshake
682                 status.
683
684
685 Bluetooth PAN HAL (ID 4)
686 ========================
687
688 Android HAL name: "pan" (BT_PROFILE_PAN_ID)
689
690 Commands and responses:
691
692         Opcode 0x00 - Error response
693
694         Opcode 0x01 - Enable command/response
695
696                 Command parameters: Local role (1 octet)
697                 Response parameters: <none>
698
699                 Valid role values: 0x00 = None
700                                    0x01 = NAP
701                                    0x02 = PANU
702
703                 In case of an error, the error response will be returned.
704
705         Opcode 0x02 - Get Local Role command/response
706
707                 Command parameters: <none>
708                 Response parameters: Local role (1 octet)
709
710                 Valid role values: 0x00 = None
711                                    0x01 = NAP
712                                    0x02 = PANU
713
714                 In case of an error, the error response will be returned.
715
716         Opcode 0x03 - Connect command/response
717
718                 Command parameters: Remote address (6 octets)
719                                     Local role (1 octet)
720                                     Remote role (1 octet)
721                 Response parameters: <none>
722
723                 Valid role values: 0x01 = NAP
724                                    0x02 = PANU
725
726                 In case of an error, the error response will be returned.
727
728         Opcode 0x04 - Disconnect command/response
729
730                 Command parameters: Remote address (6 octets)
731                 Response parameters: <none>
732
733                 In case of an error, the error response will be returned.
734
735 Notifications:
736
737         Opcode 0x81 - Control State notification
738
739                 Notification parameters: Control state (1 octet)
740                                          Status (1 octet)
741                                          Local role (1 octet)
742                                          Interface name (17 octet)
743
744                 Valid control states: 0x00 = Enabled
745                                       0x01 = Disabled
746
747                 Valid role values: 0x00 = None
748                                    0x01 = NAP
749                                    0x02 = PANU
750
751         Opcode 0x82 - Connection State notification
752
753                 Notification parameters: Connection state (1 octet)
754                                          Status (1 octet)
755                                          Remote address (6 octets)
756                                          Local role (1 octet)
757                                          Remote role (1 octet)
758
759                 Valid connection states: 0x00 = Connected
760                                          0x01 = Connecting
761                                          0x02 = Disconnected
762                                          0x03 = Disconnecting
763
764                 Valid role values: 0x01 = NAP
765                                    0x02 = PANU
766
767
768 Bluetooth Handsfree HAL (ID 5)
769 ==============================
770
771 Android HAL name: "handsfree" (BT_PROFILE_HANDSFREE_ID)
772
773         Service modes: 0x00 = Headset Profile only mode (default)
774                        0x01 = Handsfree Profile (narrowband speech)
775                        0x02 = Handsfree Profile (narrowband and wideband speech)
776
777 Commands and responses:
778
779         Opcode 0x00 - Error response
780
781         Opcode 0x01 - Connect command/response
782
783                 Command parameters: Remote address (6 octets)
784                 Response parameters: <none>
785
786                 In case of an error, the error response will be returned.
787
788         Opcode 0x02 - Disconnect command/response
789
790                 Command parameters: Remote address (6 octets)
791                 Response parameters: <none>
792
793                 In case of an error, the error response will be returned.
794
795         Opcode 0x03 - Connect Audio command/response
796
797                 Command parameters: Remote address (6 octets)
798                 Response parameters: <none>
799
800                 In case of an error, the error response will be returned.
801
802         Opcode 0x04 - Disconnect Audio command/response
803
804                 Command parameters: Remote address (6 octets)
805                 Response parameters: <none>
806
807                 In case of an error, the error response will be returned.
808
809         Opcode 0x05 - Start Voice Recognition command/response
810
811                 Command parameters: Remote address (6 octets)
812                 Response parameters: <none>
813
814                 In case of an error, the error response will be returned.
815
816         Opcode 0x06 - Stop Voice Recognition command/response
817
818                 Command parameters: Remote address (6 octets)
819                 Response parameters: <none>
820
821                 In case of an error, the error response will be returned.
822
823         Opcode 0x07 - Volume Control command/response
824
825                 Command parameters: Volume type (1 octet)
826                                     Volume (1 octet)
827                                     Remote address (6 octets)
828                 Response parameters: <none>
829
830                 Valid volume types: 0x00 = Speaker
831                                     0x01 = Microphone
832
833                 In case of an error, the error response will be returned.
834
835         Opcode 0x08 - Device Status Notification command/response
836
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>
842
843                 Valid network states: 0x00 = Not available
844                                       0x01 = Available
845
846                 Valid service types: 0x00 = Home network
847                                      0x01 = Roaming network
848
849                 In case of an error, the error response will be returned.
850
851         Opcode 0x09 - COPS Response command/response
852
853                 Command parameters: COPS command response (string)
854                                     Remote address (6 octets)
855                 Response parameters: <none>
856
857                 In case of an error, the error response will be returned.
858
859         Opcode 0x0a - CIND Response command/response
860
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>
870
871                 Valid call setup states: 0x00 = Active
872                                          0x01 = Held
873                                          0x02 = Dialing
874                                          0x03 = Alerting
875                                          0x04 = Incoming
876                                          0x05 = Waiting
877                                          0x06 = Idle
878
879                 In case of an error, the error response will be returned.
880
881         Opcode 0x0b - Formatted AT Response command/response
882
883                 Command parameters: Pre-formatted AT response (string)
884                                     Remote address (6 octets)
885                 Response parameters: <none>
886
887                 In case of an error, the error response will be returned.
888
889         Opcode 0x0c - AT Response command/response
890
891                 Command parameters: Response code (1 octet)
892                                     Error code (1 octet)
893                                     Remote address (6 octets)
894                 Response parameters: <none>
895
896                 Valid response codes: 0x00 = ERROR
897                                       0x01 = OK
898
899                 In case of an error, the error response will be returned.
900
901         Opcode 0x0d - CLCC Response command/response
902
903                 Command parameters: Call index (1 octet)
904                                     Call direction (1 octet)
905                                     Call state (1 octet)
906                                     Call mode (1 octet)
907                                     Call multiparty type (1 octet)
908                                     Call number type (1 octet)
909                                     Call number (string)
910                                     Remote address (6 octets)
911                 Response parameters: <none>
912
913                 Valid call directions: 0x00 = Outgoing
914                                        0x01 = Incoming
915
916                 Valid call states: 0x00 = Active
917                                    0x01 = Held
918                                    0x02 = Dialing
919                                    0x03 = Alerting
920                                    0x04 = Incoming
921                                    0x05 = Waiting
922                                    0x06 = Idle
923
924                 Valid call modes: 0x00 = Voice
925                                   0x01 = Data
926                                   0x02 = Fax
927
928                 Valid multiparty types: 0x00 = Single call
929                                         0x01 = Multiparty call
930
931                 Valid number types: 0x81 = Unknown
932                                     0x91 = International
933
934                 In case of an error, the error response will be returned.
935
936         Opcode 0x0e - Phone Status Change command/response
937
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)
942                                     Call number (string)
943                 Response parameters: <none>
944
945                 Valid call setup states: 0x00 = Active
946                                          0x01 = Held
947                                          0x02 = Dialing
948                                          0x03 = Alerting
949                                          0x04 = Incoming
950                                          0x05 = Waiting
951                                          0x06 = Idle
952
953                 Valid number types: 0x81 = Unknown
954                                     0x91 = International
955
956                 In case of an error, the error response will be returned.
957
958         Opcode 0x0f - Configure WBS command/response
959
960                 Command parameters: Remote address (6 octets)
961                                     Config (1 octet)
962                 Response parameters: <none>
963
964                 Valid config values: 0x00 = None
965                                      0x01 = No
966                                      0x02 = Yes
967
968                 In case of an error, the error response will be returned.
969
970 Notifications:
971
972         Opcode 0x81 - Connection State notification
973
974                 Notification parameters: Connection state (1 octet)
975                                          Remote address (6 octets)
976
977                 Valid connection states: 0x00 = Disconnected
978                                          0x01 = Connecting
979                                          0x02 = Connected
980                                          0x03 = SLC connected
981                                          0x04 = Disconnecting
982
983         Opcode 0x82 - Audio State notification
984
985                 Notification parameters: Audio state (1 octet)
986                                          Remote address (6 octets)
987
988                 Valid audio states: 0x00 = Disconnected
989                                     0x01 = Connecting
990                                     0x02 = Connected
991                                     0x03 = Disconnecting
992
993         Opcode 0x83 - Voice Recognition Command notification
994
995                 Notification parameters: Voice recognition state (1 octet)
996                                          Remote address (6 octets)
997
998                 Valid voice recognition states: 0x00 = Stopped
999                                                 0x01 = Started
1000
1001         Opcode 0x84 - Answer Call Command notification
1002
1003                 Notification parameters: Remote address (6 octets)
1004
1005         Opcode 0x85 - Hangup Call Command notification
1006
1007                 Notification parameters: Remote address (6 octets)
1008
1009         Opcode 0x86 - Volume Command notification
1010
1011                 Notification parameters: Volume type (1 octet)
1012                                          Volume (1 octet)
1013                                          Remote address (6 octets)
1014
1015                 Valid volume types: 0x00 = Speaker
1016                                     0x01 = Microphone
1017
1018         Opcode 0x87 - Dial Call Command notification
1019
1020                 Notification parameters: Remote address (6 octets)
1021                                          Number (string)
1022
1023         Opcode 0x88 - DTMF Command notification
1024
1025                 Notification parameters: Tone (1 octet)
1026                                          Remote address (6 octets)
1027
1028         Opcode 0x89 - NREC Command notification
1029
1030                 Notification parameters: NREC types (1 octet)
1031                                          Remote address (6 octets)
1032
1033                 Valid NREC types: 0x00 = Stop
1034                                   0x01 = Start
1035
1036         Opcode 0x8a - CHLD Command notification
1037
1038                 Notification parameters: NREC types (1 octet)
1039                                          Remote address (6 octets)
1040
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
1045
1046         Opcode 0x8b - CNUM Command notification
1047
1048                 Notification parameters: Remote address (6 octets)
1049
1050         Opcode 0x8c - CIND Command notification
1051
1052                 Notification parameters: Remote address (6 octets)
1053
1054         Opcode 0x8d - COPS Command notification
1055
1056                 Notification parameters: Remote address (6 octets)
1057
1058         Opcode 0x8e - CLCC Command notification
1059
1060                 Notification parameters: Remote address (6 octets)
1061
1062         Opcode 0x8f - Unknown AT Command notification
1063
1064                 Notification parameters: Remote address (6 octets)
1065                                          AT command (string)
1066
1067         Opcode 0x90 - Key Pressed Command notification
1068
1069                 Notification parameters: Remote address (6 octets)
1070
1071
1072 Bluetooth Advanced Audio HAL (ID 6)
1073 Bluetooth Advanced Audio Sink HAL (ID 13)
1074 =========================================
1075
1076 Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID)
1077 Android HAL name: "a2dp_sink" (BT_PROFILE_ADVANCED_AUDIO__SINK_ID)
1078
1079 Commands and responses:
1080
1081         Opcode 0x00 - Error response
1082
1083         Opcode 0x01 - Connect command/response
1084
1085                 Command parameters: Remote address (6 octets)
1086                 Response parameters: <none>
1087
1088                 In case of an error, the error response will be returned.
1089
1090         Opcode 0x02 - Disconnect command/response
1091
1092                 Command parameters: Remote address (6 octets)
1093                 Response parameters: <none>
1094
1095                 In case of an error, the error response will be returned.
1096
1097 Notifications:
1098
1099         Opcode 0x81 - Connection State notification
1100
1101                 Notification parameters: Connection state (1 octet)
1102                                          Remote address (6 octets)
1103
1104                 Valid connection states: 0x00 = Disconnected
1105                                          0x01 = Connecting
1106                                          0x02 = Connected
1107                                          0x03 = Disconnecting
1108
1109         Opcode 0x82 - Audio State notification
1110
1111                 Notification parameters: Audio state (1 octet)
1112                                          Remote address (6 octets)
1113
1114                 Valid connection states: 0x00 = Remote suspend
1115                                          0x01 = Stopped
1116                                          0x02 = Started
1117
1118         Opcode 0x83 - Audio Configuration notification
1119
1120                 Notification parameters: Remote address (6 octets)
1121                                          Sample Rate in Hz (4 octets)
1122                                          Channel Count (1 octet)
1123
1124                 Valid channel count: 0x01 = Mono
1125                                      0x02 = Stereo
1126
1127 Bluetooth Health HAL (ID 7)
1128 ===========================
1129
1130 Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
1131
1132 Commands and responses:
1133
1134         Opcode 0x00 - Error response
1135
1136         Opcode 0x01 - Register Application command/response
1137
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)
1144                                     Data (data length)
1145                 Response parameters: Application ID (2 octets)
1146
1147                 Strings are null terminated.
1148                 In case of an error, the error response will be returned.
1149
1150         Opcode 0x02 - Register Application MDEP data command/response
1151
1152                 Command parameters: Application ID (2 octets)
1153                                     MDEP Role (1 octet)
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>
1159
1160                 In case of an error, the error response will be returned.
1161
1162         Opcode 0x03 - Unregister Application command/response
1163
1164                 Command parameters: Application ID (2 octets)
1165                 Response parameters: <none>
1166
1167                 In case of an error, the error response will be returned.
1168
1169         Opcode 0x04 - Connect Channel command/response
1170
1171                 Command parameters: Application ID (2 octets)
1172                                     Remote address (6 octets)
1173                                     MDEP index (1 octet)
1174                 Response parameters: Channel ID (2 octets)
1175
1176                 In case of an error, the error response will be returned.
1177
1178         Opcode 0x05 - Destroy Channel command/response
1179
1180                 Command parameters: Channel ID (2 octets)
1181                 Response parameters: <none>
1182
1183                 In case of an error, the error response will be returned.
1184
1185 Notifications:
1186
1187         Opcode 0x81 - Application Registration State notification
1188
1189                 Notification parameters: Application ID (2 octets)
1190                                          Application state (1 octet)
1191
1192                 Valid application states: 0x00 = Registration success
1193                                           0x01 = Registration failed
1194                                           0x02 = Deregistration success
1195                                           0x03 = Deregistration failed
1196
1197         Opcode 0x82 - Channel State notification
1198
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)
1205
1206                 Valid channel states: 0x00 = Connecting
1207                                       0x01 = Connected
1208                                       0x02 = Disconnecting
1209                                       0x03 = Disconnected
1210                                       0x04 = Destroyed
1211
1212
1213 Bluetooth Remote Control Target HAL (ID 8)
1214 ===================================
1215
1216 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
1217
1218 Commands and responses:
1219
1220         Opcode 0x00 - Error response
1221
1222         Opcode 0x01 - Get Play Status Response command/response
1223
1224                 Command parameters: Status (1 octet)
1225                                     Duration (4 octets)
1226                                     Position (4 octets)
1227
1228                 In case of an error, the error response will be returned.
1229
1230                 Valid status values: 0x00 = Stopped
1231                                      0x01 = Playing
1232                                      0x02 = Paused
1233                                      0x03 = Fwd seek
1234                                      0x04 = Rev seek
1235                                      0xff = Error
1236
1237         Opcode 0x02 - List Player Attributes Response command/response
1238
1239                 Command parameters: Number of attributes (1 octet)
1240                                     Attribute # (1 octet)
1241                                     ...
1242
1243                 In case of an error, the error response will be returned.
1244
1245                 Valid attributes: 0x01 = Equalizer
1246                                   0x02 = Repead
1247                                   0x03 = Shuffle
1248                                   0x04 = Scan
1249
1250         Opcode 0x03 - List Player Values Response command/response
1251
1252                 Command parameters: Number of values (1 octet)
1253                                     Value # (1 octet)
1254                                     ...
1255
1256                 In case of an error, the error response will be returned.
1257
1258         Opcode 0x04 - Get Player Values Response command/response
1259
1260                 Command parameters: Number of attributes (1 octet)
1261                                     Attribute # (1 octet)
1262                                     Value # (1 octet)
1263                                     ...
1264
1265                 In case of an error, the error response will be returned.
1266
1267                 Valid attributes: Same as in List Player Attributes
1268
1269         Opcode 0x05 - Get Player Attributes Text Response command/response
1270
1271                 Command parameters: Number of attributes (1 octet)
1272                                     Attribute # (1 octet)
1273                                     Attribute # text length (1 octet)
1274                                     Attribute # text (variable)
1275                                     ...
1276
1277                 In case of an error, the error response will be returned.
1278
1279                 Valid attributes: Same as in List Player Attributes
1280
1281         Opcode 0x06 - Get Player Values Text Response command/response
1282
1283                 Command parameters: Number of values (1 octet)
1284                                     Value # (1 octet)
1285                                     Value # text length (1 octet)
1286                                     Value # text (variable)
1287                                     ...
1288
1289                 In case of an error, the error response will be returned.
1290
1291         Opcode 0x07 - Get Element Attributes Text Response command/response
1292
1293                 Command parameters: Number of elements (1 octet)
1294                                     Element # (1 octet)
1295                                     Element # text length (1 octet)
1296                                     Element # text (variable)
1297                                     ...
1298
1299                 In case of an error, the error response will be returned.
1300
1301                 Valid elements: 0x01 = Title
1302                                 0x02 = Artist
1303                                 0x03 = Album
1304                                 0x04 = Track Number
1305                                 0x05 = Number of Tracks
1306                                 0x06 = Genre
1307                                 0x06 = Duration
1308
1309         Opcode 0x08 - Set Player Attributes Value Response command/response
1310
1311                 Command parameters: Status (1 octet)
1312
1313                 In case of an error, the error response will be returned.
1314
1315                 Valid status values: Same as in Get Play Status Response
1316
1317         Opcode 0x09 - Register Notification Response command/response
1318
1319                 Command parameters: Event (1 octet)
1320                                     Type (1 octet)
1321                                     Data length (1 octet)
1322                                     Data (variable)
1323
1324                 In case of an error, the error response will be returned.
1325
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
1332
1333                 Valid type values : 0x00 = Interim
1334                                     0x01 = Changed
1335
1336         Opcode 0x0a - Set Volume command/response
1337
1338                 Command parameters: Value (1 octet)
1339
1340                 In case of an error, the error response will be returned.
1341
1342 Notifications:
1343
1344         Opcode 0x81 - Remote Features notification
1345
1346                 Notification parameters: Remote address (6 octets)
1347                                          Features (1 octet)
1348
1349                 Valid features values : 0x00 = None
1350                                         0x01 = Metadata
1351                                         0x02 = Absolute Volume
1352                                         0x03 = Browse
1353
1354         Opcode 0x82 - Get Play Status notification
1355
1356                 Notification parameters: <none>
1357
1358         Opcode 0x83 - List Player Attributes notification
1359
1360                 Notification parameters: <none>
1361
1362         Opcode 0x84 - List Player Values notification
1363
1364                 Notification parameters: Attribute (1 octet)
1365
1366                 Valid attribute values: Same as in List Player Attributes
1367
1368         Opcode 0x85 - Get Player Values notification
1369
1370                 Notification parameters: Number of attributes (1 octet)
1371                                          Attribute # (1 octet)
1372                                          ...
1373
1374                 Valid attribute values: Same as in List Player Attributes
1375
1376         Opcode 0x86 - Get Player Attributes Text notification
1377
1378                 Notification parameters: Number of attributes (1 octet)
1379                                          Attribute # (1 octet)
1380                                          ...
1381
1382                 Valid attribute values: Same as in List Player Attributes
1383
1384         Opcode 0x87 - Get Player Values Text notification
1385
1386                 Notification parameters: Attribute (1 octet)
1387                                          Number of values (1 octet)
1388                                          Value # (1 octet)
1389                                          ...
1390
1391                 Valid attribute values: Same as in List Player Attributes
1392
1393         Opcode 0x88 - Set Player Values notification
1394
1395                 Notification parameters: Number of attributes (1 octet)
1396                                          Attribute # (1 octet)
1397                                          Value # (1 octet)
1398                                          ...
1399
1400                 Valid attribute values: Same as in List Player Attributes
1401
1402         Opcode 0x89 - Get Element Attributes notification
1403
1404                 Notification parameters: Number of attributes (1 octet)
1405                                          Attribute # (1 octet)
1406                                          ...
1407
1408                 Valid attribute values: Same as in Get Element Attribute
1409
1410         Opcode 0x8a - Register Notification notification
1411
1412                 Notification parameters: Event (1 octet)
1413                                          Parameter (4 octets)
1414
1415                 Valid event values: Same as in Register Notification
1416
1417         Opcode 0x8b - Volume Changed notification
1418
1419                 Notification parameters: Volume (1 octet)
1420                                          Type (1 octet)
1421
1422                 Valid type values: Same as in Register Notification
1423
1424         Opcode 0x8c - Passthrough Command notification
1425
1426                 Notification parameters: ID (1 octet)
1427                                          State (1 octet)
1428
1429 Bluetooth GATT HAL (ID 9)
1430 =========================
1431
1432 Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
1433
1434 Structures:
1435
1436         GATT Service ID: UUID (16 octets)
1437                          Instance ID (1 octet)
1438                          Is Primary (1 octet)
1439
1440         GATT Included Service ID: UUID (16 octets)
1441                                   Instance ID (1 octet)
1442                                   Is Primary (1 octet)
1443
1444         GATT Characteristic ID: UUID (16 octets)
1445                                 Instance ID (1 octet)
1446
1447         GATT Descriptor ID: UUID (16 octets)
1448                             Instance ID (1 octet)
1449
1450 Commands and responses:
1451
1452         Opcode 0x00 - Error response
1453
1454         Opcode 0x01 - Client Register command/response
1455
1456                 Command parameters: Service UUID (16 octets)
1457                 Response parameters: <none>
1458
1459                 In case of an error, the error response will be returned.
1460
1461         Opcode 0x02 - Client Unregister command/response
1462
1463                 Command parameters: Client Interface (4 octets)
1464                 Response parameters: <none>
1465
1466                 In case of an error, the error response will be returned.
1467
1468         Opcode 0x03 - Client Scan command/response
1469
1470                 Command parameters: Client Interface (4 octets)
1471                                     Start (1 octet)
1472                 Response parameters: <none>
1473
1474                 In case of an error, the error response will be returned.
1475
1476         Opcode 0x04 - Client Connect Device command/response
1477
1478                 Command parameters: Client Interface (4 octets)
1479                                     Remote address (6 octets)
1480                                     Is Direct (1 octet)
1481                                     Transport (4 octets)
1482                 Response parameters: <none>
1483
1484                 Valid transport value: 0x00 = Auto
1485                                        0x01 = BR/EDR
1486                                        0x02 = LE
1487
1488                 In case of an error, the error response will be returned.
1489
1490         Opcode 0x05 - Client Disconnect Device command/response
1491
1492                 Command parameters: Client Interface (4 octets)
1493                                     Remote address (6 octets)
1494                                     Connection ID (4 octets)
1495                 Response parameters: <none>
1496
1497                 In case of an error, the error response will be returned.
1498
1499         Opcode 0x06 - Client Listen command/response
1500
1501                 Command parameters: Client Interface (4 octets)
1502                                     Start (1 octet)
1503                 Response parameters: <none>
1504
1505                 In case of an error, the error response will be returned.
1506
1507         Opcode 0x07 - Client Refresh command/response
1508
1509                 Command parameters: Client Interface (4 octets)
1510                                     Remote address (6 octets)
1511                 Response parameters: <none>
1512
1513                 In case of an error, the error response will be returned.
1514
1515         Opcode 0x08 - Client Search Service command/response
1516
1517                 Command parameters: Connection ID (4 octets)
1518                                     Filtered (1 octet)
1519                                     Filter UUID (16 octets)
1520                 Response parameters: <none>
1521
1522                 Filter UUID shall only be present when Filtered is non-zero.
1523
1524                 In case of an error, the error response will be returned.
1525
1526         Opcode 0x09 - Client Get Included Service command/response
1527
1528                 Command parameters: Connection ID (4 octets)
1529                                     GATT Service ID (18 octets)
1530                                     Continuation (1 octet)
1531                                     GATT Included Service ID (18 octets)
1532                                     ...
1533                 Response parameters: <none>
1534
1535                 GATT Included Service ID shall only be present when Continuation
1536                 is non-zero.
1537
1538                 In case of an error, the error response will be returned.
1539
1540         Opcode 0x0a - Client Get Characteristic command/response
1541
1542                 Command parameters: Connection ID (4 octets)
1543                                     GATT Service ID (18 octets)
1544                                     Continuation (1 octet)
1545                                     GATT Characteristic ID (17 octets)
1546                                     ...
1547                 Response parameters: <none>
1548
1549                 GATT Characteristic ID shall only be present when Continuation
1550                 is non-zero.
1551
1552                 In case of an error, the error response will be returned.
1553
1554         Opcode 0x0b - Client Get Descriptor command/response
1555
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)
1561                                     ...
1562                 Response parameters: <none>
1563
1564                 GATT Descriptor ID shall only be present when Continuation is
1565                 non-zero.
1566
1567                 In case of an error, the error response will be returned.
1568
1569         Opcode 0x0c - Client Read Characteristic command/response
1570
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>
1576
1577                 In case of an error, the error response will be returned.
1578
1579         Opcode 0x0d - Client Write Characteristic command/response
1580
1581                 Command parameters: Connection ID (4 octets)
1582                                     GATT Service ID (18 octets)
1583                                     GATT Characteristic ID (17 octets)
1584                                     Write Type (4 octets)
1585                                     Length (4 octets)
1586                                     Authorization Req. (4 octets)
1587                                     Value (variable)
1588                 Response parameters: <none>
1589
1590                 Valid Write Type: 0x01 = No response
1591                                   0x02 = Default
1592                                   0x03 = Prepare
1593                                   0x04 = Signed
1594
1595                 In case of an error, the error response will be returned.
1596
1597         Opcode 0x0e - Client Read Descriptor command/response
1598
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>
1605
1606                 In case of an error, the error response will be returned.
1607
1608         Opcode 0x0f - Client Write Descriptor command/response
1609
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)
1615                                     Length (4 octets)
1616                                     Authorization Req. (4 octets)
1617                                     Value (variable)
1618                 Response parameters: <none>
1619
1620                 Valid Write Type: 0x01 = No response
1621                                   0x02 = Default
1622                                   0x03 = Prepare
1623                                   0x04 = Signed
1624
1625                 In case of an error, the error response will be returned.
1626
1627         Opcode 0x10 - Client Execute Write command/response
1628
1629                 Command parameters: Connection ID (4 octets)
1630                                     Execute (4 octets)
1631                 Response parameters: <none>
1632
1633                 In case of an error, the error response will be returned.
1634
1635         Opcode 0x11 - Client Register For Notification command/response
1636
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>
1642
1643                 In case of an error, the error response will be returned.
1644
1645         Opcode 0x12 - Client Deregister For Notification command/response
1646
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>
1652
1653                 In case of an error, the error response will be returned.
1654
1655         Opcode 0x13 - Client Read Remote RSSI command/response
1656
1657                 Command parameters: Client Interface (4 octets)
1658                                     Remote address (6 octets)
1659                 Response parameters: <none>
1660
1661                 In case of an error, the error response will be returned.
1662
1663         Opcode 0x14 - Client Get Device Type command/response
1664
1665                 Command parameters: Remote address (6 octets)
1666                 Response parameters: Device Type
1667
1668                 Valid Device Type: 0x01 = BREDR
1669                                    0x02 = BLE
1670                                    0x03 = DUAL
1671
1672                 In case of an error, the error response will be returned.
1673
1674         Opcode 0x15 - Client Set Advertising data command/response
1675
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>
1686
1687                 In case of an error, the error response will be returned.
1688
1689         Opcode 0x16 - Client Test Command command/response
1690
1691                 Command parameters: Command (4 octets)
1692                                     Address (6 octets)
1693                                     UUID (16 octets)
1694                                     U1 (2 octets)
1695                                     U2 (2 octets)
1696                                     U3 (2 octets)
1697                                     U4 (2 octets)
1698                                     U5 (2 octets)
1699                 Response parameters: <none>
1700
1701                 In case of an error, the error response will be returned.
1702
1703         Opcode 0x17 - Server Register command/response
1704
1705                 Command parameters: UUID (16 octets)
1706                 Response parameters: <none>
1707
1708                 In case of an error, the error response will be returned.
1709
1710         Opcode 0x18 - Server Unregister command/response
1711
1712                 Command parameters: Server (4 octets)
1713                 Response parameters: <none>
1714
1715                 In case of an error, the error response will be returned.
1716
1717         Opcode 0x19 - Server Connect Peripheral command/response
1718
1719                 Command parameters: Server (4 octets)
1720                                     Remote address (6 octets)
1721                                     Is Direct (1 octet)
1722                                     Transport (4 octets)
1723                 Response parameters: <none>
1724
1725                 In case of an error, the error response will be returned.
1726
1727         Opcode 0x1a - Server Disconnect Peripheral command/response
1728
1729                 Command parameters: Server (4 octets)
1730                                     Remote address (6 octets)
1731                                     Connection ID (1 octet)
1732                 Response parameters: <none>
1733
1734                 In case of an error, the error response will be returned.
1735
1736         Opcode 0x1b - Server Add Service command/response
1737
1738                 Command parameters: Server (4 octets)
1739                                     GATT Service ID (18 octets)
1740                                     Number of Handles (4 octet)
1741                 Response parameters: <none>
1742
1743                 Valid GATT Service ID: UUID (16 octets)
1744                                        Instance ID (1 octet)
1745                                        Is Primary (1 octet)
1746
1747                 In case of an error, the error response will be returned.
1748
1749         Opcode 0x1c - Server Add Included Service command/response
1750
1751                 Command parameters: Server (4 octets)
1752                                     Service handle (4 octets)
1753                                     Included handle (4 octets)
1754                 Response parameters: <none>
1755
1756                 In case of an error, the error response will be returned.
1757
1758         Opcode 0x1d - Server Add Characteristic command/response
1759
1760                 Command parameters: Server (4 octets)
1761                                     Service handle (4 octets)
1762                                     UUID (16 octets)
1763                                     Properties (4 octets)
1764                                     Permissions (4 octets)
1765                 Response parameters: <none>
1766
1767                 In case of an error, the error response will be returned.
1768
1769         Opcode 0x1e - Server Add Descriptor command/response
1770
1771                 Command parameters: Server (4 octets)
1772                                     Service handle (4 octets)
1773                                     UUID (16 octets)
1774                                     Permissions (4 octets)
1775                 Response parameters: <none>
1776
1777                 In case of an error, the error response will be returned.
1778
1779         Opcode 0x1f - Server Start Service command/response
1780
1781                 Command parameters: Server (4 octets)
1782                                     Service handle (4 octets)
1783                                     Transport (4 octets)
1784                 Response parameters: <none>
1785
1786                 In case of an error, the error response will be returned.
1787
1788         Opcode 0x20 - Server Stop Service command/response
1789
1790                 Command parameters: Server (4 octets)
1791                                     Service handle (4 octets)
1792                 Response parameters: <none>
1793
1794                 In case of an error, the error response will be returned.
1795
1796         Opcode 0x21 - Server Delete Service command/response
1797
1798                 Command parameters: Server (4 octets)
1799                                     Service handle (4 octets)
1800                 Response parameters: <none>
1801
1802                 In case of an error, the error response will be returned.
1803
1804         Opcode 0x22 - Server Send Indication command/response
1805
1806                 Command parameters: Server (4 octets)
1807                                     Attribute handle (4 octets)
1808                                     Connection ID (4 octets)
1809                                     Length (4 octets)
1810                                     Confirmation (4 octets)
1811                                     Value (variable)
1812                 Response parameters: <none>
1813
1814                 In case of an error, the error response will be returned.
1815
1816         Opcode 0x23 - Server Send Response command/response
1817
1818                 Command parameters: Connection ID (4 octets)
1819                                     Transaction ID (4 octets)
1820                                     Handle (2 octets)
1821                                     Offset (2 octets)
1822                                     Auth Request (1 octect)
1823                                     Status (4 octets)
1824                                     GATT Response (4 octets)
1825                 Response parameters: <none>
1826
1827                 Valid GATT Response: GATT Value (607 octets)
1828                                      Handle (2 octets)
1829
1830                 Valid GATT Value: Value (600 octets)
1831                                   Handle (2 octets)
1832                                   Offset (2 octets)
1833                                   Length (2 octets)
1834                                   Authentication Request (1 octet)
1835
1836                 In case of an error, the error response will be returned.
1837
1838         Opcode 0x24 - Client Scan Filter Params Setup command/response
1839
1840                 Command parameters: Client Interface (4 octets)
1841                                     Action (4 octets)
1842                                     Filter Index (4 octets)
1843                                     Features (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>
1853
1854                 In case of an error, the error response will be returned.
1855
1856         Opcode 0x25 - Client Scan Filter Add Remove command/response
1857
1858                 Command parameters: Client Interface (4 octets)
1859                                     Action (4 octets)
1860                                     Filter Type (4 octets)
1861                                     Filter Index (4 octets)
1862                                     Company ID (4 octets)
1863                                     Company ID Mask (4 octets)
1864                                     UUID (16 octets)
1865                                     UUID Mask (16 octets)
1866                                     Address (6 octets)
1867                                     Address Type (1 octet)
1868                                     Data Length (4 octets)
1869                                     Data (variable)
1870                                     Mask Length (4 octets)
1871                                     Mask (variable)
1872                 Response parameters: <none>
1873
1874                 In case of an error, the error response will be returned.
1875
1876         Opcode 0x26 - Client Scan Filter Clear command/response
1877
1878                 Command parameters: Client Interface (4 octets)
1879                                     Filter Index (4 octets)
1880                 Response parameters: <none>
1881
1882                 In case of an error, the error response will be returned.
1883
1884         Opcode 0x27 - Client Scan Filter Enable command/response
1885
1886                 Command parameters: Client Interface (4 octets)
1887                                     Enable (1 octet)
1888                 Response parameters: <none>
1889
1890                 In case of an error, the error response will be returned.
1891
1892         Opcode 0x28 - Client Configure MTU command/response
1893
1894                 Command parameters: Connection ID (4 octets)
1895                                     MTU (4 octets)
1896                 Response parameters: <none>
1897
1898                 In case of an error, the error response will be returned.
1899
1900         Opcode 0x29 - Client Connection Parameter Update command/response
1901
1902                 Command parameters: Address (6 octets)
1903                                     Min Interval (4 octets)
1904                                     Max Interval (4 octets)
1905                                     Latency (4 octets)
1906                                     Timeoutl (4 octets)
1907                 Response parameters: <none>
1908
1909                 In case of an error, the error response will be returned.
1910
1911         Opcode 0x2a - Client Set Scan Parameters command/response
1912
1913                 Command parameters: Scan Interval (4 octets)
1914                                     Scan Window (4 octets)
1915                 Response parameters: <none>
1916
1917                 In case of an error, the error response will be returned.
1918
1919         Opcode 0x2b - Client Setup Multi Advertising command/response
1920
1921                 Command parameters: Client ID (4 octets)
1922                                     Min Interval (4 octets)
1923                                     Max Interval (4 octets)
1924                                     ADV Type (4 octets)
1925                                     Channel Map (4 octets)
1926                                     TX Power (4 octets)
1927                                     Timeout (4 octets)
1928                 Response parameters: <none>
1929
1930                 In case of an error, the error response will be returned.
1931
1932         Opcode 0x2c - Client Update Multi Advertising command/response
1933
1934                 Command parameters: Client ID (4 octets)
1935                                     Min Interval (4 octets)
1936                                     Max Interval (4 octets)
1937                                     ADV Type (4 octets)
1938                                     Channel Map (4 octets)
1939                                     TX Power (4 octets)
1940                                     Timeout (4 octets)
1941                 Response parameters: <none>
1942
1943                 In case of an error, the error response will be returned.
1944
1945         Opcode 0x2d - Client Setup Multi Advertising Instance command/response
1946
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>
1959
1960                 In case of an error, the error response will be returned.
1961
1962         Opcode 0x2e - Client Disable Multi Advertising Instance command/response
1963
1964                 Command parameters: Client ID (4 octets)
1965                 Response parameters: <none>
1966
1967                 In case of an error, the error response will be returned.
1968
1969         Opcode 0x2f - Client Configure Batchscan command/response
1970
1971                 Command parameters: Client ID (4 octets)
1972                                     Full Max (4 octets)
1973                                     Trunc Max (4 octets)
1974                                     Notify Threshold (4 octets)
1975                 Response parameters: <none>
1976
1977                 In case of an error, the error response will be returned.
1978
1979         Opcode 0x30 - Client Enable Batchscan command/response
1980
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>
1988
1989                 In case of an error, the error response will be returned.
1990
1991         Opcode 0x31 - Client Disable Batchscan command/response
1992
1993                 Command parameters: Client ID (4 octets)
1994                 Response parameters: <none>
1995
1996                 In case of an error, the error response will be returned.
1997
1998         Opcode 0x32 - Client Read Batchscan Resports command/response
1999
2000                 Command parameters: Client ID (4 octets)
2001                                     Scan Mode (4 octets)
2002                 Response parameters: <none>
2003
2004                 In case of an error, the error response will be returned.
2005
2006 Notifications:
2007
2008         Opcode 0x81 - Client Register notification
2009
2010                 Notification parameters: Status (4 octets)
2011                                          Client Interface (4 octets)
2012                                          UUID (16 octets)
2013
2014         Opcode 0x82 - Client Scan Result notification
2015
2016                 Notification parameters: Address (6 octets)
2017                                          RSSI (4 octets)
2018                                          Length (2 octets)
2019                                          Data (variable)
2020
2021         Opcode 0x83 - Client Connect Device notification
2022
2023                 Notification parameters: Connection ID (4 octets)
2024                                          Status (4 octets)
2025                                          Client Interface (4 octets)
2026                                          Address (6 octets)
2027
2028         Opcode 0x84 - Client Disconnect Device notification
2029
2030                 Notification parameters: Connection ID (4 octets)
2031                                          Status (4 octets)
2032                                          Client Interface (4 octets)
2033                                          Address (6 octets)
2034
2035         Opcode 0x85 - Client Search Complete notification
2036
2037                 Notification parameters: Connection ID (4 octets)
2038                                          Status (4 octets)
2039
2040         Opcode 0x86 - Client Search Result notification
2041
2042                 Notification parameters: Connection ID (4 octets)
2043                                          GATT Service ID (18 octets)
2044
2045         Opcode 0x87 - Client Get Characteristic notification
2046
2047                 Notification parameters: Connection ID (4 octets)
2048                                          Status (4 octets)
2049                                          GATT Service ID (18 octets)
2050                                          GATT Characteristic ID (17 octets)
2051                                          Char Prop. (4 octets)
2052
2053         Opcode 0x88 - Client Get Descriptor notification
2054
2055                 Notification parameters: Connection ID (4 octets)
2056                                          Status (4 octets)
2057                                          GATT Service ID (18 octets)
2058                                          GATT Characteristic ID (17 octets)
2059                                          GATT Descriptor ID (17 octets)
2060
2061         Opcode 0x89 - Client Get Included Service notification
2062
2063                 Notification parameters: Connection ID (4 octets)
2064                                          Status (4 octets)
2065                                          GATT Service ID (18 octets)
2066                                          GATT Included Service ID (18 octets)
2067
2068         Opcode 0x8a - Client Register For Notification notification
2069
2070                 Notification parameters: Connection ID (4 octets)
2071                                          Registered (4 octets)
2072                                          Status (4 octets)
2073                                          GATT Service ID (18 octets)
2074                                          GATT Characteristic ID (17 octets)
2075
2076         Opcode 0x8b - Client Notify notification
2077
2078                 Notification parameters: Connection ID (4 octets)
2079                                          Address (6 octets)
2080                                          GATT Service ID (18 octets)
2081                                          GATT Characteristic ID (17 octets)
2082                                          Is Notify (1 octet)
2083                                          Length (2 octets)
2084                                          Value (variable)
2085
2086         Opcode 0x8c - Client Read Characteristic notification
2087
2088                 Notification parameters: Connection ID (4 octets)
2089                                          Status (4 octets)
2090                                          GATT Read Parameters (variable)
2091
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)
2096                                             Status (1 octet)
2097                                             Length (2 octets)
2098                                             Value (variable)
2099
2100         Opcode 0x8d - Client Write Characteristic notification
2101
2102                 Notification parameters: Connection ID (4 octets)
2103                                          Status (4 octets)
2104                                          GATT Write Parameters (53 octets)
2105
2106                 Valid GATT Write Parameters: GATT Service ID (18 octets)
2107                                              GATT Characteristic ID (17 octets)
2108                                              GATT Description ID (17 octets)
2109                                              Status (1 octet)
2110
2111         Opcode 0x8e - Client Read Descriptor notification
2112
2113                 Notification parameters: Connection ID (4 octets)
2114                                          Status (4 octets)
2115                                          GATT Read Parameters (variable)
2116
2117                 Valid GATT Read Parameters: As described in Read Characteristic
2118
2119         Opcode 0x8f - Client Write Descriptor notification
2120
2121                 Notification parameters: Connection ID (4 octets)
2122                                          Status (4 octets)
2123                                          GATT Write Parameters (53 octets)
2124
2125                 Valid GATT Write Parameters: As described in Write Characteristic
2126
2127         Opcode 0x90 - Client Execute Write notification
2128
2129                 Notification parameters: Connection ID (4 octets)
2130                                          Status (4 octets)
2131
2132         Opcode 0x91 - Client Read Remote RSSI notification
2133
2134                 Notification parameters: Client (4 octets)
2135                                          Address (6 octets)
2136                                          RSSI (4 octets)
2137                                          Status (4 octets)
2138
2139         Opcode 0x92 - Client Listen notification
2140
2141                 Notification parameters: Status (4 octets)
2142                                          Server Interface (4 octets)
2143
2144         Opcode 0x93 - Server Register notification
2145
2146                 Notification parameters: Status (4 octets)
2147                                          Server (4 octets)
2148                                          UUID (16 octets)
2149
2150         Opcode 0x94 - Server Connection notification
2151
2152                 Notification parameters: Connection ID (4 octets)
2153                                          Server (4 octets)
2154                                          Connected (4 octets)
2155                                          Address (6 octets)
2156
2157         Opcode 0x95 - Server Service Added notification
2158
2159                 Notification parameters: Status (4 octets)
2160                                          Server (4 octets)
2161                                          GATT Service ID (18 octets)
2162                                          Service Handle (4 octets)
2163
2164         Opcode 0x96 - Server Included Service Added notification
2165
2166                 Notification patemeters: Status (4 octets)
2167                                          Server (4 octets)
2168                                          Service Handle (4 octets)
2169                                          Included Service Handle (4 octets)
2170
2171         Opcode 0x97 - Server Characteristic Added notification
2172
2173                 Notification parameters: Status (4 octets)
2174                                          Server (4 octets)
2175                                          UUID (16 octets)
2176                                          Service Handle (4 octets)
2177                                          Characteristic Handle (4 octets)
2178
2179         Opcode 0x98 - Server Descriptor Added notification
2180
2181                 Notification parameters: Status (4 octets)
2182                                          Server (4 octets)
2183                                          UUID (6 octets)
2184                                          Service Handle (4 octets)
2185                                          Descriptor Handle (4 octets)
2186
2187         Opcode 0x99 - Server Service Started notification
2188
2189                 Notification parameters: Status (4 octets)
2190                                          Server (4 octets)
2191                                          Service Handle (4 octets)
2192
2193         Opcode 0x9a - Server Service Stopped notification
2194
2195                 Notification parameters: Status (4 octets)
2196                                          Server (4 octets)
2197                                          Service Handle (4 octets)
2198
2199         Opcode 0x9b - Server Service Deleted notification
2200
2201                 Notification parameters: Status (4 octets)
2202                                          Server (4 octets)
2203                                          Service Handle (4 octets)
2204
2205         Opcode 0x9c - Server Request Read notification
2206
2207                 Notification parameters: Connection ID (4 octets)
2208                                          Trans ID (4 octets)
2209                                          Address (6 octets)
2210                                          Attribute Handle (4 octets)
2211                                          Offset (4 octets)
2212                                          Is Long (1 octet)
2213
2214         Opcode 0x9d - Server Request Write notification
2215
2216                 Notification parameters: Connection ID (4 octets)
2217                                          Trans ID (4 octets)
2218                                          Address (6 octets)
2219                                          Attribute Handle (4 octets)
2220                                          Offset (4 octets)
2221                                          Length (4 octets)
2222                                          Need Response (4 octets)
2223                                          Is Prepare (1 octet)
2224                                          Value (variable)
2225
2226         Opcode 0x9e - Server Request Execute Write notification
2227
2228                 Notification parameters: Connection ID (4 octets)
2229                                          Trans ID (4 octets)
2230                                          Address (6 octets)
2231                                          Execute Write (4 octets)
2232
2233         Opcode 0x9f - Server Response Confirmation notification
2234
2235                 Notification parameters: Status (4 octets)
2236                                          Handle (4 octets)
2237
2238         Opcode 0xa0 - Client Configure MTU notification
2239
2240                 Notification parameters: Connection ID (4 octets)
2241                                          Status (4 octets)
2242                                          MTU (4 octets)
2243
2244         Opcode 0xa1 - Client Filter Configuration notification
2245
2246                 Notification parameters: Action (4 octets)
2247                                          Client ID (4 octets)
2248                                          Status (4 octets)
2249                                          Filter Type (4 octets)
2250                                          Available Space (4 octets)
2251
2252         Opcode 0xa2 - Client Filter Parameters notification
2253
2254                 Notification parameters: Action (4 octets)
2255                                          Client ID (4 octets)
2256                                          Status (4 octets)
2257                                          Available Space (4 octets)
2258
2259         Opcode 0xa3 - Client Filter Status notification
2260
2261                 Notification parameters: Enable (4 octets)
2262                                          Client ID (4 octets)
2263                                          Status (4 octets)
2264
2265         Opcode 0xa4 - Client Multi Advertising Enable notification
2266
2267                 Notification parameters: Client ID (4 octets)
2268                                          Status (4 octets)
2269
2270         Opcode 0xa5 - Client Multi Advertising Update notification
2271
2272                 Notification parameters: Client ID (4 octets)
2273                                          Status (4 octets)
2274
2275         Opcode 0xa6 - Client Multi Advertising Data notification
2276
2277                 Notification parameters: Client ID (4 octets)
2278                                          Status (4 octets)
2279
2280         Opcode 0xa7 - Client Multi Advertising Disable notification
2281
2282                 Notification parameters: Client ID (4 octets)
2283                                          Status (4 octets)
2284
2285         Opcode 0xa8 - Client Congestion notification
2286
2287                 Notification parameters: Connection ID (4 octets)
2288                                          Congested (1 octet)
2289
2290         Opcode 0xa9 - Client Configure Batchscan notification
2291
2292                 Notification parameters: Client ID (4 octets)
2293                                          Status (4 octets)
2294
2295         Opcode 0xaa - Client Enable Batchscan notification
2296
2297                 Notification parameters: Action (4 octets)
2298                                          Client ID (4 octets)
2299                                          Status (4 octets)
2300
2301         Opcode 0xab - Client Batchscan Reports notification
2302
2303                 Notification parameters: Client ID (4 octets)
2304                                          Status (4 octets)
2305                                          Report Format (4 octets)
2306                                          Num Reports (4 octets)
2307                                          Data Length (4 octets)
2308                                          Data (variable)
2309
2310         Opcode 0xac - Client Batchscan Threshold notification
2311
2312                 Notification parameters: Client ID (4 octets)
2313
2314         Opcode 0xad - Client Track ADV notification
2315
2316                 Notification parameters: Client ID (4 octets)
2317                                          Filter Index (4 octets)
2318                                          Address Type (4 octets)
2319                                          Address (6 octets)
2320                                          State (4 octets)
2321
2322         Opcode 0xae - Server Indication Sent notification
2323
2324                 Notification parameters: Connection ID (4 octets)
2325                                          Status (4 octets)
2326
2327         Opcode 0xaf - Server Congestion notification
2328
2329                 Notification parameters: Connection ID (4 octets)
2330                                          Congested (1 octet)
2331
2332
2333 Bluetooth Handsfree Client HAL (ID 10)
2334 ======================================
2335
2336 Android HAL name: "hf_client" (BT_PROFILE_HANDSFREE_CLIENT_ID)
2337
2338 Commands and response:
2339
2340         Opcode 0x00 - Error response
2341
2342         Opcode 0x01 - Connect command/respose
2343
2344                 Command parameters: Remote address (6 octects)
2345                 Response parameters: <none>
2346
2347                  In case of an error, the error response will be returned.
2348
2349         Opcode 0x02 - Disonnect command/response
2350
2351                 Command parameters: Remote address (6 octetcs)
2352                 Response parameters: <none>
2353
2354                  In case of an error, the error response will be returned.
2355
2356         Opcode 0x03 - Connect Audio command/response
2357
2358                 Command parameters: Remote address (6 octets)
2359                 Response parameters: <none>
2360
2361                 In case of an error, the error response will be returned.
2362
2363         Opcode 0x04 - Disconnect Audio command/response
2364
2365                 Command parameters: Remote address (6 octets)
2366                 Response parameters: <none>
2367
2368                 In case of an error, the error response will be returned.
2369
2370         Opcode 0x05 - Start Voice Recognition command/response
2371
2372                 Command parameters: <none>
2373                 Response parameters: <none>
2374
2375                 In case of an error, the error response will be returned.
2376
2377         Opcode 0x06 - Stop Voice Recognition command/response
2378
2379                 Command parameters: <none>
2380                 Response parameters: <none>
2381
2382                 In case of an error, the error response will be returned.
2383
2384         Opcode 0x07 - Volume Control command/response
2385
2386                 Command parameters: Volume type (1 octet)
2387                                     Volume (1 octet)
2388                 Response parameters: <none>
2389
2390                 Valid volume types: 0x00 = Speaker
2391                                     0x01 = Microphone
2392
2393                 In case of an error, the error response will be returned.
2394
2395         Opcode 0x08 - Dial command/response
2396
2397                 Command parameters: Number (string)
2398                 Response parameters: <none>
2399
2400                 In case of an error, the error response will be returned.
2401
2402         Opcode 0x09 - Dial Memory command/response
2403
2404                 Command parameters: Location (4 octet)
2405                 Response parameters: <none>
2406
2407                 In case of an error, the error response will be returned.
2408
2409         Opcode 0x10 - Handle Call Action command/response
2410
2411                 Command parameters: Action (1 octet)
2412                                     Call Index (1 octet)
2413                 Response parameters: <none>
2414
2415                 Valid actions: 0x00 = CHLD_0
2416                                0x01 = CHLD_1
2417                                0x02 = CHLD_2
2418                                0x03 = CHLD_3
2419                                0x04 = CHLD_4
2420                                0x05 = CHLD_1x
2421                                0x06 = CHLD_2x
2422                                0x07 = ATA
2423                                0x08 = CHUP
2424                                0x09 = BTRH_0
2425                                0x10 = BTRH_1
2426                                0x11 = BTRH_2
2427
2428                 In case of an error, the error response will be returned.
2429
2430         Opcode 0x11 - Query Current Calls commad/response
2431
2432                 Command parameters: <none>
2433                 Response parameters: <none>
2434
2435                 In case of an error, the error response will be returned.
2436
2437         Opcode 0x12 - Query Current Operator Name
2438
2439                 Command parameters: <none>
2440                 Response parameters: <none>
2441
2442                 In case of an error, the error response will be returned.
2443
2444         Opcode 0x13 - Retrieve Subscriber Info command/response
2445
2446                 Command parameters: <none>
2447                 Response parameters: <none>
2448
2449                 In case of an error, the error response will be returned.
2450
2451         Opcode 0x14 - Send DTMF Tone command/response
2452
2453                 Command parameters: Tone (1 octet)
2454                 Response parameters: <none>
2455
2456                 In case of an error, the error response will be returned.
2457
2458         Opcode 0x15 - Request Last Voice Tag Number command/response
2459
2460                 Command parameters: <none>
2461                 Response parameters: <none>
2462
2463                 In case of an error, the error response will be returned.
2464
2465 Notifications:
2466
2467         Opcode 0x81 - Connection State Changed notification
2468
2469                 Notification parameters: State (1 octet)
2470                                          Peer Features (4 octets)
2471                                          CHLD Features (4 octets)
2472                                          Address (6 octets)
2473
2474                 Valid State values: 0x00 = Disconnected
2475                                     0x01 = Connecting
2476                                     0x02 = Connected
2477                                     0x03 = SLC Connected
2478                                     0x04 = Disconnecting
2479
2480                 Peer Features is a bitmask of the supported features. Currently
2481                 available bits:
2482
2483                         0       Three way calling
2484                         1       Echo cancellation and/or noise reduction
2485                         2       Voice recognition
2486                         3       In band ring tone
2487                         4       Attach a number to a voice tag
2488                         5       Ability to reject a call
2489                         6       Enhanced call status
2490                         7       Enhanced call control
2491                         8       Extended Error Result Codes
2492                         9       Codec negotiations
2493                         10-31   Reserved for future use
2494
2495                 CHLD Features is a bitmask of the supported features. Currently
2496                 available bits:
2497
2498                         0       Release waiting call or held calls
2499                         1       Release active calls and accept other call
2500                         2       Release specified active call only
2501                         3       Place all active calls on hold and accept other call
2502                         4       Request private mode with secified call
2503                         5       Add a held call to the multiparty
2504                         6       Connect two calls and leave multiparty
2505                         7-31    Reserved for future use
2506
2507                 Note: Peer and CHLD Features are valid only in SCL Connected state
2508
2509
2510         Opcode 0x82 - Audio State Changed notification
2511
2512                 Notification parameters: State (1 octet)
2513                                          Address (6 octets)
2514
2515                 Valid State values: 0x00 = Disconnected
2516                                     0x01 = Connecting
2517                                     0x02 = Connected
2518                                     0x03 = Connected mSBC
2519
2520         Opcode 0x83 - Voice Recognition State Changed notification
2521
2522                 Notification parameters: State (1 octet)
2523
2524                 Valid State values: 0x00 = VR Stopped
2525                                     0x01 = VR Started
2526
2527         Opcode 0x84 - Network State Changed notification
2528
2529                 Notification parameters: State (1 octet)
2530
2531                 Valid State values: 0x00 = Network Not Available
2532                                     0x01 = Network Available
2533
2534         Opcode 0x85 - Network Roaming Type Changed notification
2535
2536                 Notification parameters: Type (1 octet)
2537
2538                 Valid Type values: 0x00 = Home
2539                                    0x01 = Roaming
2540
2541         Opcode 0x86 - Network Signal Strength notification
2542
2543                 Notification parameters: Signal Strength (1 octet)
2544
2545         Opcode 0x87 - Battery Level notification
2546
2547                 Notification parameters: Battery Level (1 octet)
2548
2549         Opcode 0x88 - Current Operator Name notification
2550
2551                 Notification parameters: Name (string)
2552
2553         Opcode 0x89 - Call Indicatior notification
2554
2555                 Notification parameters: Call (1 octet)
2556
2557                 Valid Call values: 0x00 = No Call In Progress
2558                                    0x01 = Call In Progress
2559
2560         Opcode 0x8a - Call Setup Indicator notification
2561
2562                 Notification parameters: Call Setup (1 octet)
2563
2564                 Valid Call Setup values: 0x00 = None
2565                                          0x01 = Incoming
2566                                          0x02 = Outgoing
2567                                          0x03 = Alerting
2568
2569         Opcode 0x8b - Call Held Indicator notification
2570
2571                 Notification parameters: Call Held (1 octet)
2572
2573                 Valid Call Held values: 0x00 = None
2574                                         0x01 = Hold and Active
2575                                         0x02 = Hold
2576
2577         Opcode 0x8c - Resposne and Hold Status notification
2578
2579                 Notification parameters: Status (1 octet)
2580
2581                 Valid Status values: 0x00 = Held
2582                                      0x01 = Accept
2583                                      0x02 = Reject
2584
2585         Opcode 0x8d - Calling Line Identification notification
2586
2587                 Notification parameters: Number (string)
2588
2589                 Note: This will be called only on incoming call if number is
2590                 provided.
2591
2592         Opcode 0x8e - Call Waiting notification
2593
2594                 Notification parameters: Nunmber (string)
2595
2596         Opcode 0x8f - Current Calls List notification
2597
2598                 Notification parameters: Index (1 octet)
2599                                          Direction (1 octet)
2600                                          Call State (1 octet)
2601                                          Multiparty (1 octet)
2602                                          Number (string)
2603
2604                 Valid Direction values: 0x00 = Outgoing
2605                                         0x01 = Incoming
2606
2607                 Valid Call Sate values: 0x00 = Active
2608                                         0x01 = Held
2609                                         0x02 = Dialing
2610                                         0x03 = Alerting
2611                                         0x04 = Incoming
2612                                         0x05 = Waiting
2613                                         0x06 = Call held by Response and Hold
2614
2615                 Valid Multiparty values: 0x00 = Single Call
2616                                          0x01 = Multiparty (conference) Call
2617
2618                 Note: Number might be empty
2619
2620         Opcode 0x90 - Volume Changed notification
2621
2622                 Notification parameters: Type (1 octet)
2623                                          Volume (1 octet)
2624
2625                 Valid Type values: 0x00 = Speaker
2626                                    0x01 = Microphone
2627
2628         Opcode 0x91 - Command Complete Callback notification
2629
2630                 Notification parameters: Type (1 octet)
2631                                          CME (1 octet)
2632
2633                 Valid Type values: 0x00 = OK
2634                                    0x01 = Error
2635                                    0x02 = Error no carrier
2636                                    0x03 = Error busy
2637                                    0x04 = Error no answer
2638                                    0x05 = Error delayed
2639                                    0x06 = Error blacklisted
2640                                    0x07 = Error CME
2641
2642                 Note: CME parameter is valid only for Error CME type
2643
2644         Opcode 0x92 - Subscriber Service Info Callback notification
2645
2646                 Notification parameters: Name (string)
2647                                          Type (1 octet)
2648
2649                 Valid Type values: 0x00 = Service unknown
2650                                    0x01 = Service voice
2651                                    0x02 = Service fax
2652
2653         Opcode 0x93 - In Band Ring Settings Callback notification
2654
2655                 Notification parameters: State (1 octet)
2656
2657                 Valid State values: 0x00 = In band ringtone not provided
2658                                     0x01 = In band ringtone provided
2659
2660         Opcode 0x94 - Last Voice Call Tag Number Callback notification
2661
2662                 Notification parameters: Number (string)
2663
2664         Opcode 0x95 - Ring Indication notification
2665
2666                 Notification parameters: <none>
2667
2668
2669 Bluetooth Map Client HAL (ID 11)
2670 =========================
2671
2672 Android HAL name: "map_client" (BT_PROFILE_MAP_CLIENT_ID)
2673
2674 Commands and responses:
2675
2676         Opcode 0x00 - Error response
2677
2678         Opcode 0x01 - Get Remote MAS Instances
2679
2680                 Command parameters: Remote address (6 octets)
2681                 Response parameters: <none>
2682
2683                 In case of an error, the error response will be returned.
2684
2685 Notifications:
2686
2687         Opcode 0x81 - Remote MAS Instances notification
2688
2689                 Notification parameters: Status (1 octet)
2690                                          Remote address (6 octets)
2691                                          Number of instances (4 octets)
2692                                          Instance ID # (4 octets)
2693                                          Channel # (4 octets)
2694                                          Message types (4 octets)
2695                                          Name # (string)
2696
2697 Bluetooth Remote Control Controller HAL (ID 12)
2698 ===================================
2699
2700 Android HAL name: "avrcp-ctrl" (BT_PROFILE_AV_RC_CTRL_ID)
2701
2702 Commands and responses:
2703
2704         Opcode 0x00 - Error response
2705
2706         Opcode 0x01 - Send Pass Through command/response
2707
2708                 Command parameters: Remote Address (6 octets)
2709                                     Key Code (1 octet)
2710                                     Key State (1 octet)
2711
2712                 In case of an error, the error response will be returned.
2713
2714 Notifications:
2715
2716         Opcode 0x81 - Passthrough Response Notification
2717
2718                 Notification parameters: ID (1 octet)
2719                                          Key State (1 octet)
2720
2721         Opcode 0x82 - Connection State Notification
2722
2723                 Notification parameters: State (1 octet)
2724                                          Remote Address (6 octets)