device_google_pantah/uwb/country_conf_gen.sh
Rex Lin dd2c9ef82f uwb: update country conf file for C10
- update script for restricted channels
- set UWB-calibration_fcc.conf as UWB-calibration.conf which will served as default and unknown configuration

Bug: 240199018
Test: Verified with local build
Signed-off-by: Rex Lin <rexcylin@google.com>
Change-Id: I2dc2e2c57ab145afcdd0c2fd50682f5d8ee5ba2b
2022-08-29 23:04:46 +00:00

31 lines
1.2 KiB
Bash
Executable file

#!/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, 233619860
count=1
mkdir -p $2
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 | tr -d "\"")
code[count]=$(echo $line | cut -d ':' -f2 | tr -d "\"" | tr -d " ")
if [ "$header" = "FCC" ]; then
cp $1/UWB-calibration-fcc.conf $2/UWB-calibration-${code[$count]}.conf
elif [ "$header" = "CE" ]; then
cp $1/UWB-calibration-ce.conf $2/UWB-calibration-${code[$count]}.conf
elif [ "$header" = "JP" ]; then
cp $1/UWB-calibration-jp.conf $2/UWB-calibration-${code[$count]}.conf
elif [ "$header" = "TW" ]; then
cp $1/UWB-calibration-tw.conf $2/UWB-calibration-${code[$count]}.conf
elif [ "$header" = "Restricted" ]; then
cp $1/UWB-calibration-restricted.conf $2/UWB-calibration-${code[$count]}.conf
fi
fi
((count++))
done < $1/uwb_country.conf