Update the channel sounding HAL API
Bug: 357090692
Test: build
Change-Id: I7bb5d1e10f6681103199d741ff4496dbb3530c0e
diff --git a/bluetooth/ranging/OWNERS b/bluetooth/ranging/OWNERS
index 3d95624..88a91ea 100644
--- a/bluetooth/ranging/OWNERS
+++ b/bluetooth/ranging/OWNERS
@@ -3,3 +3,4 @@
include platform/packages/modules/Bluetooth:/OWNERS
chienyuanhuang@google.com
+steveliu@google.com
diff --git a/bluetooth/ranging/aidl/Android.bp b/bluetooth/ranging/aidl/Android.bp
index d0d1b90..4096669 100644
--- a/bluetooth/ranging/aidl/Android.bp
+++ b/bluetooth/ranging/aidl/Android.bp
@@ -42,6 +42,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
index e8fefbe..03a7d24 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
@@ -38,6 +38,9 @@
int aclHandle;
int l2capCid;
int realTimeProcedureDataAttHandle;
+ /**
+ * @deprecated use the role in Config.aidl
+ */
android.hardware.bluetooth.ranging.Role role;
boolean localSupportsSoundingPhaseBasedRanging;
boolean remoteSupportsSoundingPhaseBaseRanging;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
new file mode 100644
index 0000000..70bed88
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum Ch3cShapeType {
+ HAT_SHAPE = 0x00,
+ X_SHAPE = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
new file mode 100644
index 0000000..78bbbc1
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum ChannelSelectionType {
+ ALOGRITHM_3B = 0x00,
+ ALOGRITHM_3C = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
index 8fc77ae..64aabec 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ChannelSoundingProcedureData
+ */
@VintfStability
parcelable ChannelSoudingRawData {
int procedureCounter;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
new file mode 100644
index 0000000..ef4facc
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable ChannelSoundingProcedureData {
+ int procedureCounter;
+ int procedureSequence;
+ byte initiatorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE /* 127 */;
+ byte reflectorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE /* 127 */;
+ android.hardware.bluetooth.ranging.SubeventResultData[] initiatorSubeventResultData;
+ android.hardware.bluetooth.ranging.ProcedureAbortReason initiatorProcedureAbortReason;
+ android.hardware.bluetooth.ranging.SubeventResultData[] reflectorSubeventResultData;
+ android.hardware.bluetooth.ranging.ProcedureAbortReason reflectorProcedureAbortReason;
+ const byte SELECTED_TX_POWER_UNAVAILABLE = 0x7Fu8;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
index 172ac5e..b86994e 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ChannelSoundingProcedureData
+ */
@VintfStability
parcelable ChannelSoundingSingleSideData {
@nullable android.hardware.bluetooth.ranging.StepTonePct[] stepTonePcts;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
index 4d5ac21..c3d5d91 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ComplexNumber.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use PctIQSample instead for V2 and above.
+ */
@VintfStability
parcelable ComplexNumber {
double real;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
index c9ac991..bd07cd0 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/Config.aidl
@@ -38,4 +38,22 @@
android.hardware.bluetooth.ranging.SubModeType subModeType;
android.hardware.bluetooth.ranging.RttType rttType;
byte[10] channelMap;
+ int minMainModeSteps;
+ int maxMainModeSteps;
+ byte mainModeRepetition;
+ byte mode0Steps;
+ android.hardware.bluetooth.ranging.Role role;
+ android.hardware.bluetooth.ranging.CsSyncPhyType csSyncPhyType;
+ android.hardware.bluetooth.ranging.ChannelSelectionType channelSelectionType;
+ android.hardware.bluetooth.ranging.Ch3cShapeType ch3cShapeType;
+ byte ch3cJump;
+ int channelMapRepetition;
+ int tIp1TimeUs;
+ int tIp2TimeUs;
+ int tFcsTimeUs;
+ byte tPmTimeUs;
+ byte tSwTimeUsSupportedByLocal;
+ byte tSwTimeUsSupportedByRemote;
+ int bleConnInterval = BLE_CONN_INTERVAL_UNAVAILABLE /* 0 */;
+ const int BLE_CONN_INTERVAL_UNAVAILABLE = 0;
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
new file mode 100644
index 0000000..9611f13
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum CsSyncPhyType {
+ NOT_VALID_PHY = 0x00,
+ LE_1M_PHY = 0x01,
+ LE_2M_PHY = 0x02,
+ LE_2M_2BT_PHY = 0x03,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
index 004a482..19b949f 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
@@ -36,6 +36,10 @@
interface IBluetoothChannelSounding {
@nullable android.hardware.bluetooth.ranging.VendorSpecificData[] getVendorSpecificData();
@nullable android.hardware.bluetooth.ranging.SessionType[] getSupportedSessionTypes();
+ /**
+ * @deprecated use getSupportedCsSecurityLevels() instead
+ */
android.hardware.bluetooth.ranging.CsSecurityLevel getMaxSupportedCsSecurityLevel();
@nullable android.hardware.bluetooth.ranging.IBluetoothChannelSoundingSession openSession(in android.hardware.bluetooth.ranging.BluetoothChannelSoundingParameters params, in android.hardware.bluetooth.ranging.IBluetoothChannelSoundingSessionCallback callback);
+ android.hardware.bluetooth.ranging.CsSecurityLevel[] getSupportedCsSecurityLevels();
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
index 9f691b4..99418bc 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
@@ -39,4 +39,8 @@
boolean isAbortedProcedureRequired();
void writeRawData(in android.hardware.bluetooth.ranging.ChannelSoudingRawData rawData);
void close(android.hardware.bluetooth.ranging.Reason reason);
+ void writeProcedureData(in android.hardware.bluetooth.ranging.ChannelSoundingProcedureData procedureData);
+ void updateChannelSoundingConfig(in android.hardware.bluetooth.ranging.Config conifg);
+ void updateProcedureEnableConfig(in android.hardware.bluetooth.ranging.ProcedureEnableConfig procedureEnableConfig);
+ void updateBleConnInterval(in int bleConnInterval);
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl
new file mode 100644
index 0000000..6fdfffe
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeData.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+union ModeData {
+ android.hardware.bluetooth.ranging.ModeZeroData modeZeroData;
+ android.hardware.bluetooth.ranging.ModeOneData modeOneData;
+ android.hardware.bluetooth.ranging.ModeTwoData modeTwoData;
+ android.hardware.bluetooth.ranging.ModeThreeData modeThreeData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl
new file mode 100644
index 0000000..698dd63
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeOneData.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable ModeOneData {
+ byte packetQuality;
+ android.hardware.bluetooth.ranging.Nadm packetNadm;
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE /* 127 */;
+ android.hardware.bluetooth.ranging.RttToaTodData rttToaTodData;
+ byte packetAntenna;
+ @nullable android.hardware.bluetooth.ranging.PctIQSample packetPct1;
+ @nullable android.hardware.bluetooth.ranging.PctIQSample packetPct2;
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF;
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl
new file mode 100644
index 0000000..1aa928b
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeThreeData.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable ModeThreeData {
+ android.hardware.bluetooth.ranging.ModeOneData modeOneData;
+ android.hardware.bluetooth.ranging.ModeTwoData modeTwoData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl
new file mode 100644
index 0000000..c07b0c0
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeTwoData.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable ModeTwoData {
+ byte antennaPermutationIndex;
+ android.hardware.bluetooth.ranging.PctIQSample[] tonePctIQSamples;
+ byte[] toneQualityIndicators;
+ const int TONE_QUALITY_HIGH = 0x0;
+ const int TONE_QUALITY_MEDIUM = 0x1;
+ const int TONE_QUALITY_LOW = 0x2;
+ const int TONE_QUALITY_UNAVAILABLE = 0x3;
+ const int EXTENSION_SLOT_NONE = 0x0;
+ const int EXTENSION_SLOT_TONE_NOT_EXPECTED_TO_BE_PRESENT = 0x1;
+ const int EXTENSION_SLOT_TONE_EXPECTED_TO_BE_PRESENT = 0x2;
+ const int EXTENSION_SLOT_SHIFT = 4;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl
new file mode 100644
index 0000000..f94f3d1
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ModeZeroData.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2023 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.ranging;
+@VintfStability
+parcelable ModeZeroData {
+ byte packetQuality;
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE /* 127 */;
+ byte packetAntenna;
+ int initiatorMeasuredFreqOffset = MEASURED_FREQ_OFFSET_UNAVAILABLE /* -16384 */;
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF;
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ const int MEASURED_FREQ_OFFSET_UNAVAILABLE = 0xFFFFC000;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl
new file mode 100644
index 0000000..a15b579
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/PctIQSample.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable PctIQSample {
+ int iSample = SAMPLE_UNAVAILABLE /* -1 */;
+ int qSample = SAMPLE_UNAVAILABLE /* -1 */;
+ const int SAMPLE_UNAVAILABLE = 0xFFFFFFFF;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
new file mode 100644
index 0000000..ead7ceb
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum ProcedureAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ FILTERED_CHANNEL_MAP_LESS_THAN_15 = 0x02,
+ CHANNEL_MAP_UPDATE_INSTANT_PASSED = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
new file mode 100644
index 0000000..11030bb
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable ProcedureEnableConfig {
+ byte toneAntennaConfigSelection;
+ int subeventLenUs;
+ byte subeventsPerEvent;
+ int subeventInterval;
+ int eventInterval;
+ int procedureInterval;
+ int procedureCount;
+ int maxProcedureLen;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
index d092b80..ccac70b 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResult.aidl
@@ -45,4 +45,6 @@
android.hardware.bluetooth.ranging.Nadm detectedAttackLevel;
double velocityMetersPerSecond;
@nullable byte[] vendorSpecificCsRangingResultsData;
+ android.hardware.bluetooth.ranging.RangingResultStatus rangingResultStatus;
+ long timestampNanos;
}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
new file mode 100644
index 0000000..cdf8ed2
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum RangingResultStatus {
+ SUCCESS = 0x00,
+ FAIL_INITIATOR_ABORT = 0x01,
+ FAIL_REFLECTOR_ABORT = 0x02,
+ FAIL_BOTH_ABORT = 0x03,
+ FAIL_UNSPECIFIED = 0xFFu8,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl
new file mode 100644
index 0000000..496ccb2
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/RttToaTodData.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+union RttToaTodData {
+ int toaTodInitiator = TOA_TOD_UNAVAILABLE /* -32768 */;
+ int todToaReflector = TOA_TOD_UNAVAILABLE /* -32768 */;
+ const int TOA_TOD_UNAVAILABLE = 0xFFFF8000;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl
new file mode 100644
index 0000000..cdebc8e
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepData.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable StepData {
+ byte stepChannel;
+ android.hardware.bluetooth.ranging.ModeType stepMode;
+ android.hardware.bluetooth.ranging.ModeData stepModeData;
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
index 4125748..02d5413 100644
--- a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/StepTonePct.aidl
@@ -32,6 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use ModeTwoData
+ */
@VintfStability
parcelable StepTonePct {
List<android.hardware.bluetooth.ranging.ComplexNumber> tonePcts;
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
new file mode 100644
index 0000000..a3bb366
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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.ranging;
+@Backing(type="byte") @VintfStability
+enum SubeventAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ NO_CS_SYNC_RECEIVED = 0x02,
+ SCHEDULING_CONFLICTS_OR_LIMITED_RESOURCES = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl
new file mode 100644
index 0000000..3a7c393
--- /dev/null
+++ b/bluetooth/ranging/aidl/aidl_api/android.hardware.bluetooth.ranging/current/android/hardware/bluetooth/ranging/SubeventResultData.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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.ranging;
+@VintfStability
+parcelable SubeventResultData {
+ int startAclConnEventCounter;
+ int frequencyCompensation = FREQ_COMPENSATION_UNAVAILABLE /* -16384 */;
+ byte referencePowerLevelDbm;
+ byte numAntennaPaths;
+ android.hardware.bluetooth.ranging.SubeventAbortReason subeventAbortReason;
+ android.hardware.bluetooth.ranging.StepData[] stepData;
+ long timestampNanos;
+ const int FREQ_COMPENSATION_UNAVAILABLE = 0xFFFFC000;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
index 0cda847..fbc0165 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/BluetoothChannelSoundingParameters.aidl
@@ -44,6 +44,7 @@
int realTimeProcedureDataAttHandle;
/**
* Role of the local device.
+ * @deprecated use the role in Config.aidl
*/
Role role;
/**
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
new file mode 100644
index 0000000..558f68b
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Ch3cShapeType.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * The selected shape to be rendered when Channel Selection Algorithm #3c is used
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum Ch3cShapeType {
+ /**
+ * Use Hat shape for user-specified channel sequence
+ */
+ HAT_SHAPE = 0x00,
+ /**
+ * Use X shape for user-specified channel sequence
+ */
+ X_SHAPE = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
new file mode 100644
index 0000000..6fd71aa
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSelectionType.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * The channel selection algorithm for non-mode-0 steps
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum ChannelSelectionType {
+ /**
+ * Use Channel Selection Algorithm #3b for non-mode-0 CS steps
+ */
+ ALOGRITHM_3B = 0x00,
+ /**
+ * Use Channel Selection Algorithm #3c for non-mode-0 CS steps
+ */
+ ALOGRITHM_3C = 0x01,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
index 78ce4f4..f06af0f 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoudingRawData.aidl
@@ -24,6 +24,7 @@
* See Channel Sounding CR_PR 3.1.10 and Channel Sounding HCI Updates CR_PR 3.1.23 for details.
*
* Specification: https://www.bluetooth.com/specifications/specs/channel-sounding-cr-pr/
+ * @deprecated use ChannelSoundingProcedureData
*/
@VintfStability
parcelable ChannelSoudingRawData {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
new file mode 100644
index 0000000..2c51abe
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingProcedureData.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.ProcedureAbortReason;
+import android.hardware.bluetooth.ranging.SubeventResultData;
+
+/**
+ * The measured data for a whole procedure, it includes all local and remote related data.
+ */
+@VintfStability
+parcelable ChannelSoundingProcedureData {
+ /**
+ * CS procedure count since completion of the Channel Sounding Security Start procedure
+ */
+ int procedureCounter;
+ /**
+ * The procequre sequence since completion of the Channel Sounding Procecedure Enable procedure,
+ * this is not defined by spec, BT
+ */
+ int procedureSequence;
+ const byte SELECTED_TX_POWER_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Transmit power level used for CS procedure of initiator.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43
+ * ** HCI_LE_CS_Procedure_Enable_Complete#selected_tx_power
+ * See BLUETOOTH Ranging Service Version 1.0 3.2.1.2
+ * ** Ranging Header#Selected TX power
+ * Range: -127 to 20
+ * Unit: dBm
+ * value: 0x7F - Transmit power level is unavailable
+ */
+ byte initiatorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE;
+ /**
+ * Transmit power level used for CS procedure of reflector.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43
+ * ** HCI_LE_CS_Procedure_Enable_Complete#selected_tx_power
+ * See BLUETOOTH Ranging Service Version 1.0 3.2.1.2
+ * ** Ranging Header#Selected TX power
+ * Range: -127 to 20
+ * Unit: dBm
+ * value: 0x7F - Transmit power level is unavailable
+ */
+ byte reflectorSelectedTxPower = SELECTED_TX_POWER_UNAVAILABLE;
+ /**
+ * The subevent result data of initiator
+ */
+ SubeventResultData[] initiatorSubeventResultData;
+ /**
+ * Indicates the procedure abort reason of the initiator
+ */
+ ProcedureAbortReason initiatorProcedureAbortReason;
+ /**
+ * The subevent result data of reflector
+ */
+ SubeventResultData[] reflectorSubeventResultData;
+ /**
+ * Indicates the procedure abort reason of the initiator
+ */
+ ProcedureAbortReason reflectorProcedureAbortReason;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
index 9c4b472..75f0b67 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ChannelSoundingSingleSideData.aidl
@@ -25,6 +25,7 @@
* See Channel Sounding CR_PR 3.1.10 and Channel Sounding HCI Updates CR_PR 3.1.23 for details.
*
* Specification: https://www.bluetooth.com/specifications/specs/channel-sounding-cr-pr/
+ * @deprecated use ChannelSoundingProcedureData
*/
@VintfStability
parcelable ChannelSoundingSingleSideData {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
index 5253d9f..8d59934 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ComplexNumber.aidl
@@ -16,6 +16,9 @@
package android.hardware.bluetooth.ranging;
+/**
+ * @deprecated use PctIQSample instead for V2 and above.
+ */
@VintfStability
parcelable ComplexNumber {
double real;
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
index 85ae4c1..95817b5 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/Config.aidl
@@ -16,10 +16,20 @@
package android.hardware.bluetooth.ranging;
+import android.hardware.bluetooth.ranging.Ch3cShapeType;
+import android.hardware.bluetooth.ranging.ChannelSelectionType;
+import android.hardware.bluetooth.ranging.CsSyncPhyType;
import android.hardware.bluetooth.ranging.ModeType;
+import android.hardware.bluetooth.ranging.Role;
import android.hardware.bluetooth.ranging.RttType;
import android.hardware.bluetooth.ranging.SubModeType;
+/**
+ * LE CS Config Complete data of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.8.137 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
@VintfStability
parcelable Config {
/**
@@ -42,4 +52,96 @@
* Channel n is disabled for CS procedure = 0
*/
byte[10] channelMap;
+ /**
+ * Minimum number of CS main mode steps to be executed before a submode step is executed
+ * Value: 0x02 to 0xFF
+ */
+ int minMainModeSteps;
+ /**
+ * Maximum number of CS main mode steps to be executed before a submode step is executed
+ * Value: 0x02 to 0xFF
+ */
+ int maxMainModeSteps;
+ /**
+ * Number of main mode steps taken from the end of the last CS subevent to be repeated at
+ * the beginning of the current CS subevent directly after the last mode-0 step of that event
+ * Value: 0x00 to 0x03
+ */
+ byte mainModeRepetition;
+ /**
+ * Number of CS mode-0 steps to be included at the beginning of each CS subevent
+ * Value: 0x00 to 0x03
+ */
+ byte mode0Steps;
+ /**
+ * The Channel Sounding role of the local device
+ */
+ Role role;
+ /**
+ * Indicates the PHY to be used for CS_SYNC exchanges during the CS procedure
+ */
+ CsSyncPhyType csSyncPhyType;
+ /**
+ * Indicates the Channel Selection Algorithm to be used during the CS procedure for non-mode-0
+ * steps
+ */
+ ChannelSelectionType channelSelectionType;
+ /**
+ * Indicates the selected shape
+ */
+ Ch3cShapeType ch3cShapeType;
+ /**
+ * Number of channels skipped in each rising and falling sequence
+ * Value: 0x02 to 0x08
+ */
+ byte ch3cJump;
+ /**
+ * The number of times the map represented by the Channel_Map field is to be cycled through
+ * for non-mode-0 steps within a CS procedure
+ * Value: 0x01 to 0xFF
+ */
+ int channelMapRepetition;
+ /**
+ * Interlude time in microseconds between the RTT packets
+ * Value: 0x0A, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, or 0x91
+ * unit: us
+ */
+ int tIp1TimeUs;
+ /**
+ * Interlude time in microseconds between the CS tones
+ * Value: 0x0A, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, or 0x91
+ * unit: us
+ */
+ int tIp2TimeUs;
+ /**
+ * Time in microseconds for frequency changes
+ * Value: 0x0F, 0x14, 0x1E, 0x28, 0x32, 0x3C, 0x50, 0x64, 0x78, or 0x96
+ * unit: us
+ */
+ int tFcsTimeUs;
+ /**
+ * Time in microseconds for the phase measurement period of the CS tones
+ * Value: 0x0A, 0x14, or 0x28
+ * unit: us
+ */
+ byte tPmTimeUs;
+ /**
+ * Time in microseconds for the antenna switch period of the CS tones supported by local device
+ * Value: 0, 1, 2, 4, 10 us
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.8.130
+ */
+ byte tSwTimeUsSupportedByLocal;
+ /**
+ * Time in microseconds for the antenna switch period of the CS tones supported by remote device
+ * Value: 0, 1, 2, 4, 10 us
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.39
+ */
+ byte tSwTimeUsSupportedByRemote;
+ const int BLE_CONN_INTERVAL_UNAVAILABLE = 0;
+ /**
+ * BLE event connection interval, a multiple of 1.25 ms in the range 7.5 ms to 4.0 s
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 6, Part B 4.5.1
+ * Unit: 1.25ms
+ */
+ int bleConnInterval = BLE_CONN_INTERVAL_UNAVAILABLE;
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
new file mode 100644
index 0000000..c7fe8a6
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/CsSyncPhyType.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * The PHY to be used for CS_SYNC exchanges during the CS procedure
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum CsSyncPhyType {
+ NOT_VALID_PHY = 0x00,
+ LE_1M_PHY = 0x01,
+ LE_2M_PHY = 0x02,
+ LE_2M_2BT_PHY = 0x03,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
index 45ec79f..283f588 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSounding.aidl
@@ -52,6 +52,7 @@
*
* @return CsSecurityLevel that indicates max supported security level of CS for ranging
* algorithms.
+ * @deprecated use getSupportedCsSecurityLevels() instead
*/
CsSecurityLevel getMaxSupportedCsSecurityLevel();
@@ -63,4 +64,13 @@
@nullable IBluetoothChannelSoundingSession openSession(
in BluetoothChannelSoundingParameters params,
in IBluetoothChannelSoundingSessionCallback callback);
+
+ /**
+ * API to get all supported security level (0 to 4) of CS for ranging algorithms.
+ *
+ * See: BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 3, Part C 10.11.1
+ *
+ * @return All supported security level of CS for ranging algorithms.
+ */
+ CsSecurityLevel[] getSupportedCsSecurityLevels();
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
index 97b147e..b87024e 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/IBluetoothChannelSoundingSession.aidl
@@ -17,6 +17,9 @@
package android.hardware.bluetooth.ranging;
import android.hardware.bluetooth.ranging.ChannelSoudingRawData;
+import android.hardware.bluetooth.ranging.ChannelSoundingProcedureData;
+import android.hardware.bluetooth.ranging.Config;
+import android.hardware.bluetooth.ranging.ProcedureEnableConfig;
import android.hardware.bluetooth.ranging.Reason;
import android.hardware.bluetooth.ranging.ResultType;
import android.hardware.bluetooth.ranging.VendorSpecificData;
@@ -63,4 +66,28 @@
* Close the current session. Object is no longer useful after this method.
*/
void close(Reason reason);
+
+ /**
+ * API to provide raw ranging procedure data to the HAL. The HAL converts this data into
+ * meaningful ranging results using a proprietary algorithm and then calls back to the
+ * Bluetooth stack via BluetoothChannelSoundingSessionCallback.onResult().
+ */
+ void writeProcedureData(in ChannelSoundingProcedureData procedureData);
+
+ /**
+ * API to provide the latest CS config to the HAL.
+ */
+ void updateChannelSoundingConfig(in Config conifg);
+
+ /**
+ * API to provide the latest CS procedure enable complete information.
+ */
+ void updateProcedureEnableConfig(in ProcedureEnableConfig procedureEnableConfig);
+
+ /**
+ * API to provide the latest BLE event connection interval.
+ * BLE event connection interval, a multiple of 1.25 ms in the range 7.5 ms to 4.0 s
+ * see BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 6, Part B 4.5.1
+ */
+ void updateBleConnInterval(in int bleConnInterval);
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl
new file mode 100644
index 0000000..99199d2
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeData.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.ModeOneData;
+import android.hardware.bluetooth.ranging.ModeThreeData;
+import android.hardware.bluetooth.ranging.ModeTwoData;
+import android.hardware.bluetooth.ranging.ModeZeroData;
+
+/**
+ * Mode specific data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+union ModeData {
+ ModeZeroData modeZeroData;
+ ModeOneData modeOneData;
+ ModeTwoData modeTwoData;
+ ModeThreeData modeThreeData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl
new file mode 100644
index 0000000..51e8c70
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeOneData.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.Nadm;
+import android.hardware.bluetooth.ranging.PctIQSample;
+import android.hardware.bluetooth.ranging.RttToaTodData;
+
+/**
+ * Mode 1 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeOneData {
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF; // bit 3 is reserved
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ /**
+ * bits 0 to 3:
+ * ** 0x0 = CS Access Address check is successful, and all bits match the expected sequence
+ * ** 0x1 = CS Access Address check contains one or more bit errors
+ * ** 0x2 = CS Access Address not found
+ * bits 4 to 7: Number of bit errors being reported on the payload with a random or sounding
+ * sequence. Value 0 may indicate zero bit errors or no report available.
+ * Value 15 may indicate 15 or more bit errors.
+ */
+ byte packetQuality;
+ /**
+ * Normalized Attack Detector Metric.
+ */
+ Nadm packetNadm;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Range: -127 to +20
+ * Unit: dBm
+ * Value: 0x7F - RSSI is not available
+ */
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE;
+ /**
+ * Time difference of the time of arrival and the time of depature of the CS packets.
+ * see RttToaTodData for details.
+ */
+ RttToaTodData rttToaTodData;
+ /**
+ * Antenna identifier used for the RTT packet
+ * Value: 0x01 to 0x04
+ */
+ byte packetAntenna;
+ /**
+ * Phase Correction Term 1 of the sounding sequence.
+ */
+ @nullable PctIQSample packetPct1;
+ /**
+ * Phase Correction Term 2 of the sounding sequence.
+ */
+ @nullable PctIQSample packetPct2;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl
new file mode 100644
index 0000000..a70d371
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeThreeData.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.ModeOneData;
+import android.hardware.bluetooth.ranging.ModeTwoData;
+
+/**
+ * Mode 3 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeThreeData {
+ ModeOneData modeOneData;
+ ModeTwoData modeTwoData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl
new file mode 100644
index 0000000..b360c90
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeTwoData.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.PctIQSample;
+
+/**
+ * Mode 2 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeTwoData {
+ /**
+ * Antenna Permutation Index for the chosen Num_Antenna_Paths parameter used during the
+ * phase measurement stage of the CS step
+ */
+ byte antennaPermutationIndex;
+ /**
+ * The I and Q sample of Phase Correction Term for (Num_Antenna_Paths + 1) CS tone
+ * The order is the same as the BT core defined
+ */
+ PctIQSample[] tonePctIQSamples;
+
+ const int TONE_QUALITY_HIGH = 0x0;
+ const int TONE_QUALITY_MEDIUM = 0x1;
+ const int TONE_QUALITY_LOW = 0x2;
+ const int TONE_QUALITY_UNAVAILABLE = 0x3;
+ const int EXTENSION_SLOT_NONE = 0x0;
+ const int EXTENSION_SLOT_TONE_NOT_EXPECTED_TO_BE_PRESENT = 0x1;
+ const int EXTENSION_SLOT_TONE_EXPECTED_TO_BE_PRESENT = 0x2;
+ /**
+ * Shift amount for extension slot (bits 4 to 7).
+ */
+ const int EXTENSION_SLOT_SHIFT = 4;
+ /**
+ * Tone quality indicator for (Num_Antenna_Paths + 1) CS tone
+ * bits 0 to 3:
+ * ** 0x0 = Tone quality is high
+ * ** 0x1 = Tone quality is medium
+ * ** 0x2 = Tone quality is low
+ * ** 0x3 = Tone quality is unavailable
+ * bits 4 to 7:
+ * ** 0x0 = Not tone extension slot
+ * ** 0x1 = Tone extension slot; tone not expected to be present
+ * ** 0x2 = Tone extension slot; tone expected to be present
+ */
+ byte[] toneQualityIndicators;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl
new file mode 100644
index 0000000..6f326d1
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ModeZeroData.aidl
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2023 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.ranging;
+
+/**
+ * Mode 0 data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ModeZeroData {
+ const byte FLAG_CS_ACCESS_ADDR_SUCCESS = 0x0;
+ const byte FLAG_CS_ACCESS_ADDR_ERRORS = 0x1;
+ const byte FLAG_CS_ACCESS_ADDR_NOT_FOUND = 0x2;
+ const byte FLAG_CS_ACCESS_ADDR_MASK = 0xF; // bit 3 is reserved
+ const byte RANDOM_OR_SOUNDING_SEQUENCE_ERROR_COUNT_SHIFT = 4;
+ /**
+ * bits 0 to 3:
+ * ** 0x0 = CS Access Address check is successful, and all bits match the expected sequence
+ * ** 0x1 = CS Access Address check contains one or more bit errors
+ * ** 0x2 = CS Access Address not found
+ * bits 4 to 7: Number of bit errors being reported on the payload with a random or sounding
+ * sequence. Value 0 may indicate zero bit errors or no report available.
+ * Value 15 may indicate 15 or more bit errors.
+ */
+ byte packetQuality;
+ const byte PACKET_RSSI_UNAVAILABLE = 0x7Fu8;
+ /**
+ * Range: -127 to +20
+ * Unit: dBm
+ * Value: 0x7F - RSSI is not available
+ */
+ byte packetRssiDbm = PACKET_RSSI_UNAVAILABLE;
+ /**
+ * Antenna identifier used for the RTT packet
+ * Value: 0x01 to 0x04
+ */
+ byte packetAntenna;
+ const int MEASURED_FREQ_OFFSET_UNAVAILABLE = 0xFFFFC000;
+ /**
+ * Measured frequency offset in units of 0.01 ppm (15-bit signed integer, it had been converted
+ * as int here.) for initiator, this should be ignored for relector.
+ * Range: -100 ppm (0x58F0) to +100 ppm (0x2710)
+ * Unit: 0.01 ppm
+ * Value: 0xFFFFC000 - Frequency offset is not available
+ */
+ int initiatorMeasuredFreqOffset = MEASURED_FREQ_OFFSET_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl
new file mode 100644
index 0000000..81da870
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/PctIQSample.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * I and Q sample data of PCT.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ *
+ * BT core defines the I and Q sample as following, they were converted to 2 integers here.
+ * ** bits 0 to 11 are the I sample with type sint12
+ * ** bits 12 to 23 are the Q sample with type sint12
+ */
+@VintfStability
+parcelable PctIQSample {
+ const int SAMPLE_UNAVAILABLE = 0xFFFFFFFF;
+
+ int iSample = SAMPLE_UNAVAILABLE;
+ int qSample = SAMPLE_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
new file mode 100644
index 0000000..e8b520a
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureAbortReason.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * Procedure abort reason of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum ProcedureAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ FILTERED_CHANNEL_MAP_LESS_THAN_15 = 0x02,
+ CHANNEL_MAP_UPDATE_INSTANT_PASSED = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
new file mode 100644
index 0000000..b97f394
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/ProcedureEnableConfig.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * LE CS Procedure Enable Complete data
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.43 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable ProcedureEnableConfig {
+ /**
+ * Antenna Configuration Index as described in [Vol 6] Part A, Section 5.3
+ * Value: 0x00 to 0x07
+ */
+ byte toneAntennaConfigSelection;
+ /**
+ * Duration for each CS subevent in microseconds
+ * Value: 1250 μs to 4 s
+ */
+ int subeventLenUs;
+ /**
+ * Number of CS subevents anchored off the same ACL connection event
+ * Value: 0x01 to 0x20
+ */
+ byte subeventsPerEvent;
+ /**
+ * Time between consecutive CS subevents anchored off the same ACL connection event.
+ * Unit: 0.625 ms
+ */
+ int subeventInterval;
+ /**
+ * Number of ACL connection events between consecutive CS event anchor points
+ */
+ int eventInterval;
+ /**
+ * Number of ACL connection events between consecutive CS procedure anchor points
+ */
+ int procedureInterval;
+ /**
+ * Number of CS procedures to be scheduled.
+ * Value: 0x0000 to 0xFFFF
+ * Value 0: CS procedures to continue until disabled
+ */
+ int procedureCount;
+ /**
+ * Maximum duration for each CS procedure
+ * Range: 0x0001 to 0xFFFF
+ * unit: 0.625 ms
+ * Time range: 0.625 ms to 40.959375 s
+ */
+ int maxProcedureLen;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
index 65907dd..0962527 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResult.aidl
@@ -17,6 +17,7 @@
package android.hardware.bluetooth.ranging;
import android.hardware.bluetooth.ranging.Nadm;
+import android.hardware.bluetooth.ranging.RangingResultStatus;
/**
* Generic structure to return the ranging result
@@ -90,4 +91,13 @@
* Parameter for vendors to place vendor-specific ranging results data.
*/
@nullable byte[] vendorSpecificCsRangingResultsData;
+ /**
+ * If the result is valid, for e.g. the result was gotten from an aborted procedure.
+ */
+ RangingResultStatus rangingResultStatus;
+ /**
+ * The timestamp of the first subevent with the measured procedure.
+ * see SubeventResultData#timestampNanos
+ */
+ long timestampNanos;
}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
new file mode 100644
index 0000000..b877af8
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RangingResultStatus.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.ranging;
+
+@VintfStability
+@Backing(type="byte")
+enum RangingResultStatus {
+ SUCCESS = 0x00,
+ /**
+ * The procedure of the initiator was aborted
+ */
+ FAIL_INITIATOR_ABORT = 0x01,
+ /**
+ * The procedure of the reflector was aborted
+ */
+ FAIL_REFLECTOR_ABORT = 0x02,
+ /**
+ * The procedure of both the initiator and the reflector were aborted
+ */
+ FAIL_BOTH_ABORT = 0x03,
+ FAIL_UNSPECIFIED = 0xFFu8,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl
new file mode 100644
index 0000000..c2a48e4
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/RttToaTodData.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * The ToA/ToD data for the initator or reflector.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+union RttToaTodData {
+ const int TOA_TOD_UNAVAILABLE = 0xFFFF8000;
+ /**
+ * Time difference in units of 0.5 nanoseconds between the time of arrival and
+ * the time of departure of the CS packets at the initiator during a CS step
+ * (16-bit signed integer, it had been converted to 'int' here), where the known
+ * nominal offsets are excluded.
+ * value: 0xFFFF8000 (0x8000 as signed 16-bit) - Time difference is not available
+ */
+ int toaTodInitiator = TOA_TOD_UNAVAILABLE;
+ /**
+ * Time difference in units of 0.5 nanoseconds between the time of departure
+ * and the time of arrival of the CS packets at the reflector during a CS step
+ * (16-bit signed integer, it had been converted to 'int' here), where the known
+ * nominal offsets are excluded.
+ * value: 0xFFFF8000 (0x8000 as signed 16-bit) - Time difference is not available
+ */
+ int todToaReflector = TOA_TOD_UNAVAILABLE;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl
new file mode 100644
index 0000000..4006415
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepData.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.ModeData;
+import android.hardware.bluetooth.ranging.ModeType;
+
+/**
+ * The data for a CS step of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable StepData {
+ /**
+ * CS channel index
+ * Value: 0x00 to 0x4E
+ */
+ byte stepChannel;
+ ModeType stepMode;
+ ModeData stepModeData;
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
index 4650861..af25a11 100644
--- a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/StepTonePct.aidl
@@ -20,6 +20,7 @@
/**
* Tone PCT data with quality indicator from a mode-2 or mode-3 step.
+ * @deprecated use ModeTwoData
*/
@VintfStability
parcelable StepTonePct {
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
new file mode 100644
index 0000000..bef87e8
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventAbortReason.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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.ranging;
+
+/**
+ * The subevent abort reason of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.42 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+@Backing(type="byte")
+enum SubeventAbortReason {
+ SUCCESS = 0x0,
+ LOCAL_OR_REMOTE_REQUEST = 0x01,
+ NO_CS_SYNC_RECEIVED = 0x02,
+ SCHEDULING_CONFLICTS_OR_LIMITED_RESOURCES = 0x03,
+ UNSPECIFIED = 0x0F,
+}
diff --git a/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl
new file mode 100644
index 0000000..102d217
--- /dev/null
+++ b/bluetooth/ranging/aidl/android/hardware/bluetooth/ranging/SubeventResultData.aidl
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2024 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.ranging;
+
+import android.hardware.bluetooth.ranging.StepData;
+import android.hardware.bluetooth.ranging.SubeventAbortReason;
+
+/**
+ * The subevent data within a CS procedure of Channel Sounding.
+ * See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 4, Part E 7.7.65.44 for details.
+ *
+ * Specification: https://www.bluetooth.com/specifications/specs/core60-html/
+ */
+@VintfStability
+parcelable SubeventResultData {
+ /**
+ * Starting ACL connection event counter for the results reported in the event
+ */
+ int startAclConnEventCounter;
+ const int FREQ_COMPENSATION_UNAVAILABLE = 0xFFFFC000;
+ /**
+ * Frequency compensation value in units of 0.01 ppm (15-bit signed integer, it had been
+ * converted as int here.)
+ * Unit: 0.01 ppm
+ * 0xFFFFC000 - Frequency compensation value is not available, or the role is not initiator
+ */
+ int frequencyCompensation = FREQ_COMPENSATION_UNAVAILABLE;
+ /**
+ * Reference power level
+ * Range: -127 to 20
+ * Unit: dBm
+ */
+ byte referencePowerLevelDbm;
+ /**
+ * 0x00 Ignored because phase measurement does not occur during the CS step
+ * 0x01 to 0x04 Number of antenna paths used during the phase measurement stage of the CS step
+ */
+ byte numAntennaPaths;
+ /**
+ * Indicates the abort reason
+ */
+ SubeventAbortReason subeventAbortReason;
+ /**
+ * The measured data for all steps
+ */
+ StepData[] stepData;
+ /**
+ * Timestamp when all subevent data are received by the host; Not defined by the spec.
+ * Using epoch time in nano seconds (e.g., 1697673127175).
+ */
+ long timestampNanos;
+}