From: hcj <1224667075@qq.com> Date: Tue, 15 Jul 2025 03:13:05 +0000 (+0800) Subject: 1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=9f1ab19a6704f38ac7763e5f9dcd76610a49d1ae;p=mirrors%2FFD230.git 1 --- diff --git a/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip b/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip deleted file mode 100644 index f153a28f5..000000000 --- a/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b98532e83e5f83c7b86d43e923091987eb3517bacf6fc5bc24c3ed9d88ad4d9 -size 11630097 diff --git a/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1524.zip b/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1524.zip new file mode 100644 index 000000000..842488220 --- /dev/null +++ b/cat1modem/fd230/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1524.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5db7b8ce249c29afc7be765f6814122f6dc836aa49884559938dde22aac89b79 +size 11630065 diff --git a/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944.zip:Zone.Identifier b/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944.zip:Zone.Identifier deleted file mode 100644 index e69de29bb..000000000 diff --git a/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250709-1731.zip b/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250709-1731.zip deleted file mode 100644 index 065abd4c3..000000000 --- a/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250709-1731.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:82324c00dd851ace1c45e65886849fe39d7d356573b965ce90b66ff123b0c6d7 -size 11630066 diff --git a/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip b/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip deleted file mode 100644 index f153a28f5..000000000 --- a/cat1modem/fd230/bak/EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630_20250630-1944_20250710-1429.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b98532e83e5f83c7b86d43e923091987eb3517bacf6fc5bc24c3ed9d88ad4d9 -size 11630097 diff --git a/cat1modem/fd230/bak/dfota_1.bin b/cat1modem/fd230/bak/dfota_1.bin new file mode 100644 index 000000000..056adbe73 --- /dev/null +++ b/cat1modem/fd230/bak/dfota_1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f24e88c307af6112c683db86b7ac96c3907972e36a64b56eb7ba20bb1a219730 +size 63496 diff --git a/cat1modem/fd230/bak/dfota_2.bin b/cat1modem/fd230/bak/dfota_2.bin new file mode 100644 index 000000000..261758a8a --- /dev/null +++ b/cat1modem/fd230/bak/dfota_2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:490ba61e0fc4caee01854c1798cb3738d042acf280940c58761da9daf3393ee2 +size 3530844 diff --git a/cat1modem/src/cat1Service.py b/cat1modem/src/cat1Service.py index deed26916..8472750c9 100644 --- a/cat1modem/src/cat1Service.py +++ b/cat1modem/src/cat1Service.py @@ -79,7 +79,7 @@ sms.setCallback(msg_cb)#sms注册回调 CAT1_SERVICE_HEAD = 'FE' #固定head PROJECT_NAME = "Cat1SlipUDPService" -PROJECT_VERSION = "PY_SRV_V19" +PROJECT_VERSION = "PY_SRV_V20" CONFIG_JSON="/usr/system_config.json" CURRENT_APP_TYPE="pysrv" diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 0977143b8..d56d6e275 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -7487,99 +7487,125 @@ errcode_t decode_single_dial_info(ble_read_data *buffer_handle) } static errcode_t install_dial(void) { - char *lzmapkgname =uapi_dev_runtime_get_dialname(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"install %s\n",lzmapkgname); - char *lzmaindex = strstr(lzmapkgname,".lzma"); - if (lzmaindex != NULL) - { - struct stat info; - if (stat(get_dial_path(), &info) != 0) - { - if (mkdir(get_dial_path(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) - { - return ERRCODE_FAIL; // - } - } + char *lzmapkgname = uapi_dev_runtime_get_dialname(); + // 增加初始参数校验打印 + if (lzmapkgname == NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:获取到的表盘包名为空\n"); + return ERRCODE_FAIL; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 开始安装表盘,包名:%s\n", lzmapkgname); - char dial_basename[64]={0}; - int dial_basenamelen = (lzmaindex - lzmapkgname); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"dial_basenamelen %d\n",dial_basenamelen); - if (dial_basenamelen>0 ) - { - memcpy_s(dial_basename,sizeof(dial_basename),lzmapkgname,dial_basenamelen); - } - else{ + // 检查是否为lzma格式包 + char *lzmaindex = strstr(lzmapkgname, ".lzma"); + if (lzmaindex == NULL) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:包名中未找到.lzma后缀,不是有效压缩包\n"); + return ERRCODE_FAIL; + } + + // 创建表盘目录(若不存在) + struct stat info; + if (stat(get_dial_path(), &info) != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 表盘目录不存在,尝试创建...\n"); + if (mkdir(get_dial_path(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:创建表盘目录失败\n"); return ERRCODE_FAIL; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"dial_basename %s\n",dial_basename); - char dialbin_filepath[128]={0}; - if(ble_dial_uid>5) - { - if (get_dial_file_path(dial_basename,strlen(dial_basename),dialbin_filepath,sizeof(dialbin_filepath)) != ERRCODE_SUCC) - { - return ERRCODE_FAIL; - } - } - else - { - if (get_custom_dial_file_path(ble_dial_uid,dial_basename,strlen(dial_basename),dialbin_filepath,sizeof(dialbin_filepath)) != ERRCODE_SUCC) - { - return ERRCODE_FAIL; - } - } - + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 表盘目录创建成功\n"); + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 表盘目录已存在,无需创建\n"); + } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"dialbin_filepath %s\n",dialbin_filepath); - char lzma_filepath[128]={0}; - if (get_file_recv_file_path(lzmapkgname,strlen(lzmapkgname),lzma_filepath,sizeof(lzma_filepath)) != ERRCODE_SUCC) - { + // 解析表盘基础名称(去除.lzma后缀) + char dial_basename[64] = {0}; + int dial_basenamelen = lzmaindex - lzmapkgname; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解析基础名称长度:%d\n", dial_basenamelen); + if (dial_basenamelen <= 0 || dial_basenamelen >= sizeof(dial_basename)) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:基础名称长度无效(%d),超出缓冲区大小\n", dial_basenamelen); + return ERRCODE_FAIL; + } + memcpy_s(dial_basename, sizeof(dial_basename), lzmapkgname, dial_basenamelen); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解析到表盘基础名称:%s\n", dial_basename); + + // 确定解压后bin文件路径 + char dialbin_filepath[128] = {0}; + if (ble_dial_uid > 5) { + if (get_dial_file_path(dial_basename, strlen(dial_basename), dialbin_filepath, sizeof(dialbin_filepath)) != ERRCODE_SUCC) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:获取常规表盘文件路径失败\n"); + return ERRCODE_FAIL; + } + } else { + if (get_custom_dial_file_path(ble_dial_uid, dial_basename, strlen(dial_basename), dialbin_filepath, sizeof(dialbin_filepath)) != ERRCODE_SUCC) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:获取自定义表盘文件路径失败\n"); return ERRCODE_FAIL; } - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"lzma_filepath %s\n",lzma_filepath); + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解压目标bin文件路径:%s\n", dialbin_filepath); - errcode_t ret = uapi_dial_pkg_decompress(lzma_filepath,dialbin_filepath); + // 确定源lzma文件路径 + char lzma_filepath[128] = {0}; + if (get_file_recv_file_path(lzmapkgname, strlen(lzmapkgname), lzma_filepath, sizeof(lzma_filepath)) != ERRCODE_SUCC) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:获取源lzma文件路径失败\n"); + return ERRCODE_FAIL; + } + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 源lzma文件路径:%s\n", lzma_filepath); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"decode %s to %s , ret %X \n",lzma_filepath,dialbin_filepath, ret); + // 执行解压操作 + errcode_t ret = uapi_dial_pkg_decompress(lzma_filepath, dialbin_filepath); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解压操作完成,返回码:0x%X(%s)\n", ret, + (ret == ERRCODE_SUCC) ? "成功" : "失败"); - char *namebuf= strtok(lzmapkgname,"."); + // 关键:检查解压后bin文件是否存在及大小 + struct stat bin_info; + if (stat(dialbin_filepath, &bin_info) != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:解压后bin文件不存在或无法访问(路径:%s)\n", dialbin_filepath); + ret = ERRCODE_FAIL; // 即使解压返回成功,文件不存在也视为失败 + } else { + if (bin_info.st_size <= 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 错误:解压后bin文件大小为空(%ld字节),无效文件\n", bin_info.st_size); + ret = ERRCODE_FAIL; // 大小为空视为失败 + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解压后bin文件大小正常:%ld字节\n", bin_info.st_size); + } + } - if(ble_dial_uid>5) - { - install_Register_dial(namebuf,ble_dial_uid); + // 若解压失败,直接返回 + if (ret != ERRCODE_SUCC) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 解压失败,终止安装流程\n"); + return ret; + } + // 注册并设置表盘 + char *namebuf = strtok(lzmapkgname, "."); + if (ble_dial_uid > 5) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 注册常规表盘:%s(ID:%d)\n", namebuf, ble_dial_uid); + install_Register_dial(namebuf, ble_dial_uid); + ble_set_dial_by_id(ble_dial_uid); + } else { + if (ble_dial_file_index == ble_dial_file_count) { + char name_str[32] = {0}; + ble_get_custom_dial(ble_dial_uid, name_str); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 自定义表盘安装完毕,注册:%s(ID:%d)\n", name_str, ble_dial_uid); + install_Register_dial(name_str, ble_dial_uid); ble_set_dial_by_id(ble_dial_uid); - - } - else - { - if(ble_dial_file_index==ble_dial_file_count) - { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"自定义表盘安装完毕\r\n"); - char name_str[32]={0}; - ble_get_custom_dial(ble_dial_uid,name_str); - install_Register_dial(name_str,ble_dial_uid); - ble_set_dial_by_id(ble_dial_uid); - } - + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 自定义表盘未达安装条件(当前索引:%d,总数:%d)\n", + ble_dial_file_index, ble_dial_file_count); } - - - //安装完后删除表盘 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"remove %s\r\n",lzma_filepath); - - if(0!=remove(lzma_filepath)) - return ERRCODE_FAIL; + } - if ( ret == ERRCODE_SUCC) - return ERRCODE_SUCC; - else - return ERRCODE_FAIL; - }else{ - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,".lzma not found\n"); - return ERRCODE_FAIL; + // 删除源lzma文件 + #if 1 + if (remove(lzma_filepath) != 0) { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 警告:删除源lzma文件失败(路径:%s),可能残留冗余文件\n", lzma_filepath); + // 此处不返回失败,仅警告,因为核心安装已完成 + } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 源lzma文件已成功删除\n"); } -} + #endif + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[install_dial] 表盘安装流程全部完成,返回成功\n"); + return ERRCODE_SUCC; +} static char file_name[128]={0}; static uint32_t file_size=0; diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index 12e926e1c..4ba80ef34 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -2447,6 +2447,24 @@ static void blesrvAi_send_service_task(void const *arg) if(getselect4gorbtai() == 1) //选择的是4g { + if(get_clear_queue_stream()) + { + // osal_msg_queue_write_head_copy(g_ble_Ai_record_queue, (void *)&mail,sizeof(blesrv_custom_cmd_t), 0); + int quesize = osal_msg_queue_get_msg_num(g_ble_Ai_record_queue); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"do_uart_slip_cmd quesize %d\n",quesize); + while(quesize) + { + osal_msg_queue_read_copy(g_ble_Ai_record_queue, (void *)&mail, &msgsize, + OSAL_MSGQ_WAIT_FOREVER); + if(mail.msg_data) + { + free(mail.msg_data); + mail.msg_data = NULL; + } + quesize--; + } + set_clear_queue_stream(0); + } if(mail.msg_data && mail.msg_len!=0) { if(server_handle == 200 ||server_handle == 201 ) diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_at_cmd.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_at_cmd.cpp index 825668649..0072bf24d 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_at_cmd.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_at_cmd.cpp @@ -679,7 +679,7 @@ static uint32_t sendfotaurl(uint8_t *para, uint32_t paraLen, char *strCommonCmd) printf("CAT1TEST ATCMD Convert Command Failed\n"); return ERRCODE_FAIL; } - star_http_ota_updata(); + star_http_ota_updata(19); return 0; } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.h b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.h index f2963d362..6e2e7c4fd 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.h +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.h @@ -66,7 +66,7 @@ void cat1_call_hungup_timer(void); void send_fota_url(char *buf); -void star_http_ota_updata(void); +void star_http_ota_updata(uint8_t ver); #ifdef __cplusplus #if __cplusplus diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp index c47292e6a..62444427f 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_tcpServer.cpp @@ -1262,12 +1262,19 @@ void cat1_server_file_task(void *pvParameters) CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); } - else if (g_py_ver==19 ) + else if (g_py_ver>=19 ) { char * cat1_modemver = uapi_dev_runtime_get_cat1_modemver(); - if(strcmp(cat1_modemver, "EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630")!=0) + if(g_py_ver==19) { - star_http_ota_updata(); + if(strcmp(cat1_modemver, "EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_TEST0630")!=0) + { + star_http_ota_updata(g_py_ver); + } + } + else + { + star_http_ota_updata(g_py_ver); } } diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp index 0e2fda24c..cf159f1d2 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp @@ -1239,6 +1239,7 @@ void bk_websocket_demo(void *data) { #include "soc_osal.h" #include "common_def.h" #include "los_printf.h" +#include #define CAT1_SERVICE_TASK_SIZE (2048) #define CAT1_SERVICE_TASK_PRIO 5 @@ -1981,6 +1982,7 @@ void bk_websocket_tts(void *data) { { if(disconnect_server==0) { + set_clear_queue_stream(1); goto TTS_SATRT; } tts_reconnect=0; diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/http_cat1_ota.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/http_cat1_ota.cpp index 4f176d36d..b0312fdf6 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/http_cat1_ota.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/http_cat1_ota.cpp @@ -209,14 +209,21 @@ static void read_http_get_ota_url_file(char *out_put_url) // // http://snicker.com.cn:8089/FD230/PY_SRV_V19/dfota_2.bin -void star_http_ota_updata(void) +void star_http_ota_updata(uint8_t ver) { int ret=0; char buf_1[256]={0}; - ret = http_get_ota_url(buf_1,"PY19_1"); + char PY_BUF_1[32]={0}; + sprintf(PY_BUF_1,"PY%d_1",ver); + ret = http_get_ota_url(buf_1,PY_BUF_1); + + char PY_BUF_2[32]={0}; + sprintf(PY_BUF_2,"PY%d_2",ver); + ret = http_get_ota_url(buf_1,PY_BUF_2); + for (int i = 0; i <3; i++) { - ret = http_get_ota_url(buf_1,"PY19_1"); + ret = http_get_ota_url(buf_1,PY_BUF_1); if(ret==200) break; } @@ -226,10 +233,10 @@ void star_http_ota_updata(void) return; } char buf_2[256]={0}; - http_get_ota_url(buf_2,"PY19_2"); + http_get_ota_url(buf_2,PY_BUF_2); for (int i = 0; i <3; i++) { - ret = http_get_ota_url(buf_2,"PY19_2"); + ret = http_get_ota_url(buf_2,PY_BUF_2); if(ret==200) break; } @@ -239,6 +246,12 @@ void star_http_ota_updata(void) return; } + if(strlen(buf_1)==0 || strlen(buf_2)==0) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "no updata"); + return ; + } + char * send_buf=(char *) malloc(strlen(buf_1)+strlen(buf_2)+40); memset(send_buf,0,strlen(buf_1)+strlen(buf_2)+40);