forked from immortalwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tianling Shen <[email protected]> (cherry picked from commit cc212ef)
- Loading branch information
1 parent
ce0948b
commit b79a919
Showing
11 changed files
with
203 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
# | ||
# (c) 2022-2024 Cezary Jackiewicz <[email protected]> | ||
# | ||
# (c) 2022-2024 modified by Rafał Wabik - IceG - From eko.one.pl forum | ||
# | ||
|
||
hextobands() { | ||
BANDS="" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
_DEVICE=/dev/ttyUSB2 | ||
_DEFAULT_LTE_BANDS="1 3 5 8 38 39 40 41" | ||
|
||
getinfo() { | ||
echo "Yuge CLM920 NC_5" | ||
} | ||
|
||
getsupportedbands() { | ||
echo "$_DEFAULT_LTE_BANDS" | ||
} | ||
|
||
getbands() { | ||
O=$(sms_tool -d $_DEVICE at "as+bandcfg?") | ||
HEXHI=$(echo "$O" | awk -F[,] '/^\+BANDCFG:3,/{print $2}' | xargs) | ||
HEXLO=$(echo "$O" | awk -F[,] '/^\+BANDCFG:3,/{print $3}' | xargs) | ||
hextobands $(printf "0x%x%08x" 0x${HEXHI:-0} 0x${HEXLO:-0}) | ||
} | ||
|
||
setbands() { | ||
BANDS="$1" | ||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS" | ||
|
||
HEX=$(bandstohex "$BANDS") | ||
LEN=${#HEX} | ||
if [ $LEN -gt 8 ]; then | ||
CNT=$((LEN - 8)) | ||
HEXHI=${HEX:0:CNT} | ||
HEXLO=${HEX:CNT} | ||
else | ||
HEXLO=$HEX | ||
HEXHI=0 | ||
fi | ||
HEXHI=$(printf "%X" 0x$HEXHI) | ||
HEXLO=$(printf "%X" 0x$HEXLO) | ||
[ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "at+bandcfg=$HEXHI,$HEXLO,3" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# +GTUSBMODE: 40 | ||
_DEVICE=/dev/ttyUSB2 | ||
|
||
. $RES/_fibocom_fm350_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# +GTUSBMODE: 41 | ||
_DEVICE=/dev/ttyUSB4 | ||
|
||
. $RES/_fibocom_fm350_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
_DEVICE=/dev/ttyUSB2 | ||
|
||
getinfo() { | ||
echo "Sierra Wireless EM7465" | ||
} | ||
|
||
getsupportedbands() { | ||
sms_tool -d $_DEVICE at 'AT!ENTERCND="A710"' >/dev/null 2>&1 | ||
O=$(sms_tool -d $_DEVICE at 'AT!BAND=?') | ||
HEX=$(echo "$O" | awk '/^00, All bands/{printf "0x%s%s\n", $6, $5}') | ||
[ "$HEX" = "0x" ] || hextobands "$HEX" | ||
} | ||
|
||
getbands() { | ||
sms_tool -d $_DEVICE at 'AT!ENTERCND="A710"' >/dev/null 2>&1 | ||
O=$(sms_tool -d $_DEVICE at 'AT!BAND?') | ||
HEX=$(echo "$O" | awk -F, '/^[0-9a-fA-F][0-9a-fA-F],/{print $3}' | awk '{printf "0x%s%s\n", $3, $2}') | ||
[ "$HEX" = "0x" ] || hextobands "$HEX" | ||
} | ||
|
||
setbands() { | ||
BANDS="$1" | ||
|
||
if [ "$BANDS" = "default" ]; then | ||
sms_tool -d $_DEVICE at 'AT!ENTERCND="A710"' >/dev/null 2>&1 | ||
sms_tool -d $_DEVICE at 'AT!BAND=00' >/dev/null 2>&1 | ||
else | ||
HEX=$(bandstohex "$BANDS") | ||
if [ "$HEX" != "0" ]; then | ||
sms_tool -d $_DEVICE at 'AT!ENTERCND="A710"' >/dev/null 2>&1 | ||
O=$(sms_tool -d $_DEVICE at 'AT!BAND?') | ||
HEXGW=$(echo "$O" | awk -F, '/^[0-9a-fA-F][0-9a-fA-F],/{print $3}' | awk '{print $1}') | ||
LEN=${#HEX} | ||
if [ $LEN -gt 16 ]; then | ||
CNT=$((LEN - 16)) | ||
HEXL2=${HEX:0:CNT} | ||
HEXL1=${HEX:CNT} | ||
else | ||
HEXL1=$HEX | ||
HEXL2=0 | ||
fi | ||
sms_tool -d $_DEVICE at 'AT!BAND=10,"Custom bands",'$HEXGW','$HEXL1','$HEXL2 | ||
sms_tool -d $_DEVICE at 'AT!BAND=10' | ||
sms_tool -d $_DEVICE at 'AT!RESET' | ||
fi | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
_DEVICE=/dev/ttyUSB2 | ||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 17 18 19 20 25 26 28 29 30 32 34 38/39 40 41 42 43 48 66 71" | ||
_DEFAULT_5GNSA_BANDS="38 41 77 78" | ||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 20 25 28 38 40 41 48 66 71 77 78" | ||
|
||
getinfo() { | ||
echo "Quectel RM502Q-GL" | ||
} | ||
|
||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38 | ||
|
||
. $RES/_quectel_common2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
net/modemband/files/usr/share/modemband/_fibocom_fm350_common
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
getinfo() { | ||
O=$(sms_tool -d $_DEVICE at "AT+CGMM?") | ||
_NAME="Fibocom $(echo "$O" | awk -F[:,] '/^\+CGMM:/{gsub("\"","");print $2}' | xargs)" | ||
echo "$_NAME" | ||
} | ||
|
||
getsupportedbands() { | ||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 17 18 19 20 25 26 28 29 30 32 34 38 39 40 41 42 43 46 48 66 71" | ||
echo "$_DEFAULT_LTE_BANDS" | ||
} | ||
|
||
getbands() { | ||
# +GTACT: 20,6,3,101,102,103,104,105,107,108,112,113,114,117,118,119,120,125,126,128,129,130,132,134,138,139,140,141,142,143,146,148,166,171 | ||
|
||
O=$(sms_tool -d $_DEVICE at "AT+GTACT?") | ||
BANDS=$(echo "$O" | awk -F: '/^\+GTACT:/{gsub(","," ");print $2}') | ||
for BAND in $BANDS; do | ||
if [ $BAND -gt 100 ] && [ $BAND -lt 200 ]; then | ||
echo -n "$((BAND - 100)) " | ||
fi | ||
done | ||
echo "" | ||
} | ||
|
||
setbands() { | ||
BANDS="$1" | ||
|
||
T="" | ||
if [ "$BANDS" = "default" ]; then | ||
T="0" | ||
else | ||
for BAND in $BANDS; do | ||
case $BAND in | ||
''|*[!0-9]*) continue ;; | ||
esac | ||
[ -n "$T" ] && T="${T}," | ||
T="${T}$((BAND + 100))" | ||
done | ||
fi | ||
|
||
if [ -n "$T" ]; then | ||
O=$(sms_tool -d $_DEVICE at "AT+GTACT?") | ||
MODE=$(echo "$O" | awk -F[:,] '/\+GTACT:/{print $2","$3","$4}'| xargs) | ||
sms_tool -d $_DEVICE at "AT+GTACT=$MODE,$T" | ||
fi | ||
} | ||
|
||
getsupportedbands5gsa() { | ||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 20 25 28 30 38 40 41 48 66 71 77 78 79" | ||
echo "$_DEFAULT_5GSA_BANDS" | ||
} | ||
|
||
getbands5gsa() { | ||
# +GTACT: 20,6,3,501,502,503,505,507,508,5020,5025,5028,5030,5038,5040,5041,5048,5066,5071,5077,5078,5079 | ||
|
||
O=$(sms_tool -d $_DEVICE at "AT+GTACT?") | ||
BANDS=$(echo "$O" | awk -F: '/^\+GTACT:/{gsub(","," ");print $2}') | ||
for BAND in $BANDS; do | ||
if [ $BAND -gt 500 ] && [ $BAND -lt 5100 ]; then | ||
echo -n "$(echo "$BAND" | sed 's/^50//g') " | ||
fi | ||
done | ||
echo "" | ||
} | ||
|
||
setbands5gsa() { | ||
BANDS="$1" | ||
|
||
T="" | ||
if [ "$BANDS" = "default" ]; then | ||
T="0" | ||
else | ||
for BAND in $BANDS; do | ||
case $BAND in | ||
''|*[!0-9]*) continue ;; | ||
esac | ||
[ -n "$T" ] && T="${T}," | ||
T="${T}50${BAND}" | ||
done | ||
fi | ||
|
||
if [ -n "$T" ]; then | ||
O=$(sms_tool -d $_DEVICE at "AT+GTACT?") | ||
MODE=$(echo "$O" | awk -F[:,] '/\+GTACT:/{print $2","$3","$4}'| xargs) | ||
sms_tool -d $_DEVICE at "AT+GTACT=$MODE,$T" | ||
fi | ||
} |