From 97dffefeb0129efae08aa71a114e32ce092a7fba Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Fri, 23 Aug 2024 09:59:00 +0800 Subject: [PATCH] =?utf8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E7=A8=8B=E8=93=9D?= =?utf8?q?=E7=89=99=E5=8D=8F=E8=AE=AE=E9=83=A8=E5=88=86=E5=A2=9E=E5=8A=A0?= =?utf8?q?=E7=BB=93=E6=9D=9F=E6=A0=87=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/blemoder/bletest.cpp | 6 ++++-- .../service/ble_service/blemoder/bletest.h | 3 ++- .../service/ble_service/bleservice/bleEvent.c | 15 +++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) 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) { -- 2.17.1