cat1_print_info("HTTP file download service: Timeout timer destroyed\n");
}
+ if (g_download_complete_sem != NULL) {
+ osSemaphoreRelease(g_download_complete_sem);
+ }
+
// 删除信号量
if (g_download_complete_sem != NULL) {
osSemaphoreDelete(g_download_complete_sem);
g_download_state = HTTP_DOWNLOAD_STATE_IDLE;
return -1;
}
+
+ set_expected_seq(0);
+
udp_send_msg_toCat1(UDP_CMD_HTTP_FILE_DOWNLOAD, udp_msg);
cat1_print_info("HTTP file download: Download command sent, waiting for completion...\n");
}
return -1;
}
+ set_expected_seq(0);
+
udp_send_msg_toCat1(UDP_CMD_HTTP_FILE_DOWNLOAD, udp_msg);
cat1_print_info("HTTP file download: Download command sent (URL: %s, resume from byte: %u, write delay: %u ms)\n", url, resume_from_byte, write_delay_ms);
void ln_ws_audio_init(bool is_vad_server_enabled)
{
- // 检查是否已经初始化
+ // 检查是否已经初始化
if (g_audio_initialized) {
LN_WS_WARN("Audio already initialized, skipping duplicate initialization\n");
return;
ret = uapi_ws_send_text(json_string);
if (ret == 0) {
LN_WS_DEBUG("VoiceChatInterrupt sent successfully\n");
- {
- // 如果检测到频繁数据接收,直接重连
- LN_WS_INFO("Triggering reconnection due to frequent binary data reception\n");
- if (ln_ws_reconnect() != 0) {
- LN_WS_ERROR("Failed to reconnect after frequent data reception\n");
- }
- }
- }
+ }
+ // 如果检测到频繁数据接收,直接重连
+ LN_WS_INFO("Triggering reconnection due to frequent binary data reception\n");
+ if (ln_ws_reconnect() != 0) {
+ LN_WS_ERROR("Failed to reconnect after frequent data reception\n");
+ }
}
else {
LN_WS_INFO("no to send VoiceChatInterrupt\n");
// 如果未初始化,自动初始化
if (!g_download_service_initialized) {
WEARABLE_LOGW(WEARABLE_LOG_MODULE_APP, "[HTTP_DL] Service not initialized, auto-initializing...");
- if (ln_http_download_init() != 0) {
- WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[HTTP_DL] Auto-initialization failed");
- return -1;
- }
+ return -1;
+
}
WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "[HTTP_DL] Starting download: URL=%s, timeout=%u ms (data via internal callback, no file write)",
url, timeout_ms);
// file_path传入NULL,不写入文件,数据通过内部回调处理
- int ret = http_file_download_start(url, NULL, timeout_ms, 10);
+ int ret = http_file_download_start(url, NULL, timeout_ms, 20);
if (ret == 0) {
// 获取下载统计信息
// 降低优先级,避免抢占 NAND Flash 操作(文件下载时会导致 QSPI 总线冲突)
// 从 osPriorityHigh (40) 降低到 osPriorityNormal (24),与 sio_irq_proc 同级
-
+
//改回osPriorityHigh,底优先级,无法正确传输
taskcfg.attr.priority = osPriorityHigh;
}
}
+void set_expected_seq(uint8_t data)
+{
+ g_expected_seq=data;
+}
*/
void custom_spi_register_error_callback(custom_spi_error_callback_t callback);
+void set_expected_seq(uint8_t data);
+
#ifdef __cplusplus
}