Simplify lcid collection
This commit is contained in:
parent
42fc435db5
commit
bf539bd5e1
2 changed files with 1 additions and 23 deletions
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
rm -f /tmp/logread.txt
|
||||
|
||||
logread -f > /tmp/logread.txt &
|
||||
LOGREAD_PID=$!
|
||||
|
||||
mmcli -m 0 --command="AT+CREG?" > /dev/null
|
||||
kill -9 ${LOGREAD_PID}
|
||||
|
||||
ATRES=$(grep -Eo '\+CREG: [0-9],[0-9],"[0-9A-F]+","[0-9A-F]+"' /tmp/logread.txt)
|
||||
rm -f /tmp/logread.txt
|
||||
|
||||
echo $ATRES | cut -d, -f4 | grep -Eo '[0-9A-F]+'
|
|
@ -8,16 +8,7 @@ RES=$(mmcli -m 0 --signal-get -K)
|
|||
RSRQ=$(echo -en "$RES" | grep modem.signal.lte.rsrq | grep -Eo "\-?[0-9]*.[0-9]*$")
|
||||
RSRP=$(echo -en "$RES" | grep modem.signal.lte.rsrp | grep -Eo "\-?[0-9]*.[0-9]*$")
|
||||
SNR=$(echo -en "$RES" | grep modem.signal.lte.snr | grep -Eo "\-?[0-9]*.[0-9]*$")
|
||||
|
||||
# Run AT Command to get LCID not reported by MM
|
||||
rm -f /tmp/logread.txt
|
||||
logread -f > /tmp/logread.txt &
|
||||
LOGREAD_PID=$!
|
||||
mmcli -m 0 --command="AT+CREG?" > /dev/null
|
||||
kill -9 ${LOGREAD_PID}
|
||||
ATRES=$(grep -Eo '\+CREG: [0-9],[0-9],"[0-9A-F]+","[0-9A-F]+"' /tmp/logread.txt)
|
||||
rm -f /tmp/logread.txt
|
||||
LCID=$(echo $ATRES | cut -d, -f4 | grep -Eo '[0-9A-F]+')
|
||||
LCID=$(qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-info|grep 'Cell ID: '|grep -o '\d*')
|
||||
|
||||
# Display parsed data
|
||||
echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID"
|
||||
|
|
Loading…
Reference in a new issue