@@ -54,6 +54,15 @@ LE910Cx_modes=$(cat << EOF
54
54
6 1251 RNDIS+NMEA+MODEM+MODEM+SAP
55
55
EOF
56
56
)
57
+ LE910_V2_modes=$( cat << EOF
58
+ 0 0036 NCM
59
+ 1 0034
60
+ 2 0035
61
+ 3 0032 MBIM+NCM
62
+ 4 0037 NCM
63
+ 5 0033 MBIM+NCM
64
+ EOF
65
+ )
57
66
LM9x0_modes=$( cat << EOF
58
67
0 1042 RNDIS DIAG ADB NMEA MODEM MODEM AUX
59
68
1 1040 DIAG ADB RMnet NMEA MODEM MODEM AUX
@@ -100,15 +109,25 @@ set -e
100
109
check_dependencies
101
110
check_pid_exists
102
111
case ${_pid} in
112
+
113
+ 0036|0034|0035|0032|0037|0033)
114
+ modem=" LE910_V2"
115
+ tty=/dev/ttyACM0
116
+ NEED_RESET=1
117
+ ;;
103
118
1040|1042|1041|1043)
104
119
modem=" LM9x0"
105
120
tty=/dev/ttyUSB3
106
121
;;
107
- 1201|1203|1204|1205|1206|1250| 1251)
122
+ 1201|1203|1204|1205|1206|1251)
108
123
modem=" LE910Cx"
109
124
tty=/dev/ttyUSB3
110
125
;;
111
- 1062|1060|1061|1063|1064)
126
+ 1250)
127
+ modem=" LE910Cx"
128
+ tty=/dev/ttyUSB1
129
+ ;;
130
+ 1062|1060|1061|1063|1064|1066)
112
131
modem=" LN920"
113
132
tty=/dev/ttyUSB3
114
133
;;
@@ -147,13 +166,22 @@ set -x
147
166
sudo sendat -p $tty -c ' at#usbcfg=' $mode
148
167
set +x
149
168
150
- echo [+] waiting $_timeout seconds for the modem to reconfigure into $next_pid ...
169
+ if [[ -n $NEED_RESET ]]; then
170
+ sudo sendat -p $tty -c ' at#reboot'
171
+ fi
172
+
173
+ dmesg_minor_version=$( dmesg --version | cut -d" " -f4 | cut -d" ." -f2)
174
+
175
+ # dmesg --follow-new flag is supported from minor version 37 only
176
+ if [[ $dmesg_minor_version -ge 37 ]]; then
177
+ echo [+] waiting $_timeout seconds for the modem to reconfigure into $next_pid ...
151
178
/usr/bin/expect << EOF
152
179
set timeout $_timeout
153
- spawn dmesg -TW
180
+ spawn dmesg --ctime --follow-new
154
181
expect {
155
182
timeout { send_user "\nWait timed out. Either the modem is slower or did not reconfigure correctly, please check manually.\n"; exit 1 }
156
183
eof { send_user "\ncould not get dmesg\n"; exit 1 }
157
184
"New USB device found*idProduct=$next_pid *" { send_user "\nModem reconfigured correctly\n"; exit 0 }
158
185
}
159
186
EOF
187
+ fi
0 commit comments