MS-PDRLKVHCADMG\Administrator 5 gadi atpakaļ
vecāks
revīzija
237f2d8184
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 5 2
      websocket/idcolWss.php

+ 5 - 2
websocket/idcolWss.php

@@ -46,6 +46,8 @@ $ws_worker->onWorkerStart = function($ws_worker)
             $id = strtolower($id);
             if (strpos($room,'CmdOutput')) {
                 $msg = unpack('H*',$message);
+                var_dump($msg);
+                var_dump($room);
                 if (isset($devUpdateList[$id]) && !empty($devUpdateList[$id])) {
                     $temp = $devUpdateList[$id];
                     $type = substr($msg[1], 0,2);
@@ -104,9 +106,10 @@ $ws_worker->onWorkerStart = function($ws_worker)
                         if (!empty($firmware_info) && !empty($firmware_info[0]['id'])) {
                             $file_path = $url.$firmware_info[0]['path'];
                             $cmd = '190100010000000000';
-                            while (strlen($file_path) < 200) {
-                                $file_path .= '0';
+                            for ($i=0; $i < 200; $i++) { 
+                                $file_path .= pack('H*','00');
                             }
+                            $file_path = substr($file_path,0,200);
                             // $cmd .= $file_path;
                             $cmd = pack('H*', $cmd);
                             $crc = crc16($cmd.$file_path);