From 00f0197bd29c2dc66bd4c3adcc6a4ea6b7aa2d35 Mon Sep 17 00:00:00 2001 From: fujr Date: Sat, 11 May 2024 14:29:03 +0800 Subject: [PATCH] temp solution:get model by id --- .../root/usr/share/modem/modem_util.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/luci-app-modem/root/usr/share/modem/modem_util.sh b/luci-app-modem/root/usr/share/modem/modem_util.sh index 5a58037..79c5f43 100755 --- a/luci-app-modem/root/usr/share/modem/modem_util.sh +++ b/luci-app-modem/root/usr/share/modem/modem_util.sh @@ -453,7 +453,19 @@ m_set_modem_config() local modem_name=$(uci -q get modem.modem${modem_no}.name) [ -z "$modem_name" ] && { local at_command="AT+CGMM?" - modem_name=$(at ${at_port} ${at_command} | grep "+CGMM: " | awk -F'"' '{print $2}' | tr 'A-Z' 'a-z') + modem_name=$(at ${at_port} ${at_command} | grep "+CGMM: " | awk -F'"' '{print $2}' | tr 'A-Z' 'a-z' |cut -d ' ' -f 1) + } + [ -z "$modem_name" ] && { + #通过模组id设置型号 + if [ -f "${physical_path}/idVendor" ] && [ -f "${physical_path}/idProduct" ]; then + local manufacturer_id=$(cat "${physical_path}/idVendor") + local product_id=$(cat "${physical_path}/idProduct") + case "$manufacturer_id" in + 2c7c) + modem_name="quectel_generic" + ;; + esac + fi } #获取模组支持列表 @@ -941,4 +953,4 @@ test_tty_hotplug() echo BUSNUM:"$BUSNUM" >> /root/test echo MAJOR:"$MAJOR" >> /root/test echo MINOR:"$MINOR" >> /root/test -} \ No newline at end of file +}