wang jun 1 year ago
parent
commit
ea736ab815

+ 19 - 4
application/common/server/ShouhuanCommand.php

@@ -146,18 +146,27 @@ class ShouhuanCommand
     {
         $command = $data['command'];
         $infoarr = $this->getsendcommandinfo($command);
+        $commandxy = "3G";
         if (!$infoarr) {
             // Log::write("无对应命令数据1:" . $command, 'shouhuan');
             // Log::write($data, 'shouhuan');
-            return false;
+            //return false;
+            $msgdata = [
+                0 => $commandxy,
+                'device_id_code' => $device_id_code,
+                'len' => str_pad(strtoupper(dechex(mb_strlen($command))), 4, "0", STR_PAD_LEFT),
+                'content' => $command,
+            ];
+            $msg = '[' . implode('*', $msgdata) . ']';
+            return $msg;
         }
         $content_arr = $data['content_arr'];
         $config = $infoarr;
-
         $m_ssl = new ShsendlistModel();
-        $commandxy = "3G";
+
         if ('back' == $config['kind']) {
-            $content = $infoarr['command'];
+            $content = $config['content'];
+            $content = $content['command'];
             $weight = $this->getsendweight($command);
             $msgdata = [
                 0 => $commandxy,
@@ -521,6 +530,12 @@ class ShouhuanCommand
                 ],
                 'kind' => 'back',
             ],
+            'UD2' => [
+                'content' => [
+                    'command' => 'UD2',
+                ],
+                'kind' => 'back',
+            ],
         ];
         if (!isset($data[$command])) {
             return false;

+ 3 - 2
application/common/server/SouhuanAnalysis.php

@@ -97,9 +97,10 @@ class SouhuanAnalysis
                 $errmsg = '命令无解析配置 command:' . $command;
                 Log::write($errmsg, 'shouhuan');
                 //return false;
-            } else {
-                $data['config'] = [];
             }
+            //else {
+            //     $data['config'] = [];
+            // }
         }
         if (isset($field)) {
             return $data[$field];

+ 1 - 1
application/workerman/ShTcp.php

@@ -124,7 +124,7 @@ class ShTcp extends Server
                 $lineinfo = $server_sa->getline($data);
                 $device_id_code = $lineinfo['device_id_code'];
                 if ($lineinfo['config']) {
-                    $result = $server_sa->savereceivequeue($data, $lineinfo);
+                    $result = $server_sa->savereceivequeue($data, $device_id_code);
                     if (empty($result)) {
                         Log::write("手环接收信息队列,数据保存失败", 'shouhuan');
                     }