Project

General

Profile

« Previous | Next » 

Revision 145cc518

Added by Seth Mos over 12 years ago

Fix the Cellular strength indicator, rssi was always reporting 8 because we didn't use the variable.
The dBm values array was reversed, corrected

View differences:

etc/inc/pfsense-utils.inc
2601 2601
function huawei_rssi_to_string($rssi) {
2602 2602
	$dbm = array();
2603 2603
	$i = 0;
2604
	$dbstart = -51;
2605
	while($i < 31) {
2606
		$dbm[$i] = $dbstart - ($i * 2);
2604
	$dbstart = -113;
2605
	while($i < 32) {
2606
		$dbm[$i] = $dbstart + ($i * 2);
2607 2607
		$i++;
2608 2608
	}
2609 2609
	$percent = round(($rssi / 31) * 100);
2610
	$string = "rssi:8 level:{$dbm[$rssi]}dBm percent:{$percent}%";
2610
	$string = "rssi:{$rssi} level:{$dbm[$rssi]}dBm percent:{$percent}%";
2611 2611
	return $string;
2612 2612
}
2613 2613

  

Also available in: Unified diff