From: hcj_ <1224667075@qq.com> Date: Thu, 30 May 2024 05:17:13 +0000 (+0800) Subject: 修改步数同步协议 X-Git-Tag: release_V1.2.70_20241020_135402~1064^2~2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F198%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 7b90b4950..45f3b3d99 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -61,9 +61,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}; @@ -73,6 +73,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; @@ -82,11 +83,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