mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-27 10:31:38 +08:00
✨ Sync 2026-06-07 19:00:00
This commit is contained in:
parent
55eb509939
commit
a427b26104
28
modemband/Makefile
Normal file
28
modemband/Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=modemband
|
||||
PKG_VERSION:=20241111
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_MAINTAINER:=Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/modemband
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WWAN
|
||||
TITLE:=Setting LTE/5G bands for selected modems
|
||||
DEPENDS:=+sms-tool
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/modemband/install
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,modemband))
|
||||
135
modemband/README.md
Normal file
135
modemband/README.md
Normal file
@ -0,0 +1,135 @@
|
||||
Setting LTE/5G NSA/5G SA bands for selected modems.
|
||||
|
||||
Supported devices:
|
||||
- BroadMobi BM806U
|
||||
- Dell DW5821e Snapdragon X20 LTE (Foxconn T77W968)
|
||||
- Fibocom FM350-GL
|
||||
- Fibocom L850-GL
|
||||
- Fibocom L850-GL in mbim mode
|
||||
- Fibocom L860-GL
|
||||
- Fibocom L860-GL-16
|
||||
- HP lt4112 (Huawei ME906E)
|
||||
- HP lt4132 LTE/HSPA+ 4G Module (Huawei ME906s-158)
|
||||
- HP lt4220 (Foxconn T77W676)
|
||||
- HP lt4220 (Foxconn T77W676) in mbim mode
|
||||
- Huawei (various models) in serial mode
|
||||
- Quectel EC20
|
||||
- Quectel EC25
|
||||
- Quectel EG06-E
|
||||
- Quectel EG18-EA
|
||||
- Quectel EM12-G
|
||||
- Quectel EM160R-GL
|
||||
- Quectel EP06-E
|
||||
- Quectel RG500Q-EA
|
||||
- Quectel RG502Q-EA
|
||||
- Quectel RM500Q-GL
|
||||
- Quectel RM500U-CNV
|
||||
- Quectel RM502Q-AE
|
||||
- Quectel RM502Q-GL
|
||||
- Quectel RM505Q-AE
|
||||
- Quectel RM520N-GL
|
||||
- Sierra Wireless EM7455/MC7455/DW5811e
|
||||
- SIMCOM SIM8200EA-M2
|
||||
- Telit LM940
|
||||
- Telit LN940 (Foxconn T77W676)
|
||||
- Telit LN940 (Foxconn T77W676) in mbim mode
|
||||
- Telit LN960 (Foxconn T77W968)
|
||||
- Telit LN960
|
||||
- Yuge CLM920 NC_5
|
||||
- ZTE MF286 (router)
|
||||
- ZTE MF286A (router)
|
||||
- ZTE MF286D (router)
|
||||
- ZTE MF286R (router)
|
||||
- ZTE MF289R (router)
|
||||
|
||||
```
|
||||
root@MiFi:~# modemband.sh help
|
||||
Available commands:
|
||||
/usr/bin/modemband.sh getinfo
|
||||
/usr/bin/modemband.sh json
|
||||
/usr/bin/modemband.sh help
|
||||
|
||||
for LTE modem
|
||||
/usr/bin/modemband.sh getsupportedbands
|
||||
/usr/bin/modemband.sh getsupportedbandsext
|
||||
/usr/bin/modemband.sh getbands
|
||||
/usr/bin/modemband.sh getbandsext
|
||||
/usr/bin/modemband.sh setbands "<band list>"
|
||||
|
||||
for 5G NSA modem
|
||||
/usr/bin/modemband.sh getsupportedbands5gnsa
|
||||
/usr/bin/modemband.sh getsupportedbandsext5gnsa
|
||||
/usr/bin/modemband.sh getbands5gnsa
|
||||
/usr/bin/modemband.sh getbandsext5gnsa
|
||||
/usr/bin/modemband.sh setbands5gnsa "<band list>"
|
||||
|
||||
for 5G SA modem
|
||||
/usr/bin/modemband.sh getsupportedbands5gsa
|
||||
/usr/bin/modemband.sh getsupportedbandsext5gsa
|
||||
/usr/bin/modemband.sh getbands5gsa
|
||||
/usr/bin/modemband.sh getbandsext5gsa
|
||||
/usr/bin/modemband.sh setbands5gsa "<band list>"
|
||||
|
||||
root@MiFi:~# # modemband.sh
|
||||
Modem: Quectel EC25
|
||||
Supported LTE bands: 1 3 5 7 8 20 38 40 41
|
||||
LTE bands: 1 3 5 7 8 20 38 40 41
|
||||
|
||||
1: FDD 2100 MHz
|
||||
3: FDD 1800 MHz
|
||||
5: FDD 850 MHz
|
||||
7: FDD 2600 MHz
|
||||
8: FDD 900 MHz
|
||||
20: FDD 800 MHz
|
||||
38: TDD 2600 MHz
|
||||
40: TDD 2300 MHz
|
||||
41: TDD 2500 MHz
|
||||
|
||||
root@MiFi:~# modemband.sh json
|
||||
{ "modem": "Quectel EC25", "supported": [ { "band": 1, "txt": "FDD 2100 MHz" }, { "band": 3, "txt": "FDD 1800 MHz" }, { "band": 5, "txt": "FDD 850 MHz" }, { "band": 7, "txt": "FDD 2600 MHz" }, { "band": 8, "txt": "FDD 900 MHz" }, { "band": 20, "txt": "FDD 800 MHz" }, { "band": 38, "txt": "TDD 2600 MHz" }, { "band": 40, "txt": "TDD 2300 MHz" }, { "band": 41, "txt": "TDD 2500 MHz" } ], "enabled": [ 1, 3, 5, 7, 8, 20, 38, 40, 41 ] }
|
||||
|
||||
root@MiFi:~# modemband.sh getinfo
|
||||
Quectel EC25
|
||||
|
||||
root@MiFi:~# modemband.sh getsupportedbands
|
||||
1 3 5 7 8 20 38 40 41
|
||||
|
||||
root@MiFi:~# modemband.sh getsupportedbandsext
|
||||
1: FDD 2100 MHz
|
||||
3: FDD 1800 MHz
|
||||
5: FDD 850 MHz
|
||||
7: FDD 2600 MHz
|
||||
8: FDD 900 MHz
|
||||
20: FDD 800 MHz
|
||||
38: TDD 2600 MHz
|
||||
40: TDD 2300 MHz
|
||||
41: TDD 2500 MHz
|
||||
|
||||
root@MiFi:~# modemband.sh getbands
|
||||
1 3 5 7 8 20 38 40 41
|
||||
|
||||
root@MiFi:~# modemband.sh getbandsext
|
||||
1: FDD 2100 MHz
|
||||
3: FDD 1800 MHz
|
||||
5: FDD 850 MHz
|
||||
7: FDD 2600 MHz
|
||||
8: FDD 900 MHz
|
||||
20: FDD 800 MHz
|
||||
38: TDD 2600 MHz
|
||||
40: TDD 2300 MHz
|
||||
41: TDD 2500 MHz
|
||||
|
||||
root@MiFi:~# modemband.sh setbands "1 3 5 40"
|
||||
at+qcfg="band",0,8000000015,0,1
|
||||
|
||||
root@MiFi:~# modemband.sh getbands
|
||||
1 3 5 40
|
||||
|
||||
root@MiFi:~# modemband.sh setbands default
|
||||
at+qcfg="band",0,1a0000800d5,0,1
|
||||
|
||||
root@MiFi:~# modemband.sh getbands
|
||||
1 3 5 7 8 20 38 40 41
|
||||
```
|
||||
|
||||
See also [description in Polish](https://eko.one.pl/?p=openwrt-modemband).
|
||||
518
modemband/files/usr/bin/modemband.sh
Normal file
518
modemband/files/usr/bin/modemband.sh
Normal file
@ -0,0 +1,518 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# (c) 2022-2024 Cezary Jackiewicz <cezary@eko.one.pl>
|
||||
#
|
||||
# (c) 2022-2024 modified by Rafał Wabik - IceG - From eko.one.pl forum
|
||||
#
|
||||
|
||||
hextobands() {
|
||||
BANDS=""
|
||||
HEX="$1"
|
||||
LEN=${#HEX}
|
||||
if [ $LEN -gt 18 ]; then
|
||||
CNT=$((LEN - 16))
|
||||
HHEX=${HEX:0:CNT}
|
||||
HEX="0x"${HEX:CNT}
|
||||
fi
|
||||
|
||||
for B in $(seq 0 63); do
|
||||
POW=$((2 ** $B))
|
||||
T=$((HEX&$POW))
|
||||
[ "x$T" = "x$POW" ] && BANDS="${BANDS}$((B + 1)) "
|
||||
done
|
||||
if [ -n "$HHEX" ]; then
|
||||
for B in $(seq 0 63); do
|
||||
POW=$((2 ** $B))
|
||||
T=$((HHEX&$POW))
|
||||
[ "x$T" = "x$POW" ] && BANDS="${BANDS}$((B + 1 + 64)) "
|
||||
done
|
||||
fi
|
||||
echo "$BANDS"
|
||||
}
|
||||
|
||||
bandstohex() {
|
||||
BANDS="$1"
|
||||
SUM=0
|
||||
HSUM=0
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
if [ $BAND -gt 64 ]; then
|
||||
B=$((BAND - 1 - 64))
|
||||
POW=$((2 ** $B))
|
||||
HSUM=$((HSUM + POW))
|
||||
else
|
||||
B=$((BAND - 1))
|
||||
POW=$((2 ** $B))
|
||||
SUM=$((SUM + POW))
|
||||
fi
|
||||
done
|
||||
if [ $HSUM -eq 0 ]; then
|
||||
HEX=$(printf '%x' $SUM)
|
||||
else
|
||||
HEX=$(printf '%x%016x' $HSUM $SUM)
|
||||
fi
|
||||
echo "$HEX"
|
||||
}
|
||||
|
||||
bandtxt() {
|
||||
BAND=$1
|
||||
|
||||
# see https://en.wikipedia.org/wiki/LTE_frequency_bands
|
||||
|
||||
case "$BAND" in
|
||||
"1") echo " $BAND: FDD 2100 MHz";;
|
||||
"2") echo " $BAND: FDD 1900 MHz";;
|
||||
"3") echo " $BAND: FDD 1800 MHz";;
|
||||
"4") echo " $BAND: FDD 1700 MHz";;
|
||||
"5") echo " $BAND: FDD 850 MHz";;
|
||||
"7") echo " $BAND: FDD 2600 MHz";;
|
||||
"8") echo " $BAND: FDD 900 MHz";;
|
||||
"11") echo "$BAND: FDD 1500 MHz";;
|
||||
"12") echo "$BAND: FDD 700 MHz";;
|
||||
"13") echo "$BAND: FDD 700 MHz";;
|
||||
"14") echo "$BAND: FDD 700 MHz";;
|
||||
"17") echo "$BAND: FDD 700 MHz";;
|
||||
"18") echo "$BAND: FDD 850 MHz";;
|
||||
"19") echo "$BAND: FDD 850 MHz";;
|
||||
"20") echo "$BAND: FDD 800 MHz";;
|
||||
"21") echo "$BAND: FDD 1500 MHz";;
|
||||
"24") echo "$BAND: FDD 1600 MHz";;
|
||||
"25") echo "$BAND: FDD 1900 MHz";;
|
||||
"26") echo "$BAND: FDD 850 MHz";;
|
||||
"28") echo "$BAND: FDD 700 MHz";;
|
||||
"29") echo "$BAND: SDL 700 MHz";;
|
||||
"30") echo "$BAND: FDD 2300 MHz";;
|
||||
"31") echo "$BAND: FDD 450 MHz";;
|
||||
"32") echo "$BAND: SDL 1500 MHz";;
|
||||
"34") echo "$BAND: TDD 2000 MHz";;
|
||||
"37") echo "$BAND: TDD 1900 MHz";;
|
||||
"38") echo "$BAND: TDD 2600 MHz";;
|
||||
"39") echo "$BAND: TDD 1900 MHz";;
|
||||
"40") echo "$BAND: TDD 2300 MHz";;
|
||||
"41") echo "$BAND: TDD 2500 MHz";;
|
||||
"42") echo "$BAND: TDD 3500 MHz";;
|
||||
"43") echo "$BAND: TDD 3700 MHz";;
|
||||
"46") echo "$BAND: TDD 5200 MHz";;
|
||||
"47") echo "$BAND: TDD 5900 MHz";;
|
||||
"48") echo "$BAND: TDD 3500 MHz";;
|
||||
"50") echo "$BAND: TDD 1500 MHz";;
|
||||
"51") echo "$BAND: TDD 1500 MHz";;
|
||||
"53") echo "$BAND: TDD 2400 MHz";;
|
||||
"54") echo "$BAND: TDD 1600 MHz";;
|
||||
"65") echo "$BAND: FDD 2100 MHz";;
|
||||
"66") echo "$BAND: FDD 1700 MHz";;
|
||||
"67") echo "$BAND: SDL 700 MHz";;
|
||||
"69") echo "$BAND: SDL 2600 MHz";;
|
||||
"70") echo "$BAND: FDD 1700 MHz";;
|
||||
"71") echo "$BAND: FDD 600 MHz";;
|
||||
"72") echo "$BAND: FDD 450 MHz";;
|
||||
"73") echo "$BAND: FDD 450 MHz";;
|
||||
"74") echo "$BAND: FDD 1500 MHz";;
|
||||
"75") echo "$BAND: SDL 1500 MHz";;
|
||||
"76") echo "$BAND: SDL 1500 MHz";;
|
||||
"85") echo "$BAND: FDD 700 MHz";;
|
||||
"87") echo "$BAND: FDD 410 MHz";;
|
||||
"88") echo "$BAND: FDD 410 MHz";;
|
||||
"103") echo "$BAND: FDD 700 MHz";;
|
||||
"106") echo "$BAND: FDD 900 MHz";;
|
||||
esac
|
||||
}
|
||||
|
||||
bandtxt5g() {
|
||||
BAND=$1
|
||||
|
||||
# see https://en.wikipedia.org/wiki/5G_NR_frequency_bands
|
||||
|
||||
case "$BAND" in
|
||||
"1") echo " $BAND: FDD 2100 MHz";;
|
||||
"2") echo " $BAND: FDD 1900 MHz";;
|
||||
"3") echo " $BAND: FDD 1800 MHz";;
|
||||
"5") echo " $BAND: FDD 850 MHz";;
|
||||
"7") echo " $BAND: FDD 2600 MHz";;
|
||||
"8") echo " $BAND: FDD 900 MHz";;
|
||||
"12") echo "$BAND: FDD 700 MHz";;
|
||||
"13") echo "$BAND: FDD 700 MHz";;
|
||||
"14") echo "$BAND: FDD 700 MHz";;
|
||||
"18") echo "$BAND: FDD 850 MHz";;
|
||||
"20") echo "$BAND: FDD 800 MHz";;
|
||||
"24") echo "$BAND: FDD 1600 MHz";;
|
||||
"25") echo "$BAND: FDD 1900 MHz";;
|
||||
"26") echo "$BAND: FDD 850 MHz";;
|
||||
"28") echo "$BAND: FDD 700 MHz";;
|
||||
"29") echo "$BAND: SDL 700 MHz";;
|
||||
"30") echo "$BAND: TDD 2300 MHz";;
|
||||
"34") echo "$BAND: TDD 2100 MHz";;
|
||||
"38") echo "$BAND: TDD 2600 MHz";;
|
||||
"39") echo "$BAND: TDD 1900 MHz";;
|
||||
"40") echo "$BAND: TDD 2300 MHz";;
|
||||
"41") echo "$BAND: TDD 2500 MHz";;
|
||||
"46") echo "$BAND: TDD 5200 MHz";;
|
||||
"47") echo "$BAND: TDD 5900 MHz";;
|
||||
"48") echo "$BAND: TDD 3500 MHz";;
|
||||
"50") echo "$BAND: TDD 1500 MHz";;
|
||||
"51") echo "$BAND: TDD 1500 MHz";;
|
||||
"53") echo "$BAND: TDD 2400 MHz";;
|
||||
"54") echo "$BAND: TDD 1600 MHz";;
|
||||
"65") echo "$BAND: FDD 2100 MHz";;
|
||||
"66") echo "$BAND: FDD 1700/2100 MHz";;
|
||||
"67") echo "$BAND: SDL 700 MHz";;
|
||||
"70") echo "$BAND: FDD 2000 MHz";;
|
||||
"71") echo "$BAND: FDD 600 MHz";;
|
||||
"74") echo "$BAND: FDD 1500 MHz";;
|
||||
"75") echo "$BAND: SDL 1500 MHz";;
|
||||
"76") echo "$BAND: SDL 1500 MHz";;
|
||||
"77") echo "$BAND: TDD 3700 MHz";;
|
||||
"78") echo "$BAND: TDD 3500 MHz";;
|
||||
"79") echo "$BAND: TDD 4700 MHz";;
|
||||
"80") echo "$BAND: SUL 1800 MHz";;
|
||||
"81") echo "$BAND: SUL 900 MHz";;
|
||||
"82") echo "$BAND: SUL 800 MHz";;
|
||||
"83") echo "$BAND: SUL 700 MHz";;
|
||||
"84") echo "$BAND: SUL 2100 MHz";;
|
||||
"85") echo "$BAND: FDD 700 MHz";;
|
||||
"86") echo "$BAND: SUL 1700 MHz";;
|
||||
"89") echo "$BAND: SUL 850 MHz";;
|
||||
"90") echo "$BAND: TDD 2500 MHz";;
|
||||
"91") echo "$BAND: FDD 800/1500 MHz";;
|
||||
"92") echo "$BAND: FDD 800/1500 MHz";;
|
||||
"93") echo "$BAND: FDD 900/1500 MHz";;
|
||||
"94") echo "$BAND: FDD 900/1500 MHz";;
|
||||
"95") echo "$BAND: SUL 2100 MHz";;
|
||||
"96") echo "$BAND: TDD 6000 MHz";;
|
||||
"97") echo "$BAND: SUL 2300 MHz";;
|
||||
"98") echo "$BAND: SUL 1900 MHz";;
|
||||
"99") echo "$BAND: SUL 1600 MHz)";;
|
||||
"100") echo "$BAND: FDD 900 MHz";;
|
||||
"101") echo "$BAND: TDD 1900 MHz";;
|
||||
"102") echo "$BAND: TDD 6200 MHz";;
|
||||
"104") echo "$BAND: TDD 6700 MHz";;
|
||||
"105") echo "$BAND: FDD 600 MHz";;
|
||||
"257") echo "$BAND: 28 GHz";;
|
||||
"258") echo "$BAND: 26 GHz";;
|
||||
"259") echo "$BAND: 41 GHz";;
|
||||
"260") echo "$BAND: 39 GHz";;
|
||||
"261") echo "$BAND: 28 GHz";;
|
||||
"262") echo "$BAND: 47 GHz";;
|
||||
"263") echo "$BAND: 60 GHz";;
|
||||
esac
|
||||
}
|
||||
|
||||
_DEVICE=""
|
||||
_DEFAULT_LTE_BANDS=""
|
||||
_DEFAULT_5GNSA_BANDS=""
|
||||
_DEFAULT_5GSA_BANDS=""
|
||||
|
||||
# default templates
|
||||
|
||||
# modem name/type
|
||||
getinfo() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
# get supported band - 4G
|
||||
getsupportedbands() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getsupportedbandsext() {
|
||||
T=$(getsupportedbands)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# get current configured bands - 4G
|
||||
getbands() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getbandsext() {
|
||||
T=$(getbands)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# set bands - 4G
|
||||
setbands() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
# get supported band - 5G NSA
|
||||
getsupportedbands5gnsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getsupportedbandsext5gnsa() {
|
||||
T=$(getsupportedbands5gnsa)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt5g "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# get current configured bands - 5G NSA
|
||||
getbands5gnsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getbandsext5gnsa() {
|
||||
T=$(getbands5gnsa)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt5g "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# set bands - 5G NSA
|
||||
setbands5gnsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
# get supported band - 5G SA
|
||||
getsupportedbands5gsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getsupportedbandsext5gsa() {
|
||||
T=$(getsupportedbands5gsa)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt5g "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# get current configured bands - 5G SA
|
||||
getbands5gsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
getbandsext5gsa() {
|
||||
T=$(getbands5gsa)
|
||||
[ "x$T" = "xUnsupported" ] && return
|
||||
for BAND in $T; do
|
||||
bandtxt5g "$BAND"
|
||||
done
|
||||
}
|
||||
|
||||
# set bands - 5G SA
|
||||
setbands5gsa() {
|
||||
echo "Unsupported"
|
||||
}
|
||||
|
||||
|
||||
RES="/usr/share/modemband"
|
||||
|
||||
_DEVS=$(awk '{gsub("="," ");
|
||||
if ($0 ~ /Bus.*Lev.*Prnt.*Port.*/) {T=$0}
|
||||
if ($0 ~ /Vendor.*ProdID/) {idvendor[T]=$3; idproduct[T]=$5}
|
||||
if ($0 ~ /Product/) {product[T]=$3}}
|
||||
END {for (idx in idvendor) {printf "%s%s\n%s%s%s\n", idvendor[idx], idproduct[idx], idvendor[idx], idproduct[idx], product[idx]}}' /sys/kernel/debug/usb/devices)
|
||||
for _DEV in $_DEVS; do
|
||||
if [ -e "$RES/$_DEV" ]; then
|
||||
. "$RES/$_DEV"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$_DEVICE" ]; then
|
||||
if [ "x$1" = "xjson" ]; then
|
||||
echo '{"error":"No supported modem was found, quitting..."}'
|
||||
else
|
||||
echo "No supported modem was found, quitting..."
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
_DEVICE1=$(uci -q get modemband.@modemband[0].set_port)
|
||||
if [ -n "$_DEVICE1" ]; then
|
||||
_DEVICE=$_DEVICE1
|
||||
fi
|
||||
fi
|
||||
if [ ! -e "$_DEVICE" ]; then
|
||||
if [ "x$1" = "xjson" ]; then
|
||||
echo '{"error":"Port not found, quitting..."}'
|
||||
else
|
||||
echo "Port not found, quitting..."
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $1 in
|
||||
"getinfo")
|
||||
getinfo
|
||||
;;
|
||||
"getsupportedbands")
|
||||
getsupportedbands
|
||||
;;
|
||||
"getsupportedbandsext")
|
||||
getsupportedbandsext
|
||||
;;
|
||||
"getbands")
|
||||
getbands
|
||||
;;
|
||||
"getbandsext")
|
||||
getbandsext
|
||||
;;
|
||||
"setbands")
|
||||
[ -n "$2" ] && setbands "$2"
|
||||
;;
|
||||
"getsupportedbands5gnsa")
|
||||
getsupportedbands5gnsa
|
||||
;;
|
||||
"getsupportedbandsext5gnsa")
|
||||
getsupportedbandsext5gnsa
|
||||
;;
|
||||
"getbands5gnsa")
|
||||
getbands5gnsa
|
||||
;;
|
||||
"getbandsext5gnsa")
|
||||
getbandsext5gnsa
|
||||
;;
|
||||
"setbands5gnsa")
|
||||
[ -n "$2" ] && setbands5gnsa "$2"
|
||||
;;
|
||||
"getsupportedbands5gsa")
|
||||
getsupportedbands5gsa
|
||||
;;
|
||||
"getsupportedbandsext5gsa")
|
||||
getsupportedbandsext5gsa
|
||||
;;
|
||||
"getbands5gsa")
|
||||
getbands5gsa
|
||||
;;
|
||||
"getbandsext5gsa")
|
||||
getbandsext5gsa
|
||||
;;
|
||||
"setbands5gsa")
|
||||
[ -n "$2" ] && setbands5gsa "$2"
|
||||
;;
|
||||
"json")
|
||||
. /usr/share/libubox/jshn.sh
|
||||
json_init
|
||||
json_add_string modem "$(getinfo)"
|
||||
json_add_array supported
|
||||
T=$(getsupportedbands)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
for BAND in $T; do
|
||||
json_add_object ""
|
||||
json_add_int band $BAND
|
||||
TXT="$(bandtxt $BAND)"
|
||||
json_add_string txt "${TXT##*: }"
|
||||
json_close_object
|
||||
done
|
||||
fi
|
||||
json_close_array
|
||||
json_add_array enabled
|
||||
T=$(getbands)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
for BAND in $T; do
|
||||
json_add_int "" $BAND
|
||||
done
|
||||
fi
|
||||
json_close_array
|
||||
|
||||
T=$(getsupportedbands5gnsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
json_add_array supported5gnsa
|
||||
for BAND in $T; do
|
||||
json_add_object ""
|
||||
json_add_int band $BAND
|
||||
TXT="$(bandtxt5g $BAND)"
|
||||
json_add_string txt "${TXT##*: }"
|
||||
json_close_object
|
||||
done
|
||||
json_close_array
|
||||
json_add_array enabled5gnsa
|
||||
T=$(getbands5gnsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
for BAND in $T; do
|
||||
json_add_int "" $BAND
|
||||
done
|
||||
fi
|
||||
json_close_array
|
||||
fi
|
||||
T=$(getsupportedbands5gsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
json_add_array supported5gsa
|
||||
for BAND in $T; do
|
||||
json_add_object ""
|
||||
json_add_int band $BAND
|
||||
TXT="$(bandtxt5g $BAND)"
|
||||
json_add_string txt "${TXT##*: }"
|
||||
json_close_object
|
||||
done
|
||||
json_close_array
|
||||
json_add_array enabled5gsa
|
||||
T=$(getbands5gsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
for BAND in $T; do
|
||||
json_add_int "" $BAND
|
||||
done
|
||||
fi
|
||||
json_close_array
|
||||
fi
|
||||
json_dump
|
||||
;;
|
||||
"help")
|
||||
echo "Available commands:"
|
||||
echo " $0 getinfo"
|
||||
echo " $0 json"
|
||||
echo " $0 help"
|
||||
echo ""
|
||||
echo "for LTE modem"
|
||||
echo " $0 getsupportedbands"
|
||||
echo " $0 getsupportedbandsext"
|
||||
echo " $0 getbands"
|
||||
echo " $0 getbandsext"
|
||||
echo " $0 setbands \"<band list>\""
|
||||
echo ""
|
||||
echo "for 5G NSA modem"
|
||||
echo " $0 getsupportedbands5gnsa"
|
||||
echo " $0 getsupportedbandsext5gnsa"
|
||||
echo " $0 getbands5gnsa"
|
||||
echo " $0 getbandsext5gnsa"
|
||||
echo " $0 setbands5gnsa \"<band list>\""
|
||||
echo ""
|
||||
echo "for 5G SA modem"
|
||||
echo " $0 getsupportedbands5gsa"
|
||||
echo " $0 getsupportedbandsext5gsa"
|
||||
echo " $0 getbands5gsa"
|
||||
echo " $0 getbandsext5gsa"
|
||||
echo " $0 setbands5gsa \"<band list>\""
|
||||
;;
|
||||
*)
|
||||
echo -n "Modem: "
|
||||
getinfo
|
||||
echo -n "Supported LTE bands: "
|
||||
getsupportedbands
|
||||
echo -n "Enabled LTE bands: "
|
||||
getbands
|
||||
echo ""
|
||||
getsupportedbandsext
|
||||
T=$(getsupportedbands5gnsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
echo -n "Supported 5G NSA bands: "
|
||||
getsupportedbands5gnsa
|
||||
echo -n "Enabled 5G NSA bands: "
|
||||
getbands5gnsa
|
||||
echo ""
|
||||
getsupportedbandsext5gnsa
|
||||
fi
|
||||
T=$(getsupportedbands5gsa)
|
||||
if [ "x$T" != "xUnsupported" ]; then
|
||||
echo -n "Supported 5G SA bands: "
|
||||
getsupportedbands5gsa
|
||||
echo -n "Enabled 5G SA bands: "
|
||||
getbands5gsa
|
||||
echo ""
|
||||
getsupportedbandsext5gsa
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
8
modemband/files/usr/share/modemband/03f00857
Normal file
8
modemband/files/usr/share/modemband/03f00857
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 17 18 19 20 21 25 26 28 29 30 38 39 40 41 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Qualcomm Snapdragon(TM) X12 LTE-A"
|
||||
}
|
||||
|
||||
. $RES/_foxconn_common2
|
||||
10
modemband/files/usr/share/modemband/05c69215
Normal file
10
modemband/files/usr/share/modemband/05c69215
Normal file
@ -0,0 +1,10 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 20"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EC20"
|
||||
}
|
||||
|
||||
# +QCFG: "band",0xdf,0x800d5,0x3f
|
||||
|
||||
. $RES/_quectel_common
|
||||
36
modemband/files/usr/share/modemband/05c69625
Normal file
36
modemband/files/usr/share/modemband/05c69625
Normal file
@ -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"
|
||||
}
|
||||
4
modemband/files/usr/share/modemband/0e8d7126
Normal file
4
modemband/files/usr/share/modemband/0e8d7126
Normal file
@ -0,0 +1,4 @@
|
||||
# +GTUSBMODE: 40
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
|
||||
. $RES/_fibocom_fm350_common
|
||||
4
modemband/files/usr/share/modemband/0e8d7127
Normal file
4
modemband/files/usr/share/modemband/0e8d7127
Normal file
@ -0,0 +1,4 @@
|
||||
# +GTUSBMODE: 41
|
||||
_DEVICE=/dev/ttyUSB4
|
||||
|
||||
. $RES/_fibocom_fm350_common
|
||||
38
modemband/files/usr/share/modemband/11999071
Normal file
38
modemband/files/usr/share/modemband/11999071
Normal file
@ -0,0 +1,38 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
|
||||
getinfo() {
|
||||
echo "Sierra Wireless EM7455/MC7455/DW5811e"
|
||||
}
|
||||
|
||||
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\n", $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\n", $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
|
||||
HEXL=$(bandstohex "$BANDS")
|
||||
if [ "$HEXL" != "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}')
|
||||
sms_tool -d $_DEVICE at 'AT!BAND=10,"Custom bands",'$HEXGW','$HEXL
|
||||
sms_tool -d $_DEVICE at 'AT!BAND=10'
|
||||
sms_tool -d $_DEVICE at 'AT!RESET'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
47
modemband/files/usr/share/modemband/11999091
Normal file
47
modemband/files/usr/share/modemband/11999091
Normal file
@ -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
|
||||
}
|
||||
60
modemband/files/usr/share/modemband/12d11506
Normal file
60
modemband/files/usr/share/modemband/12d11506
Normal file
@ -0,0 +1,60 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
|
||||
getinfo() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+cgmi")
|
||||
VENDOR=$(echo "$O" | awk '/^[a-zA-Z0-9]/ && !/at\+cgmi/{print $0}' | xargs)
|
||||
O=$(sms_tool -d $_DEVICE at "at+cgmm")
|
||||
PRODUCT=$(echo "$O" | awk '/^[a-zA-Z0-9]/ && !/at\+cgmm/{print $0}' | xargs)
|
||||
echo "$(echo ${VENDOR:0:1} | tr '[a-z]' '[A-Z]')${VENDOR:1} $PRODUCT"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+cgmm")
|
||||
_NAME=$(echo "$O" | awk '/^[a-zA-Z0-9]/ && !/at\+cgmm/{print tolower($0)}' | xargs)
|
||||
case "$_NAME" in
|
||||
"me906e"* | \
|
||||
"me909u-521")
|
||||
echo "1 2 3 5 7 8 20"
|
||||
;;
|
||||
"me906s"*)
|
||||
echo "1 2 3 5 7 8 20 28"
|
||||
;;
|
||||
"me909s-120")
|
||||
echo "1 2 3 4 5 7 8 20"
|
||||
;;
|
||||
"me909s-821")
|
||||
echo "1 3 8 38 39 40 41"
|
||||
;;
|
||||
"me909s-821a")
|
||||
echo "1 3 5 8 38 39 40 41"
|
||||
;;
|
||||
*)
|
||||
echo "1 3 7 8 20"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
getbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at^syscfgex?")
|
||||
HEX="0x"$(echo "$O" | awk -F[:,] '/^\^SYSCFGEX:/{print $6}' | xargs)
|
||||
if [ "$HEX" = "0x7FFFFFFFFFFFFFFF" ]; then
|
||||
getsupportedbands
|
||||
else
|
||||
[ "$HEX" = "0x" ] || hextobands "$HEX"
|
||||
fi
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
|
||||
if [ "$BANDS" = "default" ]; then
|
||||
HEX="7FFFFFFFFFFFFFFF"
|
||||
else
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
fi
|
||||
if [ "$HEX" != "0" ]; then
|
||||
O=$(sms_tool -d $_DEVICE at "at^syscfgex?")
|
||||
MODE=$(echo "$O" | awk -F[:,] '{print $2}' | xargs)
|
||||
sms_tool -d $_DEVICE at "at^syscfgex=\"${MODE:-030201}\",3FFFFFFF,2,4,$HEX,,"
|
||||
fi
|
||||
}
|
||||
34
modemband/files/usr/share/modemband/12d1155e
Normal file
34
modemband/files/usr/share/modemband/12d1155e
Normal file
@ -0,0 +1,34 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
|
||||
getinfo() {
|
||||
echo "Huawei E3372h-320"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "1 3 7 8 20 28"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at^syscfgex?")
|
||||
HEX="0x"$(echo "$O" | awk -F[:,] '/^\^SYSCFGEX:/{print $6}' | xargs)
|
||||
if [ "$HEX" = "0x7FFFFFFFFFFFFFFF" ]; then
|
||||
getsupportedbands
|
||||
else
|
||||
[ "$HEX" = "0x" ] || hextobands "$HEX"
|
||||
fi
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
|
||||
if [ "$BANDS" = "default" ]; then
|
||||
HEX="7FFFFFFFFFFFFFFF"
|
||||
else
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
fi
|
||||
if [ "$HEX" != "0" ]; then
|
||||
O=$(sms_tool -d $_DEVICE at "at^syscfgex?")
|
||||
MODE=$(echo "$O" | awk -F[:,] '{print $2}' | xargs)
|
||||
sms_tool -d $_DEVICE at "at^syscfgex=\"${MODE:-030201}\",3FFFFFFF,2,4,$HEX,,"
|
||||
fi
|
||||
}
|
||||
20
modemband/files/usr/share/modemband/19d21432
Normal file
20
modemband/files/usr/share/modemband/19d21432
Normal file
@ -0,0 +1,20 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 3 7 8 20 28"
|
||||
_NAME="ZTE MF286"
|
||||
|
||||
case $(cat /tmp/sysinfo/board_name) in
|
||||
"zte,mf286a")
|
||||
_DEFAULT_LTE_BANDS="1 2 3 5 7 8 20 38"
|
||||
_NAME="ZTE MF286A"
|
||||
;;
|
||||
"zte,mf289f")
|
||||
_DEFAULT_LTE_BANDS="1 3 7 8 20 28 32 38"
|
||||
_NAME="ZTE MF289F"
|
||||
;;
|
||||
esac
|
||||
|
||||
getinfo() {
|
||||
echo "$_NAME"
|
||||
}
|
||||
|
||||
. $RES/_zte_common
|
||||
15
modemband/files/usr/share/modemband/19d21485
Normal file
15
modemband/files/usr/share/modemband/19d21485
Normal file
@ -0,0 +1,15 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 3 7 8 20 28 32 38"
|
||||
_NAME="ZTE MF286D"
|
||||
|
||||
case $(cat /tmp/sysinfo/board_name) in
|
||||
"zte,mf289f")
|
||||
_NAME="ZTE MF289F"
|
||||
;;
|
||||
esac
|
||||
|
||||
getinfo() {
|
||||
echo "$_NAME"
|
||||
}
|
||||
|
||||
. $RES/_zte_common
|
||||
8
modemband/files/usr/share/modemband/19d21489
Normal file
8
modemband/files/usr/share/modemband/19d21489
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyACM0
|
||||
_DEFAULT_LTE_BANDS="1 3 7 8 20 38"
|
||||
|
||||
getinfo() {
|
||||
echo "ZTE MF286R"
|
||||
}
|
||||
|
||||
. $RES/_zte_common
|
||||
31
modemband/files/usr/share/modemband/1bc71040
Normal file
31
modemband/files/usr/share/modemband/1bc71040
Normal file
@ -0,0 +1,31 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 17 20 25 26 28 29 30 38 40 41"
|
||||
|
||||
getinfo() {
|
||||
echo "Telit LM940"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# #BND: 0,11,1A03B0918DF
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at#bnd?")
|
||||
HEX="0x"$(echo "$O" | awk -F[:,] '{print $4}' | xargs)
|
||||
hextobands "$HEX"
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
if [ "$HEX" != "0" ]; then
|
||||
O=$(sms_tool -d $_DEVICE at "at#bnd?")
|
||||
GSM=$(echo "$O" | awk -F[:,] '{print $2}' | xargs)
|
||||
UMTS=$(echo "$O" | awk -F[:,] '{print $3}' | xargs)
|
||||
sms_tool -d $_DEVICE at "at#bnd=${GSM},${UMTS},${HEX}"
|
||||
fi
|
||||
}
|
||||
8
modemband/files/usr/share/modemband/1bc71900
Normal file
8
modemband/files/usr/share/modemband/1bc71900
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 17 18 19 20 21 25 26 28 29 30 38 39 40 41 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Telit LN940 Mobile Broadband"
|
||||
}
|
||||
|
||||
. $RES/_foxconn_common2
|
||||
8
modemband/files/usr/share/modemband/1bc71910
Normal file
8
modemband/files/usr/share/modemband/1bc71910
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 17 18 19 20 25 26 28 29 30 32 38 39 40 41 42 43 46 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Telit LN960 Mobile Broadband"
|
||||
}
|
||||
|
||||
. $RES/_foxconn_common1
|
||||
83
modemband/files/usr/share/modemband/1e0e9001
Normal file
83
modemband/files/usr/share/modemband/1e0e9001
Normal file
@ -0,0 +1,83 @@
|
||||
_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="1 2 3 5 7 8 12 14 20 28 38 40 41 48 66 71 77 78"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 14 20 28 38 40 41 48 66 71 77 78"
|
||||
|
||||
getinfo() {
|
||||
echo "SIMCOM SIM8200EA-M2"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "AT+CSYSSEL=\"lte_band\"")
|
||||
echo "$O" | awk -F, '/^\+CSYSSEL: "lte_band",/{gsub(":"," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "AT+CSYSSEL=\"lte_band\",$T"
|
||||
}
|
||||
|
||||
getsupportedbands5gnsa() {
|
||||
echo "$_DEFAULT_5GNSA_BANDS"
|
||||
}
|
||||
|
||||
getbands5gnsa() {
|
||||
O=$(sms_tool -d $_DEVICE at "AT+CSYSSEL=\"nsa_nr5g_band\"")
|
||||
echo "$O" | awk -F, '/^\+CSYSSEL: "nsa_nr5g_band",/{gsub(":"," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands5gnsa() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_5GNSA_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "AT+CSYSSEL=\"nsa_nr5g_band\",$T"
|
||||
}
|
||||
|
||||
getsupportedbands5gsa() {
|
||||
echo "$_DEFAULT_5GSA_BANDS"
|
||||
}
|
||||
|
||||
getbands5gsa() {
|
||||
O=$(sms_tool -d $_DEVICE at "AT+CSYSSEL=\"nr5g_band\"")
|
||||
echo "$O" | awk -F, '/^\+CSYSSEL: "nr5g_band",/{gsub(":"," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands5gsa() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_5GSA_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "AT+CSYSSEL=\"nr5g_band\",$T"
|
||||
}
|
||||
24
modemband/files/usr/share/modemband/20202033
Normal file
24
modemband/files/usr/share/modemband/20202033
Normal file
@ -0,0 +1,24 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 5 7 8 12 17 20 38 40"
|
||||
|
||||
getinfo() {
|
||||
echo "BroadMobi BM806U"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+bmbandpref?")
|
||||
HEX=$(echo "$O" | awk -F[:,] '{print $3}' | xargs)
|
||||
hextobands "$HEX"
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
[ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "at+bmbandpref=,$HEX,"
|
||||
}
|
||||
8
modemband/files/usr/share/modemband/2c7c0125
Normal file
8
modemband/files/usr/share/modemband/2c7c0125
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 20 38 40 41"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EC25"
|
||||
}
|
||||
|
||||
. $RES/_quectel_common
|
||||
10
modemband/files/usr/share/modemband/2c7c0306EG06-E
Normal file
10
modemband/files/usr/share/modemband/2c7c0306EG06-E
Normal file
@ -0,0 +1,10 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 20 28 32 38 40 41"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EG06-E"
|
||||
}
|
||||
|
||||
# +QCFG: "band",0x8df,0x1a0880800d5,0x0
|
||||
|
||||
. $RES/_quectel_common
|
||||
10
modemband/files/usr/share/modemband/2c7c0306EP06-E
Normal file
10
modemband/files/usr/share/modemband/2c7c0306EP06-E
Normal file
@ -0,0 +1,10 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 20 28 38 40 41"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EP06-E"
|
||||
}
|
||||
|
||||
# +QCFG: "band",0x8d0,0x1a0080800d5,0x1
|
||||
|
||||
. $RES/_quectel_common
|
||||
8
modemband/files/usr/share/modemband/2c7c0512EG18-EA
Normal file
8
modemband/files/usr/share/modemband/2c7c0512EG18-EA
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 20 28 38 40 41"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EG18-EA"
|
||||
}
|
||||
|
||||
. $RES/_quectel_common
|
||||
26
modemband/files/usr/share/modemband/2c7c0512EM12-G
Normal file
26
modemband/files/usr/share/modemband/2c7c0512EM12-G
Normal file
@ -0,0 +1,26 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 9 12 13 14 17 18 19 20 21 25 26 28 29 30 32 38 39 40 41 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EM12-G"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# +QCFG: "band",0x5af0,0x42000000003300185a,0x1
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "AT+QCFG=\"band\"")
|
||||
HEX=$(echo "$O" | awk -F[:,] '{print $4}' | xargs)
|
||||
hextobands "$HEX"
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
[ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "AT+QCFG=\"band\",0,$HEX,1"
|
||||
}
|
||||
33
modemband/files/usr/share/modemband/2c7c0620
Normal file
33
modemband/files/usr/share/modemband/2c7c0620
Normal file
@ -0,0 +1,33 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 18 19 20 25 26 28 29 30 32 38 39 40 41 42 46 48 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel EM160R-GL"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+qnwprefcfg=\"lte_band\"?")
|
||||
echo "$O" | awk -F, '/^\+QNWPREFCFG:/{gsub(":"," ");print $2}'
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at+qnwprefcfg=\"lte_band\",$T"
|
||||
}
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RG500Q-EA
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RG500Q-EA
Normal file
@ -0,0 +1,12 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 3 5 7 8 18 19 20 26 28 32 34 38 39 40 41 42 43"
|
||||
_DEFAULT_5GNSA_BANDS="1 3 5 7 8 20 28 38 40 41 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 3 5 7 8 20 28 38 40 41 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RG500Q-EA"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RG502Q-EA
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RG502Q-EA
Normal file
@ -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 46 48 66 71"
|
||||
_DEFAULT_5GNSA_BANDS="1 3 5 7 8 20 28 38 40 41 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 3 5 7 8 20 28 38 40 41 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RG502Q-EA"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RM500Q-GL
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RM500Q-GL
Normal file
@ -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 46 48 66 71"
|
||||
_DEFAULT_5GNSA_BANDS="1 2 3 5 7 8 12 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RM500Q-GL"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RM502Q-AE
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RM502Q-AE
Normal file
@ -0,0 +1,12 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 18 19 20 25 26 28 29 30 32 34 38 39 40 41 42 43 46 48 66 71"
|
||||
_DEFAULT_5GNSA_BANDS="1 2 3 5 7 8 12 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RM502Q-AE"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RM502Q-GL
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RM502Q-GL
Normal file
@ -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
|
||||
12
modemband/files/usr/share/modemband/2c7c0800RM505Q-AE
Normal file
12
modemband/files/usr/share/modemband/2c7c0800RM505Q-AE
Normal file
@ -0,0 +1,12 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 8 12 13 14 17 18 19 20 25 26 28 29 30 32 34 39 40 41 42 43 46 48 66 71"
|
||||
_DEFAULT_5GNSA_BANDS="1 2 3 5 7 8 12 14 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 14 20 25 28 38 40 41 48 66 71 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RM505Q-AE"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0801
Normal file
12
modemband/files/usr/share/modemband/2c7c0801
Normal file
@ -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 46 48 66 71"
|
||||
_DEFAULT_5GNSA_BANDS="1 2 3 5 7 8 12 13 14 18 20 25 26 28 29 30 38 40 41 48 66 70 71 75 76 77 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 7 8 12 13 14 18 20 25 26 28 29 30 38 40 41 48 66 70 71 75 76 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RM520N-GL"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
12
modemband/files/usr/share/modemband/2c7c0900
Normal file
12
modemband/files/usr/share/modemband/2c7c0900
Normal file
@ -0,0 +1,12 @@
|
||||
_DEVICE=/dev/ttyUSB2
|
||||
_DEFAULT_LTE_BANDS="1 2 3 5 8 34 38 39 40 41"
|
||||
_DEFAULT_5GNSA_BANDS="41 78 79"
|
||||
_DEFAULT_5GSA_BANDS="1 2 3 5 8 28 41 77 78 79"
|
||||
|
||||
getinfo() {
|
||||
echo "Quectel RM500U-CNV"
|
||||
}
|
||||
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
. $RES/_quectel_common2
|
||||
8
modemband/files/usr/share/modemband/413c81d7
Normal file
8
modemband/files/usr/share/modemband/413c81d7
Normal file
@ -0,0 +1,8 @@
|
||||
_DEVICE=/dev/ttyUSB1
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 17 18 19 20 25 26 28 29 30 32 38 39 40 41 42 43 46 66"
|
||||
|
||||
getinfo() {
|
||||
echo "Dell DW5821e Snapdragon X20 LTE"
|
||||
}
|
||||
|
||||
. $RES/_foxconn_common1
|
||||
57
modemband/files/usr/share/modemband/8087095a
Normal file
57
modemband/files/usr/share/modemband/8087095a
Normal file
@ -0,0 +1,57 @@
|
||||
_DEVICE=/dev/ttyACM2
|
||||
|
||||
getinfo() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+gmm")
|
||||
_NAME="Fibocom $(echo "$O" | awk -F, '{print $2}')"
|
||||
echo "$_NAME"
|
||||
}
|
||||
|
||||
getsupportedbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+gmm")
|
||||
if echo "$O" | grep -q "L850"; then
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 11 12 13 17 18 19 20 21 26 28 29 30 38 39 40 41 66"
|
||||
fi
|
||||
if echo "$O" | grep -q "L860"; then
|
||||
_DEFAULT_LTE_BANDS="1 2 3 4 5 7 8 12 13 14 17 18 19 20 25 26 28 29 30 32 38 39 40 41 42 46 66"
|
||||
fi
|
||||
if echo "$O" | grep -q "L860-GL-16"; then
|
||||
_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"
|
||||
fi
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# +XACT: 4,2,1,1,2,4,5,8,101,102,103,104,105,107,108,112,113,114,117,118,119,120,125,126,128,129,130,132,138,139,140,141,142,146,166
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+xact?")
|
||||
BANDS=$(echo "$O" | awk -F: '/^\+XACT:/{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+xact?")
|
||||
MODE=$(echo "$O" | awk -F[:,] '{print $2}' | xargs)
|
||||
sms_tool -d $_DEVICE at "at+xact=$MODE,,,$T"
|
||||
fi
|
||||
}
|
||||
131
modemband/files/usr/share/modemband/_fibocom_fm350_common
Normal file
131
modemband/files/usr/share/modemband/_fibocom_fm350_common
Normal file
@ -0,0 +1,131 @@
|
||||
# Unified for NSA/SA
|
||||
_DEFAULT_5G_BANDS="1 2 3 5 7 8 20 25 28 30 38 40 41 48 66 71 77 78 79"
|
||||
|
||||
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() {
|
||||
echo "$_DEFAULT_5G_BANDS"
|
||||
}
|
||||
|
||||
getsupportedbands5gnsa() {
|
||||
echo "$_DEFAULT_5G_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 ""
|
||||
}
|
||||
|
||||
getbands5gnsa() {
|
||||
# +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
|
||||
}
|
||||
|
||||
setbands5gnsa() {
|
||||
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
|
||||
}
|
||||
|
||||
27
modemband/files/usr/share/modemband/_foxconn_common1
Normal file
27
modemband/files/usr/share/modemband/_foxconn_common1
Normal file
@ -0,0 +1,27 @@
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# ^SLBAND: WCDMA,Enabled,1,2,4,5,6,8,9,19
|
||||
# ^SLBAND: LTE,Enabled,1,2,3,4,5,7,8,12,13,14,17,18,19,20,25,26,28,29,30,32,38,39,40,41,42,43,46,66
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at^slband?")
|
||||
echo "$O" | awk -F: '/LTE/{gsub("LTE,Enabled,","");gsub(","," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T},"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at^slband=lte,2,$T"
|
||||
}
|
||||
27
modemband/files/usr/share/modemband/_foxconn_common2
Normal file
27
modemband/files/usr/share/modemband/_foxconn_common2
Normal file
@ -0,0 +1,27 @@
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# ^SLBAND: WCDMA,1,2,4,5,6,8,9,19
|
||||
# ^SLBAND: LTE,1,2,3,4,5,7,8,12,13,17,18,19,20,21,25,26,28,29,30,38,39,40,41,66
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at^slband?")
|
||||
echo "$O" | awk -F: '/^\^SLBAND:.*LTE,/{gsub("LTE,","");gsub(","," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T},"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at^slband=lte,$T"
|
||||
}
|
||||
17
modemband/files/usr/share/modemband/_quectel_common
Normal file
17
modemband/files/usr/share/modemband/_quectel_common
Normal file
@ -0,0 +1,17 @@
|
||||
getsupportedbands() {
|
||||
echo "${_DEFAULT_LTE_BANDS:-Unsupported}"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
O=$(sms_tool -d $_DEVICE at "at+qcfg=\"band\"")
|
||||
HEX=$(echo "$O" | awk -F[:,] '{print $4}' | xargs)
|
||||
hextobands "$HEX"
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
[ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "at+qcfg=\"band\",0,$HEX,0,1"
|
||||
}
|
||||
80
modemband/files/usr/share/modemband/_quectel_common2
Normal file
80
modemband/files/usr/share/modemband/_quectel_common2
Normal file
@ -0,0 +1,80 @@
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# +QNWPREFCFG: "lte_band",1:3:7:8:20:28:38
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+qnwprefcfg=\"lte_band\"")
|
||||
echo "$O" | awk -F, '/^\+QNWPREFCFG:/{gsub(":"," ");print $2}'
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at+qnwprefcfg=\"lte_band\",$T"
|
||||
}
|
||||
|
||||
getsupportedbands5gnsa() {
|
||||
echo "$_DEFAULT_5GNSA_BANDS"
|
||||
}
|
||||
|
||||
getbands5gnsa() {
|
||||
# +QNWPREFCFG: "nsa_nr5g_band",1:2:3:5:7:8:12:20:25:28:38:40:41:48:66:71:77:78:79
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+qnwprefcfg=\"nsa_nr5g_band\"")
|
||||
echo "$O" | awk -F, '/^\+QNWPREFCFG:/{gsub(":"," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands5gnsa() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_5GNSA_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at+qnwprefcfg=\"nsa_nr5g_band\",$T"
|
||||
}
|
||||
|
||||
getsupportedbands5gsa() {
|
||||
echo "$_DEFAULT_5GSA_BANDS"
|
||||
}
|
||||
|
||||
getbands5gsa() {
|
||||
# +QNWPREFCFG: "nr5g_band",1:2:3:5:7:8:12:20:25:28:38:40:41:48:66:71:77:78:79
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+qnwprefcfg=\"nr5g_band\"")
|
||||
echo "$O" | awk -F, '/^\+QNWPREFCFG:/{gsub(":"," ");print $2}' | xargs
|
||||
}
|
||||
|
||||
setbands5gsa() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_5GSA_BANDS"
|
||||
|
||||
T=""
|
||||
for BAND in $BANDS; do
|
||||
case $BAND in
|
||||
''|*[!0-9]*) continue ;;
|
||||
esac
|
||||
[ -n "$T" ] && T="${T}:"
|
||||
T="${T}${BAND}"
|
||||
done
|
||||
|
||||
[ -n "$T" ] && sms_tool -d $_DEVICE at "at+qnwprefcfg=\"nr5g_band\",$T"
|
||||
}
|
||||
19
modemband/files/usr/share/modemband/_zte_common
Normal file
19
modemband/files/usr/share/modemband/_zte_common
Normal file
@ -0,0 +1,19 @@
|
||||
getsupportedbands() {
|
||||
echo "$_DEFAULT_LTE_BANDS"
|
||||
}
|
||||
|
||||
getbands() {
|
||||
# +ZNLOCKBAND: 80800c5,2000000680380
|
||||
|
||||
O=$(sms_tool -d $_DEVICE at "at+znlockband?")
|
||||
HEX="0x"$(echo "$O" | awk -F[:,] '{print $2}' | xargs)
|
||||
hextobands "$HEX"
|
||||
}
|
||||
|
||||
setbands() {
|
||||
BANDS="$1"
|
||||
[ "$BANDS" = "default" ] && BANDS="$_DEFAULT_LTE_BANDS"
|
||||
|
||||
HEX=$(bandstohex "$BANDS")
|
||||
[ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "at+znlockband=1,0,$HEX,0"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user