From: SnickerSun Date: Sat, 12 Oct 2024 23:28:35 +0000 (+0800) Subject: 更新Modem固件,PY_SRV_V14 X-Git-Tag: release_V1.2.70_20241020_135402~60^2~3^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=407da4f525d02f74bf7807562e6feb1af4d40408;p=mirrors%2FFD230.git 更新Modem固件,PY_SRV_V14 添加自动更新Python脚本支持。但必须在PY_SRV_V13以上 --- 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 index 000000000..981614019 --- /dev/null +++ b/cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20241013-0925.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3468b00bf777e0275310f16cb398b491b9e7b9aa2cc4485fb921aa7e8c3b2c20 +size 11640237 diff --git a/cat1modem/src/cat1Service.py b/cat1modem/src/cat1Service.py index 97ce5852c..f80e24d18 100644 --- a/cat1modem/src/cat1Service.py +++ b/cat1modem/src/cat1Service.py @@ -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): diff --git a/cat1modem/src/checkota.py b/cat1modem/src/checkota.py index 773ca7014..e5ef1f1ae 100644 --- a/cat1modem/src/checkota.py +++ b/cat1modem/src/checkota.py @@ -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" # 设置日志输出级别 diff --git a/cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip b/cat1modem/src/current_img/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip similarity index 100% rename from cat1modem/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip rename to cat1modem/src/current_img/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312_20240924-2153.zip diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/cat1Service.py b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/cat1Service.py index c45968fef..f80e24d18 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/cat1Service.py +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/cat1Service.py @@ -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 diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/checkota.py b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/checkota.py index 773ca7014..e5ef1f1ae 100644 --- a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/checkota.py +++ b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/system/cat1ota/checkota.py @@ -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" # 设置日志输出级别 diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp index e3fece0d5..9b5fbbd46 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp @@ -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