From: hcj_ <1224667075@qq.com> Date: Thu, 30 May 2024 05:17:13 +0000 (+0800) Subject: 修改步数同步协议 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=refs%2Fchanges%2F193%2F2;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 aa82c750e..865c83eef 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -58,9 +58,9 @@ extern "C" { #include "bletest.h" -#define CWM_HISTORY_DATA_PATH "/system/" +#define CWM_HISTORY_DATA_PATH "/user/userdata/step_" -char * ble_step_history(uint8_t day) +char * ble_step_history(uint8_t day,uint16_t *len) { char path_[64]={0}; char timeday[12] = {0}; @@ -70,6 +70,7 @@ char * ble_step_history(uint8_t day) FILE * fp = fopen(path_,"rb+"); if(fp==NULL) { + printf("fopen fail\r\n"); return NULL; } uint32_t size; @@ -79,11 +80,22 @@ char * ble_step_history(uint8_t day) size = ftell(fp); // 获取当前文件指针位置,即文件大小 fseek(fp, 0, SEEK_SET); // 将文件指针移回文件开头 } + printf("size %d \r\n",size); char * buf=(char *)malloc(size); + if(buf==NULL) + { + printf("malloc fail\r\n"); + return buf; + } uint32_t ret= fread(buf,1,size,fp); - printf("fread %d \r\n",ret); + printf("fread %d \r\n",ret); + for(int i=0;i