diff --git a/core/ajax/AbeilleZigate.ajax.php b/core/ajax/AbeilleZigate.ajax.php
index 938ba513f2..639e4f1732 100755
--- a/core/ajax/AbeilleZigate.ajax.php
+++ b/core/ajax/AbeilleZigate.ajax.php
@@ -45,7 +45,7 @@ function logToFile($msg = "")
$msg = array();
$msg['topic'] = $topic;
$msg['payload'] = $payload;
- $msgJson = json_encode($msg);
+ $msgJson = json_encode($msg, JSON_UNESCAPED_SLASHES);
$queue = msg_get_queue($abQueues['xToCmd']['id']);
if (msg_send($queue, 1, $msgJson, false, false) == false) {
@@ -72,7 +72,7 @@ function logToFile($msg = "")
"type" => $type,
"network" => $network
);
- $msgJson = json_encode($msg);
+ $msgJson = json_encode($msg, JSON_UNESCAPED_SLASHES);
if (msg_send($queue, 1, $msgJson, false, false) == false) {
$error = "Could not send msg to 'xToParser': msg=".$msgJson;
diff --git a/core/class/Abeille.class.php b/core/class/Abeille.class.php
index 20ddfc2d17..0f8d9d299e 100644
--- a/core/class/Abeille.class.php
+++ b/core/class/Abeille.class.php
@@ -543,13 +543,15 @@ public static function cron() {
// Checking how many gateways are in pairing mode
$count = 0;
for ($gtwId = 1; $gtwId <= $GLOBALS['maxGateways']; $gtwId++) {
- if (self::checkInclusionStatus("Abeille".$gtwId) == 1) {
- Abeille::publishMosquitto($abQueues['xToCmd']['id'], PRIO_NORM, "CmdAbeille".$gtwId."/0000/permitJoin", "Status");
+ $incStatus = self::checkInclusionStatus("Abeille${gtwId}");
+ log::add('Abeille', 'debug', "cron(): Abeille${gtwId} => inclusion status = ${incStatus}");
+ if ($incStatus === 1) {
+ Abeille::publishMosquitto($abQueues['xToCmd']['id'], PRIO_NORM, "CmdAbeille${gtwId}/0000/permitJoin", "Status");
$count++;
}
}
if ($count > 1)
- message::add("Abeille", "Attention !! Vous avez plusieurs (${count}) passerelles en mode inclusion.");
+ message::add("Abeille", "Attention !! Vous avez plusieurs passerelles en mode inclusion.");
// log::add( 'Abeille', 'debug', 'cron(): Fin ------------------------------------------------------------------------------------------------------------------------' );
} // End cron()
@@ -1019,15 +1021,14 @@ public static function postSave() {
}
/* Returns inclusion status: 1=include mode, 0=normal, -1=ERROR */
- public static function checkInclusionStatus($dest) {
- // Return: Inclusion status or -1 if error
- $ruche = Abeille::byLogicalId($dest.'/0000', 'Abeille');
-
- if ($ruche) {
- // echo "Join status collection\n";
- $cmdJoinStatus = $ruche->getCmd('Info', 'permitJoin-Status');
- if ($cmdJoinStatus) {
- return $cmdJoinStatus->execCmd();
+ public static function checkInclusionStatus($net) {
+ $eqLogic = eqLogic::byLogicalId($net.'/0000', 'Abeille');
+ if (is_object($eqLogic)) {
+ $cmdJoinStatus = $eqLogic->getCmd('info', 'permitJoin-Status');
+ if (is_object($cmdJoinStatus)) {
+ $incStatus = $cmdJoinStatus->execCmd();
+ if (($incStatus === 0) || ($incStatus === 1))
+ return $incStatus;
}
}
@@ -1794,7 +1795,7 @@ public static function msgFromParser($msg) {
if (isset($eqLogic)) {
$eqLogic->setIsEnable(0);
/* Display message only if NOT in include mode */
- if (self::checkInclusionStatus($net) != 1)
+ if (self::checkInclusionStatus($net) !== 1)
message::add("Abeille", $eqLogic->getHumanName().": A quitté le réseau => désactivé.", '');
$eqLogic->save();
$eqLogic->refresh();
diff --git a/core/class/AbeilleCmdProcess.class.php b/core/class/AbeilleCmdProcess.class.php
index d381bf9aa4..9a571dc572 100755
--- a/core/class/AbeilleCmdProcess.class.php
+++ b/core/class/AbeilleCmdProcess.class.php
@@ -338,123 +338,6 @@ function ReportParamXiaomi($dest,$Command) {
}
}
- // Tcharp38: Seems no longer used
- // J'ai un probleme avec la command 0110, je ne parviens pas à l utiliser. Prendre setParam2 en atttendant.
- // function setParam($dest,$address,$clusterId,$attributeId,$dstEp,$Param) {
- // /*
- //
- //
- //