fix: Fixed PMP frequency divisor (#7899)

* Update Frequency Divisor

* Fix Linting

* Update array declaration
This commit is contained in:
Paul Heinrichs
2017-12-15 15:51:45 -05:00
committed by Neil Lathwood
parent 7e2cfb03bc
commit ade19f93be

View File

@@ -121,7 +121,7 @@ class Pmp extends OS implements
'Frequency', 'Frequency',
null, null,
1, 1,
10000 $this->freqDivisor()
) )
); );
} }
@@ -195,4 +195,35 @@ class Pmp extends OS implements
$device = $this->getDevice(); $device = $this->getDevice();
return str_contains($device['hardware'], 'AP') || str_contains($device['hardware'], 'Master'); return str_contains($device['hardware'], 'AP') || str_contains($device['hardware'], 'Master');
} }
/**
* PMP Frequency divisor is different per model
* using the following for production:
* FSK 5.2, 5.4, 5.7 GHz: OID returns MHz
* FSK 900 MHz, 2.4 GHz: OID returns 100's of KHz
* OFDM: OID returns 10's of KHz"
*/
private function freqDivisor()
{
$device = $this->getDevice();
$types = array(
'OFDM' => 1000,
'5.4GHz' => 1,
'5.2Ghz' => 1,
'5.7Ghz' => 1,
'2.4Ghz' => 10,
'900Mhz' => 10
);
$boxType = snmp_get($device, 'boxDeviceType.0', '-Oqv', 'WHISP-BOX-MIBV2-MIB');
foreach ($types as $key => $value) {
if (str_contains($boxType, $key)) {
return $value;
}
}
return 1;
}
} }