更新Modem固件,PY_SRV_V14
authorSnickerSun <snickersun@163.com>
Sat, 12 Oct 2024 23:28:35 +0000 (07:28 +0800)
committerSnickerSun <snickersun@163.com>
Sat, 12 Oct 2024 23:28:35 +0000 (07:28 +0800)
添加自动更新Python脚本支持。但必须在PY_SRV_V13以上

cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20241013-0925.zip [new file with mode: 0644]
cat1modem/src/cat1Service.py
cat1modem/src/checkota.py
cat1modem/src/current_img/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip [moved from cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip with 100% similarity]
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/cat1Service.py
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/checkota.py
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

diff --git a/cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20241013-0925.zip b/cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20241013-0925.zip
new file mode 100644 (file)
index 0000000..9816140
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3468b00bf777e0275310f16cb398b491b9e7b9aa2cc4485fb921aa7e8c3b2c20
+size 11640237
index 97ce585..f80e24d 100644 (file)
@@ -73,7 +73,7 @@ sms.setCallback(msg_cb)#sms注册回调
 CAT1_SERVICE_HEAD = 'FE' #固定head 
 
 PROJECT_NAME = "Cat1SlipUDPService"
-PROJECT_VERSION = "PY_SRV_V13"
+PROJECT_VERSION = "PY_SRV_V14"
 CONFIG_JSON="/usr/system_config.json"
 CURRENT_APP_TYPE="pysrv"
 
@@ -94,9 +94,9 @@ def get_default_versionvalue_by_py(app_type):
     if (app_type == "pymain"):
         return "PY_MAIN_V2"
     elif (app_type == "pyota"):
-        return  "PY_OTA_V13"
+        return  "PY_OTA_V14"
     elif (app_type == "pysrv"):
-        return  "PY_SRV_V13"
+        return  "PY_SRV_V14"
 
 #如果没有configfile则创建它
 if not ql_fs.path_exists(CONFIG_JSON):
index 773ca70..e5ef1f1 100644 (file)
@@ -14,7 +14,7 @@ import utime
 import log
 import uos
 
-PROJECT_VERSION="PY_OTA_V13"
+PROJECT_VERSION="PY_OTA_V14"
 CONFIG_JSON="/usr/system_config.json"
 CURRENT_APP_TYPE="pyota"
 # 设置日志输出级别
index c45968f..f80e24d 100644 (file)
@@ -73,7 +73,7 @@ sms.setCallback(msg_cb)#sms注册回调
 CAT1_SERVICE_HEAD = 'FE' #固定head 
 
 PROJECT_NAME = "Cat1SlipUDPService"
-PROJECT_VERSION = "PY_SRV_V13"
+PROJECT_VERSION = "PY_SRV_V14"
 CONFIG_JSON="/usr/system_config.json"
 CURRENT_APP_TYPE="pysrv"
 
@@ -94,9 +94,9 @@ def get_default_versionvalue_by_py(app_type):
     if (app_type == "pymain"):
         return "PY_MAIN_V2"
     elif (app_type == "pyota"):
-        return  "PY_OTA_V13"
+        return  "PY_OTA_V14"
     elif (app_type == "pysrv"):
-        return  "PY_SRV_V13"
+        return  "PY_SRV_V14"
 
 #如果没有configfile则创建它
 if not ql_fs.path_exists(CONFIG_JSON):
@@ -306,7 +306,11 @@ class Cat1Service:
             # UDP_CMD_DIAL_NUMB
             if eventMesh.publish("get_volte_switch") == 1: #只有BLE开了VOLTE才允许打电话
                 ret = voiceCall.callStart(str(parm))
+                if ret != 0:
+                    ret = voiceCall.callStart(str(parm))
                 print("ret={} {} {}".format(ret,cmd,parm))
+                if ret != 0:
+                    self.reply_cmd('0F',"callfail")
         elif cmd == "02":
             print(cmd)
             # UDP_CMD_HUNGUP
index 773ca70..e5ef1f1 100644 (file)
@@ -14,7 +14,7 @@ import utime
 import log
 import uos
 
-PROJECT_VERSION="PY_OTA_V13"
+PROJECT_VERSION="PY_OTA_V14"
 CONFIG_JSON="/usr/system_config.json"
 CURRENT_APP_TYPE="pyota"
 # 设置日志输出级别
index e3fece0..9b5fbbd 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "lwip/apps/sntp.h"
 // #include "graphic_service.h"
-
+#include "cat1_tcpServer.h"
 #ifdef __cplusplus
 
 extern "C" {
@@ -243,6 +243,8 @@ static uint8_t g_time_synced = 0;
 #define MAX_TIME_SYNC_RETRY_TIME 5
 static uint8_t g_time_sync_retry_time = 0;
 
+#define  PY_SRV_VER_CURRENT 14
+#define  PY_SRV_VER_SUPORT_PY_OTA_MINI_VER 13
 
 #define  PY_SRV_VER_4 "PY_SRV_V4"
 #define  PY_SRV_VER_5 "PY_SRV_V5"
@@ -250,6 +252,17 @@ static uint8_t g_time_sync_retry_time = 0;
 
 static uint8_t g_py_ver = 4;
 
+/**如果 
+ * g_python_updated == 0 && 
+ * g_py_ver >= PY_SRV_VER_SUPORT_PY_OTA_MINI_VER &&
+ * g_py_ver != PY_SRV_VER_CURRENT
+ * 升级开始,马上设置 g_python_updated = 1
+ * 否则
+ * g_python_updated = 1 
+ * 跳过升级
+ * 保证开机只升级一次。
+ * */
+static uint8_t g_python_updated = 0;
 
 static struct tcp_msg_old_t *unpack_tlv_format_old(char *rx_buffer, int length)
 {
@@ -721,6 +734,22 @@ static int decodeNetStat(char* msg)
         }
     }
 
+    /**Start check Python OTA **/
+    if ( g_python_updated == 0)
+    {
+         /**升级开始,马上设置 */
+        if (g_py_ver >= PY_SRV_VER_SUPORT_PY_OTA_MINI_VER && g_py_ver != PY_SRV_VER_CURRENT) 
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"start cat1 python ota\n");
+            Cat1_OTA(CAT1_TCP_START_OTA);
+        }else{
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"current PyVer %d, mini pyVer %d , local pyVer %d,  skip cat1 python ota!\n",g_py_ver,PY_SRV_VER_SUPORT_PY_OTA_MINI_VER,PY_SRV_VER_CURRENT);
+        }
+    }
+    g_python_updated = 1;
+    /**End check Python OTA **/
+
+
     if (update > 0)
         return 0;
     else