Changeset 911 for trunk/Modules/NetworkConfigAirOS/Generators/Signal.php
- Timestamp:
- Jul 31, 2021, 12:26:16 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigAirOS/Generators/Signal.php
r887 r911 21 21 if (count($Result) > 0) 22 22 { 23 //print_r($Result); 24 $Array = json_decode(implode("\n", $Result), true); 25 //print_r($Array); 26 echo('-'); 27 foreach ($Array as $Properties) 28 { 29 $DbResult = $this->Database->select('NetworkInterface', 'Id', '`MAC`="'.$Properties['mac'].'"'); 30 if ($DbResult->num_rows > 0) 23 //print_r($Result); 24 $Array = json_decode(implode("\n", $Result), true); 25 //print_r($Array); 26 echo('-'); 27 foreach ($Array as $Properties) 31 28 { 32 $DbRow = $DbResult->fetch_assoc(); 33 $Interface = $DbRow['Id']; 34 } else $Interface = null; 29 $DbResult = $this->Database->select('NetworkInterface', 'Id', '`MAC`="'.$Properties['mac'].'"'); 30 if ($DbResult->num_rows > 0) 31 { 32 $DbRow = $DbResult->fetch_assoc(); 33 $Interface = $DbRow['Id']; 34 } else $Interface = null; 35 35 36 $Strength = $Properties['signal']; 37 $RateRx = $Properties['rx']; 38 $RateTx = $Properties['tx']; 39 $this->Database->insert('NetworkSignal', array('MAC' => $Properties['mac'], 40 'Value' => $Strength, 'RateRx' => $RateRx, 'RateTx' => $RateTx, 41 'Time' => TimeToMysqlDateTime($Time), 'Interface' => $Interface, 'Device' => $Device['Id'])); 42 echo('.'); 43 } 44 echo("\n"); 36 $Strength = $Properties['signal']; 37 $RemoteSignal = $Properties['remote']['signal']; 38 $RateRx = $Properties['rx']; 39 $RateTx = $Properties['tx']; 40 $this->Database->insert('NetworkSignal', array('MAC' => $Properties['mac'], 41 'Value' => $Strength, 'Remote' => $RemoteSignal, 'RateRx' => $RateRx, 'RateTx' => $RateTx, 42 'Time' => TimeToMysqlDateTime($Time), 'Interface' => $Interface, 'Device' => $Device['Id'])); 43 echo('.'); 44 } 45 echo("\n"); 45 46 } else echo("Empty response\n"); 46 47 }
Note:
See TracChangeset
for help on using the changeset viewer.