From: hcj <1224667075@qq.com> Date: Fri, 23 Aug 2024 01:59:00 +0000 (+0800) Subject: 调整日程蓝牙协议部分增加结束标志 X-Git-Tag: release_V1.2.70_20241020_135402~601 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F772%2F1;p=mirrors%2FFD230.git 调整日程蓝牙协议部分增加结束标志 --- diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp index a83924f14..620675f15 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -98,7 +98,7 @@ bool is_first_pair(void) } -bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_end,char *title,char *data) +bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_end,char *title,char *data,bool is_end) { OHOS::ScheduleRevData info_; @@ -139,7 +139,9 @@ bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_e printf("//////////////////////////////////////////////\r\n"); //printf("delete_before_file now day%d %d %d\r\n ",y,m,d); - OHOS::C_ScheduleSetByApp(&info_, id - 1, false); + OHOS::C_ScheduleSetByApp(&info_, id - 1, is_end); + if(is_end) + printf("////////////////////结束///////////////////\r\n"); return true; } diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index 1c11521a0..ec8c59566 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -356,7 +356,8 @@ void set_br_pair(void); bool get_lcd_state(void); ////////////////////////////////////////////////////////////////////////// -bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_end,char *title,char *data); +bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_end,char *title,char *data,bool is_end); + #ifdef __cplusplus #if __cplusplus 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 ae51d0065..3a8993a71 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -2543,7 +2543,11 @@ bool bin_Check_schedule(uint8_t *data,uint16_t len) if(buf_len==0) { printf("%d %d\r\n",offset,len); - Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,"0"); + if(offset==len) + Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,"",true); + else + Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,"",false); + if(title) { free(title); @@ -2560,10 +2564,13 @@ bool bin_Check_schedule(uint8_t *data,uint16_t len) memset_s(str_,512,0,buf_len+1); memcpy_s(str_,512,&data[offset],buf_len); - - Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,str_); - offset+=buf_len; + if(offset==len) + Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,str_,true); + else + Ble_Set_ScheduleInfo(id,timetemp_begin,timetemp_end,title,str_,false); + + if(title) {