Bläddra i källkod

Merge branch 'master' of http://gogs.renlianiot.com:4000/zmcoding/station-test-api

likang 1 år sedan
förälder
incheckning
0207d9ec7b
1 ändrade filer med 3 tillägg och 4 borttagningar
  1. 3 4
      catch/api/controller/Api.php

+ 3 - 4
catch/api/controller/Api.php

@@ -428,8 +428,6 @@ class Api extends CatchController
 
     //消息处理
     public function handleMessage($text, $mac, $time, $ues_redis){
-        $EXP_TIME = 20;
-        $EFF_SIG_NUM = 10;
         while(strlen($text)>=24){
     
             $da=substr($text,0,24);
@@ -558,8 +556,8 @@ class Api extends CatchController
                             "left" => number_format( $sum3/$cacCount, 2 ),
                             "right" => number_format( $sum4/$cacCount, 2 ),
                         ];
-    
-                        if ($cacCount == $EFF_SIG_NUM) {
+                        // var_dump($cacCount, $EFF_SIG_NUM, "dddddddd");
+                        if ($cacCount == $config['effSigNum']) {
                             # code...
                            $info = $this->compAndPush($info ,$config);
                         }
@@ -593,6 +591,7 @@ class Api extends CatchController
         $flagIn = $avg["front"] < $config["front_in"] || $avg["behind"] < $config["behind_in"] || $avg["left"] < $config["left_in"] || $avg["right"] < $config["right_in"];
         $flagOut = $avg["front"] > $config["front_out"] && $avg["behind"] > $config["behind_out"] && $avg["left"] > $config["left_out"] && $avg["right"] > $config["right_out"];
 
+        
         $url="http://47.114.185.186:8115/api/areaReport";
         if($flagIn && $status == 2){
             if ($info["pushTime"] &&  (time()-$info['pushTime']) < 5 ) {