G10:协议问题
authordxy15521469561 <1731678236@qq.com>
Fri, 24 May 2024 02:39:14 +0000 (10:39 +0800)
committerdxy15521469561 <1731678236@qq.com>
Fri, 24 May 2024 02:39:14 +0000 (10:39 +0800)
2.sdk/project/D10/new.bat
2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr.py
2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/mgr_d15.py
2.sdk/project/D10/sdk/services/microPython/ports/quectel/core/protocol.py

index 43458e9..8aacecf 100644 (file)
@@ -13,7 +13,7 @@ if errorlevel 0 (
 )
 :STEP1
 
-..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 716800 -i .\images\customer_fs.bin
+..\..\Helios_SDK\tools\ASR_1606\win32\mklfs.exe -c usr -b 4096 -r 4096 -p 4096 -s 393216 -i .\images\customer_fs.bin
 if errorlevel 1 (
     echo "customer_fs.binÉú³Éʧ°Ü Çë¼ì²éusrĿ¼ÊÇ·ñ´óÓÚ316K!!!!!!!!!!!!!!!"
     goto exit
index 494ad49..dcc3f70 100644 (file)
@@ -676,6 +676,7 @@ if EventMesh.model == "D10":
                     EventMesh.debug_log("voice_callback:on_list_flag{}".format(on_list_flag))
                     if on_list_flag == 1:#在白名单里
                         if WLKEY == "2":
+                            WL_timer.stop()
                             WL_timer.start(30000, 0, WL_timer_cb)
                     else:
                         EventMesh.debug_log("voice_callback:不在白名单中,挂断")
@@ -1340,7 +1341,7 @@ if EventMesh.model == "D10":
 
                     if get_temp_state > 1  and (WEAR != 1 or call_state != 0):
                         EventMesh.publish(constants.EVENT.STOP_TEMP)
-                        EventMesh.publish("set_temp_state",0)       
+                        EventMesh.publish("set_temp_state",0)
                         EventMesh.txt_log("auto stop_temp:22")
 
                     if (self.get_hr_state > 1 or self.get_spo2_state > 1 or get_bp_state > 1 or get_bg_state > 1) and (WEAR != 1 or call_state != 0):
@@ -1365,7 +1366,6 @@ if EventMesh.model == "D10":
                                     EventMesh.publish(constants.PROTOCOL.OXYGEN_SEND,spo2_value)
                             
                         if get_bp_state > 1:
-
                             EventMesh.txt_log("auto stop_bp:22")
                             EventMesh.publish("set_bp_state",0)#2代表后台进入测试
                             EventMesh.publish(constants.EVENT.STOP_HEART)
@@ -1382,7 +1382,6 @@ if EventMesh.model == "D10":
                             
                         if get_bg_state > 1:
                             EventMesh.txt_log("auto stop_bg:22")
-                            
                             EventMesh.publish("set_bg_state",0)#2代表后台进入测试
                             EventMesh.publish(constants.EVENT.STOP_HEART)
                             if WEAR == 1:
@@ -1575,6 +1574,8 @@ if EventMesh.model == "D10":
                                         EventMesh.publish(constants.PROTOCOL.TEMP_SEND,[tmp_f_tmp,tmp_d_tmp])
                                 EventMesh.publish(constants.EVENT.STOP_TEMP)
                                 EventMesh.txt_log("auto start_temp:333")
+                        else:
+                            self.temp_one_state = 0
 
 
         
@@ -1597,7 +1598,7 @@ if EventMesh.model == "D10":
                                         EventMesh.txt_log("auto START_temp:1")
                                         EventMesh.publish(constants.EVENT.START_TEMP)
 
-                                    elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1:
+                                    elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1 and get_temp_state == 2:
                                         self.temp_state = 0
                                         EventMesh.txt_log("auto stop_temp:1")
                                         EventMesh.publish("set_temp_state",0)
@@ -1663,7 +1664,7 @@ if EventMesh.model == "D10":
                                         # EventMesh.publish("set_hr_blood_led",1)
                                         EventMesh.publish(constants.EVENT.START_HEART)
                                         
-                                    elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1:
+                                    elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1 and get_hr_state == 2:
                                         self.HR_Onestate = 0
                                         EventMesh.publish("set_hr_state",0)#2代表后台进入测试
                                         EventMesh.debug_log("stop debug3")
@@ -1713,7 +1714,7 @@ if EventMesh.model == "D10":
                                     EventMesh.publish("set_spo2_state",2)#2代表后台进入测试
                                     EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧
                                     
-                                elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1:
+                                elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1 and get_spo2_state == 2:
                                     EventMesh.publish("set_spo2_state",0)#2代表后台进入测试
                                     self.spo2auto_state = 0
                                     EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
@@ -1760,7 +1761,7 @@ if EventMesh.model == "D10":
                                     # EventMesh.publish("set_hr_blood_led",1)
                                     EventMesh.publish(constants.EVENT.START_HEART)
                                     
-                                elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1:
+                                elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1 and get_bp_state == 2:
                                     self.bpauto_state = 0
                                     EventMesh.publish("set_bp_state",0)#2代表后台进入测试
                                     blood_data = get_autoblood_value()
@@ -1816,7 +1817,7 @@ if EventMesh.model == "D10":
                                     # EventMesh.publish("set_hr_blood_led",1)
                                     EventMesh.publish(constants.EVENT.START_HEART)
                                     self.BG_state = 1
-                                elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1:
+                                elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1 and get_bg_state == 2:
                                     self.BG_state = 0
                                     EventMesh.publish("set_bg_state",0)#2代表后台进入测试
                                     # EventMesh.publish("stop_led_timer")#设置参数
index c09f710..2520269 100644 (file)
@@ -1609,7 +1609,7 @@ if EventMesh.model == "D15":
                                         EventMesh.txt_log("auto START_temp:1")
                                         EventMesh.publish(constants.EVENT.START_TEMP)
 
-                                    elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1:
+                                    elif (time_tmp-self.temp_timeSecond) >= 30 and self.temp_state == 1 and get_temp_state == 2:
                                         self.temp_state = 0
                                         EventMesh.txt_log("auto stop_temp:1")
                                         EventMesh.publish("set_temp_state",0)
@@ -1673,7 +1673,7 @@ if EventMesh.model == "D15":
                                         # EventMesh.publish("set_hr_blood_led",1)
                                         EventMesh.publish(constants.EVENT.START_HEART)
                                         
-                                    elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1:
+                                    elif (time_tmp - self.hr_timeSecond) >= 60 and self.HR_Onestate == 1 and get_hr_state == 2:
                                         self.HR_Onestate = 0
                                         EventMesh.publish("set_hr_state",0)#2代表后台进入测试
                                         EventMesh.debug_log("stop debug3")
@@ -1723,7 +1723,7 @@ if EventMesh.model == "D15":
                                     EventMesh.publish("set_spo2_state",2)#2代表后台进入测试
                                     EventMesh.publish(constants.EVENT.START_BLOOD_OXYGEN)#K开血氧
                                     
-                                elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1:
+                                elif (time_tmp - self.spo2_timeSecond) >= 60 and self.spo2auto_state == 1 and get_spo2_state == 2:
                                     EventMesh.publish("set_spo2_state",0)#2代表后台进入测试
                                     self.spo2auto_state = 0
                                     EventMesh.publish(constants.EVENT.STOP_BLOOD_OXYGEN)
@@ -1770,7 +1770,7 @@ if EventMesh.model == "D15":
                                     # EventMesh.publish("set_hr_blood_led",1)
                                     EventMesh.publish(constants.EVENT.START_HEART)
                                     
-                                elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1:
+                                elif (time_tmp - self.bp_timeSecond) >= 60 and self.bpauto_state == 1 and get_bp_state == 2:
                                     self.bpauto_state = 0
                                     EventMesh.publish("set_bp_state",0)#2代表后台进入测试
                                     blood_data = get_autoblood_value()
@@ -1825,7 +1825,7 @@ if EventMesh.model == "D15":
                                     # EventMesh.publish("set_hr_blood_led",1)
                                     EventMesh.publish(constants.EVENT.START_HEART)
                                     self.BG_state = 1
-                                elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1:
+                                elif (time_tmp - self.bg_timeSecond) >= 60 and self.BG_state == 1 and get_bg_state == 2:
                                     self.BG_state = 0
                                     EventMesh.publish("set_bg_state",0)#2代表后台进入测试
                                     # EventMesh.publish("stop_led_timer")#设置参数
index 6e64fe9..2ab81a5 100644 (file)
@@ -456,7 +456,7 @@ class SockManager(Abstract):
                 # ip_addr = "app.api.thisiot.com"
                 # http://app.api.thisiot.com/
                 url = "http://app.api.thisiot.com/dev/device/check?imei={}&bid={}&sonce={}&sign={}".format(imei,pid_data,sonce_data,sign_data)
-
+                
                 # print("url:{}".format(url))
                 response = request.get(url)
                 data_tmp ={}
@@ -2208,7 +2208,7 @@ class sosHome_dial_ProtoCol(ProtoCol):
     TYPE = "SOS"
     def send(self, event, msg):
         # [XT*334588000000156*0004*MONITOR]
-        send_data = self.PID+"*%s*0003*SOS"%(self.imei)
+        send_data = EventMesh.publish("get_new_pid")+"*%s*0003*SOS"%(self.imei)
         MD5_SIGN = self.pack_MD5_head(send_data)
         data = "[%s%s]"%(str(MD5_SIGN),send_data)
         print("sosHome_dial_ProtoCol:data:%s"%(data))
@@ -3418,7 +3418,7 @@ class SCREEN_SHOWProtoCol(ProtoCol):
     TYPE = "SCREEN_SHOW"
     def send(self, event, msg):
         # [XT*334588000000156*0006*SILENCETIME2]
-        send_data = self.PID+"*%s*000B*SCREEN_SHOW"%(self.imei)
+        send_data = EventMesh.publish("get_new_pid")+"*%s*000B*SCREEN_SHOW"%(self.imei)
         MD5_SIGN = self.pack_MD5_head(send_data)
         data = "[%s%s]"%(str(MD5_SIGN),send_data)
         # print("KEYBRD:data:%s"%(data))