更新界面
This commit is contained in:
parent
541f2ddf4b
commit
71552e31f8
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=luci-app-modem
|
||||
LUCI_TITLE:=LuCI support for Modem
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.4.0
|
||||
PKG_VERSION:=1.4.2
|
||||
PKG_LICENSE:=GPLv3
|
||||
PKG_LINCESE_FILES:=LICENSE
|
||||
PKF_MAINTAINER:=siriling <siriling@qq.com>
|
||||
|
@ -315,6 +315,12 @@ function getModemInfo()
|
||||
end
|
||||
end
|
||||
end
|
||||
--添加额外翻译
|
||||
translation["Unknown"]=luci.i18n.translate("Unknown")
|
||||
translation["Excellent"]=luci.i18n.translate("Excellent")
|
||||
translation["Good"]=luci.i18n.translate("Good")
|
||||
translation["Fair"]=luci.i18n.translate("Fair")
|
||||
translation["Bad"]=luci.i18n.translate("Bad")
|
||||
|
||||
--整合数据
|
||||
local data={}
|
||||
|
@ -76,12 +76,6 @@ getMobileNetwork()
|
||||
|
||||
--------advanced--------
|
||||
|
||||
-- 配置ID
|
||||
id = s:taboption("advanced", ListValue, "id", translate("Config ID"))
|
||||
id.rmempty = false
|
||||
id:value(arg[1])
|
||||
-- uci:set('modem',arg[1],'id',arg[1])
|
||||
|
||||
-- 拨号工具
|
||||
dial_tool = s:taboption("advanced", ListValue, "dial_tool", translate("Dial Tool"))
|
||||
dial_tool.description = translate("After switching the dialing tool, it may be necessary to restart the module or restart the router to recognize the module.")
|
||||
@ -136,4 +130,13 @@ password:depends("auth", "both")
|
||||
password:depends("auth", "pap")
|
||||
password:depends("auth", "chap")
|
||||
|
||||
-- 配置ID
|
||||
id = s:taboption("advanced", ListValue, "id", translate("Config ID"))
|
||||
id.rmempty = false
|
||||
id:value(arg[1])
|
||||
-- uci:set('modem',arg[1],'id',arg[1])
|
||||
|
||||
-- 隐藏配置ID
|
||||
m:append(Template("modem/hide_dial_config_id"))
|
||||
|
||||
return m
|
||||
|
@ -31,7 +31,9 @@ function s.create(uci, t)
|
||||
end
|
||||
function s.remove(uci, t)
|
||||
uci.map.proceed = true
|
||||
uci.map:del(t)
|
||||
-- 设置删除
|
||||
uci.map:set(t,"delete","1")
|
||||
-- uci.map:del(t)
|
||||
luci.http.redirect(d.build_url("admin", "network", "modem","dial_overview"))
|
||||
end
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
window.onload=function()
|
||||
{
|
||||
// 获取高级设置标签元素
|
||||
var str="advanced"
|
||||
var advanced_element = document.querySelector('div[data-tab="'+str+'"]');
|
||||
|
||||
//隐藏拨号配置ID元素
|
||||
var dial_config_id_element = advanced_element.lastElementChild;
|
||||
dial_config_id_element.style.display="none";
|
||||
}
|
||||
|
||||
//]]>
|
||||
</script>
|
@ -174,6 +174,232 @@ end
|
||||
network_info_Element.innerHTML=network_info_view;
|
||||
}
|
||||
|
||||
// 获取一个范围的百分比
|
||||
function get_percent(value, min, max)
|
||||
{
|
||||
var percent;
|
||||
if (value <= min) {
|
||||
percent=0;
|
||||
} else if (value >= max) {
|
||||
percent=100;
|
||||
} else {
|
||||
percent=((value - min) / (max - min)) * 100;
|
||||
}
|
||||
return percent.toFixed(2);
|
||||
}
|
||||
|
||||
// 获取参考信号接收功率(RSRP)的信息视图
|
||||
function get_rsrp_info_view(network_type,value)
|
||||
{
|
||||
value=parseFloat(value);
|
||||
var rsrp_info_view={percent:100,quality:"Unknown",style:"width:100.00%;background-color: gray;"};
|
||||
|
||||
// 获取百分比
|
||||
var percent=100;
|
||||
if (network_type.includes("NR"))
|
||||
{
|
||||
percent=get_percent(value,-153,31);
|
||||
}
|
||||
else if (network_type.includes("LTE"))
|
||||
{
|
||||
percent=get_percent(value,-140,-44);
|
||||
}
|
||||
else if (network_type.includes("WCDMA"))
|
||||
{
|
||||
// percent=get_percent(value,-140,-44);
|
||||
}
|
||||
|
||||
// 获取样式
|
||||
var quality="Unknown";
|
||||
var color="gray";
|
||||
if (value>=-70)
|
||||
{
|
||||
quality="Excellent";
|
||||
color="limegreen";
|
||||
}
|
||||
else if (value>=-80&&value<-70)
|
||||
{
|
||||
quality="Good";
|
||||
color="lime";
|
||||
}
|
||||
else if (value>=-90&&value<-80)
|
||||
{
|
||||
quality="Fair";
|
||||
color="gold";
|
||||
}
|
||||
else if (value<-90)
|
||||
{
|
||||
quality="Bad";
|
||||
color="red";
|
||||
}
|
||||
|
||||
rsrp_info_view.percent=percent;
|
||||
rsrp_info_view.quality=quality;
|
||||
rsrp_info_view.style='width:'+rsrp_info_view.percent+'%;background-color: '+color+';';
|
||||
|
||||
return rsrp_info_view;
|
||||
}
|
||||
|
||||
// 获取参考信号接收质量(RSRQ)的信息视图
|
||||
function get_rsrq_info_view(network_type,value)
|
||||
{
|
||||
value=parseFloat(value);
|
||||
var rsrq_info_view={percent:100,quality:"Unknown",style:"width:100.00%;background-color: gray;"};
|
||||
|
||||
// 获取百分比
|
||||
var percent=100;
|
||||
if (network_type.includes("NR"))
|
||||
{
|
||||
percent=get_percent(value,-43,20);
|
||||
}
|
||||
else if (network_type.includes("LTE"))
|
||||
{
|
||||
percent=get_percent(value,-19.5,-3);
|
||||
}
|
||||
else if (network_type.includes("WCDMA"))
|
||||
{
|
||||
// percent=get_percent(value,-19.5,-3);
|
||||
}
|
||||
|
||||
// 获取样式
|
||||
var quality="Unknown";
|
||||
var color="gray";
|
||||
if (value>=-10)
|
||||
{
|
||||
quality="Excellent";
|
||||
color="limegreen";
|
||||
}
|
||||
else if (value>=-15&&value<-10)
|
||||
{
|
||||
quality="Good";
|
||||
color="lime";
|
||||
}
|
||||
else if (value>=-20&&value<-15)
|
||||
{
|
||||
quality="Fair";
|
||||
color="gold";
|
||||
}
|
||||
else if (value<-20)
|
||||
{
|
||||
quality="Bad";
|
||||
color="red";
|
||||
}
|
||||
|
||||
rsrq_info_view.percent=percent;
|
||||
rsrq_info_view.quality=quality;
|
||||
rsrq_info_view.style='width:'+rsrq_info_view.percent+'%;background-color: '+color+';';
|
||||
|
||||
return rsrq_info_view;
|
||||
}
|
||||
|
||||
// 获取信噪比(SINR)的信息视图
|
||||
function get_sinr_info_view(network_type,value)
|
||||
{
|
||||
value=parseFloat(value);
|
||||
var sinr_info_view={percent:100,quality:"Unknown",style:"width:100.00%;background-color: gray;"};
|
||||
|
||||
// 获取百分比
|
||||
var percent=100;
|
||||
if (network_type.includes("NR"))
|
||||
{
|
||||
percent=get_percent(value,-23,40);
|
||||
}
|
||||
else if (network_type.includes("LTE"))
|
||||
{
|
||||
percent=get_percent(value,-20,-30);
|
||||
}
|
||||
else if (network_type.includes("WCDMA"))
|
||||
{
|
||||
// percent=get_percent(value,-20,-30);
|
||||
}
|
||||
|
||||
// 获取样式
|
||||
var quality="Unknown";
|
||||
var color="gray";
|
||||
if (value>=25)
|
||||
{
|
||||
quality="Excellent";
|
||||
color="limegreen";
|
||||
}
|
||||
else if (value>=15&&value<25)
|
||||
{
|
||||
quality="Good";
|
||||
color="lime";
|
||||
}
|
||||
else if (value>=-10&&value<15)
|
||||
{
|
||||
quality="Fair";
|
||||
color="gold";
|
||||
}
|
||||
else if (value<10)
|
||||
{
|
||||
quality="Bad";
|
||||
color="red";
|
||||
}
|
||||
|
||||
sinr_info_view.percent=percent;
|
||||
sinr_info_view.quality=quality;
|
||||
sinr_info_view.style='width:'+sinr_info_view.percent+'%;background-color: '+color+';';
|
||||
|
||||
return sinr_info_view;
|
||||
}
|
||||
|
||||
// 获取接收信号功率(RxLev)的信息视图
|
||||
function get_rxlev_info_view(network_type,value)
|
||||
{
|
||||
value=parseFloat(value);
|
||||
var sinr_info_view={percent:100,quality:"Unknown",style:"width:100.00%;background-color: gray;"};
|
||||
|
||||
// 获取百分比
|
||||
var percent=100;
|
||||
if (network_type.includes("NR"))
|
||||
{
|
||||
percent=get_percent(value,-153,31);
|
||||
}
|
||||
else if (network_type.includes("LTE"))
|
||||
{
|
||||
percent=get_percent(value,-140,-44);
|
||||
}
|
||||
else if (network_type.includes("WCDMA"))
|
||||
{
|
||||
percent=get_percent(value,-120,-25);
|
||||
}
|
||||
else if (network_type.includes("GSM"))
|
||||
{
|
||||
percent=get_percent(value,-110,-48);
|
||||
}
|
||||
|
||||
// 获取样式
|
||||
var quality="Unknown";
|
||||
var color="gray";
|
||||
if (value>=-70)
|
||||
{
|
||||
quality="Excellent";
|
||||
color="limegreen";
|
||||
}
|
||||
else if (value>=-80&&value<-70)
|
||||
{
|
||||
quality="Good";
|
||||
color="lime";
|
||||
}
|
||||
else if (value>=-90&&value<-80)
|
||||
{
|
||||
quality="Fair";
|
||||
color="gold";
|
||||
}
|
||||
else if (value<-100)
|
||||
{
|
||||
quality="Bad";
|
||||
color="red";
|
||||
}
|
||||
|
||||
sinr_info_view.percent=percent;
|
||||
sinr_info_view.quality=quality;
|
||||
sinr_info_view.style='width:'+sinr_info_view.percent+'%;background-color: '+color+';';
|
||||
|
||||
return sinr_info_view;
|
||||
}
|
||||
|
||||
//获取小区信息视图
|
||||
function get_cell_info_view(network_mode_info,network_type,translation)
|
||||
{
|
||||
@ -204,26 +430,54 @@ end
|
||||
//添加单位
|
||||
if (key=="Band") {
|
||||
if (network_type.includes("NR")) {
|
||||
value="N"+value
|
||||
value="N"+value;
|
||||
}
|
||||
else if (network_type.includes("LTE")) {
|
||||
value="B"+value
|
||||
value="B"+value;
|
||||
}
|
||||
else if (network_type.includes("WCDMA")) {
|
||||
value="B"+value
|
||||
value="B"+value;
|
||||
}
|
||||
}
|
||||
else if (key=="UL Bandwidth"||key=="DL Bandwidth") {
|
||||
value=value+" MHz"
|
||||
value=value+" MHz";
|
||||
}
|
||||
else if (key=="RSRP"||key=="TX Power"||key=="RxLev") {
|
||||
value=value+" dBm"
|
||||
|
||||
if (key=="RSRP")
|
||||
{
|
||||
var rsrp_info_view=get_rsrp_info_view(network_type,value);
|
||||
value='<div class="cbi-progressbar" title="'+value+' dBm | '+translation[rsrp_info_view.quality]+' ('+rsrp_info_view.percent+'%)"><div style="'+rsrp_info_view.style+'"></div></div>';
|
||||
}
|
||||
else if (key=="RxLev")
|
||||
{
|
||||
var rxlev_info_view=get_rxlev_info_view(network_type,value);
|
||||
value='<div class="cbi-progressbar" title="'+value+' dBm | '+translation[rxlev_info_view.quality]+' ('+rxlev_info_view.percent+'%)"><div style="'+rxlev_info_view.style+'"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
value=value+" dBm";
|
||||
}
|
||||
}
|
||||
else if (key=="RSRQ"||key=="SINR"||key=="RSSNR"||key=="Ec/Io") {
|
||||
value=value+" dB"
|
||||
|
||||
if (key=="RSRQ")
|
||||
{
|
||||
var rsrq_info_view=get_rsrq_info_view(network_type,value);
|
||||
value='<div class="cbi-progressbar" title="'+value+' dB | '+translation[rsrq_info_view.quality]+' ('+rsrq_info_view.percent+'%)"><div style="'+rsrq_info_view.style+'"></div></div>';
|
||||
}
|
||||
else if (key=="SINR")
|
||||
{
|
||||
var sinr_info_view=get_sinr_info_view(network_type,value);
|
||||
value='<div class="cbi-progressbar" title="'+value+' dB | '+translation[sinr_info_view.quality]+' ('+sinr_info_view.percent+'%)"><div style="'+sinr_info_view.style+'"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
value=value+" dB";
|
||||
}
|
||||
}
|
||||
else if (key=="SCS") {
|
||||
value=value+" KHz"
|
||||
value=value+" KHz";
|
||||
}
|
||||
cell_info_view+='<tr class="tr"><td class="td left" title="'+full_name+'">'+translation[key]+'</td><td class="td left" id="'+key+'">'+value+'</td></tr>';
|
||||
break;
|
||||
|
@ -151,13 +151,13 @@
|
||||
<th class="th cbi-section-table-cell"><%:Status%></th>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:USB Network%>" id="usb_network"><%:USB Network%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:usbnet%>" id="usb_net_kernel_model_name">usbnet.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="usb_network"><%:USB Network%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="usb_net_kernel_model_name">usbnet.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="usbnet_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:Serial Port%>" id="serial"><%:Serial Port%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:qcserial%>" id="serial_kernel_model_name">qcserial.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="serial"><%:Serial Port%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="serial_kernel_model_name">qcserial.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="qcserial_status">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -177,28 +177,28 @@
|
||||
<th class="th cbi-section-table-cell"><%:Status%></th>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:QMI%>" id="qmi"><%:QMI%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:qmi_wwan%>" id="qmi_kernel_model_name">qmi_wwan.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="qmi"><%:QMI%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="qmi_kernel_model_name">qmi_wwan.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="qmi_wwan_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:ECM%>" id="ecm"><%:ECM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:cdc_ether%>" id="ecm_kernel_model_name">cdc_ether.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="ecm"><%:ECM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="ecm_kernel_model_name">cdc_ether.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="cdc_ether_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:MBIM%>" id="mbim"><%:MBIM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:cdc_mbim%>" id="mbim_kernel_model_name">cdc_mbim.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="mbim"><%:MBIM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mbim_kernel_model_name">cdc_mbim.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="cdc_mbim_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:RNDIS%>" id="rndis"><%:RNDIS%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:rndis_host%>" id="rndis_kernel_model_name">rndis_host.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="rndis"><%:RNDIS%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="rndis_kernel_model_name">rndis_host.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="rndis_host_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:NCM%>" id="ecm"><%:NCM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:cdc_ncm%>" id="ncm_kernel_model_name">cdc_ncm.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="ecm"><%:NCM%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="ncm_kernel_model_name">cdc_ncm.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="cdc_ncm_status">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -218,38 +218,38 @@
|
||||
<th class="th cbi-section-table-cell"><%:Status%></th>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:General%>" id="mhi_net"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:mhi_net%>" id="mhi_net_kernel_model_name">mhi_net.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="mhi_net"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mhi_net_kernel_model_name">mhi_net.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="mhi_net_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:General%>" id="qrtr_mhi"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:qrtr_mhi%>" id="qrtr_kernel_model_name">qrtr_mhi.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="qrtr_mhi"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="qrtr_kernel_model_name">qrtr_mhi.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="qrtr_mhi_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:General%>" id="mhi_pci_generic"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:mhi_pci_generic%>" id="mhi_pci_kernel_model_name">mhi_pci_generic.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="mhi_pci_generic"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mhi_pci_kernel_model_name">mhi_pci_generic.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="mhi_pci_generic_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:General%>" id="mhi_wwan_mbim"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:mhi_wwan_mbim%>" id="mhi_mbim_kernel_model_name">mhi_wwan_mbim.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="mhi_wwan_mbim"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mhi_mbim_kernel_model_name">mhi_wwan_mbim.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="mhi_wwan_mbim_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||||
<td class="td cbi-value-field" data-title="<%:General%>" id="mhi_wwan_ctrl"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:mhi_wwan_ctrl%>" id="mhi_wwan_kernel_model_name">mhi_wwan_ctrl.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="mhi_wwan_ctrl"><%:General%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mhi_wwan_kernel_model_name">mhi_wwan_ctrl.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="mhi_wwan_ctrl_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:Private%>" id="private_q"><%:Private%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:pcie_mhi%>" id="pcie_mhi_kernel_model_name">pcie_mhi.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="private_q"><%:Private%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="pcie_mhi_kernel_model_name">pcie_mhi.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="pcie_mhi_status">-</td>
|
||||
</tr>
|
||||
<tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||||
<td class="td cbi-value-field" data-title="<%:Private%>" id="private_mtk"><%:Private%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:mtk_pcie_wwan_m80%>" id="mtk_pcie_wwan_m80_kernel_model_name">mtk_pcie_wwan_m80.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Driver Type%>" id="private_mtk"><%:Private%></td>
|
||||
<td class="td cbi-value-field" data-title="<%:Kernel Model%>" id="mtk_pcie_wwan_m80_kernel_model_name">mtk_pcie_wwan_m80.ko</td>
|
||||
<td class="td cbi-value-field" data-title="<%:Status%>" id="mtk_pcie_wwan_m80_status">-</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -523,6 +523,18 @@ msgstr "中国电信"
|
||||
msgid "46011"
|
||||
msgstr "中国电信"
|
||||
|
||||
msgid "Excellent"
|
||||
msgstr "非常好"
|
||||
|
||||
msgid "Good"
|
||||
msgstr "好"
|
||||
|
||||
msgid "Fair"
|
||||
msgstr "一般"
|
||||
|
||||
msgid "Bad"
|
||||
msgstr "差"
|
||||
|
||||
msgid "Plugin Config"
|
||||
msgstr "插件配置"
|
||||
|
||||
@ -569,7 +581,7 @@ msgid "modemmanager Version"
|
||||
msgstr "modemmanager 版本"
|
||||
|
||||
msgid "Modem General Driver Info"
|
||||
msgstr "模组通用信息"
|
||||
msgstr "模组通用驱动信息"
|
||||
|
||||
msgid "Driver Type"
|
||||
msgstr "驱动类型"
|
||||
|
@ -569,7 +569,7 @@ msgid "modemmanager Version"
|
||||
msgstr "modemmanager 版本"
|
||||
|
||||
msgid "Modem General Driver Info"
|
||||
msgstr "模组通用信息"
|
||||
msgstr "模组通用驱动信息"
|
||||
|
||||
msgid "Driver Type"
|
||||
msgstr "驱动类型"
|
||||
|
@ -547,41 +547,52 @@ stop_dial()
|
||||
if [ -f "${MODEM_RUN_CONFIG}" ] && grep -q "${network}" "${MODEM_RUN_CONFIG}"; then
|
||||
#该配置ID在运行,需要删除记录
|
||||
sed -i "/${id}/d" "${MODEM_RUN_CONFIG}"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
#获取模块序号
|
||||
get_modem_no "${network}"
|
||||
#获取模块序号
|
||||
get_modem_no "${network}"
|
||||
|
||||
#获取模组的拨号模式
|
||||
[ -z "${modem_no}" ] && return 0
|
||||
local mode=$(get_mode ${modem_no})
|
||||
[ -z "$mode" ] || [ "$mode" = "unknown" ] && return
|
||||
#获取模组的拨号模式
|
||||
[ -z "${modem_no}" ] && return 0
|
||||
local mode=$(get_mode ${modem_no})
|
||||
[ -z "$mode" ] || [ "$mode" = "unknown" ] && return
|
||||
|
||||
#根据不同的拨号模式停止拨号
|
||||
if [ "$mode" = "qmi" ]; then
|
||||
stop_qmi
|
||||
elif [ "$mode" = "gobinet" ]; then
|
||||
stop_gobinet
|
||||
elif [ "$mode" = "ecm" ]; then
|
||||
stop_ecm
|
||||
elif [ "$mode" = "mbim" ]; then
|
||||
stop_mbim
|
||||
elif [ "$mode" = "rndis" ]; then
|
||||
stop_rndis
|
||||
elif [ "$mode" = "ncm" ]; then
|
||||
stop_ncm
|
||||
fi
|
||||
|
||||
#根据不同的拨号模式停止拨号
|
||||
if [ "$mode" = "qmi" ]; then
|
||||
stop_qmi
|
||||
elif [ "$mode" = "gobinet" ]; then
|
||||
stop_gobinet
|
||||
elif [ "$mode" = "ecm" ]; then
|
||||
stop_ecm
|
||||
elif [ "$mode" = "mbim" ]; then
|
||||
stop_mbim
|
||||
elif [ "$mode" = "rndis" ]; then
|
||||
stop_rndis
|
||||
elif [ "$mode" = "ncm" ]; then
|
||||
stop_ncm
|
||||
fi
|
||||
}
|
||||
|
||||
dial()
|
||||
{
|
||||
local enable #启用
|
||||
local id #ID
|
||||
local enable #启用
|
||||
local id #ID
|
||||
local delete #删除
|
||||
|
||||
config_get enable $1 enable
|
||||
config_get id $1 id
|
||||
config_get delete $1 delete
|
||||
|
||||
#删除拨号配置
|
||||
[ "$delete" = "1" ] && {
|
||||
stop_dial "$id"
|
||||
uci -q del modem.${id}
|
||||
uci commit modem
|
||||
return 0
|
||||
}
|
||||
|
||||
#停止拨号配置
|
||||
[ "$enable" = "0" ] && {
|
||||
stop_dial "$id"
|
||||
return 0
|
||||
@ -676,14 +687,14 @@ manual_set_modem_config()
|
||||
#获取网络设备路径
|
||||
local network_path="$(readlink -f /sys/class/net/${network})"
|
||||
|
||||
#只处理最上级的网络设备
|
||||
local count=$(echo "${network_path}" | grep -o "/net" | wc -l)
|
||||
[ "$count" -ge "2" ] && return
|
||||
#只处理最上级的网络设备
|
||||
local count=$(echo "${network_path}" | grep -o "/net" | wc -l)
|
||||
[ "$count" -ge "2" ] && return
|
||||
|
||||
#判断路径是否带有usb(排除其他eth网络设备)
|
||||
if [[ "$network" = *"eth"* ]] && [[ "$network_path" != *"usb"* ]]; then
|
||||
return
|
||||
fi
|
||||
if [[ "$network" = *"eth"* ]] && [[ "$network_path" != *"usb"* ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
#获取物理路径
|
||||
local physical_path=$(m_get_device_physical_path ${network_path})
|
||||
|
@ -609,6 +609,34 @@ fibocom_get_nr_dl_bandwidth()
|
||||
echo "$nr_dl_bandwidth"
|
||||
}
|
||||
|
||||
#获取信噪比
|
||||
# $1:网络类型
|
||||
# $2:信噪比数字
|
||||
fibocom_get_sinr_num()
|
||||
{
|
||||
local sinr
|
||||
case $1 in
|
||||
"LTE") sinr=$(awk "BEGIN{ printf \"%.2f\", $2 * 0.5 - 23.5 }" | sed 's/\.*0*$//') ;;
|
||||
"NR") sinr=$(awk "BEGIN{ printf \"%.2f\", $2 * 0.5 - 23.5 }" | sed 's/\.*0*$//') ;;
|
||||
esac
|
||||
echo "$sinr"
|
||||
}
|
||||
|
||||
#获取接收信号功率
|
||||
# $1:网络类型
|
||||
# $2:接收信号功率数字
|
||||
fibocom_get_rxlev()
|
||||
{
|
||||
local rxlev
|
||||
case $1 in
|
||||
"GSM") rxlev=$(($2-110)) ;;
|
||||
"WCDMA") rxlev=$(($2-121)) ;;
|
||||
"LTE") rxlev=$(($2-141)) ;;
|
||||
"NR") rxlev=$(($2-157)) ;;
|
||||
esac
|
||||
echo "$rxlev"
|
||||
}
|
||||
|
||||
#获取参考信号接收功率
|
||||
# $1:网络类型
|
||||
# $2:参考信号接收功率数字
|
||||
@ -644,20 +672,6 @@ fibocom_get_rssnr()
|
||||
echo "$rssnr"
|
||||
}
|
||||
|
||||
#获取接收信号功率
|
||||
# $1:网络类型
|
||||
# $2:接收信号功率数字
|
||||
fibocom_get_rxlev()
|
||||
{
|
||||
local rxlev
|
||||
case $1 in
|
||||
"WCDMA") rxlev=$(($2-121)) ;;
|
||||
"LTE") rxlev=$(($2-141)) ;;
|
||||
"NR") rxlev=$(($2-157)) ;;
|
||||
esac
|
||||
echo "$rxlev"
|
||||
}
|
||||
|
||||
#获取Ec/Io
|
||||
# $1:Ec/Io数字
|
||||
fibocom_get_ecio()
|
||||
@ -699,7 +713,8 @@ fibocom_cell_info()
|
||||
nr_band=$(fibocom_get_band "NR" ${nr_band_num})
|
||||
nr_dl_bandwidth_num=$(echo "$response" | awk -F',' '{print $10}')
|
||||
nr_dl_bandwidth=$(fibocom_get_nr_dl_bandwidth ${nr_dl_bandwidth_num})
|
||||
nr_sinr=$(echo "$response" | awk -F',' '{print $11}')
|
||||
nr_sinr_num=$(echo "$response" | awk -F',' '{print $11}')
|
||||
nr_sinr=$(fibocom_get_sinr_num "NR" ${nr_sinr_num})
|
||||
nr_rxlev_num=$(echo "$response" | awk -F',' '{print $12}')
|
||||
nr_rxlev=$(fibocom_get_rxlev "NR" ${nr_rxlev_num})
|
||||
nr_rsrp_num=$(echo "$response" | awk -F',' '{print $13}')
|
||||
@ -740,7 +755,8 @@ fibocom_cell_info()
|
||||
endc_nr_band=$(fibocom_get_band "NR" ${endc_nr_band_num})
|
||||
nr_dl_bandwidth_num=$(echo "$response" | awk -F',' '{print $10}')
|
||||
endc_nr_dl_bandwidth=$(fibocom_get_nr_dl_bandwidth ${nr_dl_bandwidth_num})
|
||||
endc_nr_sinr=$(echo "$response" | awk -F',' '{print $11}')
|
||||
endc_nr_sinr_num=$(echo "$response" | awk -F',' '{print $11}')
|
||||
endc_nr_sinr=$(fibocom_get_sinr_num "NR" ${endc_nr_sinr_num})
|
||||
endc_nr_rxlev_num=$(echo "$response" | awk -F',' '{print $12}')
|
||||
endc_nr_rxlev=$(fibocom_get_rxlev "NR" ${endc_nr_rxlev_num})
|
||||
endc_nr_rsrp_num=$(echo "$response" | awk -F',' '{print $13}')
|
||||
|
@ -104,6 +104,70 @@
|
||||
"data_interface":"usb",
|
||||
"define_connect":"1",
|
||||
"modes":["qmi","gobinet","ecm","mbim","rndis","ncm"]
|
||||
},
|
||||
"SRM815":{
|
||||
"manufacturer_id":"2dee",
|
||||
"manufacturer":"meig",
|
||||
"platform":"qualcomm",
|
||||
"data_interface":"usb",
|
||||
"define_connect":"1",
|
||||
"modes":["qmi","gobinet","ecm","mbim","rndis"]
|
||||
},
|
||||
"SRM825":{
|
||||
"manufacturer_id":"2dee",
|
||||
"manufacturer":"meig",
|
||||
"platform":"qualcomm",
|
||||
"data_interface":"usb",
|
||||
"define_connect":"1",
|
||||
"modes":["qmi","gobinet","ecm","mbim","rndis"]
|
||||
},
|
||||
"device":{
|
||||
"quectel":{
|
||||
"unisoc":{
|
||||
"vendor_id":["2c7c"],
|
||||
"product_id":["6001","6002","6004","6005","6006","6007","0900","0901","0902","0903","0904"]
|
||||
},
|
||||
"qualcomm":{
|
||||
"vendor_id":["2c7c"],
|
||||
"product_id":["0121","0125","0191","0195","0296","0306","030b","0435","0452","0455","0512","0620","0800","0801"]
|
||||
},
|
||||
"mediatek":{
|
||||
"vendor_id":["2c7c"],
|
||||
"product_id":["0700","7001","7003"]
|
||||
}
|
||||
},
|
||||
"fibocom":{
|
||||
"unisoc":{
|
||||
"vendor_id":["2cb7","3c93","3763"],
|
||||
"product_id":["0a04","0a05","0a06","0a07","3c93","ffff"]
|
||||
},
|
||||
"qualcomm":{
|
||||
"vendor_id":["2cb7"],
|
||||
"product_id":["0104","0105","0106","0107","0108","0109","010A","010B","010F","0110","0111"]
|
||||
},
|
||||
"mediatek":{
|
||||
"vendor_id":["0e8d"],
|
||||
"product_id":["7126","7127"]
|
||||
}
|
||||
},
|
||||
"meig":{
|
||||
"unisoc":{
|
||||
"vendor_id":["2dee"],
|
||||
"product_id":["4d50","4d51","4d52","4d53"]
|
||||
},
|
||||
"qualcomm":{
|
||||
"vendor_id":["2dee","05c6"],
|
||||
"product_id":["4d22","4d23","4d38","4d45","f601"]
|
||||
},
|
||||
"hisilicon":{
|
||||
"vendor_id":["2dee","4d20"],
|
||||
"product_id":["7126","7127"]
|
||||
},
|
||||
"asrmicro":{
|
||||
"vendor_id":["2dee"],
|
||||
"product_id":["4d57","4d58","4d59"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"pcie":{
|
||||
|
Loading…
x
Reference in New Issue
Block a user