From cb3c1de91895950b67295ddec04fa6927f459d8e Mon Sep 17 00:00:00 2001 From: Jin Chen Date: Wed, 28 Jun 2023 21:11:28 +0000 Subject: [PATCH] [uwb](hal) Add radar support * Adding radar session type, capabilities, oids, and app configs based on the Android UWB radar UCI spec v1.0. Test: Compile Bug: 237097302 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:db326d178686dd981dbb81804534b51502392ae2) Merged-In: Ia0b901859b38127db8532118f2427338fdf502a8 Change-Id: Ia0b901859b38127db8532118f2427338fdf502a8 --- .../UwbVendorCapabilityTlvTypes.aidl | 39 ++++--- .../UwbVendorCapabilityTlvValues.aidl | 26 +++-- .../fira_android/UwbVendorGidAndroidOids.aidl | 9 +- .../uwb/fira_android/UwbVendorGids.aidl | 2 +- .../UwbVendorRadarAppConfigTlvTypes.aidl | 49 ++++++++ .../UwbVendorRadarAppConfigTlvValues.aidl | 38 ++++++ .../fira_android/UwbVendorReasonCodes.aidl | 6 +- .../UwbVendorSessionAppConfigTlvTypes.aidl | 24 ++-- .../UwbVendorSessionAppConfigTlvValues.aidl | 2 +- .../UwbVendorSessionInitSessionType.aidl | 3 +- .../fira_android/UwbVendorStatusCodes.aidl | 8 +- .../hardware/uwb/fira_android/README.md | 3 - .../UwbVendorCapabilityTlvTypes.aidl | 10 ++ .../UwbVendorCapabilityTlvValues.aidl | 6 + .../fira_android/UwbVendorGidAndroidOids.aidl | 11 ++ .../UwbVendorRadarAppConfigTlvTypes.aidl | 110 ++++++++++++++++++ .../UwbVendorRadarAppConfigTlvValues.aidl | 29 +++++ .../UwbVendorSessionInitSessionType.aidl | 1 + 18 files changed, 317 insertions(+), 59 deletions(-) create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl create mode 100644 uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl create mode 100644 uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 25d704ecde..ff9c24752f 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -34,23 +34,24 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorCapabilityTlvTypes { - SUPPORTED_POWER_STATS_QUERY = 192, - CCC_SUPPORTED_CHAPS_PER_SLOT = 160, - CCC_SUPPORTED_SYNC_CODES = 161, - CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 162, - CCC_SUPPORTED_CHANNELS = 163, - CCC_SUPPORTED_VERSIONS = 164, - CCC_SUPPORTED_UWB_CONFIGS = 165, - CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166, - CCC_SUPPORTED_RAN_MULTIPLIER = 167, - CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 168, - CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 169, - SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227, - SUPPORTED_MIN_RANGING_INTERVAL_MS = 228, - SUPPORTED_RANGE_DATA_NTF_CONFIG = 229, - SUPPORTED_RSSI_REPORTING = 230, - SUPPORTED_DIAGNOSTICS = 231, - SUPPORTED_MIN_SLOT_DURATION_RSTU = 232, - SUPPORTED_MAX_RANGING_SESSION_NUMBER = 233, - SUPPORTED_CHANNELS_AOA = 234, + SUPPORTED_POWER_STATS_QUERY = 0xC0, + CCC_SUPPORTED_CHAPS_PER_SLOT = 0xA0, + CCC_SUPPORTED_SYNC_CODES = 0xA1, + CCC_SUPPORTED_HOPPING_CONFIG_MODES_AND_SEQUENCES = 0xA2, + CCC_SUPPORTED_CHANNELS = 0xA3, + CCC_SUPPORTED_VERSIONS = 0xA4, + CCC_SUPPORTED_UWB_CONFIGS = 0xA5, + CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 0xA6, + CCC_SUPPORTED_RAN_MULTIPLIER = 0xA7, + CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8, + CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + RADAR_SUPPORT = 0xB0, + SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xE3, + SUPPORTED_MIN_RANGING_INTERVAL_MS = 0xE4, + SUPPORTED_RANGE_DATA_NTF_CONFIG = 0xE5, + SUPPORTED_RSSI_REPORTING = 0xE6, + SUPPORTED_DIAGNOSTICS = 0xE7, + SUPPORTED_MIN_SLOT_DURATION_RSTU = 0xE8, + SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xE9, + SUPPORTED_CHANNELS_AOA = 0xEA, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 0e33f70221..702e5614ae 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -40,17 +40,19 @@ enum UwbVendorCapabilityTlvValues { PULSE_SHAPE_PRECURSOR_FREE = 1, PULSE_SHAPE_PRECURSOR_FREE_SPECIAL = 2, CHAPS_PER_SLOT_3 = 1, - CHAPS_PER_SLOT_4 = 2, - CHAPS_PER_SLOT_6 = 4, - CHAPS_PER_SLOT_8 = 8, - CHAPS_PER_SLOT_9 = 16, - CHAPS_PER_SLOT_12 = 32, - CHAPS_PER_SLOT_24 = 64, - HOPPING_SEQUENCE_DEFAULT = 16, - HOPPING_SEQUENCE_AES = 8, - HOPPING_CONFIG_MODE_NONE = 128, - HOPPING_CONFIG_MODE_CONTINUOUS = 64, - HOPPING_CONFIG_MODE_ADAPTIVE = 32, + CHAPS_PER_SLOT_4 = (1 << 1) /* 2 */, + CHAPS_PER_SLOT_6 = (1 << 2) /* 4 */, + CHAPS_PER_SLOT_8 = (1 << 3) /* 8 */, + CHAPS_PER_SLOT_9 = (1 << 4) /* 16 */, + CHAPS_PER_SLOT_12 = (1 << 5) /* 32 */, + CHAPS_PER_SLOT_24 = (1 << 6) /* 64 */, + HOPPING_SEQUENCE_DEFAULT = (1 << 4) /* 16 */, + HOPPING_SEQUENCE_AES = (1 << 3) /* 8 */, + HOPPING_CONFIG_MODE_NONE = (1 << 7) /* 128 */, + HOPPING_CONFIG_MODE_CONTINUOUS = (1 << 6) /* 64 */, + HOPPING_CONFIG_MODE_ADAPTIVE = (1 << 5) /* 32 */, CCC_CHANNEL_5 = 1, - CCC_CHANNEL_9 = 2, + CCC_CHANNEL_9 = (1 << 1) /* 2 */, + RADAR_NOT_SUPPORTED = 0, + RADAR_SWEEP_SAMPLES_SUPPORTED = 1, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index fbcfbff667..34bc4ec6a8 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -34,7 +34,10 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorGidAndroidOids { - ANDROID_GET_POWER_STATS = 0, - ANDROID_SET_COUNTRY_CODE = 1, - ANDROID_RANGE_DIAGNOSTICS = 2, + ANDROID_GET_POWER_STATS = 0x0, + ANDROID_SET_COUNTRY_CODE = 0x1, + ANDROID_RANGE_DIAGNOSTICS = 0x2, + RADAR_SET_APP_CONFIG = 0x11, + RADAR_GET_APP_CONFIG = 0x12, + RADAR_DATA_NTF = 0x13, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl index 5515c67961..f02ed70a65 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorGids.aidl @@ -34,5 +34,5 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorGids { - ANDROID = 12, + ANDROID = 0xC, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl new file mode 100644 index 0000000000..760166c3a4 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl @@ -0,0 +1,49 @@ +/* + * Copyright (C) 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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorRadarAppConfigTlvTypes { + RADAR_TIMING_PARAMS = 0x0, + SAMPLES_PER_SWEEP = 0x1, + RADAR_CHANNEL_NUMBER = 0x2, + SWEEP_OFFSET = 0x3, + RADAR_RFRAME_CONFIG = 0x4, + RADAR_PREAMBLE_DURATION = 0x5, + RADAR_PREAMBLE_CODE_INDEX = 0x6, + RADAR_SESSION_PRIORITY = 0x7, + BITS_PER_SAMPLE = 0x8, + RADAR_PRF_MODE = 0x9, + NUMBER_OF_BURSTS = 0xA, + RADAR_DATA_TYPE = 0xB, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl new file mode 100644 index 0000000000..1eb2ce93a7 --- /dev/null +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl @@ -0,0 +1,38 @@ +/* + * Copyright (C) 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.uwb.fira_android; +@Backing(type="int") @VintfStability +enum UwbVendorRadarAppConfigTlvValues { + RADAR_DATA_TYPE_RADAR_SWEEP_SAMPLES = 0x0, +} diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl index a438cbe16a..db1e0db460 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorReasonCodes.aidl @@ -34,7 +34,7 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorReasonCodes { - REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 128, - REASON_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 129, - REASON_REGULATION_UWB_OFF = 130, + REASON_ERROR_INVALID_CHANNEL_WITH_AOA = 0x80, + REASON_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x81, + REASON_REGULATION_UWB_OFF = 0x82, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl index c3ac4019a2..d02cf4da1a 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl @@ -34,16 +34,16 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionAppConfigTlvTypes { - CCC_HOP_MODE_KEY = 160, - CCC_UWB_TIME0 = 161, - CCC_RANGING_PROTOCOL_VER = 163, - CCC_UWB_CONFIG_ID = 164, - CCC_PULSESHAPE_COMBO = 165, - CCC_URSK_TTL = 166, - CCC_LAST_INDEX_USED = 168, - NB_OF_RANGE_MEASUREMENTS = 227, - NB_OF_AZIMUTH_MEASUREMENTS = 228, - NB_OF_ELEVATION_MEASUREMENTS = 229, - ENABLE_DIAGNOSTICS = 232, - DIAGRAMS_FRAME_REPORTS_FIELDS = 233, + CCC_HOP_MODE_KEY = 0xA0, + CCC_UWB_TIME0 = 0xA1, + CCC_RANGING_PROTOCOL_VER = 0xA3, + CCC_UWB_CONFIG_ID = 0xA4, + CCC_PULSESHAPE_COMBO = 0xA5, + CCC_URSK_TTL = 0xA6, + CCC_LAST_INDEX_USED = 0xA8, + NB_OF_RANGE_MEASUREMENTS = 0xE3, + NB_OF_AZIMUTH_MEASUREMENTS = 0xE4, + NB_OF_ELEVATION_MEASUREMENTS = 0xE5, + ENABLE_DIAGNOSTICS = 0xE8, + DIAGRAMS_FRAME_REPORTS_FIELDS = 0xE9, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl index a7f487bcd2..5216e1f135 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvValues.aidl @@ -34,5 +34,5 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionAppConfigTlvValues { - AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 240, + AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 0xF0, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl index 30a0a1b98f..bf968bda7f 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl @@ -34,5 +34,6 @@ package android.hardware.uwb.fira_android; @Backing(type="int") @VintfStability enum UwbVendorSessionInitSessionType { - CCC = 160, + CCC = 0xA0, + RADAR = 0xA1, } diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl index 28cf7fe1f3..52f13505ab 100644 --- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl +++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorStatusCodes.aidl @@ -34,8 +34,8 @@ package android.hardware.uwb.fira_android; @Backing(type="byte") @VintfStability enum UwbVendorStatusCodes { - STATUS_ERROR_CCC_SE_BUSY = 80, - STATUS_ERROR_CCC_LIFECYCLE = 81, - STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 82, - STATUS_REGULATION_UWB_OFF = 83, + STATUS_ERROR_CCC_SE_BUSY = 0x50, + STATUS_ERROR_CCC_LIFECYCLE = 0x51, + STATUS_ERROR_STOPPED_DUE_TO_OTHER_SESSION_CONFLICT = 0x52, + STATUS_REGULATION_UWB_OFF = 0x53, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/README.md b/uwb/aidl/android/hardware/uwb/fira_android/README.md index e658d934aa..7912bbc311 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/README.md +++ b/uwb/aidl/android/hardware/uwb/fira_android/README.md @@ -10,6 +10,3 @@ These include: All other interactions sent/received over the HAL interface is expected to comply with the UCI specification that can be found [here]( https://groups.firaconsortium.org/wg/Technical/document/folder/127). - -TODO([b/196004116](b/196004116)): Link to the published specification. - diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl index 22b7bfeedf..ceef1befee 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl @@ -149,6 +149,16 @@ enum UwbVendorCapabilityTlvTypes { */ CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9, + /********************************************* + * RADAR specific + ********************************************/ + /** + * 1 byte bitmask to indicate the supported Radar data types. + * Each "1" in this bitmap corresponds to a specific radar data type where: + * 0x01 = "Radar Sweep Samples", + */ + RADAR_SUPPORT = 0xB0, + /********************************************* * FIRA specific ********************************************/ diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl index 7c86b79327..6ef52fe5ec 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvValues.aidl @@ -51,4 +51,10 @@ enum UwbVendorCapabilityTlvValues { CCC_CHANNEL_5 = 1, CCC_CHANNEL_9 = 1 << 1, + + /********************************************* + * RADAR specific + ********************************************/ + RADAR_NOT_SUPPORTED = 0, + RADAR_SWEEP_SAMPLES_SUPPORTED = 1, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl index 4768f550b8..203b940ccc 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorGidAndroidOids.aidl @@ -37,4 +37,15 @@ enum UwbVendorGidAndroidOids { // Supported only if the UwbVendorCapabilityTlvTypes.SUPPORTED_DIAGNOSTICS set // to 1. ANDROID_RANGE_DIAGNOSTICS = 0x2, + + /********************************************* + * Range 0x10 - 0x1F reserved for RADAR specific + * Supported only if the UwbVendorCapabilityTlvTypes.RADAR_SUPPORT is not 0x00. + ********************************************/ + // Used to set application configurations for radar session. + RADAR_SET_APP_CONFIG = 0x11, + // Used to get application configurations for radar session. + RADAR_GET_APP_CONFIG = 0x12, + // Used to report radar data for certain radar data types. + RADAR_DATA_NTF = 0x13, } diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl new file mode 100644 index 0000000000..a5ea688790 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvTypes.aidl @@ -0,0 +1,110 @@ +/* + * Copyright (C) 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.uwb.fira_android; + +/** + * Android specific radar app params set/expected in UCI command: + * GID: 1100b (Android specific Group) + * OID: 010001b (RADAR_SET_APP_CONFIG_CMD) + * OID: 010010b (RADAR_GET_APP_CONFIG_CMD) + */ +@VintfStability +@Backing(type="int") +enum UwbVendorRadarAppConfigTlvTypes { + /** + * 7 byte data + * Radar frame timing parameters: + * Octet [3:0] - BURST_PERIOD + * Duration between the start of two consecutive Radar bursts in ms. + * Octet [5:4] - SWEEP_PERIOD + * Duration between the start times of two consecutive Radar sweeps in + * RSTU. + * Octet [6] - SWEEPS_PER_BURST + * Number of Radar sweeps within the Radar burst. + */ + RADAR_TIMING_PARAMS = 0x0, + /** + * 1 byte data + * The number of samples captured for each radar sweep. (default = 64) + */ + SAMPLES_PER_SWEEP = 0x1, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 9) + */ + RADAR_CHANNEL_NUMBER = 0x2, + /** + * 2 byte data + * Defines the start offset with respect to 0cm distance to limit the sweep + * range. Signed value and unit in samples. + * (default = 0) + */ + SWEEP_OFFSET = 0x3, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 0x0) + */ + RADAR_RFRAME_CONFIG = 0x4, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config, but extended to 0xA. + * (default = 0x2 : 128 symbols) + */ + RADAR_PREAMBLE_DURATION = 0x5, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config, but extended to 127. + * (default = 25) + */ + RADAR_PREAMBLE_CODE_INDEX = 0x6, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 50) + */ + RADAR_SESSION_PRIORITY = 0x7, + /** + * 1 byte data + * Bits per sample in the radar sweep. + * 0x00 = 32 bits per sample (default) + * 0x01 = 48 bits per sample + * 0x02 = 64 bits per sample + */ + BITS_PER_SAMPLE = 0x8, + /** + * 1 byte data + * Same as in FiRa UCI Session App Config. + * (default = 0x1) + */ + RADAR_PRF_MODE = 0x9, + /** + * 2 byte data + * Maximum number of Radar bursts to be executed in the session. The + * session is stopped and moved to SESSION_STATE_IDLE Session State when + * configured radar bursts are elapsed. + * 0x00 = Unlimited (default) + */ + NUMBER_OF_BURSTS = 0xA, + /** + * 2 byte data + * Type of radar data to be reported. + * 0x00: Radar Sweep Samples. Reported in RADAR_DATA_NTF. (default) + */ + RADAR_DATA_TYPE = 0xB, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl new file mode 100644 index 0000000000..81c0a4d936 --- /dev/null +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorRadarAppConfigTlvValues.aidl @@ -0,0 +1,29 @@ +/* + * Copyright (C) 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.uwb.fira_android; + +/** + * Android specific radar app config values set/expected in UCI command: + * GID: 1100b (Android specific Group) + * OID: 010001b (RADAR_SET_APP_CONFIG_CMD) + * OID: 010010b (RADAR_GET_APP_CONFIG_CMD) + */ +@VintfStability +@Backing(type="int") +enum UwbVendorRadarAppConfigTlvValues { + RADAR_DATA_TYPE_RADAR_SWEEP_SAMPLES = 0x0, +} diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl index 1e2c817d84..d3df67216b 100644 --- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl +++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionInitSessionType.aidl @@ -29,4 +29,5 @@ package android.hardware.uwb.fira_android; enum UwbVendorSessionInitSessionType { /** Added in vendor version 0. */ CCC = 0xA0, + RADAR = 0xA1, }