Browse Source

UPD: Engine bump to version 1.9.26
CHG: changed return values of Async functions

Giancarlo Voci 7 years ago
parent
commit
9fa61f32dc

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
 	"name": "OM-Link",
 	"name": "OM-Link",
-	"version": "1.9.25",
+	"version": "1.9.26",
 	"private": true,
 	"private": true,
 	"description": "OM-Link Engine",
 	"description": "OM-Link Engine",
 	"author": "Open Mind",
 	"author": "Open Mind",

+ 2 - 2
src/Modules/Blank/Pages.php

@@ -58,10 +58,10 @@ class Pages extends Controller
 					//$findBoxCore->UnBind($label);
 					//$findBoxCore->UnBind($label);
 				}*/
 				}*/
 
 
-		$this->BlinkOFF($labels);
+/*		$this->BlinkOFF($labels);
 		sleep(5);
 		sleep(5);
 
 
-		$this->BlinkON($labels);
+		$this->BlinkON($labels);*/
 
 
 		$this->BlinkONW([
 		$this->BlinkONW([
 			'0113067F',
 			'0113067F',

+ 8 - 1
src/OpenMind/FindBox/FindBoxCoreSystem.php

@@ -11,6 +11,7 @@
 namespace OpenMind\FindBox;
 namespace OpenMind\FindBox;
 
 
 use Exception;
 use Exception;
+use Generator;
 use OpenMind\System\System;
 use OpenMind\System\System;
 use ZipArchive;
 use ZipArchive;
 
 
@@ -111,7 +112,13 @@ class FindBoxCoreSystem
 			"value" => $val);
 			"value" => $val);
 	}
 	}
 
 
-	public function AsyncCallAPI(string $URI, string $Parameters, bool $skipResponse = false)
+	/**
+	 * @param string $URI
+	 * @param string $Parameters
+	 * @param bool $skipResponse
+	 * @return Generator
+	 */
+	public function AsyncCallAPI(string $URI, string $Parameters, bool $skipResponse = false): Generator
 	{
 	{
 		$bodyJSON = null;
 		$bodyJSON = null;
 		$auth = "Authorization: Basic " . base64_encode("{$this->Key}:{$this->Pass}") . "\r\n";
 		$auth = "Authorization: Basic " . base64_encode("{$this->Key}:{$this->Pass}") . "\r\n";

+ 15 - 2
src/OpenMind/FindBox/SmartESL.php

@@ -7,6 +7,8 @@
 
 
 namespace OpenMind\FindBox;
 namespace OpenMind\FindBox;
 
 
+use Generator;
+
 class SmartESL
 class SmartESL
 {
 {
 	protected $core;
 	protected $core;
@@ -51,12 +53,23 @@ class SmartESL
 		return array_values(array_filter_keys($softVersion, ['soft_major', 'soft_minor', 'soft_patch']));
 		return array_values(array_filter_keys($softVersion, ['soft_major', 'soft_minor', 'soft_patch']));
 	}
 	}
 
 
-	public function AsyncBlinkOff()
+	public function AsyncBlinkOff(): Generator
 	{
 	{
 		return $this->AsyncBlinkSpecial(0, 0, 0, 0, 0);
 		return $this->AsyncBlinkSpecial(0, 0, 0, 0, 0);
 	}
 	}
 
 
-	public function AsyncBlinkSpecial(int $pattern, int $repeat, int $iter_time, int $iterations, int $ledColor = 0)
+
+	/**
+	 * Blink the label with parameters. BlinkSpecial make use of getData() and check how many leds has to auto select the firmware version.
+	 *
+	 * @param int $pattern
+	 * @param int $repeat
+	 * @param int $iter_time
+	 * @param int $iterations
+	 * @param int|0 $ledColor
+	 * @return Generator
+	 */
+	public function AsyncBlinkSpecial(int $pattern, int $repeat, int $iter_time, int $iterations, int $ledColor = 0): Generator
 	{
 	{
 
 
 		$uriParams = json_encode(array_merge(
 		$uriParams = json_encode(array_merge(