From 55ee81d8e5aa6799770f3ac5088778deba9ba605 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sun, 4 Jan 2026 11:08:55 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=98=9F=E5=8E=86=E4=B8=8B?= =?utf8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/notify/transmitting.cpp | 29 +++++++++++++++++-- .../ble_service/bleservice/bleEvent.c | 4 +++ code/sdk/zhihui/utils/custom_runtime.c | 19 ++++++++++++ code/sdk/zhihui/utils/custom_runtime.h | 8 +++++ 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp index e4d3cc883..ffcaef514 100644 --- a/code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/fd272/service/msg_center/src/notify/transmitting.cpp @@ -202,6 +202,28 @@ namespace OHOS NotificationManager::GetInstance()->StopNotify(); } + static uint8_t epo_timer_falg=20; + void epo_timerCallBack(int data) + { + //给15s时间,等待EPO文件解压完成,超过15s不管成功与否,都停止通知 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "epo_timerCallBack epo_timer_falg = %d", epo_timer_falg); + if(epo_timer_falg<=0) + { + epo_timer_falg=20; + NotificationManager::GetInstance()->StopNotify(); + } + else + { + //如果EPO文件解压成功,停止通知 + if(uapi_dev_runtime_get_epo_file_extracted_status() == 1) + { + NativeAbility::GetInstance().ChangeSlice(VIEW_EPHEMERIS_DOWNLOAD); + NotificationManager::GetInstance()->StopNotify(); + } + } + epo_timer_falg--; + } + void creat_down_OTA() @@ -1360,9 +1382,10 @@ namespace OHOS osTimerStop(transmitting_timer); osTimerDelete(transmitting_timer); transmitting_timer = NULL; + epo_timer_falg=20; } - transmitting_timer = osTimerNew((osTimerFunc_t)dialtimerCallBack, osTimerPeriodic, NULL, NULL); - tick =3000;// osMs2Tick(1000); + transmitting_timer = osTimerNew((osTimerFunc_t)epo_timerCallBack, osTimerPeriodic, NULL, NULL); + tick =1000;// osMs2Tick(1000); retTimer = osTimerStart(transmitting_timer, tick); if (retTimer != osOK && transmitting_timer != NULL) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"StartCallTimer osTimerStart failed, ret = %lx!!", retTimer); @@ -1442,7 +1465,7 @@ namespace OHOS UIViewGroup_transmitting->RemoveAll(); } uapi_dev_runtime_set_transmitting_status(1); - printf("Transmitting_falg:%d",Transmitting_falg); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Transmitting_falg:%d",Transmitting_falg); #ifdef SUPPORT_BLE_SERVICE switch (Transmitting_falg) { diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c index 627a5bb65..6e7f88ae1 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c @@ -7091,6 +7091,8 @@ static errcode_t handle_epo_file_decompress(ble_read_data *buffer_handle) if (extract_ret == ERRCODE_SUCC) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[handle_epo_file_decompress] EPO lzma file extracted successfully\n"); + // 设置EPO文件解压状态为成功 + uapi_dev_runtime_set_epo_file_extracted_status(1); // 解压成功后删除lzma文件 remove(lzma_file_path); return ERRCODE_SUCC; @@ -7098,6 +7100,8 @@ static errcode_t handle_epo_file_decompress(ble_read_data *buffer_handle) else { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[handle_epo_file_decompress] Failed to extract EPO lzma file, ret=0x%X\n", extract_ret); + // 设置EPO文件解压状态为失败 + uapi_dev_runtime_set_epo_file_extracted_status(0); return ERRCODE_FAIL; } } diff --git a/code/sdk/zhihui/utils/custom_runtime.c b/code/sdk/zhihui/utils/custom_runtime.c index 07603c9d9..f1a9cd38e 100644 --- a/code/sdk/zhihui/utils/custom_runtime.c +++ b/code/sdk/zhihui/utils/custom_runtime.c @@ -69,6 +69,7 @@ typedef struct bt_runtime_status_t bt_runtime; char current_dial_name[32]; char current_epo_file_path[128]; // EPO文件完整路径 + uint8_t epo_file_extracted_status;//EPO文件解压状态 0 未解压, 1 解压成功 uint8_t time_hour_show_model; uint8_t sleep_monitoring_status;//睡眠监测 uint8_t sleep_status;//睡眠状态 @@ -272,6 +273,24 @@ char* uapi_dev_runtime_get_epo_file_path(void) { return (char*)&(g_runtime.current_epo_file_path[0]); } + +/** + * 设置 EPO 文件解压状态 +*/ +void uapi_dev_runtime_set_epo_file_extracted_status(uint8_t status) +{ + g_runtime.epo_file_extracted_status = status; +} + +/** + * 获取 EPO 文件解压状态 +*/ +uint8_t uapi_dev_runtime_get_epo_file_extracted_status(void) +{ + return g_runtime.epo_file_extracted_status; +} + + void uapi_dev_runtime_set_bt_powerstat(uint8_t stat) { g_runtime.bt_runtime.bt_powerOn = stat; diff --git a/code/sdk/zhihui/utils/custom_runtime.h b/code/sdk/zhihui/utils/custom_runtime.h index b8e4354f7..f2bcb4bb4 100644 --- a/code/sdk/zhihui/utils/custom_runtime.h +++ b/code/sdk/zhihui/utils/custom_runtime.h @@ -48,6 +48,14 @@ void uapi_dev_runtime_set_epo_file_path(char* file_path); */ char* uapi_dev_runtime_get_epo_file_path(void); +/** + * 设置 EPO 文件解压状态 +*/ +void uapi_dev_runtime_set_epo_file_extracted_status(uint8_t status); +/** + * 获取 EPO 文件解压状态 +*/ +uint8_t uapi_dev_runtime_get_epo_file_extracted_status(void); void uapi_dev_runtime_set_vibmod(uint8_t vibmod); -- 2.17.1