summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-22 00:19:05 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-11-22 00:19:05 +0000
commit11369306d0398ca3c52bc1786b1fbf136b3a908b (patch)
tree840aac3de080789b4988fb673f2a0d762075ef66
parent029f65b7a25c5fa6a4d6162d6fdbc2d7e6dd3400 (diff)
parent51965592a8b8bd4c4398d3cb99d161914ace3860 (diff)
downloaduwb-android14-qpr2-s3-release.tar.gz
Change-Id: I5413185585c285eed6a276722aa3b0868c93dc27
-rw-r--r--halimpl/config/README.md22
-rw-r--r--halimpl/utils/phNxpConfig.cc23
2 files changed, 36 insertions, 9 deletions
diff --git a/halimpl/config/README.md b/halimpl/config/README.md
index 678a00a..de62154 100644
--- a/halimpl/config/README.md
+++ b/halimpl/config/README.md
@@ -68,6 +68,8 @@ Main configuration can specifies additional extra calibrations with *EXTRA_CONF_
* *EXTRA_CONF_PATH[N+1]* has higher priority over *EXTRA_CONF_PATH[N]*.
* if the file path has `<country>` in it, `<country>` part will be replaced with country code (or region string)
+* if the file path has `<sku>` in it, `<sku>` part will be replace with the 'persist.vendor.uwb.cal.sku' property value.
+ if `persist.vendor.uwb.cal.sku` is unspecified, HAL will try to use `defaultsku` as a default.
Example:
@@ -75,8 +77,9 @@ Example:
# /vendor/etc/libuwb-nxp.conf:
EXTRA_CONF_PATH_1="/vendor/etc/uwb/cal-base.conf"
-EXTRA_CONF_PATH_2="/vendor/etc/uwb/cal-<country>.conf"
-EXTRA_CONF_PATH_3="/mnt/vendor/persist/uwb/cal-factory.conf"
+EXTRA_CONF_PATH_2="/vendor/etc/uwb/cal-<sku>.conf"
+EXTRA_CONF_PATH_3="/vendor/etc/uwb/cal-<country>.conf"
+EXTRA_CONF_PATH_4="/mnt/vendor/persist/uwb/cal-factory.conf"
```
#### Region mapping
@@ -160,8 +163,9 @@ Per-country, Enable DC supression. Default is 0.
REGION_MAP_PATH="/vendor/etc/uwb/regions.conf"
EXTRA_CONF_PATH_1="/vendor/etc/uwb/cal-base.conf"
-EXTRA_CONF_PATH_2="/vendor/etc/uwb/cal-<country>.conf"
-EXTRA_CONF_PATH_3="/mnt/vendor/persist/uwb/cal-factory.conf"
+EXTRA_CONF_PATH_2="/vendor/etc/uwb/cal-<sku>.conf"
+EXTRA_CONF_PATH_3="/vendor/etc/uwb/cal-<country>.conf"
+EXTRA_CONF_PATH_4="/mnt/vendor/persist/uwb/cal-factory.conf"
# /vendor/etc/uwb/cal-base.conf:
cal.rx_antenna_mask=0x03
@@ -169,6 +173,16 @@ cal.tx_antenna_mask=0x01
cal.otp.xtal=1
cal.restricted_channels=0
+# /vendor/etc/uwb/cal-defaultsku.conf:
+# effective when persist.vendor.uwb.cal.sku is unspecified
+cal.ant1.ch5.tx_power={01, 00, 02, 00}
+cal.ant1.ch9.tx_power={01, 00, 03, 00}
+
+# /vendor/etc/uwb/cal-modelA.conf:
+# effective when persist.vendor.uwb.cal.sku=modelA
+cal.ant1.ch5.tx_power={01, 00, 12, 00}
+cal.ant1.ch9.tx_power={01, 00, 13, 00}
+
# /vendor/etc/uwb/cal-FCC.conf:
cal.restricted_channel=0x0
diff --git a/halimpl/utils/phNxpConfig.cc b/halimpl/utils/phNxpConfig.cc
index e1aa9a8..8f084c1 100644
--- a/halimpl/utils/phNxpConfig.cc
+++ b/halimpl/utils/phNxpConfig.cc
@@ -41,10 +41,15 @@
#include "phNxpUciHal_utils.h"
#include "phNxpLog.h"
-const char default_nxp_config_path[] = "/vendor/etc/libuwb-nxp.conf";
-const char country_code_config_name[] = "libuwb-countrycode.conf";
-const char country_code_specifier[] = "<country>";
-const char nxp_uci_config_file[] = "libuwb-uci.conf";
+static const char default_nxp_config_path[] = "/vendor/etc/libuwb-nxp.conf";
+static const char country_code_config_name[] = "libuwb-countrycode.conf";
+static const char nxp_uci_config_file[] = "libuwb-uci.conf";
+
+static const char country_code_specifier[] = "<country>";
+static const char sku_specifier[] = "<sku>";
+
+static const char prop_name_calsku[] = "persist.vendor.uwb.cal.sku";
+static const char prop_default_calsku[] = "defaultsku";
using namespace::std;
@@ -403,7 +408,15 @@ CUwbNxpConfig::CUwbNxpConfig(const char *filepath) :
mFilePath(filepath),
mCountrySpecific(false)
{
- auto pos = mFilePath.find(country_code_specifier);
+ auto pos = mFilePath.find(sku_specifier);
+ if (pos != string::npos) {
+ char prop_str[PROPERTY_VALUE_MAX];
+ property_get(prop_name_calsku, prop_str,prop_default_calsku);
+ mFilePath.replace(pos, strlen(sku_specifier), prop_str);
+ }
+
+ // country specifier will be evaluated later in setCountry() path
+ pos = mFilePath.find(country_code_specifier);
if (pos == string::npos) {
mCurrentFile = mFilePath;
readConfig();