uwb: add uwb country conf script am: 8ace0817c9
Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs101/+/15853837 Change-Id: I7ee8a7239bc4e4e3c735ce0ca8e583598c72bf24
This commit is contained in:
commit
b32cdd7293
2 changed files with 60 additions and 0 deletions
39
uwb/calibration/country_conf_gen.sh
Executable file
39
uwb/calibration/country_conf_gen.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script is used to generate uwb conuntry configuration file,
|
||||||
|
# and the PRODUCT_COPY_FILES list in uwb.mk based on uwb_country.conf
|
||||||
|
# Bug: 196073172
|
||||||
|
|
||||||
|
project=("r4" "p7")
|
||||||
|
count=1
|
||||||
|
|
||||||
|
while read line ; do
|
||||||
|
if [[ "$line" =~ ^"*" ]]; then
|
||||||
|
header=${line:1}
|
||||||
|
elif [[ "$line" =~ ^"\"" ]]; then
|
||||||
|
line=$(echo ${line/,} | tr -d "\"")
|
||||||
|
country[count]=$(echo $line | cut -d ':' -f1)
|
||||||
|
code[count]=$(echo $line | cut -d ':' -f2 | tr -d " ")
|
||||||
|
|
||||||
|
for var in ${project[@]}; do
|
||||||
|
if [ "$header" = "restricted_channels=0x20" ]; then
|
||||||
|
echo "alternate_pulse_shape=0x01" > UWB-calibration-${code[$count]}.conf.$var
|
||||||
|
echo "$header" >> UWB-calibration-${code[$count]}.conf.$var
|
||||||
|
else
|
||||||
|
echo "$header" > UWB-calibration-${code[$count]}.conf.$var
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
((count++))
|
||||||
|
done < uwb_country.conf
|
||||||
|
|
||||||
|
for var in ${project[@]}; do
|
||||||
|
echo "============== $var =============="
|
||||||
|
for var2 in ${code[@]}; do
|
||||||
|
if [ "$var2" = "${code[-1]}" ]; then
|
||||||
|
echo "\$(LOCAL_UWB_CAL_DIR)/UWB-calibration-$var2.conf.$var:\$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-$var2.conf"
|
||||||
|
else
|
||||||
|
echo "\$(LOCAL_UWB_CAL_DIR)/UWB-calibration-$var2.conf.$var:\$(TARGET_COPY_OUT_VENDOR)/etc/UWB-calibration-$var2.conf \\"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
21
uwb/calibration/uwb_country.conf
Normal file
21
uwb/calibration/uwb_country.conf
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
*restricted_channels=0xffff
|
||||||
|
"Argentina": "ar",
|
||||||
|
"Armenia": "am",
|
||||||
|
"Azerbaijan": "az",
|
||||||
|
"Belarus": "by",
|
||||||
|
"Indonesia": "id",
|
||||||
|
"Kazakhstan": "kz",
|
||||||
|
"Kyrgyzstan": "kg",
|
||||||
|
"Nepal": "np",
|
||||||
|
"Pakistan": "pk",
|
||||||
|
"Paraguay": "py",
|
||||||
|
"Russia": "ru",
|
||||||
|
"Solomon Islands": "sb",
|
||||||
|
"Tajikistan": "tj",
|
||||||
|
"Turkmenistanr": "tm",
|
||||||
|
"Ukraine": "ua",
|
||||||
|
"Uzbekistan": "uz"
|
||||||
|
|
||||||
|
*restricted_channels=0x20
|
||||||
|
"Japan": "jp",
|
||||||
|
"Taiwan": "tw"
|
Loading…
Add table
Add a link
Reference in a new issue