From: hcj <1224667075@qq.com> Date: Wed, 2 Oct 2024 08:43:17 +0000 (+0800) Subject: 修改通讯录数据和sos数据存储 由关机存储改为同步存储 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1078%2F2;p=mirrors%2FFD230.git 修改通讯录数据和sos数据存储 由关机存储改为同步存储 --- 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 882d37105..c6b1df065 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -2154,7 +2154,8 @@ void SetmsgfiltrationCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalD offset+=data_t.len; printf("%s\r\n",data_t.name); filtration_file_updata(&data_t); - } + } + filtration_file_save(); sendBuf[17] = 1; sendBuf[18] = Calculate_CRC(sendBuf,18); @@ -3200,6 +3201,8 @@ bool bin_Check_schedule(uint8_t *data,uint16_t len) } } + + return true; } void APP_send_schedule_Cmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue) @@ -3300,6 +3303,9 @@ bool bin_Check_sos(uint8_t *data,uint16_t len) { free(name); } + + ble_sos_data_save(); + return true; } @@ -3589,6 +3595,8 @@ void SetAPPaddressbook(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalDat if(Check_CRC(data,len,crcvalue)) { addressbookToRead((char*)data); + //同步完就写一次 + addressbookTowrite(); value[17] = 0x01; value[18] = Calculate_CRC(value,18); sendBleData(value,19); @@ -6039,6 +6047,7 @@ void type2AE3Data(ble_read_data *buffer_handle,uint8_t *cmd_buf ,uint8_t *data,u case SYN_BASIC_TRANIN_HISTORY_DATA_CMD://同步基础训练历史数据 case SYN_SLEEP_HISTORY_DATA_CMD://睡眠历史数据 case ALARM_CMD://获取手表闹钟//同步闹钟 + readDevDataBle(cmd,data,datalen,totaldata,crcvalue); break; case SET_DMP_MODE_CMD://0X0131 @@ -6108,11 +6117,12 @@ void Send_Sleep_Bin_Data(uint8_t day, uint16_t num) printf("Send_Sleep_Bin_Data file_size : %d \r\n",file_size); data=(char *)malloc(file_size); - + if(data==NULL) { return; } + memset(data,0,file_size); data[0]=sleep_count; @@ -6334,6 +6344,10 @@ void Read_BIN_file_buf_send_bin_Data(uint8_t day,uint32_t pack_size,uint16_t id) //手机app下发读设备数据指令 void readDevDataBle(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue) { + // if() + // { + + // } uint8_t sendBuf[19]; memset(sendBuf,0,19); uint8_t type = cmd/256; @@ -6361,7 +6375,7 @@ void readDevDataBle(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,u switch (bleSendTypeID) { case 0x40://同步心率历史数据 - + num=(ble_nus_max_data_len-18); if(num>482)num=482; @@ -6377,6 +6391,8 @@ void readDevDataBle(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,u break; case 0x41://同步血氧历史数据 + + num=(ble_nus_max_data_len-18); if(num>482)num=482; if(!Read_Health_BIN_file_buf_send_bin_Data(data[0],num,0x41)) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index c23c40eac..9f5145393 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -195,9 +195,9 @@ void shutdown_reboot_prejobs_task(void) //保存步数 do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SAVE_DATA,NULL); - addressbookTowrite();//同步数据存储 + // addressbookTowrite();//同步数据存储 - ble_sos_data_save();//同步数据存储 + //ble_sos_data_save();//同步数据存储 //保存信息文件 saveancsdata(); //接收到信息进行保存