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();
{
// 值无变化,超时计数减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; // 重置首次检测标记(可选)
// 【此处添加停止传输后的业务逻辑】
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)
#ifdef SUPPORT_BLE_SERVICE
Set_OTA_recv_value();
- transmitting_ota_timeout = 10;
+ transmitting_ota_timeout = 60;
#endif
if(transmitting_timer!=NULL)
{