WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"[OTA_DOWNLOAD] 下载进度: %d%%", msg->progress);
push_ota_progress(msg->progress);
/* 上报升级进度 */
- if (g_ln_last_update_id && g_ln_last_update_id[0] != '\0') {
- char progress_msg[128];
- snprintf(progress_msg, sizeof(progress_msg), "升级进度%d%%", msg->progress);
- ln_ws_send_device_upgrade_status_report(g_ln_last_update_id, "UPGRADING", msg->progress, progress_msg);
- }
+ // if (g_ln_last_update_id && g_ln_last_update_id[0] != '\0') {
+ // char progress_msg[128];
+ // snprintf(progress_msg, sizeof(progress_msg), "升级进度%d%%", msg->progress);
+ // ln_ws_send_device_upgrade_status_report(g_ln_last_update_id, "UPGRADING", msg->progress, progress_msg);
+ // }
break;
case OTA_DOWNLOAD_STATUS_COMPLETED:
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"[OTA_DOWNLOAD] 下载完成,文件路径: %s", msg->file_path);
return ERRCODE_SUCC;
}
-#if 0
+#if 1
/* 下载进度回调函数 */
static int ln_ota_download_progress_callback(const uint8_t *data, uint32_t data_len, uint32_t packet_num)
{
// 统计总接收字节数(仅统计实际数据长度,不包括包头)
total_cnt += data_len;
- printf("SPI packet #%u: data_len=%u, total_cnt=%u, rx_bytes=%u\n",
- pkg_recv_cnt, data_len, total_cnt, spi_data.rx_bytes);
+ // printf("SPI packet #%u: data_len=%u, total_cnt=%u, rx_bytes=%u\n",
+ // pkg_recv_cnt, data_len, total_cnt, spi_data.rx_bytes);
// 调用注册的回调函数处理数据(传递数据部分,不包含包头)
if (g_spi_data_callback != NULL) {