修正检测gps关闭机制
authorp15692025051 <846603105@qq.com>
Tue, 30 May 2023 02:50:07 +0000 (10:50 +0800)
committerp15692025051 <846603105@qq.com>
Tue, 30 May 2023 02:50:07 +0000 (10:50 +0800)
2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py

index 0fbb761..bd63bd1 100644 (file)
@@ -644,11 +644,7 @@ class DeviceInfoManager(Abstract):
         self.hsensor.close()
         # #print("hsensor.open_heart:%d\r\n"%(self.hsensor.open_heart()))
         print("DeviceInfoManager:3")
-        ret = quecgnss.init()
-        if ret == 0:
-            print('GNSS init ok.')
-        else:
-            print('GNSS init failed.')
+        
 
         self.i2c0 = I2C(I2C.I2C0, I2C.FAST_MODE)
         self.stop_temp( None, None)
@@ -1698,9 +1694,11 @@ class LocationManager(Abstract):
         EventMesh.subscribe(constants.EVENT.WIFIINFO, self.WIFI_INFO)
         EventMesh.subscribe(constants.EVENT.WIFISCANOPEN,self.WIFI_scan_open)
         EventMesh.subscribe(constants.EVENT.CLOSE_LOCATION,self.close_location)
+        EventMesh.subscribe("get_location_thread_flag",self.get_location_thread_flag)
         
         #EventMesh.subscribe(constants.EVENT.GPSCLOSE, self.gps_close)
-
+    def get_location_thread_flag(self, event, msg):
+        return self.location_thread_flag
     def start_location(self, event, msg):
         #self.gps_open(event, msg)
         # print("start_location")
@@ -1726,6 +1724,7 @@ class LocationManager(Abstract):
         self.location_thread_flag = 0
         if(self.location_thread_id  != 0):
             _thread.stop_thread(self.location_thread_id)
+            self.location_thread_id = 0
 
     def WIFI_INFO(self, event, msg):
         self.wifi_data = msg