Skip to content

Commit 31a6343

Browse files
committed
modem_info: update
1 parent 5db7be6 commit 31a6343

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@ add_bar_info_entry()
6969
json_close_object
7070
}
7171

72+
add_speed_entry()
73+
{
74+
rate=$1
75+
type=$2
76+
if [ -z "$rate" ]; then
77+
return
78+
fi
79+
rate=`convert_rate $rate`
80+
case $type in
81+
"rx")
82+
add_plain_info_entry "Rx Rate" "$rate" "Transmit Rate"
83+
;;
84+
"tx")
85+
add_plain_info_entry "Tx Rate" "$rate" "Receive Rate"
86+
;;
87+
*)
88+
return
89+
;;
90+
esac
91+
92+
}
93+
7294
add_avalible_band_entry()
7395
{
7496
band_id=$1

luci/luci-app-qmodem/root/usr/share/qmodem/vendor/fibocom.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,8 @@ network_info()
571571
add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink"
572572
add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink"
573573
add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink"
574-
rx_rate=$(rate_convert $rx_rate)
575-
tx_rate=$(rate_convert $tx_rate)
576-
add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate"
577-
add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate"
574+
add_speed_entry rx $rx_rate
575+
add_speed_entry tx $tx_rate
578576
}
579577

580578
get_lockband(){

luci/luci-app-qmodem/root/usr/share/qmodem/vendor/meig.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,8 @@ network_info()
346346
add_plain_info_entry "Network Type" "$network_type" "Network Type"
347347
add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink"
348348
add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink"
349-
rx_rate=$(rate_convert $rx_rate)
350-
tx_rate=$(rate_convert $tx_rate)
351-
add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate"
352-
add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate"
349+
add_speed_entry rx $rx_rate
350+
add_speed_entry tx $tx_rate
353351
}
354352

355353
# Cell information
@@ -635,4 +633,4 @@ get_bandwidth()
635633
fi
636634

637635
echo "$bandwidth"
638-
}
636+
}

luci/luci-app-qmodem/root/usr/share/qmodem/vendor/quectel.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,8 @@ network_info()
490490
add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink"
491491
add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink"
492492
add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink"
493-
rx_rate=$(rate_convert $rx_rate)
494-
tx_rate=$(rate_convert $tx_rate)
495-
add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate"
496-
add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate"
493+
add_speed_entry rx $rx_rate
494+
add_speed_entry tx $tx_rate
497495
}
498496

499497
#获取频段
@@ -1693,4 +1691,3 @@ cell_info()
16931691
;;
16941692
esac
16951693
}
1696-

0 commit comments

Comments
 (0)