Changeset 751


Ignore:
Timestamp:
Oct 5, 2015, 11:11:38 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: More robust decoding of wireless signal strenght which varies across RouterOS versions.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r748 r751  
    11<?php
    22
    3 $Revision = 748; // Subversion revision
     3$Revision = 751; // Subversion revision
    44$DatabaseRevision = 748; // SQL structure revision
    5 $ReleaseTime = strtotime('2015-09-19');
     5$ReleaseTime = strtotime('2015-10-04');
  • trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php

    r738 r751  
    3939      } else $Interface = null;
    4040
    41       $Parts = explode('@', $Properties['signal-strength']);
    42       $Strength = substr($Parts[0], 0, -3); // without dBm
     41      if(strpos($Properties['signal-strength'], '@') === false)
     42      {
     43        $Strength = $Properties['signal-strength'];
     44      } else {
     45        $Parts = explode('@', $Properties['signal-strength']);
     46        if(substr($Parts[0], -3) == 'dBm')
     47          $Strength = substr($Parts[0], 0, -3); // without dBm
     48          else $Strength = $Parts[0];
     49      }
     50      echo($Properties['signal-strength'].' '.$Strength."\n");
    4351      $RateRx = substr($Properties['rx-rate'], 0, -3); // without MHz
    4452      $RateTx = substr($Properties['tx-rate'], 0, -3); // without MHz
Note: See TracChangeset for help on using the changeset viewer.