MS-PDRLKVHCADMG\Administrator 5 lat temu
rodzic
commit
b72cb57de6
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      api/application/helpers/function_helper.php

+ 2 - 2
api/application/helpers/function_helper.php

@@ -117,11 +117,11 @@ function lampMqttCmd($sendTopic,$backTopic,$sendData,$timeout = 5,$seq = ''){
     while($true == 1){
         $true = $mqtt->proc();
         if (!empty($seq) && $true != 1){
-            $res = unpack('H*', $true['msg']);
+            $res = unpack('H*', substr($true['msg'],2));
             set_log('get_load.txt','------------');
             set_log('get_load.txt',substr($res[1], 0,2));
             set_log('get_load.txt',$seq);
-            if (substr($res[1], 2,2) != strtolower($seq)) $true = 1;
+            if (substr($res[1], 0,2) != strtolower($seq)) $true = 1;
         }
         if (time() - $t >= $timeout) {
             return '';