diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh index 164fbdb..3e99ea3 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh @@ -69,6 +69,28 @@ add_bar_info_entry() json_close_object } +add_speed_entry() +{ + rate=$1 + type=$2 + if [ -z "$rate" ]; then + return + fi + rate=`convert_rate $rate` + case $type in + "rx") + add_plain_info_entry "Rx Rate" "$rate" "Transmit Rate" + ;; + "tx") + add_plain_info_entry "Tx Rate" "$rate" "Receive Rate" + ;; + *) + return + ;; + esac + +} + add_avalible_band_entry() { band_id=$1 diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/fibocom.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/fibocom.sh index 2b734ae..4163f3a 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/fibocom.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/fibocom.sh @@ -571,10 +571,8 @@ network_info() add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink" add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink" add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink" - rx_rate=$(rate_convert $rx_rate) - tx_rate=$(rate_convert $tx_rate) - add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate" - add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate" + add_speed_entry rx $rx_rate + add_speed_entry tx $tx_rate } get_lockband(){ diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/meig.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/meig.sh index 2a9a902..284139a 100644 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/meig.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/meig.sh @@ -346,10 +346,8 @@ network_info() add_plain_info_entry "Network Type" "$network_type" "Network Type" add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink" add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink" - rx_rate=$(rate_convert $rx_rate) - tx_rate=$(rate_convert $tx_rate) - add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate" - add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate" + add_speed_entry rx $rx_rate + add_speed_entry tx $tx_rate } # Cell information @@ -635,4 +633,4 @@ get_bandwidth() fi echo "$bandwidth" -} \ No newline at end of file +} diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/quectel.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/quectel.sh index 2d15772..36db2a1 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/quectel.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/vendor/quectel.sh @@ -490,10 +490,8 @@ network_info() add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink" add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink" add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink" - rx_rate=$(rate_convert $rx_rate) - tx_rate=$(rate_convert $tx_rate) - add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate" - add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate" + add_speed_entry rx $rx_rate + add_speed_entry tx $tx_rate } #获取频段 @@ -1693,4 +1691,3 @@ cell_info() ;; esac } -