修复日志上传接口
authorhcj <1224667075@qq.com>
Fri, 20 Dec 2024 03:31:20 +0000 (11:31 +0800)
committerhcj <1224667075@qq.com>
Fri, 20 Dec 2024 03:31:20 +0000 (11:31 +0800)
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c

index b53ff34..573af0d 100644 (file)
@@ -1609,8 +1609,6 @@ char * struct_to_json_buf_malloc_Alarm(void)
 
     if( 0==AlmmgrGetManagement(&data))
     {
-     
-
         for(int i=0;i<EVENT_ALARM_CLOCK_MAX;i++)
         {
             if(data.eventAlarmInfo[i].alarmClockId==i && data.eventAlarmInfo[i].alarmType==TYPE_EVENT_ALARM_CLOCK)
@@ -1841,7 +1839,7 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size)
                 {
                    
                     //*file_size=ent->d_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;
 }
 
index e81c5b4..d05e978 100644 (file)
@@ -299,7 +299,8 @@ uint8_t  calculate_lrc_file(char *file_path)
 \r
     if(fp==NULL)\r
     {\r
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"fopen fail %s\r\n",file_path);\r
+          WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"fopen fail %s\r\n",file_path);\r
+          return 0;\r
     }\r
     do\r
     {\r
@@ -7549,6 +7550,7 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id)
         {\r
             ble_data_type type_={0x05,id,file_size,pack,pack_id};\r
             send_big_data(type_,(char *)data,read_size);\r
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"Read_tar_file_buf_send_Data size %d\r\n",read_size);\r
         }\r
         \r
 \r
@@ -7567,11 +7569,14 @@ bool read_dir_send_json()
 {\r
    \r
     char *send_buf=NULL;\r
-      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"read_dir_send_json xxxxxxxx\r\n");\r
+    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"read_dir_send_json xxxxxxxx\r\n");\r
+    memset_s(file_name,128,0,128);\r
     send_buf=tar_dir_to_json_buf_malloc_(file_name,&file_size);\r
+     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"read_dir_send_json end\r\n");\r
     if( send_buf!=NULL)\r
     {\r
         //send_big_data(1,send_buf,strlen(send_buf),strlen(send_buf),1,1,0x26,0x04);\r
+\r
         ble_data_type type_={0x04,0x26,strlen(send_buf),1,1};\r
         \r
         send_big_data(type_,(char *)send_buf,strlen(send_buf));\r