From: hcj <1224667075@qq.com> Date: Fri, 20 Dec 2024 03:31:20 +0000 (+0800) Subject: 修复日志上传接口 X-Git-Tag: v1.3.113-repair_tp~18^2~35 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=e8443b578cca3f024b1c0646a9ca4033bb088d56;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 b53ff3481..573af0dc9 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp @@ -1609,8 +1609,6 @@ char * struct_to_json_buf_malloc_Alarm(void) if( 0==AlmmgrGetManagement(&data)) { - - for(int i=0;id_reclen; - char file_path[256]={0}; + char file_path[300]={0}; sprintf_s(file_path,256,"%s/%s",TAR_PATH,ent->d_name); FILE * fp = fopen(file_path,"rb+"); @@ -1858,7 +1856,8 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) } fclose(fp); - + // "exc_V1.3.102_20241220_110921_1734693197.tar" + memcpy(file_name,file_path,strlen(file_path)); uint8_t crc= Calculate_CRC_file(file_name); @@ -1875,7 +1874,7 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) char *json_format = cJSON_PrintUnformatted(itemJSON); int pSize = cJSON_GetArraySize(dataJSON); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); cJSON_Delete(dataJSON); file_index++; @@ -1896,8 +1895,12 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) } else { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"opendir fail\r\n"); + + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"opendir fail\r\n"); } + cJSON_Delete(dataJSON); + cJSON_Delete(data_arryJSON); + return NULL; } 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 e81c5b402..d05e978aa 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -299,7 +299,8 @@ uint8_t calculate_lrc_file(char *file_path) if(fp==NULL) { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"fopen fail %s\r\n",file_path); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"fopen fail %s\r\n",file_path); + return 0; } do { @@ -7549,6 +7550,7 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id) { ble_data_type type_={0x05,id,file_size,pack,pack_id}; send_big_data(type_,(char *)data,read_size); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"Read_tar_file_buf_send_Data size %d\r\n",read_size); } @@ -7567,11 +7569,14 @@ bool read_dir_send_json() { char *send_buf=NULL; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"read_dir_send_json xxxxxxxx\r\n"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"read_dir_send_json xxxxxxxx\r\n"); + memset_s(file_name,128,0,128); send_buf=tar_dir_to_json_buf_malloc_(file_name,&file_size); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"read_dir_send_json end\r\n"); if( send_buf!=NULL) { //send_big_data(1,send_buf,strlen(send_buf),strlen(send_buf),1,1,0x26,0x04); + ble_data_type type_={0x04,0x26,strlen(send_buf),1,1}; send_big_data(type_,(char *)send_buf,strlen(send_buf));