Changeset 911 for trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php
- Timestamp:
- Jul 31, 2021, 12:26:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php
r887 r911 21 21 if (!$Routerboard->Connected) continue; 22 22 $Routerboard->Write('/interface/wireless/registration-table/getall', false); 23 $Routerboard->Write('=.proplist=signal-strength, mac-address,rx-rate,tx-rate', false);23 $Routerboard->Write('=.proplist=signal-strength,tx-signal-strength,mac-address,rx-rate,tx-rate', false); 24 24 $Routerboard->Write('=stats='); 25 25 $Read = $Routerboard->Read(false); … … 37 37 { 38 38 $Strength = $Properties['signal-strength']; 39 } else { 39 } else 40 { 40 41 $Parts = explode('@', $Properties['signal-strength']); 41 42 if (substr($Parts[0], -3) == 'dBm') … … 43 44 else $Strength = $Parts[0]; 44 45 } 46 47 if (array_key_exists('tx-signal-strength', $Properties)) 48 { 49 if (strpos($Properties['tx-signal-strength'], '@') === false) 50 { 51 $RemoteSignal = $Properties['tx-signal-strength']; 52 } else 53 { 54 $Parts = explode('@', $Properties['tx-signal-strength']); 55 if (substr($Parts[0], -3) == 'dBm') 56 $RemoteSignal = substr($Parts[0], 0, -3); // without dBm 57 else $RemoteSignal = $Parts[0]; 58 } 59 } else $RemoteSignal = 0; 60 45 61 $RateRx = $this->StripUnits($Properties['rx-rate']); 46 62 $RateTx = $this->StripUnits($Properties['tx-rate']); 47 $Queries[] = 'INSERT INTO `NetworkSignal` (`MAC`, `Value`, `R ateRx`, `RateTx`, `Time`, `Interface`, `Device`) VALUES '.48 '("'.$Properties['mac-address'].'", '.$Strength.', '.$R ateRx.', '.$RateTx.', "'.63 $Queries[] = 'INSERT INTO `NetworkSignal` (`MAC`, `Value`, `Remote`, `RateRx`, `RateTx`, `Time`, `Interface`, `Device`) VALUES '. 64 '("'.$Properties['mac-address'].'", '.$Strength.', '.$RemoteSignal.', '.$RateRx.', '.$RateTx.', "'. 49 65 TimeToMysqlDateTime($Time).'", '.$Interface.', '.$Device['Id'].')'; 50 66 /*
Note:
See TracChangeset
for help on using the changeset viewer.