temp solution:get model by id

This commit is contained in:
fujr 2024-05-11 14:29:03 +08:00
parent 79d356f8b8
commit 00f0197bd2

View File

@ -453,7 +453,19 @@ m_set_modem_config()
local modem_name=$(uci -q get modem.modem${modem_no}.name) local modem_name=$(uci -q get modem.modem${modem_no}.name)
[ -z "$modem_name" ] && { [ -z "$modem_name" ] && {
local at_command="AT+CGMM?" 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 BUSNUM:"$BUSNUM" >> /root/test
echo MAJOR:"$MAJOR" >> /root/test echo MAJOR:"$MAJOR" >> /root/test
echo MINOR:"$MINOR" >> /root/test echo MINOR:"$MINOR" >> /root/test
} }