mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix the Cellular strength indicator, rssi was always reporting 8 because we didn't use the variable.
The dBm values array was reversed, corrected
This commit is contained in:
parent
7fd67662b4
commit
145cc5181c
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user