|
@@ -512,7 +512,7 @@ class ONU implements DeviceInterface
|
|
|
$log = $rootDir . "/../var/logs/" . $env . ".log";
|
|
|
$out = array();
|
|
|
exec("tail -400 {$log} | grep 'ONU_id_{$this->id}'", $out);
|
|
|
-
|
|
|
+
|
|
|
return implode("\n", $out);
|
|
|
}
|
|
|
|
|
@@ -592,7 +592,7 @@ class ONU implements DeviceInterface
|
|
|
|
|
|
return $this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Si la ONU no tiene NAP retorna 0
|
|
|
* De lo contrario recorre y retorna la primer position
|
|
@@ -615,15 +615,26 @@ class ONU implements DeviceInterface
|
|
|
asort($positions);
|
|
|
$position_range = range(1, end($positions));
|
|
|
$position_diff = array_diff($position_range, $positions);
|
|
|
-
|
|
|
+
|
|
|
if (!empty($position_diff)) {
|
|
|
$position = array_shift($position_diff);
|
|
|
} else {
|
|
|
$position = $nap->getOnus()->count() + 1;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- return $position;
|
|
|
+
|
|
|
+ return $position;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getDeviceData()
|
|
|
+ {
|
|
|
+ return array(
|
|
|
+ 'deviceType' => get_class($this),
|
|
|
+ 'deviceId' => $this->id,
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
}
|