From f977c01777c9af33480cf8fec9c760cebf3c4a2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E6=AD=A3?= <1732036298@qq.com> Date: Sat, 7 Jun 2025 07:40:16 +0000 Subject: [PATCH] Merge #1811 into sdk602patch0911 from refs/changes/1811/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 罗正 * refs/changes/1811/head: (2 commits squashed) - 解决蓝牙AI不能用问题 - Merge branch 'sdk602patch0911' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0911 Signed-off-by: 罗正 <1732036298@qq.com> Reviewed-by: Caisking <3449750381@qq.com> Reviewed-by: 罗正 <1732036298@qq.com> Reviewed-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Reviewed-by: aliyun6865282430 <1624952103@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/1811 --- .../fd230app/nativeui/aivoice/src/AiVoiceModel.cpp | 2 +- .../service/ble_service/bleservice/bleService.c | 11 +++++++---- .../service/ble_service/transspecard/transspecard.c | 8 ++++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index b654b09ad..76cf73d65 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -170,7 +170,7 @@ namespace OHOS if (GetSelect4gorbt() == AI_SELECT_4G) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSelect4gorbt() == AI_SELECT_4G"); - if (init_4gai_task) + if (GetInit_4gai_task()) { uapi_start_asr(); } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index 43047db4b..2313bbb57 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -2353,7 +2353,7 @@ void send_Ai_record(uint16_t len,uint8_t *data,uint32_t count) LOS_Msleep(AI_interval+get_ble_interval()); } - +#define ENABLE_4GAI 0 static void blesrvAi_send_service_task(void const *arg) { unused(arg); @@ -2393,12 +2393,15 @@ static void blesrvAi_send_service_task(void const *arg) // if(get_ble_connect()) + #if ENABLE_4GAI if(mail.msg_data && mail.msg_len!=0) { send_ai_bin(mail.msg_data,mail.msg_len); } - - // send_Ai_record(mail.msg_len,mail.msg_data,AI_data_count); + #else + if(mail.msg_data && mail.msg_len!=0) + send_Ai_record(mail.msg_len,mail.msg_data,AI_data_count); + #endif if(mail.msg_data) @@ -2477,7 +2480,7 @@ int send_msg_data_into_Ai_msg_queue(void *buff,uint16_t len,uint8_t type) if (buff == NULL) return ERRCODE_FAIL; uint32_t sendlen = sizeof(blesrv_custom_cmd_t); - uint32_t singlebuflen= 1024;//ble_nus_max_data_len-20; + uint32_t singlebuflen= ble_nus_max_data_len-20; blesrv_mail.msg_data=0; if(len<=singlebuflen) diff --git a/code/sdk/application/wearable/service/ble_service/transspecard/transspecard.c b/code/sdk/application/wearable/service/ble_service/transspecard/transspecard.c index 170f14cf6..3f1bf8e9c 100644 --- a/code/sdk/application/wearable/service/ble_service/transspecard/transspecard.c +++ b/code/sdk/application/wearable/service/ble_service/transspecard/transspecard.c @@ -263,10 +263,14 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen) // 多包传输逻辑 uint8_t current_packet = 1; int all_packets_sent = 0; - // 初始化信号量 + if(g_transspecard_ack_sem != NULL) + { + osSemaphoreDelete(g_transspecard_ack_sem); + g_transspecard_ack_sem = NULL; + } if (g_transspecard_ack_sem == NULL) { - g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL); + g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL);// 初始化信号量 } // 先顺序发送所有数据包 -- 2.17.1