Skip to content

Commit 3b6bf2b

Browse files
committed
huawei: fix unisoc dial mode classification
1 parent 13952f7 commit 3b6bf2b

File tree

1 file changed

+4
-2
lines changed
  • application/qmodem/files/usr/share/qmodem/vendor

1 file changed

+4
-2
lines changed

application/qmodem/files/usr/share/qmodem/vendor/huawei.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ function set_imei(){
2727

2828
function get_mode(){
2929
cfg=$(at $at_port "AT^SETMODE?")
30-
local mode_num=`echo -e "$cfg" | sed -n '2p' | sed 's/\r//g'`
30+
3131
case $platform in
3232
"unisoc")
33+
local mode_num=$(echo -e "$cfg" | grep "^SETMODE"|grep -o '\d')
3334
case $mode_num in
3435
"0") mode="rndis" ;;
3536
"1") mode="ecm" ;;
@@ -38,7 +39,8 @@ function get_mode(){
3839
esac
3940
;;
4041
*)
41-
case "$mode_num" in
42+
local mode_num=$(echo -e "$cfg" | sed -n '2p' | sed 's/\r//g')
43+
case "$mode_num" in
4244
"0"|"2") mode="ecm" ;;
4345
"1"|"3"|"4"|"5") mode="ncm" ;;
4446
"6") mode="rndis" ;;

0 commit comments

Comments
 (0)