diff --git a/bluetooth/ranging/OWNERS b/bluetooth/ranging/OWNERS index 3d95624586..88a91eab80 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 d0d1b900a2..4096669c7e 100644 --- a/bluetooth/ranging/aidl/Android.bp +++ b/bluetooth/ranging/aidl/Android.bp @@ -42,6 +42,6 @@ aidl_interface { 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 e8fefbe638..03a7d24830 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 @@ parcelable BluetoothChannelSoundingParameters { 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 0000000000..70bed88422 --- /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 -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 0000000000..78bbbc1f43 --- /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 -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 8fc77aec31..64aabec66c 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 0000000000..ef4facc63b --- /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 -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 172ac5e9e8..b86994ed27 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 4d5ac213ee..c3d5d91cf3 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 c9ac99181b..bd07cd0b59 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 @@ parcelable Config { 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 0000000000..9611f139f8 --- /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 -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 004a48299e..19b949f485 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 @@ package android.hardware.bluetooth.ranging; 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 9f691b4710..99418bce46 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 @@ interface IBluetoothChannelSoundingSession { 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 0000000000..6fdfffe7b9 --- /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 -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 0000000000..698dd63ac0 --- /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 -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 0000000000..1aa928b863 --- /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 -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 0000000000..c07b0c0469 --- /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 -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 0000000000..f94f3d1ef0 --- /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 -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 0000000000..a15b579326 --- /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 -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 0000000000..ead7ceba4f --- /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 -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 0000000000..11030bb50e --- /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 -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 d092b80628..ccac70b2bf 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 @@ parcelable RangingResult { 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 0000000000..cdf8ed2f05 --- /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 -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 0000000000..496ccb2538 --- /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 -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 0000000000..cdebc8eeb9 --- /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 -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 412574856e..02d54135dc 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 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 0000000000..a3bb366d39 --- /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 -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 0000000000..3a7c3934d5 --- /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 -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 0cda847311..fbc0165f1f 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 @@ parcelable BluetoothChannelSoundingParameters { 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 0000000000..558f68b647 --- /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 0000000000..6fd71aa259 --- /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 78ce4f4925..f06af0f3cf 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 @@ import android.hardware.bluetooth.ranging.ModeType; * 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 0000000000..2c51abe611 --- /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 9c4b47250b..75f0b670de 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 @@ import android.hardware.bluetooth.ranging.StepTonePct; * 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 5253d9fb8b..8d59934b6f 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 85ae4c123d..95817b53f5 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 @@ parcelable Config { * 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 0000000000..c7fe8a6b42 --- /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 45ec79f31e..283f588e8a 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 @@ interface IBluetoothChannelSounding { * * @return CsSecurityLevel that indicates max supported security level of CS for ranging * algorithms. + * @deprecated use getSupportedCsSecurityLevels() instead */ CsSecurityLevel getMaxSupportedCsSecurityLevel(); @@ -63,4 +64,13 @@ interface IBluetoothChannelSounding { @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 97b147e8ca..b87024eaed 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 @@ interface IBluetoothChannelSoundingSession { * 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 0000000000..99199d2f3a --- /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 0000000000..51e8c7042b --- /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 0000000000..a70d371850 --- /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 0000000000..b360c903cf --- /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 0000000000..6f326d1d70 --- /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 0000000000..81da870af9 --- /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 0000000000..e8b520aae0 --- /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 0000000000..b97f394386 --- /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 65907dd4fa..0962527538 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 @@ parcelable RangingResult { * 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 0000000000..b877af81f8 --- /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 0000000000..c2a48e453f --- /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 0000000000..40064155df --- /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 46508614ee..af25a1117b 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 @@ import android.hardware.bluetooth.ranging.ComplexNumber; /** * 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 0000000000..bef87e857a --- /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 0000000000..102d2171ae --- /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; +} diff --git a/bluetooth/ranging/aidl/default/Android.bp b/bluetooth/ranging/aidl/default/Android.bp index 5072a43141..0912a4fae3 100644 --- a/bluetooth/ranging/aidl/default/Android.bp +++ b/bluetooth/ranging/aidl/default/Android.bp @@ -14,7 +14,7 @@ cc_binary { "service.cpp", ], shared_libs: [ - "android.hardware.bluetooth.ranging-V1-ndk", + "android.hardware.bluetooth.ranging-V2-ndk", "libbase", "libbinder_ndk", "libhidlbase", diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp index 3807d4f8f3..e2a8693d45 100644 --- a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp +++ b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.cpp @@ -55,4 +55,11 @@ ndk::ScopedAStatus BluetoothChannelSounding::openSession( *_aidl_return = session; return ::ndk::ScopedAStatus::ok(); } + +ndk::ScopedAStatus BluetoothChannelSounding::getSupportedCsSecurityLevels( + std::vector* _aidl_return) { + std::vector supported_security_levels = {}; + *_aidl_return = supported_security_levels; + return ::ndk::ScopedAStatus::ok(); +} } // namespace aidl::android::hardware::bluetooth::ranging::impl diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h index d6b5c03112..43232fa778 100644 --- a/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h +++ b/bluetooth/ranging/aidl/default/BluetoothChannelSounding.h @@ -47,6 +47,8 @@ class BluetoothChannelSounding : public BnBluetoothChannelSounding { const std::shared_ptr& in_callback, std::shared_ptr* _aidl_return) override; + ndk::ScopedAStatus getSupportedCsSecurityLevels( + std::vector* _aidl_return) override; }; } // namespace aidl::android::hardware::bluetooth::ranging::impl diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp index 6c58a07f80..bfdd5b6727 100644 --- a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp +++ b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.cpp @@ -52,4 +52,20 @@ ndk::ScopedAStatus BluetoothChannelSoundingSession::close(Reason in_reason) { callback_->onClose(in_reason); return ::ndk::ScopedAStatus::ok(); } +ndk::ScopedAStatus BluetoothChannelSoundingSession::writeProcedureData( + const ChannelSoundingProcedureData& /*in_procedureData*/) { + return ::ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus BluetoothChannelSoundingSession::updateChannelSoundingConfig( + const Config& /*in_config*/) { + return ::ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus BluetoothChannelSoundingSession::updateProcedureEnableConfig( + const ProcedureEnableConfig& /*in_procedureEnableConfig*/) { + return ::ndk::ScopedAStatus::ok(); +} +ndk::ScopedAStatus BluetoothChannelSoundingSession::updateBleConnInterval( + int /*in_bleConnInterval*/) { + return ::ndk::ScopedAStatus::ok(); +} } // namespace aidl::android::hardware::bluetooth::ranging::impl diff --git a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h index 6703f7fe9b..ae66c7c592 100644 --- a/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h +++ b/bluetooth/ranging/aidl/default/BluetoothChannelSoundingSession.h @@ -22,6 +22,10 @@ namespace aidl::android::hardware::bluetooth::ranging::impl { using ::aidl::android::hardware::bluetooth::ranging::ChannelSoudingRawData; +using ::aidl::android::hardware::bluetooth::ranging:: + ChannelSoundingProcedureData; +using ::aidl::android::hardware::bluetooth::ranging::Config; +using ::aidl::android::hardware::bluetooth::ranging::ProcedureEnableConfig; using ::aidl::android::hardware::bluetooth::ranging::Reason; using ::aidl::android::hardware::bluetooth::ranging::ResultType; using ::aidl::android::hardware::bluetooth::ranging::VendorSpecificData; @@ -42,6 +46,13 @@ class BluetoothChannelSoundingSession ndk::ScopedAStatus writeRawData( const ChannelSoudingRawData& in_rawData) override; ndk::ScopedAStatus close(Reason in_reason) override; + ndk::ScopedAStatus writeProcedureData( + const ChannelSoundingProcedureData& in_procedureData) override; + ndk::ScopedAStatus updateChannelSoundingConfig( + const Config& in_config) override; + ndk::ScopedAStatus updateProcedureEnableConfig( + const ProcedureEnableConfig& in_procedureEnableConfig) override; + ndk::ScopedAStatus updateBleConnInterval(int in_bleConnInterval) override; private: std::shared_ptr callback_; diff --git a/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml b/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml index fe3613dfbc..87adf2c437 100644 --- a/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml +++ b/bluetooth/ranging/aidl/default/bluetooth-ranging-service-default.xml @@ -1,7 +1,7 @@ android.hardware.bluetooth.ranging - 1 + 2 IBluetoothChannelSounding/default diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml index 9e4a6c3136..e019902e9f 100644 --- a/compatibility_matrices/compatibility_matrix.202504.xml +++ b/compatibility_matrices/compatibility_matrix.202504.xml @@ -132,7 +132,7 @@ android.hardware.bluetooth.ranging - 1 + 1-2 IBluetoothChannelSounding default