From: luozheng <1732036298@qq.com> Date: Mon, 7 Jul 2025 10:51:39 +0000 (+0800) Subject: 解决回答问题太长导致不能显示问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1939%2F1;p=mirrors%2FFD230.git 解决回答问题太长导致不能显示问题 --- diff --git a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp index 4da61b191..4ad686766 100644 --- a/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp +++ b/code/sdk/drivers/peripheral/slip/cat1Service/cat1_ws.cpp @@ -1044,7 +1044,7 @@ bool send_ai_txt(uint8_t type,char *msg) // {"type":"middle","content":"我是","task_id":"","reasoning_content":""} -char content_str_chat[64]={0}; +// char content_str_chat[64]={0}; bool chat_result_analysis(char *buf) { @@ -1069,8 +1069,10 @@ bool chat_result_analysis(char *buf) { if(strlen(content_str)>0) { - memset_s(content_str_chat,64,0,64); - memcpy_s(content_str_chat,64,content_str,strlen(content_str)); + // memset_s(content_str_chat,64,0,64); + // memcpy_s(content_str_chat,64,content_str,strlen(content_str)); + char *content_str_chat = (char *)malloc(strlen(content_str)+1); + strcpy(content_str_chat,content_str); ble_set_ai_Answer_str(content_str_chat,2); // uapi_start_tts_single_txt(content_str_chat); // static uint8_t test=1; @@ -1080,7 +1082,7 @@ bool chat_result_analysis(char *buf) // test=0; // } - + free(content_str_chat); } }