uwb(hal): Add a capabilities mechanism for vendor commands
For the vendor commands defined for Android, allow UWB chip vendors to
optionally expose some of the features defined in a given version.
Without this mechanism, any vendor commands added has to be supported by
all chip vendors unconditionally (which may not be feasible based on
hardware capabilities).
Bug: 197886322
Test: Compiles
Change-Id: I917f2dc0d203ba9304f58955ac3cdb9d1735106c
diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp
index fe64fa7..10dbdb6 100644
--- a/uwb/aidl/default/uwb_chip.cpp
+++ b/uwb/aidl/default/uwb_chip.cpp
@@ -17,7 +17,8 @@
#include "uwb.h"
namespace {
-constexpr static int kVendorUciVersion = 1;
+constexpr static int32_t kAndroidUciVersion = 1;
+constexpr static int64_t kAndroidCapabilities = 0;
}
namespace android {
@@ -50,8 +51,13 @@
return ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus UwbChip::getSupportedVendorUciVersion(int32_t* version) {
- *version = kVendorUciVersion;
+::ndk::ScopedAStatus UwbChip::getSupportedAndroidUciVersion(int32_t* version) {
+ *version = kAndroidUciVersion;
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus UwbChip::getSupportedAndroidCapabilities(int64_t* capabilities) {
+ *capabilities = kAndroidCapabilities;
return ndk::ScopedAStatus::ok();
}