Sync Changes with development-SDXPINN

-Updated QuecManager to 0.0.2 from PR #87

- Change-log:

https: //github.com/iamromulan/quectel-rgmii-toolkit/pull/87
Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
iamromulan
2024-10-11 14:35:17 -04:00
parent 28c39a4829
commit be9ee7def5
27 changed files with 3156 additions and 436 deletions

View File

@@ -0,0 +1,60 @@
#!/bin/sh
echo "Content-type: application/json"
echo ""
CONFIG_FILE="/etc/quecmanager/cell_lock_config.txt"
if [ ! -f "$CONFIG_FILE" ]; then
echo '{"status": "error", "message": "No cell lock configurations found", "configurations": {}}'
exit 0
fi
# Function to read config values
get_config_value() {
local key=$1
local value=$(grep "^$key=" "$CONFIG_FILE" | sed "s/^$key=//")
# Remove any trailing whitespace or comments
value=$(echo "$value" | sed 's/[[:space:]]*#.*$//' | sed 's/[[:space:]]*$//')
echo "$value"
}
# Read LTE configuration values
earfcn1=$(get_config_value "earfcn1")
pci1=$(get_config_value "pci1")
earfcn2=$(get_config_value "earfcn2")
pci2=$(get_config_value "pci2")
earfcn3=$(get_config_value "earfcn3")
pci3=$(get_config_value "pci3")
# Read 5G-SA configuration values
nrarfcn=$(get_config_value "nrarfcn")
nrpci=$(get_config_value "nrpci")
scs=$(get_config_value "scs")
band=$(get_config_value "band")
# Debug output to syslog
logger "fetch-cell-lock: earfcn1=$earfcn1 pci1=$pci1 nrarfcn=$nrarfcn nrpci=$nrpci"
# Construct JSON response
cat << EOF
{
"status": "success",
"configurations": {
"lte": {
"earfcn1": "${earfcn1:-}",
"pci1": "${pci1:-}",
"earfcn2": "${earfcn2:-}",
"pci2": "${pci2:-}",
"earfcn3": "${earfcn3:-}",
"pci3": "${pci3:-}"
},
"sa": {
"nrarfcn": "${nrarfcn:-}",
"nrpci": "${nrpci:-}",
"scs": "${scs:-}",
"band": "${band:-}"
}
}
}
EOF