diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-24 03:06:54 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-24 03:06:54 +0000 |
commit | 409c319fdeb2664f5a55e28f02203ab363f6d106 (patch) | |
tree | 2f7557b0b32c87004e4791cb378a75c8b080b681 | |
parent | 77234719691bba6cf9eaed404713e6e277db9a46 (diff) | |
parent | acfb9f2ffdfde4141d42f2a515d76d3346a45a3d (diff) | |
download | interfaces-409c319fdeb2664f5a55e28f02203ab363f6d106.tar.gz |
Snap for 7310088 from acfb9f2ffdfde4141d42f2a515d76d3346a45a3d to sc-d1-release
Change-Id: I7fb28265cfa1421bf1b15aad8eb25b5e5cd8e995
-rw-r--r-- | bluetooth/ccc/1.0/Android.bp | 22 | ||||
-rw-r--r-- | bluetooth/ccc/1.0/IBluetoothCcc.hal | 42 | ||||
-rw-r--r-- | bluetooth/ccc/1.0/IBluetoothCccCallback.hal | 33 | ||||
-rw-r--r-- | bluetooth/ccc/1.0/types.hal | 53 |
4 files changed, 150 insertions, 0 deletions
diff --git a/bluetooth/ccc/1.0/Android.bp b/bluetooth/ccc/1.0/Android.bp new file mode 100644 index 0000000..bb789b5 --- /dev/null +++ b/bluetooth/ccc/1.0/Android.bp @@ -0,0 +1,22 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_google_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_google_interfaces_license"], +} + +hidl_interface { + name: "hardware.google.bluetooth.ccc@1.0", + root: "hardware.google", + srcs: [ + "IBluetoothCcc.hal", + "IBluetoothCccCallback.hal", + "types.hal", + ], + interfaces: [ + "android.hidl.base@1.0", + ], + gen_java: true, +} diff --git a/bluetooth/ccc/1.0/IBluetoothCcc.hal b/bluetooth/ccc/1.0/IBluetoothCcc.hal new file mode 100644 index 0000000..4f7f1e7 --- /dev/null +++ b/bluetooth/ccc/1.0/IBluetoothCcc.hal @@ -0,0 +1,42 @@ +/* + * Copyright 2021 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 is pixel only extension for Bluetooth HAL. + */ +package hardware.google.bluetooth.ccc@1.0; + +import IBluetoothCccCallback; + +interface IBluetoothCcc { + /** + * API to monitor Bluetooth and system timestamp for given Bluetooth device when Bluetooth + * controller send/receive given LMP events. + * + * @param callback An instance of the |IBluetoothCccCallback| HIDL interface object. + * @param address Bluetooth address to use for monitoring timestamp. + * @param lmpEventIds LMP events to use for monitoring timestamp. + */ + registerForLmpEvents(IBluetoothCccCallback callback, + Address address, vec<LmpEventId> lmpEventIds); + + /** + * API to stop monitor given Bluetooth device. + * + * @param address Bluetooth device to stop monitoring. + */ + unregisterLmpEvents(Address address); +}; diff --git a/bluetooth/ccc/1.0/IBluetoothCccCallback.hal b/bluetooth/ccc/1.0/IBluetoothCccCallback.hal new file mode 100644 index 0000000..bcd0cea --- /dev/null +++ b/bluetooth/ccc/1.0/IBluetoothCccCallback.hal @@ -0,0 +1,33 @@ +/* + * Copyright 2021 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 hardware.google.bluetooth.ccc@1.0; + +import types; + +interface IBluetoothCccCallback { + /** + * Callback when monitored LMP event involked. + * + * @param timestamp Timestamp when the LMP event involked + * @param address Remote bluetooth address that involke LMP event + * @param direction Direction of the involked LMP event + * @param lmpEventId LMP event id that bluetooth chip involked + * @param connEventCounter counter incremented by one for each new connection event + */ + onEventGenerated(Timestamp timestamp, Address address, Direction direction, + LmpEventId lmpEventId, uint16_t connEventCounter); +}; diff --git a/bluetooth/ccc/1.0/types.hal b/bluetooth/ccc/1.0/types.hal new file mode 100644 index 0000000..a65f159 --- /dev/null +++ b/bluetooth/ccc/1.0/types.hal @@ -0,0 +1,53 @@ +/* + * Copyright 2021 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 hardware.google.bluetooth.ccc@1.0; + +/** + * Generic structure to return the timestamp + */ +struct Timestamp { + /** + * Timestamp in microsecond since system boot. + */ + uint32_t systemTime; + /** + * Timestamp in microsecond since Bluetooth controller power up. + */ + uint32_t bluetoothTime; +}; + +/** + * LMP event id to be monitored + * CONNECT_IND indicator for initiating connection, timestamp will be at the anchor point + * LL_PHY_UPDATE_IND indicator for PHY update + */ +enum LmpEventId : uint8_t { + CONNECT_IND = 0x00, + LL_PHY_UPDATE_IND = 0x01 +}; + +/** + * Direction of the LMP event + */ +enum Direction : uint8_t { + TX = 0x00, RX = 0x01 +}; + +/** + * Bluetooth Address Type. 6 octest representing bluetooth of a device. + */ +typedef uint8_t[6] Address; |