mirror of
https://github.com/commaai/agnos-builder.git
synced 2026-08-03 08:40:52 +08:00
use USB vendor ID for modem upness
This commit is contained in:
@@ -10,6 +10,14 @@ LTE_RST_N=50
|
||||
LTE_BOOT=52
|
||||
LTE_PWRKEY=116
|
||||
|
||||
function is_modem_up {
|
||||
if lsusb -d "0x05c6:" >/dev/null 2>&1 || lsusb -d "0x2c7c:" >/dev/null 2>&1; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function reset {
|
||||
echo " Resetting..."
|
||||
gpio $LTE_RST_N 1
|
||||
@@ -28,7 +36,7 @@ function is_online {
|
||||
echo " Waiting until the modem comes online..."
|
||||
|
||||
for i in {0..30}; do
|
||||
if lsusb | grep -q "Quectel"; then
|
||||
if is_modem_up; then
|
||||
echo " Modem is online!"
|
||||
return 0
|
||||
fi
|
||||
@@ -44,7 +52,7 @@ function is_offline {
|
||||
echo " Waiting until the modem goes offline..."
|
||||
|
||||
for i in {0..30}; do
|
||||
if ! lsusb | grep -q "Quectel"; then
|
||||
if ! is_modem_up; then
|
||||
echo " Modem is offline!"
|
||||
return 0
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user