1
0

modified init and some debugging

This commit is contained in:
2022-01-06 13:03:26 +01:00
parent 85a7fd7ed9
commit 004c6aa572
10 changed files with 178 additions and 34 deletions

View File

@@ -2,7 +2,7 @@
function message($message)
{
global $topics, $logFh, $devices;
global $topics, $logFh, $devices, $included;
$topic = explode ("/", $message->topic);
if ($topic[1] == "bridge")
{
@@ -35,9 +35,8 @@ function message($message)
default:
break;
};
}elseif (($topic[array_key_last($topic)]) != "get" and ($topic[array_key_last($topic)]) != "set")
}elseif (($topic[array_key_last($topic)]) != "get" and ($topic[array_key_last($topic)]) != "set" and $included)
{
$topic = explode ("/", $message->topic, 2); // get topic name
$fnTree = explode ("/" , $topic[1]); // get friendlyname
echo $topic[0] . " => " . $topic[1] . EOL;
@@ -119,6 +118,7 @@ function connectResponse($r, $message)
function subscribeResponse($mid, $qosCount)
{
global $topics, $mids, $nSubscribed;
print_r($mids);
$key = $mids[$mid];
echo _("Subscribed to ") . $key . EOL;
$topics[$key]->status = true;
@@ -157,6 +157,7 @@ function publishResponse($mid)
{
//echo "unsetting mids" . EOL;
unset ($mids[$mid]);
//print_r($mids);
}else
{
//echo "setting mids" . EOL;