blob: db12986b50d17eb35b158c3868766e989cf9ea01 [file] [log] [blame]
Myles Watson10d29e42022-08-03 16:59:48 -07001/*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.bluetooth;
18
19import android.hardware.bluetooth.IBluetoothHciCallbacks;
20
21/**
22 * The Host Controller Interface (HCI) is the layer defined by the Bluetooth
23 * specification between the software that runs on the host and the Bluetooth
24 * controller chip. This boundary is the natural choice for a Hardware
25 * Abstraction Layer (HAL). Dealing only in HCI packets and events simplifies
26 * the stack and abstracts away power management, initialization, and other
27 * implementation-specific details related to the hardware.
28 */
29@VintfStability
30interface IBluetoothHci {
31 /**
32 * Close the HCI interface
33 */
34 void close();
35
36 /**
37 * Initialize the Bluetooth interface and set the callbacks.
38 */
39 void initialize(in IBluetoothHciCallbacks callback);
40
41 /**
42 * Send an HCI ACL data packet (as specified in the Bluetooth Specification
43 * V4.2, Vol 2, Part 5, Section 5.4.2) to the Bluetooth controller.
44 * Packets must be processed in order.
45 * @param data HCI data packet to be sent
46 */
47 void sendAclData(in byte[] data);
48
49 /**
50 * Send an HCI command (as specified in the Bluetooth Specification
51 * V4.2, Vol 2, Part 5, Section 5.4.1) to the Bluetooth controller.
52 * Commands must be executed in order.
53 *
54 * @param command is the HCI command to be sent
55 */
56 void sendHciCommand(in byte[] command);
57
58 /**
59 * Send an ISO data packet (as specified in the Bluetooth Core
60 * Specification v5.2) to the Bluetooth controller.
61 * Packets must be processed in order.
62 * @param data HCI data packet to be sent
63 */
64 void sendIsoData(in byte[] data);
65
66 /**
67 * Send an SCO data packet (as specified in the Bluetooth Specification
68 * V4.2, Vol 2, Part 5, Section 5.4.3) to the Bluetooth controller.
69 * Packets must be processed in order.
70 * @param data HCI data packet to be sent
71 */
72 void sendScoData(in byte[] data);
73}