From: p15692025051 <846603105@qq.com> Date: Tue, 30 May 2023 02:50:07 +0000 (+0800) Subject: 修正检测gps关闭机制 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=5ce15027a9ba3fbe5380b561220b2dc2f6a3f08f;p=mirrors%2FASR1603_G5.git 修正检测gps关闭机制 --- diff --git a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py index 0fbb7618..bd63bd18 100644 --- a/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py +++ b/2.sdk/project/K5/sdk/services/microPython/ports/quectel/core/mgr.py @@ -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