mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
Bluetooth HIDL -> AIDL conversion am: 10d29e4934 am: 392b64f13e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2239899 Change-Id: I1e2f0d10b5c5b2f288d8edcbc456ee42d4eab857 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
27
bluetooth/aidl/Android.bp
Normal file
27
bluetooth/aidl/Android.bp
Normal file
@@ -0,0 +1,27 @@
|
||||
// This is the expected build file, but it may not be right in all cases
|
||||
|
||||
aidl_interface {
|
||||
name: "android.hardware.bluetooth",
|
||||
vendor_available: true,
|
||||
srcs: ["android/hardware/bluetooth/*.aidl"],
|
||||
stability: "vintf",
|
||||
backend: {
|
||||
cpp: {
|
||||
// FIXME should this be disabled?
|
||||
// prefer NDK backend which can be used anywhere
|
||||
// If you disable this, you also need to delete the C++
|
||||
// translate code.
|
||||
enabled: true,
|
||||
},
|
||||
java: {
|
||||
sdk_version: "module_current",
|
||||
},
|
||||
ndk: {
|
||||
apex_available: [
|
||||
"//apex_available:platform",
|
||||
"com.android.btservices",
|
||||
],
|
||||
min_sdk_version: "33",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
@VintfStability
|
||||
interface IBluetoothHci {
|
||||
void close();
|
||||
void initialize(in android.hardware.bluetooth.IBluetoothHciCallbacks callback);
|
||||
void sendAclData(in byte[] data);
|
||||
void sendHciCommand(in byte[] command);
|
||||
void sendIsoData(in byte[] data);
|
||||
void sendScoData(in byte[] data);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
@VintfStability
|
||||
interface IBluetoothHciCallbacks {
|
||||
void aclDataReceived(in byte[] data);
|
||||
void hciEventReceived(in byte[] event);
|
||||
void initializationComplete(in android.hardware.bluetooth.Status status);
|
||||
void isoDataReceived(in byte[] data);
|
||||
void scoDataReceived(in byte[] data);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum Status {
|
||||
SUCCESS = 0,
|
||||
ALREADY_INITIALIZED = 1,
|
||||
UNABLE_TO_OPEN_INTERFACE = 2,
|
||||
HARDWARE_INITIALIZATION_ERROR = 3,
|
||||
UNKNOWN = 4,
|
||||
}
|
||||
73
bluetooth/aidl/android/hardware/bluetooth/IBluetoothHci.aidl
Normal file
73
bluetooth/aidl/android/hardware/bluetooth/IBluetoothHci.aidl
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
|
||||
import android.hardware.bluetooth.IBluetoothHciCallbacks;
|
||||
|
||||
/**
|
||||
* The Host Controller Interface (HCI) is the layer defined by the Bluetooth
|
||||
* specification between the software that runs on the host and the Bluetooth
|
||||
* controller chip. This boundary is the natural choice for a Hardware
|
||||
* Abstraction Layer (HAL). Dealing only in HCI packets and events simplifies
|
||||
* the stack and abstracts away power management, initialization, and other
|
||||
* implementation-specific details related to the hardware.
|
||||
*/
|
||||
@VintfStability
|
||||
interface IBluetoothHci {
|
||||
/**
|
||||
* Close the HCI interface
|
||||
*/
|
||||
void close();
|
||||
|
||||
/**
|
||||
* Initialize the Bluetooth interface and set the callbacks.
|
||||
*/
|
||||
void initialize(in IBluetoothHciCallbacks callback);
|
||||
|
||||
/**
|
||||
* Send an HCI ACL data packet (as specified in the Bluetooth Specification
|
||||
* V4.2, Vol 2, Part 5, Section 5.4.2) to the Bluetooth controller.
|
||||
* Packets must be processed in order.
|
||||
* @param data HCI data packet to be sent
|
||||
*/
|
||||
void sendAclData(in byte[] data);
|
||||
|
||||
/**
|
||||
* Send an HCI command (as specified in the Bluetooth Specification
|
||||
* V4.2, Vol 2, Part 5, Section 5.4.1) to the Bluetooth controller.
|
||||
* Commands must be executed in order.
|
||||
*
|
||||
* @param command is the HCI command to be sent
|
||||
*/
|
||||
void sendHciCommand(in byte[] command);
|
||||
|
||||
/**
|
||||
* Send an ISO data packet (as specified in the Bluetooth Core
|
||||
* Specification v5.2) to the Bluetooth controller.
|
||||
* Packets must be processed in order.
|
||||
* @param data HCI data packet to be sent
|
||||
*/
|
||||
void sendIsoData(in byte[] data);
|
||||
|
||||
/**
|
||||
* Send an SCO data packet (as specified in the Bluetooth Specification
|
||||
* V4.2, Vol 2, Part 5, Section 5.4.3) to the Bluetooth controller.
|
||||
* Packets must be processed in order.
|
||||
* @param data HCI data packet to be sent
|
||||
*/
|
||||
void sendScoData(in byte[] data);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
|
||||
import android.hardware.bluetooth.Status;
|
||||
|
||||
/**
|
||||
* The interface from the Bluetooth Controller to the stack.
|
||||
*/
|
||||
@VintfStability
|
||||
interface IBluetoothHciCallbacks {
|
||||
/**
|
||||
* Send an ACL data packet from the controller to the host.
|
||||
* @param data the ACL HCI packet to be passed to the host stack
|
||||
*/
|
||||
void aclDataReceived(in byte[] data);
|
||||
|
||||
/**
|
||||
* This function is invoked when an HCI event is received from the
|
||||
* Bluetooth controller to be forwarded to the Bluetooth stack.
|
||||
* @param event is the HCI event to be sent to the Bluetooth stack.
|
||||
*/
|
||||
void hciEventReceived(in byte[] event);
|
||||
|
||||
/**
|
||||
* Invoked when the Bluetooth controller initialization has been
|
||||
* completed.
|
||||
*/
|
||||
void initializationComplete(in Status status);
|
||||
|
||||
/**
|
||||
* Send a ISO data packet from the controller to the host.
|
||||
* @param data the ISO HCI packet to be passed to the host stack
|
||||
*/
|
||||
void isoDataReceived(in byte[] data);
|
||||
|
||||
/**
|
||||
* Send a SCO data packet from the controller to the host.
|
||||
* @param data the SCO HCI packet to be passed to the host stack
|
||||
*/
|
||||
void scoDataReceived(in byte[] data);
|
||||
}
|
||||
27
bluetooth/aidl/android/hardware/bluetooth/Status.aidl
Normal file
27
bluetooth/aidl/android/hardware/bluetooth/Status.aidl
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.bluetooth;
|
||||
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum Status {
|
||||
SUCCESS,
|
||||
ALREADY_INITIALIZED,
|
||||
UNABLE_TO_OPEN_INTERFACE,
|
||||
HARDWARE_INITIALIZATION_ERROR,
|
||||
UNKNOWN,
|
||||
}
|
||||
@@ -151,6 +151,13 @@
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.bluetooth</name>
|
||||
<interface>
|
||||
<name>IBluetoothHci</name>
|
||||
<instance>default</instance>
|
||||
</interface>
|
||||
</hal>
|
||||
<hal format="aidl" optional="true">
|
||||
<name>android.hardware.bluetooth.audio</name>
|
||||
<version>2</version>
|
||||
|
||||
Reference in New Issue
Block a user