Permalink
Browse files

Fix the Cellular strength indicator, rssi was always reporting 8 beca…

…use we didn't use the variable.

The dBm values array was reversed, corrected
  • Loading branch information...
1 parent 7fd6766 commit 145cc5181c26cdcc74cacd1d201fcfcdf4465530 @smos smos committed Mar 19, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 etc/inc/pfsense-utils.inc
@@ -2601,13 +2601,13 @@ function calculate_ipv6_delegation_length($if) {
function huawei_rssi_to_string($rssi) {
$dbm = array();
$i = 0;
- $dbstart = -51;
- while($i < 31) {
- $dbm[$i] = $dbstart - ($i * 2);
+ $dbstart = -113;
+ while($i < 32) {
+ $dbm[$i] = $dbstart + ($i * 2);
$i++;
}
$percent = round(($rssi / 31) * 100);
- $string = "rssi:8 level:{$dbm[$rssi]}dBm percent:{$percent}%";
+ $string = "rssi:{$rssi} level:{$dbm[$rssi]}dBm percent:{$percent}%";
return $string;
}

0 comments on commit 145cc51

Please sign in to comment.