From: luozheng <1732036298@qq.com> Date: Thu, 19 Mar 2026 03:42:27 +0000 (+0800) Subject: ota升级弹窗时间改为60秒 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3291%2F1;p=mirrors%2FFD230.git ota升级弹窗时间改为60秒 --- 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 e83fa686c..ee9ebdbdf 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 @@ -176,17 +176,18 @@ namespace OHOS static uint8_t timer_falg_low_power=5; - static uint8_t transmitting_ota_timeout = 10; // 10秒超时计数(每秒减1) + static uint8_t transmitting_ota_timeout = 60; // 60秒超时计数(每秒减1) static uint32_t cur_recv_value = 0; // 当前接收值 static uint32_t last_recv_value = 0; // 上一次接收值 static bool is_ota_data_stop = false; // 标记是否停止传输 static bool is_first_check = true; // 首次检测标记(避免初始值误判) static void OTATimerCallBackProc(int data) { - #ifdef SUPPORT_BLE_SERVICE + // #ifdef SUPPORT_BLE_SERVICE if(updatasider) { cur_recv_value = get_OTA_recv_value(); // 获取当前接收值 + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "cur_recv_value:%u",cur_recv_value); updatasider->SetValue(cur_recv_value); updatasider->Invalidate(); @@ -204,11 +205,12 @@ namespace OHOS { // 值无变化,超时计数减1 transmitting_ota_timeout--; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "transmitting_ota_timeout:%d",transmitting_ota_timeout); if (transmitting_ota_timeout == 0) { // 10秒值未变化,判定APP停止传输 is_ota_data_stop = true; - transmitting_ota_timeout = 10; // 重置计数(可选,根据业务需求) + transmitting_ota_timeout = 60; // 重置计数(可选,根据业务需求) is_first_check = true; // 重置首次检测标记(可选) // 【此处添加停止传输后的业务逻辑】 @@ -220,12 +222,13 @@ namespace OHOS else { // 值有变化,重置超时计数和上一次值 - transmitting_ota_timeout = 10; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OTA传输继续:值有变化"); + transmitting_ota_timeout = 60; last_recv_value = cur_recv_value; is_ota_data_stop = false; } } - #endif + // #endif } void OTATimerCallBack(int data) @@ -343,7 +346,7 @@ namespace OHOS #ifdef SUPPORT_BLE_SERVICE Set_OTA_recv_value(); - transmitting_ota_timeout = 10; + transmitting_ota_timeout = 60; #endif if(transmitting_timer!=NULL) {