Upgrade bluez5_37 :Merge the code from private
[platform/upstream/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         Opcode 0x91 - WBS Command notification
1072
1073                 Notification parameters: WBS types (1 octet)
1074                                          Remote address (6 octets)
1075
1076                 Valid WBS types: 0x00 = None
1077                                  0x01 = No
1078                                  0x02 = Yes
1079
1080 Bluetooth Advanced Audio HAL (ID 6)
1081 Bluetooth Advanced Audio Sink HAL (ID 13)
1082 =========================================
1083
1084 Android HAL name: "a2dp" (BT_PROFILE_ADVANCED_AUDIO_ID)
1085 Android HAL name: "a2dp_sink" (BT_PROFILE_ADVANCED_AUDIO__SINK_ID)
1086
1087 Commands and responses:
1088
1089         Opcode 0x00 - Error response
1090
1091         Opcode 0x01 - Connect command/response
1092
1093                 Command parameters: Remote address (6 octets)
1094                 Response parameters: <none>
1095
1096                 In case of an error, the error response will be returned.
1097
1098         Opcode 0x02 - Disconnect command/response
1099
1100                 Command parameters: Remote address (6 octets)
1101                 Response parameters: <none>
1102
1103                 In case of an error, the error response will be returned.
1104
1105 Notifications:
1106
1107         Opcode 0x81 - Connection State notification
1108
1109                 Notification parameters: Connection state (1 octet)
1110                                          Remote address (6 octets)
1111
1112                 Valid connection states: 0x00 = Disconnected
1113                                          0x01 = Connecting
1114                                          0x02 = Connected
1115                                          0x03 = Disconnecting
1116
1117         Opcode 0x82 - Audio State notification
1118
1119                 Notification parameters: Audio state (1 octet)
1120                                          Remote address (6 octets)
1121
1122                 Valid connection states: 0x00 = Remote suspend
1123                                          0x01 = Stopped
1124                                          0x02 = Started
1125
1126         Opcode 0x83 - Audio Configuration notification
1127
1128                 Notification parameters: Remote address (6 octets)
1129                                          Sample Rate in Hz (4 octets)
1130                                          Channel Count (1 octet)
1131
1132                 Valid channel count: 0x01 = Mono
1133                                      0x02 = Stereo
1134
1135 Bluetooth Health HAL (ID 7)
1136 ===========================
1137
1138 Android HAL name: "health" (BT_PROFILE_HEALTH_ID)
1139
1140 Commands and responses:
1141
1142         Opcode 0x00 - Error response
1143
1144         Opcode 0x01 - Register Application command/response
1145
1146                 Command parameters: Number of MDEP (1 octet)
1147                                     Application name offset (2 octets)
1148                                     Provider name offset (2 octets)
1149                                     Service name offset (2 octets)
1150                                     Service description offset (2 octets)
1151                                     Data length (2 octets)
1152                                     Data (data length)
1153                 Response parameters: Application ID (2 octets)
1154
1155                 Strings are null terminated.
1156                 In case of an error, the error response will be returned.
1157
1158         Opcode 0x02 - Register Application MDEP data command/response
1159
1160                 Command parameters: Application ID (2 octets)
1161                                     MDEP Role (1 octet)
1162                                     Data type (2 octets)
1163                                     Channel type (1 octet)
1164                                     MDEP description length (2 octets)
1165                                     MDEP description (MDEP desciption length)
1166                 Response parameters: <none>
1167
1168                 In case of an error, the error response will be returned.
1169
1170         Opcode 0x03 - Unregister Application command/response
1171
1172                 Command parameters: Application ID (2 octets)
1173                 Response parameters: <none>
1174
1175                 In case of an error, the error response will be returned.
1176
1177         Opcode 0x04 - Connect Channel command/response
1178
1179                 Command parameters: Application ID (2 octets)
1180                                     Remote address (6 octets)
1181                                     MDEP index (1 octet)
1182                 Response parameters: Channel ID (2 octets)
1183
1184                 In case of an error, the error response will be returned.
1185
1186         Opcode 0x05 - Destroy Channel command/response
1187
1188                 Command parameters: Channel ID (2 octets)
1189                 Response parameters: <none>
1190
1191                 In case of an error, the error response will be returned.
1192
1193 Notifications:
1194
1195         Opcode 0x81 - Application Registration State notification
1196
1197                 Notification parameters: Application ID (2 octets)
1198                                          Application state (1 octet)
1199
1200                 Valid application states: 0x00 = Registration success
1201                                           0x01 = Registration failed
1202                                           0x02 = Deregistration success
1203                                           0x03 = Deregistration failed
1204
1205         Opcode 0x82 - Channel State notification
1206
1207                 Notification parameters: Application ID (2 octets)
1208                                          Remote address (6 octets)
1209                                          MDEP index (1 octet)
1210                                          Channel ID (2 octets)
1211                                          Channel state (1 octet)
1212                                          File descriptor (inline)
1213
1214                 Valid channel states: 0x00 = Connecting
1215                                       0x01 = Connected
1216                                       0x02 = Disconnecting
1217                                       0x03 = Disconnected
1218                                       0x04 = Destroyed
1219
1220
1221 Bluetooth Remote Control Target HAL (ID 8)
1222 ===================================
1223
1224 Android HAL name: "avrcp" (BT_PROFILE_AV_RC_ID)
1225
1226 Commands and responses:
1227
1228         Opcode 0x00 - Error response
1229
1230         Opcode 0x01 - Get Play Status Response command/response
1231
1232                 Command parameters: Status (1 octet)
1233                                     Duration (4 octets)
1234                                     Position (4 octets)
1235
1236                 In case of an error, the error response will be returned.
1237
1238                 Valid status values: 0x00 = Stopped
1239                                      0x01 = Playing
1240                                      0x02 = Paused
1241                                      0x03 = Fwd seek
1242                                      0x04 = Rev seek
1243                                      0xff = Error
1244
1245         Opcode 0x02 - List Player Attributes Response command/response
1246
1247                 Command parameters: Number of attributes (1 octet)
1248                                     Attribute # (1 octet)
1249                                     ...
1250
1251                 In case of an error, the error response will be returned.
1252
1253                 Valid attributes: 0x01 = Equalizer
1254                                   0x02 = Repead
1255                                   0x03 = Shuffle
1256                                   0x04 = Scan
1257
1258         Opcode 0x03 - List Player Values Response command/response
1259
1260                 Command parameters: Number of values (1 octet)
1261                                     Value # (1 octet)
1262                                     ...
1263
1264                 In case of an error, the error response will be returned.
1265
1266         Opcode 0x04 - Get Player Values Response command/response
1267
1268                 Command parameters: Number of attributes (1 octet)
1269                                     Attribute # (1 octet)
1270                                     Value # (1 octet)
1271                                     ...
1272
1273                 In case of an error, the error response will be returned.
1274
1275                 Valid attributes: Same as in List Player Attributes
1276
1277         Opcode 0x05 - Get Player Attributes Text Response command/response
1278
1279                 Command parameters: Number of attributes (1 octet)
1280                                     Attribute # (1 octet)
1281                                     Attribute # text length (1 octet)
1282                                     Attribute # text (variable)
1283                                     ...
1284
1285                 In case of an error, the error response will be returned.
1286
1287                 Valid attributes: Same as in List Player Attributes
1288
1289         Opcode 0x06 - Get Player Values Text Response command/response
1290
1291                 Command parameters: Number of values (1 octet)
1292                                     Value # (1 octet)
1293                                     Value # text length (1 octet)
1294                                     Value # text (variable)
1295                                     ...
1296
1297                 In case of an error, the error response will be returned.
1298
1299         Opcode 0x07 - Get Element Attributes Text Response command/response
1300
1301                 Command parameters: Number of elements (1 octet)
1302                                     Element # (1 octet)
1303                                     Element # text length (1 octet)
1304                                     Element # text (variable)
1305                                     ...
1306
1307                 In case of an error, the error response will be returned.
1308
1309                 Valid elements: 0x01 = Title
1310                                 0x02 = Artist
1311                                 0x03 = Album
1312                                 0x04 = Track Number
1313                                 0x05 = Number of Tracks
1314                                 0x06 = Genre
1315                                 0x06 = Duration
1316
1317         Opcode 0x08 - Set Player Attributes Value Response command/response
1318
1319                 Command parameters: Status (1 octet)
1320
1321                 In case of an error, the error response will be returned.
1322
1323                 Valid status values: Same as in Get Play Status Response
1324
1325         Opcode 0x09 - Register Notification Response command/response
1326
1327                 Command parameters: Event (1 octet)
1328                                     Type (1 octet)
1329                                     Data length (1 octet)
1330                                     Data (variable)
1331
1332                 In case of an error, the error response will be returned.
1333
1334                 Valid event values: 0x01 = Status Changed
1335                                     0x02 = Track Changed
1336                                     0x03 = Track Reached End
1337                                     0x04 = Track Reached Start
1338                                     0x05 = Position Changed
1339                                     0x08 = Setting Changed
1340
1341                 Valid type values : 0x00 = Interim
1342                                     0x01 = Changed
1343
1344         Opcode 0x0a - Set Volume command/response
1345
1346                 Command parameters: Value (1 octet)
1347
1348                 In case of an error, the error response will be returned.
1349
1350 Notifications:
1351
1352         Opcode 0x81 - Remote Features notification
1353
1354                 Notification parameters: Remote address (6 octets)
1355                                          Features (1 octet)
1356
1357                 Valid features values : 0x00 = None
1358                                         0x01 = Metadata
1359                                         0x02 = Absolute Volume
1360                                         0x03 = Browse
1361
1362         Opcode 0x82 - Get Play Status notification
1363
1364                 Notification parameters: <none>
1365
1366         Opcode 0x83 - List Player Attributes notification
1367
1368                 Notification parameters: <none>
1369
1370         Opcode 0x84 - List Player Values notification
1371
1372                 Notification parameters: Attribute (1 octet)
1373
1374                 Valid attribute values: Same as in List Player Attributes
1375
1376         Opcode 0x85 - Get Player Values 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 0x86 - Get Player Attributes Text notification
1385
1386                 Notification parameters: Number of attributes (1 octet)
1387                                          Attribute # (1 octet)
1388                                          ...
1389
1390                 Valid attribute values: Same as in List Player Attributes
1391
1392         Opcode 0x87 - Get Player Values Text notification
1393
1394                 Notification parameters: Attribute (1 octet)
1395                                          Number of values (1 octet)
1396                                          Value # (1 octet)
1397                                          ...
1398
1399                 Valid attribute values: Same as in List Player Attributes
1400
1401         Opcode 0x88 - Set Player Values notification
1402
1403                 Notification parameters: Number of attributes (1 octet)
1404                                          Attribute # (1 octet)
1405                                          Value # (1 octet)
1406                                          ...
1407
1408                 Valid attribute values: Same as in List Player Attributes
1409
1410         Opcode 0x89 - Get Element Attributes notification
1411
1412                 Notification parameters: Number of attributes (1 octet)
1413                                          Attribute # (1 octet)
1414                                          ...
1415
1416                 Valid attribute values: Same as in Get Element Attribute
1417
1418         Opcode 0x8a - Register Notification notification
1419
1420                 Notification parameters: Event (1 octet)
1421                                          Parameter (4 octets)
1422
1423                 Valid event values: Same as in Register Notification
1424
1425         Opcode 0x8b - Volume Changed notification
1426
1427                 Notification parameters: Volume (1 octet)
1428                                          Type (1 octet)
1429
1430                 Valid type values: Same as in Register Notification
1431
1432         Opcode 0x8c - Passthrough Command notification
1433
1434                 Notification parameters: ID (1 octet)
1435                                          State (1 octet)
1436
1437 Bluetooth GATT HAL (ID 9)
1438 =========================
1439
1440 Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
1441
1442 Structures:
1443
1444         GATT Service ID: UUID (16 octets)
1445                          Instance ID (1 octet)
1446                          Is Primary (1 octet)
1447
1448         GATT Included Service ID: UUID (16 octets)
1449                                   Instance ID (1 octet)
1450                                   Is Primary (1 octet)
1451
1452         GATT Characteristic ID: UUID (16 octets)
1453                                 Instance ID (1 octet)
1454
1455         GATT Descriptor ID: UUID (16 octets)
1456                             Instance ID (1 octet)
1457
1458 Commands and responses:
1459
1460         Opcode 0x00 - Error response
1461
1462         Opcode 0x01 - Client Register command/response
1463
1464                 Command parameters: Service UUID (16 octets)
1465                 Response parameters: <none>
1466
1467                 In case of an error, the error response will be returned.
1468
1469         Opcode 0x02 - Client Unregister command/response
1470
1471                 Command parameters: Client Interface (4 octets)
1472                 Response parameters: <none>
1473
1474                 In case of an error, the error response will be returned.
1475
1476         Opcode 0x03 - Client Scan command/response
1477
1478                 Command parameters: Client Interface (4 octets)
1479                                     Start (1 octet)
1480                 Response parameters: <none>
1481
1482                 In case of an error, the error response will be returned.
1483
1484         Opcode 0x04 - Client Connect Device command/response
1485
1486                 Command parameters: Client Interface (4 octets)
1487                                     Remote address (6 octets)
1488                                     Is Direct (1 octet)
1489                                     Transport (4 octets)
1490                 Response parameters: <none>
1491
1492                 Valid transport value: 0x00 = Auto
1493                                        0x01 = BR/EDR
1494                                        0x02 = LE
1495
1496                 In case of an error, the error response will be returned.
1497
1498         Opcode 0x05 - Client Disconnect Device command/response
1499
1500                 Command parameters: Client Interface (4 octets)
1501                                     Remote address (6 octets)
1502                                     Connection ID (4 octets)
1503                 Response parameters: <none>
1504
1505                 In case of an error, the error response will be returned.
1506
1507         Opcode 0x06 - Client Listen command/response
1508
1509                 Command parameters: Client Interface (4 octets)
1510                                     Start (1 octet)
1511                 Response parameters: <none>
1512
1513                 In case of an error, the error response will be returned.
1514
1515         Opcode 0x07 - Client Refresh command/response
1516
1517                 Command parameters: Client Interface (4 octets)
1518                                     Remote address (6 octets)
1519                 Response parameters: <none>
1520
1521                 In case of an error, the error response will be returned.
1522
1523         Opcode 0x08 - Client Search Service command/response
1524
1525                 Command parameters: Connection ID (4 octets)
1526                                     Filtered (1 octet)
1527                                     Filter UUID (16 octets)
1528                 Response parameters: <none>
1529
1530                 Filter UUID shall only be present when Filtered is non-zero.
1531
1532                 In case of an error, the error response will be returned.
1533
1534         Opcode 0x09 - Client Get Included Service command/response
1535
1536                 Command parameters: Connection ID (4 octets)
1537                                     GATT Service ID (18 octets)
1538                                     Continuation (1 octet)
1539                                     GATT Included Service ID (18 octets)
1540                                     ...
1541                 Response parameters: <none>
1542
1543                 GATT Included Service ID shall only be present when Continuation
1544                 is non-zero.
1545
1546                 In case of an error, the error response will be returned.
1547
1548         Opcode 0x0a - Client Get Characteristic command/response
1549
1550                 Command parameters: Connection ID (4 octets)
1551                                     GATT Service ID (18 octets)
1552                                     Continuation (1 octet)
1553                                     GATT Characteristic ID (17 octets)
1554                                     ...
1555                 Response parameters: <none>
1556
1557                 GATT Characteristic ID shall only be present when Continuation
1558                 is non-zero.
1559
1560                 In case of an error, the error response will be returned.
1561
1562         Opcode 0x0b - Client Get Descriptor command/response
1563
1564                 Command parameters: Connection ID (4 octets)
1565                                     GATT Service ID (18 octets)
1566                                     GATT Characteristic ID (17 octets)
1567                                     Continuation (1 octet)
1568                                     GATT Descriptor ID (17 octets)
1569                                     ...
1570                 Response parameters: <none>
1571
1572                 GATT Descriptor ID shall only be present when Continuation is
1573                 non-zero.
1574
1575                 In case of an error, the error response will be returned.
1576
1577         Opcode 0x0c - Client Read Characteristic command/response
1578
1579                 Command parameters: Connection ID (4 octets)
1580                                     GATT Service ID (18 octets)
1581                                     GATT Characteristic ID (17 octets)
1582                                     Authorization (4 octets)
1583                 Response parameters: <none>
1584
1585                 In case of an error, the error response will be returned.
1586
1587         Opcode 0x0d - Client Write Characteristic command/response
1588
1589                 Command parameters: Connection ID (4 octets)
1590                                     GATT Service ID (18 octets)
1591                                     GATT Characteristic ID (17 octets)
1592                                     Write Type (4 octets)
1593                                     Length (4 octets)
1594                                     Authorization Req. (4 octets)
1595                                     Value (variable)
1596                 Response parameters: <none>
1597
1598                 Valid Write Type: 0x01 = No response
1599                                   0x02 = Default
1600                                   0x03 = Prepare
1601                                   0x04 = Signed
1602
1603                 In case of an error, the error response will be returned.
1604
1605         Opcode 0x0e - Client Read Descriptor command/response
1606
1607                 Command parameters: Connection ID (4 octets)
1608                                     GATT Service ID (18 octets)
1609                                     GATT Characteristic ID (17 octets)
1610                                     GATT Descriptor ID (17 octets)
1611                                     Authorization Req. (4 octets)
1612                 Response parameters: <none>
1613
1614                 In case of an error, the error response will be returned.
1615
1616         Opcode 0x0f - Client Write Descriptor command/response
1617
1618                 Command parameters: Connection ID (4 octets)
1619                                     GATT Service ID (18 octets)
1620                                     GATT Characteristic ID (17 octets)
1621                                     GATT Descriptor ID (17 octets)
1622                                     Write Type (4 octets)
1623                                     Length (4 octets)
1624                                     Authorization Req. (4 octets)
1625                                     Value (variable)
1626                 Response parameters: <none>
1627
1628                 Valid Write Type: 0x01 = No response
1629                                   0x02 = Default
1630                                   0x03 = Prepare
1631                                   0x04 = Signed
1632
1633                 In case of an error, the error response will be returned.
1634
1635         Opcode 0x10 - Client Execute Write command/response
1636
1637                 Command parameters: Connection ID (4 octets)
1638                                     Execute (4 octets)
1639                 Response parameters: <none>
1640
1641                 In case of an error, the error response will be returned.
1642
1643         Opcode 0x11 - Client Register For Notification command/response
1644
1645                 Command parameters: Client Interface (4 octets)
1646                                     Remote address (6 octets)
1647                                     GATT Service ID (18 octets)
1648                                     GATT Characteristic ID (17 octets)
1649                 Response parameters: <none>
1650
1651                 In case of an error, the error response will be returned.
1652
1653         Opcode 0x12 - Client Deregister For Notification command/response
1654
1655                 Command parameters: Client Interface (4 octets)
1656                                     Remote address (6 octets)
1657                                     GATT Service ID (18 octets)
1658                                     GATT Characteristic ID (17 octets)
1659                 Response parameters: <none>
1660
1661                 In case of an error, the error response will be returned.
1662
1663         Opcode 0x13 - Client Read Remote RSSI command/response
1664
1665                 Command parameters: Client Interface (4 octets)
1666                                     Remote address (6 octets)
1667                 Response parameters: <none>
1668
1669                 In case of an error, the error response will be returned.
1670
1671         Opcode 0x14 - Client Get Device Type command/response
1672
1673                 Command parameters: Remote address (6 octets)
1674                 Response parameters: Device Type
1675
1676                 Valid Device Type: 0x01 = BREDR
1677                                    0x02 = BLE
1678                                    0x03 = DUAL
1679
1680                 In case of an error, the error response will be returned.
1681
1682         Opcode 0x15 - Client Set Advertising data command/response
1683
1684                 Command parameters: Server Interface (4 octets)
1685                                     Set Scan Resp. (1 octet)
1686                                     Include Name (1 octet)
1687                                     Include TX Power (1 octet)
1688                                     Min. Interval (4 octets)
1689                                     Max. Interval (4 octets)
1690                                     Appearance (4 octets)
1691                                     Manufacturer Len. (2 octets)
1692                                     Manufacturer Data (variable)
1693                 Response parameters: <none>
1694
1695                 In case of an error, the error response will be returned.
1696
1697         Opcode 0x16 - Client Test Command command/response
1698
1699                 Command parameters: Command (4 octets)
1700                                     Address (6 octets)
1701                                     UUID (16 octets)
1702                                     U1 (2 octets)
1703                                     U2 (2 octets)
1704                                     U3 (2 octets)
1705                                     U4 (2 octets)
1706                                     U5 (2 octets)
1707                 Response parameters: <none>
1708
1709                 In case of an error, the error response will be returned.
1710
1711         Opcode 0x17 - Server Register command/response
1712
1713                 Command parameters: UUID (16 octets)
1714                 Response parameters: <none>
1715
1716                 In case of an error, the error response will be returned.
1717
1718         Opcode 0x18 - Server Unregister command/response
1719
1720                 Command parameters: Server (4 octets)
1721                 Response parameters: <none>
1722
1723                 In case of an error, the error response will be returned.
1724
1725         Opcode 0x19 - Server Connect Peripheral command/response
1726
1727                 Command parameters: Server (4 octets)
1728                                     Remote address (6 octets)
1729                                     Is Direct (1 octet)
1730                                     Transport (4 octets)
1731                 Response parameters: <none>
1732
1733                 In case of an error, the error response will be returned.
1734
1735         Opcode 0x1a - Server Disconnect Peripheral command/response
1736
1737                 Command parameters: Server (4 octets)
1738                                     Remote address (6 octets)
1739                                     Connection ID (1 octet)
1740                 Response parameters: <none>
1741
1742                 In case of an error, the error response will be returned.
1743
1744         Opcode 0x1b - Server Add Service command/response
1745
1746                 Command parameters: Server (4 octets)
1747                                     GATT Service ID (18 octets)
1748                                     Number of Handles (4 octet)
1749                 Response parameters: <none>
1750
1751                 Valid GATT Service ID: UUID (16 octets)
1752                                        Instance ID (1 octet)
1753                                        Is Primary (1 octet)
1754
1755                 In case of an error, the error response will be returned.
1756
1757         Opcode 0x1c - Server Add Included Service command/response
1758
1759                 Command parameters: Server (4 octets)
1760                                     Service handle (4 octets)
1761                                     Included handle (4 octets)
1762                 Response parameters: <none>
1763
1764                 In case of an error, the error response will be returned.
1765
1766         Opcode 0x1d - Server Add Characteristic command/response
1767
1768                 Command parameters: Server (4 octets)
1769                                     Service handle (4 octets)
1770                                     UUID (16 octets)
1771                                     Properties (4 octets)
1772                                     Permissions (4 octets)
1773                 Response parameters: <none>
1774
1775                 In case of an error, the error response will be returned.
1776
1777         Opcode 0x1e - Server Add Descriptor command/response
1778
1779                 Command parameters: Server (4 octets)
1780                                     Service handle (4 octets)
1781                                     UUID (16 octets)
1782                                     Permissions (4 octets)
1783                 Response parameters: <none>
1784
1785                 In case of an error, the error response will be returned.
1786
1787         Opcode 0x1f - Server Start Service command/response
1788
1789                 Command parameters: Server (4 octets)
1790                                     Service handle (4 octets)
1791                                     Transport (4 octets)
1792                 Response parameters: <none>
1793
1794                 In case of an error, the error response will be returned.
1795
1796         Opcode 0x20 - Server Stop 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 0x21 - Server Delete Service command/response
1805
1806                 Command parameters: Server (4 octets)
1807                                     Service handle (4 octets)
1808                 Response parameters: <none>
1809
1810                 In case of an error, the error response will be returned.
1811
1812         Opcode 0x22 - Server Send Indication command/response
1813
1814                 Command parameters: Server (4 octets)
1815                                     Attribute handle (4 octets)
1816                                     Connection ID (4 octets)
1817                                     Length (4 octets)
1818                                     Confirmation (4 octets)
1819                                     Value (variable)
1820                 Response parameters: <none>
1821
1822                 In case of an error, the error response will be returned.
1823
1824         Opcode 0x23 - Server Send Response command/response
1825
1826                 Command parameters: Connection ID (4 octets)
1827                                     Transaction ID (4 octets)
1828                                     Handle (2 octets)
1829                                     Offset (2 octets)
1830                                     Auth Request (1 octect)
1831                                     Status (4 octets)
1832                                     GATT Response (4 octets)
1833                 Response parameters: <none>
1834
1835                 Valid GATT Response: GATT Value (607 octets)
1836                                      Handle (2 octets)
1837
1838                 Valid GATT Value: Value (600 octets)
1839                                   Handle (2 octets)
1840                                   Offset (2 octets)
1841                                   Length (2 octets)
1842                                   Authentication Request (1 octet)
1843
1844                 In case of an error, the error response will be returned.
1845
1846         Opcode 0x24 - Client Scan Filter Params Setup command/response
1847
1848                 Command parameters: Client Interface (4 octets)
1849                                     Action (4 octets)
1850                                     Filter Index (4 octets)
1851                                     Features (4 octets)
1852                                     List Type (4 octets)
1853                                     Filter Type (4 octets)
1854                                     RSSI High Threshold (4 octets)
1855                                     RSSI Low Threshold (4 octets)
1856                                     Delivery Mode (4 octets)
1857                                     Found Timeout (4 octets)
1858                                     Lost Timeout (4 octets)
1859                                     Found Timeout Count (4 octets)
1860                 Response parameters: <none>
1861
1862                 In case of an error, the error response will be returned.
1863
1864         Opcode 0x25 - Client Scan Filter Add Remove command/response
1865
1866                 Command parameters: Client Interface (4 octets)
1867                                     Action (4 octets)
1868                                     Filter Type (4 octets)
1869                                     Filter Index (4 octets)
1870                                     Company ID (4 octets)
1871                                     Company ID Mask (4 octets)
1872                                     UUID (16 octets)
1873                                     UUID Mask (16 octets)
1874                                     Address (6 octets)
1875                                     Address Type (1 octet)
1876                                     Data Length (4 octets)
1877                                     Data (variable)
1878                                     Mask Length (4 octets)
1879                                     Mask (variable)
1880                 Response parameters: <none>
1881
1882                 In case of an error, the error response will be returned.
1883
1884         Opcode 0x26 - Client Scan Filter Clear command/response
1885
1886                 Command parameters: Client Interface (4 octets)
1887                                     Filter Index (4 octets)
1888                 Response parameters: <none>
1889
1890                 In case of an error, the error response will be returned.
1891
1892         Opcode 0x27 - Client Scan Filter Enable command/response
1893
1894                 Command parameters: Client Interface (4 octets)
1895                                     Enable (1 octet)
1896                 Response parameters: <none>
1897
1898                 In case of an error, the error response will be returned.
1899
1900         Opcode 0x28 - Client Configure MTU command/response
1901
1902                 Command parameters: Connection ID (4 octets)
1903                                     MTU (4 octets)
1904                 Response parameters: <none>
1905
1906                 In case of an error, the error response will be returned.
1907
1908         Opcode 0x29 - Client Connection Parameter Update command/response
1909
1910                 Command parameters: Address (6 octets)
1911                                     Min Interval (4 octets)
1912                                     Max Interval (4 octets)
1913                                     Latency (4 octets)
1914                                     Timeoutl (4 octets)
1915                 Response parameters: <none>
1916
1917                 In case of an error, the error response will be returned.
1918
1919         Opcode 0x2a - Client Set Scan Parameters command/response
1920
1921                 Command parameters: Scan Interval (4 octets)
1922                                     Scan Window (4 octets)
1923                 Response parameters: <none>
1924
1925                 In case of an error, the error response will be returned.
1926
1927         Opcode 0x2b - Client Setup Multi Advertising command/response
1928
1929                 Command parameters: Client ID (4 octets)
1930                                     Min Interval (4 octets)
1931                                     Max Interval (4 octets)
1932                                     ADV Type (4 octets)
1933                                     Channel Map (4 octets)
1934                                     TX Power (4 octets)
1935                                     Timeout (4 octets)
1936                 Response parameters: <none>
1937
1938                 In case of an error, the error response will be returned.
1939
1940         Opcode 0x2c - Client Update Multi Advertising command/response
1941
1942                 Command parameters: Client ID (4 octets)
1943                                     Min Interval (4 octets)
1944                                     Max Interval (4 octets)
1945                                     ADV Type (4 octets)
1946                                     Channel Map (4 octets)
1947                                     TX Power (4 octets)
1948                                     Timeout (4 octets)
1949                 Response parameters: <none>
1950
1951                 In case of an error, the error response will be returned.
1952
1953         Opcode 0x2d - Client Setup Multi Advertising Instance command/response
1954
1955                 Command parameters: Client ID (4 octets)
1956                                     Set Scan Response (1 octet)
1957                                     Include Name (1 octet)
1958                                     Include TX Power (1 octet)
1959                                     Appearance (4 octets)
1960                                     Manufacturer Data Length (4 octets)
1961                                     Manufacturer Data (variable)
1962                                     Service Data Length (4 octets)
1963                                     Service Data (variable)
1964                                     Service UUID Length (4 octets)
1965                                     Service UUID (variable)
1966                 Response parameters: <none>
1967
1968                 In case of an error, the error response will be returned.
1969
1970         Opcode 0x2e - Client Disable Multi Advertising Instance command/response
1971
1972                 Command parameters: Client ID (4 octets)
1973                 Response parameters: <none>
1974
1975                 In case of an error, the error response will be returned.
1976
1977         Opcode 0x2f - Client Configure Batchscan command/response
1978
1979                 Command parameters: Client ID (4 octets)
1980                                     Full Max (4 octets)
1981                                     Trunc Max (4 octets)
1982                                     Notify Threshold (4 octets)
1983                 Response parameters: <none>
1984
1985                 In case of an error, the error response will be returned.
1986
1987         Opcode 0x30 - Client Enable Batchscan command/response
1988
1989                 Command parameters: Client ID (4 octets)
1990                                     Scan Mode (4 octets)
1991                                     Scan Interval (4 octets)
1992                                     Scan Window (4 octets)
1993                                     Address Type (4 octets)
1994                                     Discard Rule (4 octets)
1995                 Response parameters: <none>
1996
1997                 In case of an error, the error response will be returned.
1998
1999         Opcode 0x31 - Client Disable Batchscan command/response
2000
2001                 Command parameters: Client ID (4 octets)
2002                 Response parameters: <none>
2003
2004                 In case of an error, the error response will be returned.
2005
2006         Opcode 0x32 - Client Read Batchscan Resports command/response
2007
2008                 Command parameters: Client ID (4 octets)
2009                                     Scan Mode (4 octets)
2010                 Response parameters: <none>
2011
2012                 In case of an error, the error response will be returned.
2013
2014 Notifications:
2015
2016         Opcode 0x81 - Client Register notification
2017
2018                 Notification parameters: Status (4 octets)
2019                                          Client Interface (4 octets)
2020                                          UUID (16 octets)
2021
2022         Opcode 0x82 - Client Scan Result notification
2023
2024                 Notification parameters: Address (6 octets)
2025                                          RSSI (4 octets)
2026                                          Length (2 octets)
2027                                          Data (variable)
2028
2029         Opcode 0x83 - Client Connect Device notification
2030
2031                 Notification parameters: Connection ID (4 octets)
2032                                          Status (4 octets)
2033                                          Client Interface (4 octets)
2034                                          Address (6 octets)
2035
2036         Opcode 0x84 - Client Disconnect Device notification
2037
2038                 Notification parameters: Connection ID (4 octets)
2039                                          Status (4 octets)
2040                                          Client Interface (4 octets)
2041                                          Address (6 octets)
2042
2043         Opcode 0x85 - Client Search Complete notification
2044
2045                 Notification parameters: Connection ID (4 octets)
2046                                          Status (4 octets)
2047
2048         Opcode 0x86 - Client Search Result notification
2049
2050                 Notification parameters: Connection ID (4 octets)
2051                                          GATT Service ID (18 octets)
2052
2053         Opcode 0x87 - Client Get Characteristic 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                                          Char Prop. (4 octets)
2060
2061         Opcode 0x88 - Client Get Descriptor notification
2062
2063                 Notification parameters: Connection ID (4 octets)
2064                                          Status (4 octets)
2065                                          GATT Service ID (18 octets)
2066                                          GATT Characteristic ID (17 octets)
2067                                          GATT Descriptor ID (17 octets)
2068
2069         Opcode 0x89 - Client Get Included Service notification
2070
2071                 Notification parameters: Connection ID (4 octets)
2072                                          Status (4 octets)
2073                                          GATT Service ID (18 octets)
2074                                          GATT Included Service ID (18 octets)
2075
2076         Opcode 0x8a - Client Register For Notification notification
2077
2078                 Notification parameters: Connection ID (4 octets)
2079                                          Registered (4 octets)
2080                                          Status (4 octets)
2081                                          GATT Service ID (18 octets)
2082                                          GATT Characteristic ID (17 octets)
2083
2084         Opcode 0x8b - Client Notify notification
2085
2086                 Notification parameters: Connection ID (4 octets)
2087                                          Address (6 octets)
2088                                          GATT Service ID (18 octets)
2089                                          GATT Characteristic ID (17 octets)
2090                                          Is Notify (1 octet)
2091                                          Length (2 octets)
2092                                          Value (variable)
2093
2094         Opcode 0x8c - Client Read Characteristic notification
2095
2096                 Notification parameters: Connection ID (4 octets)
2097                                          Status (4 octets)
2098                                          GATT Read Parameters (variable)
2099
2100                 Valid GATT Read Parameters: GATT Service ID (18 octets)
2101                                             GATT Characteristic ID (17 octets)
2102                                             GATT Descriptor ID (17 octets)
2103                                             Value Type (4 octets)
2104                                             Status (1 octet)
2105                                             Length (2 octets)
2106                                             Value (variable)
2107
2108         Opcode 0x8d - Client Write Characteristic notification
2109
2110                 Notification parameters: Connection ID (4 octets)
2111                                          Status (4 octets)
2112                                          GATT Write Parameters (53 octets)
2113
2114                 Valid GATT Write Parameters: GATT Service ID (18 octets)
2115                                              GATT Characteristic ID (17 octets)
2116                                              GATT Description ID (17 octets)
2117                                              Status (1 octet)
2118
2119         Opcode 0x8e - Client Read Descriptor notification
2120
2121                 Notification parameters: Connection ID (4 octets)
2122                                          Status (4 octets)
2123                                          GATT Read Parameters (variable)
2124
2125                 Valid GATT Read Parameters: As described in Read Characteristic
2126
2127         Opcode 0x8f - Client Write Descriptor notification
2128
2129                 Notification parameters: Connection ID (4 octets)
2130                                          Status (4 octets)
2131                                          GATT Write Parameters (53 octets)
2132
2133                 Valid GATT Write Parameters: As described in Write Characteristic
2134
2135         Opcode 0x90 - Client Execute Write notification
2136
2137                 Notification parameters: Connection ID (4 octets)
2138                                          Status (4 octets)
2139
2140         Opcode 0x91 - Client Read Remote RSSI notification
2141
2142                 Notification parameters: Client (4 octets)
2143                                          Address (6 octets)
2144                                          RSSI (4 octets)
2145                                          Status (4 octets)
2146
2147         Opcode 0x92 - Client Listen notification
2148
2149                 Notification parameters: Status (4 octets)
2150                                          Server Interface (4 octets)
2151
2152         Opcode 0x93 - Server Register notification
2153
2154                 Notification parameters: Status (4 octets)
2155                                          Server (4 octets)
2156                                          UUID (16 octets)
2157
2158         Opcode 0x94 - Server Connection notification
2159
2160                 Notification parameters: Connection ID (4 octets)
2161                                          Server (4 octets)
2162                                          Connected (4 octets)
2163                                          Address (6 octets)
2164
2165         Opcode 0x95 - Server Service Added notification
2166
2167                 Notification parameters: Status (4 octets)
2168                                          Server (4 octets)
2169                                          GATT Service ID (18 octets)
2170                                          Service Handle (4 octets)
2171
2172         Opcode 0x96 - Server Included Service Added notification
2173
2174                 Notification patemeters: Status (4 octets)
2175                                          Server (4 octets)
2176                                          Service Handle (4 octets)
2177                                          Included Service Handle (4 octets)
2178
2179         Opcode 0x97 - Server Characteristic Added notification
2180
2181                 Notification parameters: Status (4 octets)
2182                                          Server (4 octets)
2183                                          UUID (16 octets)
2184                                          Service Handle (4 octets)
2185                                          Characteristic Handle (4 octets)
2186
2187         Opcode 0x98 - Server Descriptor Added notification
2188
2189                 Notification parameters: Status (4 octets)
2190                                          Server (4 octets)
2191                                          UUID (6 octets)
2192                                          Service Handle (4 octets)
2193                                          Descriptor Handle (4 octets)
2194
2195         Opcode 0x99 - Server Service Started notification
2196
2197                 Notification parameters: Status (4 octets)
2198                                          Server (4 octets)
2199                                          Service Handle (4 octets)
2200
2201         Opcode 0x9a - Server Service Stopped notification
2202
2203                 Notification parameters: Status (4 octets)
2204                                          Server (4 octets)
2205                                          Service Handle (4 octets)
2206
2207         Opcode 0x9b - Server Service Deleted notification
2208
2209                 Notification parameters: Status (4 octets)
2210                                          Server (4 octets)
2211                                          Service Handle (4 octets)
2212
2213         Opcode 0x9c - Server Request Read notification
2214
2215                 Notification parameters: Connection ID (4 octets)
2216                                          Trans ID (4 octets)
2217                                          Address (6 octets)
2218                                          Attribute Handle (4 octets)
2219                                          Offset (4 octets)
2220                                          Is Long (1 octet)
2221
2222         Opcode 0x9d - Server Request Write notification
2223
2224                 Notification parameters: Connection ID (4 octets)
2225                                          Trans ID (4 octets)
2226                                          Address (6 octets)
2227                                          Attribute Handle (4 octets)
2228                                          Offset (4 octets)
2229                                          Length (4 octets)
2230                                          Need Response (4 octets)
2231                                          Is Prepare (1 octet)
2232                                          Value (variable)
2233
2234         Opcode 0x9e - Server Request Execute Write notification
2235
2236                 Notification parameters: Connection ID (4 octets)
2237                                          Trans ID (4 octets)
2238                                          Address (6 octets)
2239                                          Execute Write (4 octets)
2240
2241         Opcode 0x9f - Server Response Confirmation notification
2242
2243                 Notification parameters: Status (4 octets)
2244                                          Handle (4 octets)
2245
2246         Opcode 0xa0 - Client Configure MTU notification
2247
2248                 Notification parameters: Connection ID (4 octets)
2249                                          Status (4 octets)
2250                                          MTU (4 octets)
2251
2252         Opcode 0xa1 - Client Filter Configuration notification
2253
2254                 Notification parameters: Action (4 octets)
2255                                          Client ID (4 octets)
2256                                          Status (4 octets)
2257                                          Filter Type (4 octets)
2258                                          Available Space (4 octets)
2259
2260         Opcode 0xa2 - Client Filter Parameters notification
2261
2262                 Notification parameters: Action (4 octets)
2263                                          Client ID (4 octets)
2264                                          Status (4 octets)
2265                                          Available Space (4 octets)
2266
2267         Opcode 0xa3 - Client Filter Status notification
2268
2269                 Notification parameters: Enable (4 octets)
2270                                          Client ID (4 octets)
2271                                          Status (4 octets)
2272
2273         Opcode 0xa4 - Client Multi Advertising Enable notification
2274
2275                 Notification parameters: Client ID (4 octets)
2276                                          Status (4 octets)
2277
2278         Opcode 0xa5 - Client Multi Advertising Update notification
2279
2280                 Notification parameters: Client ID (4 octets)
2281                                          Status (4 octets)
2282
2283         Opcode 0xa6 - Client Multi Advertising Data notification
2284
2285                 Notification parameters: Client ID (4 octets)
2286                                          Status (4 octets)
2287
2288         Opcode 0xa7 - Client Multi Advertising Disable notification
2289
2290                 Notification parameters: Client ID (4 octets)
2291                                          Status (4 octets)
2292
2293         Opcode 0xa8 - Client Congestion notification
2294
2295                 Notification parameters: Connection ID (4 octets)
2296                                          Congested (1 octet)
2297
2298         Opcode 0xa9 - Client Configure Batchscan notification
2299
2300                 Notification parameters: Client ID (4 octets)
2301                                          Status (4 octets)
2302
2303         Opcode 0xaa - Client Enable Batchscan notification
2304
2305                 Notification parameters: Action (4 octets)
2306                                          Client ID (4 octets)
2307                                          Status (4 octets)
2308
2309         Opcode 0xab - Client Batchscan Reports notification
2310
2311                 Notification parameters: Client ID (4 octets)
2312                                          Status (4 octets)
2313                                          Report Format (4 octets)
2314                                          Num Reports (4 octets)
2315                                          Data Length (4 octets)
2316                                          Data (variable)
2317
2318         Opcode 0xac - Client Batchscan Threshold notification
2319
2320                 Notification parameters: Client ID (4 octets)
2321
2322         Opcode 0xad - Client Track ADV notification
2323
2324                 Notification parameters: Client ID (4 octets)
2325                                          Filter Index (4 octets)
2326                                          Address Type (4 octets)
2327                                          Address (6 octets)
2328                                          State (4 octets)
2329
2330         Opcode 0xae - Server Indication Sent notification
2331
2332                 Notification parameters: Connection ID (4 octets)
2333                                          Status (4 octets)
2334
2335         Opcode 0xaf - Server Congestion notification
2336
2337                 Notification parameters: Connection ID (4 octets)
2338                                          Congested (1 octet)
2339
2340         Opcode 0xb0 - Server MTU Changed notification
2341
2342                 Notification parameters: Connection ID (4 octets)
2343                                          MTU (4 octets)
2344
2345
2346 Bluetooth Handsfree Client HAL (ID 10)
2347 ======================================
2348
2349 Android HAL name: "hf_client" (BT_PROFILE_HANDSFREE_CLIENT_ID)
2350
2351 Commands and response:
2352
2353         Opcode 0x00 - Error response
2354
2355         Opcode 0x01 - Connect command/respose
2356
2357                 Command parameters: Remote address (6 octects)
2358                 Response parameters: <none>
2359
2360                  In case of an error, the error response will be returned.
2361
2362         Opcode 0x02 - Disonnect command/response
2363
2364                 Command parameters: Remote address (6 octetcs)
2365                 Response parameters: <none>
2366
2367                  In case of an error, the error response will be returned.
2368
2369         Opcode 0x03 - Connect Audio command/response
2370
2371                 Command parameters: Remote address (6 octets)
2372                 Response parameters: <none>
2373
2374                 In case of an error, the error response will be returned.
2375
2376         Opcode 0x04 - Disconnect Audio command/response
2377
2378                 Command parameters: Remote address (6 octets)
2379                 Response parameters: <none>
2380
2381                 In case of an error, the error response will be returned.
2382
2383         Opcode 0x05 - Start Voice Recognition command/response
2384
2385                 Command parameters: <none>
2386                 Response parameters: <none>
2387
2388                 In case of an error, the error response will be returned.
2389
2390         Opcode 0x06 - Stop Voice Recognition command/response
2391
2392                 Command parameters: <none>
2393                 Response parameters: <none>
2394
2395                 In case of an error, the error response will be returned.
2396
2397         Opcode 0x07 - Volume Control command/response
2398
2399                 Command parameters: Volume type (1 octet)
2400                                     Volume (1 octet)
2401                 Response parameters: <none>
2402
2403                 Valid volume types: 0x00 = Speaker
2404                                     0x01 = Microphone
2405
2406                 In case of an error, the error response will be returned.
2407
2408         Opcode 0x08 - Dial command/response
2409
2410                 Command parameters: Number (string)
2411                 Response parameters: <none>
2412
2413                 In case of an error, the error response will be returned.
2414
2415         Opcode 0x09 - Dial Memory command/response
2416
2417                 Command parameters: Location (4 octet)
2418                 Response parameters: <none>
2419
2420                 In case of an error, the error response will be returned.
2421
2422         Opcode 0x10 - Handle Call Action command/response
2423
2424                 Command parameters: Action (1 octet)
2425                                     Call Index (1 octet)
2426                 Response parameters: <none>
2427
2428                 Valid actions: 0x00 = CHLD_0
2429                                0x01 = CHLD_1
2430                                0x02 = CHLD_2
2431                                0x03 = CHLD_3
2432                                0x04 = CHLD_4
2433                                0x05 = CHLD_1x
2434                                0x06 = CHLD_2x
2435                                0x07 = ATA
2436                                0x08 = CHUP
2437                                0x09 = BTRH_0
2438                                0x10 = BTRH_1
2439                                0x11 = BTRH_2
2440
2441                 In case of an error, the error response will be returned.
2442
2443         Opcode 0x11 - Query Current Calls commad/response
2444
2445                 Command parameters: <none>
2446                 Response parameters: <none>
2447
2448                 In case of an error, the error response will be returned.
2449
2450         Opcode 0x12 - Query Current Operator Name
2451
2452                 Command parameters: <none>
2453                 Response parameters: <none>
2454
2455                 In case of an error, the error response will be returned.
2456
2457         Opcode 0x13 - Retrieve Subscriber Info command/response
2458
2459                 Command parameters: <none>
2460                 Response parameters: <none>
2461
2462                 In case of an error, the error response will be returned.
2463
2464         Opcode 0x14 - Send DTMF Tone command/response
2465
2466                 Command parameters: Tone (1 octet)
2467                 Response parameters: <none>
2468
2469                 In case of an error, the error response will be returned.
2470
2471         Opcode 0x15 - Request Last Voice Tag Number command/response
2472
2473                 Command parameters: <none>
2474                 Response parameters: <none>
2475
2476                 In case of an error, the error response will be returned.
2477
2478 Notifications:
2479
2480         Opcode 0x81 - Connection State Changed notification
2481
2482                 Notification parameters: State (1 octet)
2483                                          Peer Features (4 octets)
2484                                          CHLD Features (4 octets)
2485                                          Address (6 octets)
2486
2487                 Valid State values: 0x00 = Disconnected
2488                                     0x01 = Connecting
2489                                     0x02 = Connected
2490                                     0x03 = SLC Connected
2491                                     0x04 = Disconnecting
2492
2493                 Peer Features is a bitmask of the supported features. Currently
2494                 available bits:
2495
2496                         0       Three way calling
2497                         1       Echo cancellation and/or noise reduction
2498                         2       Voice recognition
2499                         3       In band ring tone
2500                         4       Attach a number to a voice tag
2501                         5       Ability to reject a call
2502                         6       Enhanced call status
2503                         7       Enhanced call control
2504                         8       Extended Error Result Codes
2505                         9       Codec negotiations
2506                         10-31   Reserved for future use
2507
2508                 CHLD Features is a bitmask of the supported features. Currently
2509                 available bits:
2510
2511                         0       Release waiting call or held calls
2512                         1       Release active calls and accept other call
2513                         2       Release specified active call only
2514                         3       Place all active calls on hold and accept other call
2515                         4       Request private mode with secified call
2516                         5       Add a held call to the multiparty
2517                         6       Connect two calls and leave multiparty
2518                         7-31    Reserved for future use
2519
2520                 Note: Peer and CHLD Features are valid only in SCL Connected state
2521
2522
2523         Opcode 0x82 - Audio State Changed notification
2524
2525                 Notification parameters: State (1 octet)
2526                                          Address (6 octets)
2527
2528                 Valid State values: 0x00 = Disconnected
2529                                     0x01 = Connecting
2530                                     0x02 = Connected
2531                                     0x03 = Connected mSBC
2532
2533         Opcode 0x83 - Voice Recognition State Changed notification
2534
2535                 Notification parameters: State (1 octet)
2536
2537                 Valid State values: 0x00 = VR Stopped
2538                                     0x01 = VR Started
2539
2540         Opcode 0x84 - Network State Changed notification
2541
2542                 Notification parameters: State (1 octet)
2543
2544                 Valid State values: 0x00 = Network Not Available
2545                                     0x01 = Network Available
2546
2547         Opcode 0x85 - Network Roaming Type Changed notification
2548
2549                 Notification parameters: Type (1 octet)
2550
2551                 Valid Type values: 0x00 = Home
2552                                    0x01 = Roaming
2553
2554         Opcode 0x86 - Network Signal Strength notification
2555
2556                 Notification parameters: Signal Strength (1 octet)
2557
2558         Opcode 0x87 - Battery Level notification
2559
2560                 Notification parameters: Battery Level (1 octet)
2561
2562         Opcode 0x88 - Current Operator Name notification
2563
2564                 Notification parameters: Name (string)
2565
2566         Opcode 0x89 - Call Indicatior notification
2567
2568                 Notification parameters: Call (1 octet)
2569
2570                 Valid Call values: 0x00 = No Call In Progress
2571                                    0x01 = Call In Progress
2572
2573         Opcode 0x8a - Call Setup Indicator notification
2574
2575                 Notification parameters: Call Setup (1 octet)
2576
2577                 Valid Call Setup values: 0x00 = None
2578                                          0x01 = Incoming
2579                                          0x02 = Outgoing
2580                                          0x03 = Alerting
2581
2582         Opcode 0x8b - Call Held Indicator notification
2583
2584                 Notification parameters: Call Held (1 octet)
2585
2586                 Valid Call Held values: 0x00 = None
2587                                         0x01 = Hold and Active
2588                                         0x02 = Hold
2589
2590         Opcode 0x8c - Resposne and Hold Status notification
2591
2592                 Notification parameters: Status (1 octet)
2593
2594                 Valid Status values: 0x00 = Held
2595                                      0x01 = Accept
2596                                      0x02 = Reject
2597
2598         Opcode 0x8d - Calling Line Identification notification
2599
2600                 Notification parameters: Number (string)
2601
2602                 Note: This will be called only on incoming call if number is
2603                 provided.
2604
2605         Opcode 0x8e - Call Waiting notification
2606
2607                 Notification parameters: Nunmber (string)
2608
2609         Opcode 0x8f - Current Calls List notification
2610
2611                 Notification parameters: Index (1 octet)
2612                                          Direction (1 octet)
2613                                          Call State (1 octet)
2614                                          Multiparty (1 octet)
2615                                          Number (string)
2616
2617                 Valid Direction values: 0x00 = Outgoing
2618                                         0x01 = Incoming
2619
2620                 Valid Call Sate values: 0x00 = Active
2621                                         0x01 = Held
2622                                         0x02 = Dialing
2623                                         0x03 = Alerting
2624                                         0x04 = Incoming
2625                                         0x05 = Waiting
2626                                         0x06 = Call held by Response and Hold
2627
2628                 Valid Multiparty values: 0x00 = Single Call
2629                                          0x01 = Multiparty (conference) Call
2630
2631                 Note: Number might be empty
2632
2633         Opcode 0x90 - Volume Changed notification
2634
2635                 Notification parameters: Type (1 octet)
2636                                          Volume (1 octet)
2637
2638                 Valid Type values: 0x00 = Speaker
2639                                    0x01 = Microphone
2640
2641         Opcode 0x91 - Command Complete Callback notification
2642
2643                 Notification parameters: Type (1 octet)
2644                                          CME (1 octet)
2645
2646                 Valid Type values: 0x00 = OK
2647                                    0x01 = Error
2648                                    0x02 = Error no carrier
2649                                    0x03 = Error busy
2650                                    0x04 = Error no answer
2651                                    0x05 = Error delayed
2652                                    0x06 = Error blacklisted
2653                                    0x07 = Error CME
2654
2655                 Note: CME parameter is valid only for Error CME type
2656
2657         Opcode 0x92 - Subscriber Service Info Callback notification
2658
2659                 Notification parameters: Name (string)
2660                                          Type (1 octet)
2661
2662                 Valid Type values: 0x00 = Service unknown
2663                                    0x01 = Service voice
2664                                    0x02 = Service fax
2665
2666         Opcode 0x93 - In Band Ring Settings Callback notification
2667
2668                 Notification parameters: State (1 octet)
2669
2670                 Valid State values: 0x00 = In band ringtone not provided
2671                                     0x01 = In band ringtone provided
2672
2673         Opcode 0x94 - Last Voice Call Tag Number Callback notification
2674
2675                 Notification parameters: Number (string)
2676
2677         Opcode 0x95 - Ring Indication notification
2678
2679                 Notification parameters: <none>
2680
2681
2682 Bluetooth Map Client HAL (ID 11)
2683 =========================
2684
2685 Android HAL name: "map_client" (BT_PROFILE_MAP_CLIENT_ID)
2686
2687 Commands and responses:
2688
2689         Opcode 0x00 - Error response
2690
2691         Opcode 0x01 - Get Remote MAS Instances
2692
2693                 Command parameters: Remote address (6 octets)
2694                 Response parameters: <none>
2695
2696                 In case of an error, the error response will be returned.
2697
2698 Notifications:
2699
2700         Opcode 0x81 - Remote MAS Instances notification
2701
2702                 Notification parameters: Status (1 octet)
2703                                          Remote address (6 octets)
2704                                          Number of instances (4 octets)
2705                                          Instance ID # (4 octets)
2706                                          Channel # (4 octets)
2707                                          Message types (4 octets)
2708                                          Name # (string)
2709
2710 Bluetooth Remote Control Controller HAL (ID 12)
2711 ===================================
2712
2713 Android HAL name: "avrcp-ctrl" (BT_PROFILE_AV_RC_CTRL_ID)
2714
2715 Commands and responses:
2716
2717         Opcode 0x00 - Error response
2718
2719         Opcode 0x01 - Send Pass Through command/response
2720
2721                 Command parameters: Remote Address (6 octets)
2722                                     Key Code (1 octet)
2723                                     Key State (1 octet)
2724
2725                 In case of an error, the error response will be returned.
2726
2727 Notifications:
2728
2729         Opcode 0x81 - Passthrough Response Notification
2730
2731                 Notification parameters: ID (1 octet)
2732                                          Key State (1 octet)
2733
2734         Opcode 0x82 - Connection State Notification
2735
2736                 Notification parameters: State (1 octet)
2737                                          Remote Address (6 octets)