From: Caisking <3449750381@qq.com> Date: Fri, 12 Jul 2024 09:13:23 +0000 (+0800) Subject: 增长aitxtbuf X-Git-Tag: release_V1.2.70_20241020_135402~807^2~22 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=c34dfe633bede83667087a1e66c93980e3ae4915;p=mirrors%2FFD230.git 增长aitxtbuf --- diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 879b667db..75460364e 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -2007,6 +2007,11 @@ uint8_t binCheck_AI(uint8_t *buf,uint8_t *check,uint16_t len)//json 格式解析 while (len>offset) { + if(offset>=len) + { + break; + } + if(buf[offset]==1) { offset++; @@ -2021,6 +2026,12 @@ uint8_t binCheck_AI(uint8_t *buf,uint8_t *check,uint16_t len)//json 格式解析 offset+=txt_len; //offset+=1; } + + if(offset>=len) + { + break; + } + if(buf[offset]==2) { offset++; @@ -2029,8 +2040,8 @@ uint8_t binCheck_AI(uint8_t *buf,uint8_t *check,uint16_t len)//json 格式解析 offset+=2; - char txt_buf[128]={0}; - memcpy_s(txt_buf,128,&buf[offset],txt_len); + char txt_buf[256]={0}; + memcpy_s(txt_buf,256,&buf[offset],txt_len); printf("binCheck_AI txtbuf %s %d\r\n",txt_buf,txt_len); ble_set_ai_Answer_str(txt_buf); offset+=txt_len; @@ -2043,8 +2054,8 @@ uint8_t binCheck_AI(uint8_t *buf,uint8_t *check,uint16_t len)//json 格式解析 if(buf[offset]==0) { printf("AI 解析失败\r\n"); - offset++; - break; + //offset++; + // break; } offset++; }