增加ble日志跟踪
authorCaisking <Casiking@zhihuishixun.com>
Mon, 13 Oct 2025 06:05:40 +0000 (14:05 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Mon, 13 Oct 2025 06:05:40 +0000 (14:05 +0800)
code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c

index 9a1bf83..31ab85a 100644 (file)
@@ -48,6 +48,7 @@ extern "C" {
 #include "bleInstruct.h"
 #endif
 
+
 #include "custom_utils.h"
 #include "custom_runtime.h"
 #include "bleANCS.h"
@@ -209,34 +210,74 @@ static errcode_t get_file_recv_file_path(char* input_filename ,uint32_t input_si
 {
     if(input_filename == NULL || output_file_path == NULL)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_file_recv_file_path: NULL pointer detected - input_filename=%p, output_file_path=%p", 
+                      input_filename, output_file_path);
+        return ERRCODE_FAIL;
+    }
+
+    if(input_size == 0 || max_output_size == 0)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_file_recv_file_path: Invalid size parameters - input_size=%u, max_output_size=%u", 
+                      input_size, max_output_size);
         return ERRCODE_FAIL;
     }
 
     int ret = sprintf_s(output_file_path,max_output_size,"/user/userdata/%s",input_filename);
     if (ret < 0)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_file_recv_file_path: sprintf_s failed - ret=%d, filename='%s', max_size=%u", 
+                      ret, input_filename, max_output_size);
         return ERRCODE_FAIL;
+    }
 
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] get_file_recv_file_path: Success - input='%s', output='%s'", 
+                  input_filename, output_file_path);
     return ERRCODE_SUCC;
 } 
 static errcode_t get_app_file_path(char* input_filename ,uint32_t input_size, char* output_file_path , uint32_t max_output_size)
 {
     if(input_filename == NULL || output_file_path == NULL)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_app_file_path: NULL pointer detected - input_filename=%p, output_file_path=%p", 
+                      input_filename, output_file_path);
+        return ERRCODE_FAIL;
+    }
+
+    if(input_size == 0 || max_output_size == 0)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_app_file_path: Invalid size parameters - input_size=%u, max_output_size=%u", 
+                      input_size, max_output_size);
         return ERRCODE_FAIL;
     }
 
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] get_app_file_path: Creating app_store directory");
     uapi_create_dir("/user/app_store");
 
     int ret = sprintf_s(output_file_path,max_output_size,"/user/app_store/%s",input_filename);
     if (ret < 0)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_app_file_path: sprintf_s failed - ret=%d, filename='%s', max_size=%u", 
+                      ret, input_filename, max_output_size);
         return ERRCODE_FAIL;
+    }
 
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] get_app_file_path: Success - input='%s', output='%s'", 
+                  input_filename, output_file_path);
     return ERRCODE_SUCC;
 }
 static errcode_t get_custom_dial_file_path(uint16_t id,char *filename,uint32_t input_size, char* output_file_path , uint32_t max_output_size)
 {
     if( id >=5  || output_file_path == NULL || filename == NULL)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_custom_dial_file_path: Invalid parameters - id=%u, output_file_path=%p, filename=%p", 
+                      id, output_file_path, filename);
+        return ERRCODE_FAIL;
+    }
+
+    if(input_size == 0 || max_output_size == 0)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] get_custom_dial_file_path: Invalid size parameters - input_size=%u, max_output_size=%u", 
+                      input_size, max_output_size);
         return ERRCODE_FAIL;
     }
     char name[64]={0};
@@ -331,8 +372,9 @@ uint8_t  calculate_lrc_file(char *file_path)
 
     if(fp==NULL)
     {
-          WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"fopen fail %s\r\n",file_path);
-          return 0;
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] calculate_lrc_file: Failed to open file - path='%s', errno=%d", 
+                      file_path, errno);
+        return 0;
     }
     do
     {
@@ -462,7 +504,8 @@ void send_big_data(ble_data_type type,char *data, uint16 datalen)
     buf = ym_malloc(17 + datalen + 1); 
     memset_s(buf,ble_nus_max_data_len,0,17 + datalen + 1);
     if (buf == NULL && datalen!=0) {
-          WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"内存分配失败\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] sendBleData: Memory allocation failed - requested_size=%u, datalen=%u", 
+                      17 + datalen + 1, datalen);
         return;
     }
     if(type.Packet_id>=2)
@@ -1498,7 +1541,6 @@ void sendParieSuccess(uint8_t flag,bd_addr_t *addr)//发送配对成功指令to
                 }
                 fclose(file);
             }
-            // ym_free(jsonString);
             cJSON_free(jsonString);
             cJSON_Delete(dataJSON);
             // 读取JSON文件
@@ -1614,20 +1656,23 @@ static int get_json_int_safe(cJSON* item, int default_value, int min_val, int ma
 static uint8_t jsonCheck_time(uint8_t *buf)//json 格式解析
 {
     if (buf == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Input buffer is NULL");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_time: Input buffer is NULL");
         return 2;
     }
     
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] jsonCheck_time: Parsing JSON data, length=%zu", strlen((char*)buf));
+    
     cJSON* root = cJSON_Parse((const char *)buf);
     if (root == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "JSON解析错误");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_time: JSON parse failed - data='%s'", (char*)buf);
         return 2;
     }
     
     // 验证必需字段
     cJSON* time = cJSON_GetObjectItem(root, "time");
     if (!time || !cJSON_IsNumber(time)) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Missing or invalid 'time' field");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_time: Missing or invalid 'time' field - time=%p, isNumber=%d", 
+                      time, time ? cJSON_IsNumber(time) : 0);
         cJSON_Delete(root);
         return 2;
     }
@@ -1769,7 +1814,7 @@ static uint8_t jsonCheck_targetparam(uint8_t *buf)
     json = buf;
     cJSON* root = cJSON_Parse((const char *)json);
     if (root == NULL) {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"时间 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_targetparam: JSON parse failed");
         return 2;
     }
 
@@ -1908,7 +1953,7 @@ static void jsonCheck_alarm(uint8_t *buf)//json 解析闹钟数据
     cJSON* root = cJSON_Parse((const char *)json);
 
     if (root == NULL) {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"闹钟 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_alarm: Alarm JSON parse failed");
         return;
     }
     else
@@ -1920,6 +1965,8 @@ static void jsonCheck_alarm(uint8_t *buf)//json 解析闹钟数据
     cJSON* alarms = cJSON_GetObjectItem(root, "alarms");
     if(alarms==NULL)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_alarm: Missing 'alarms' field in JSON");
+        cJSON_Delete(root);
         return;
     }
     int alarmCount = cJSON_GetArraySize(alarms);
@@ -1930,6 +1977,8 @@ static void jsonCheck_alarm(uint8_t *buf)//json 解析闹钟数据
         cJSON *data=cJSON_GetArrayItem(alarms,i);
         if(data==NULL)
         {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_alarm: Failed to get alarm item at index %d", i);
+            cJSON_Delete(root);
             return;
         }
 
@@ -2452,6 +2501,7 @@ void SYN_train_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalDa
             cJSON *json_data = ble_get_Trainingdata_by_timetamp(timetamp);
             if(json_data==NULL)
             {
+                WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] Failed to get training data by timestamp - timestamp=%u", timetamp);
                 ble_data_type type_={0x02,0x19,0,1,1};
                 send_big_data(type_,NULL,0);
                 return;
@@ -2527,7 +2577,7 @@ void SYN_train_heart_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 uint32_t file_size=0;
                 if(fp==NULL)
                 {
-                      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"打开文件失败 %s \r\n",path);
+                      WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"打开文件失败 %s \r\n",path);
 
                     ble_data_type type_={0x02,0x4b,0,1,1};
                     send_big_data(type_,NULL,0);
@@ -2544,7 +2594,7 @@ void SYN_train_heart_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 int num_check=file_size%5;//心率数据 5个字节
                 if(num_check!=0)
                 {
-                      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"数据有误 %d \r\n",cmd);
+                      WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"数据有误 %d \r\n",cmd);
 
                     ble_data_type type_={0x02,0x4b,0,1,1};
                     send_big_data(type_,NULL,0);
@@ -2552,7 +2602,11 @@ void SYN_train_heart_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 }
             
                 char* buf = (char *)ym_malloc(sizeof(char)*num+1);
-                if(buf==NULL){fclose(fp); return ;}
+                if(buf==NULL){
+                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] Memory allocation failed for file data - requested_size=%u", num+1);
+                    fclose(fp); 
+                    return ;
+                }
 
                 uint32_t pack=1;
 
@@ -2604,7 +2658,7 @@ void SYN_train_speed_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 uint32_t file_size=0;
                 if(fp==NULL)
                 {
-                      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"打开文件失败 %s \r\n",path);
+                      WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"打开文件失败 %s \r\n",path);
 
                     ble_data_type type_={0x02,0x18,0,1,1};
                     send_big_data(type_,NULL,0);
@@ -2621,7 +2675,7 @@ void SYN_train_speed_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 int num_check=file_size%6;
                 if(num_check!=0)
                 {
-                      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"数据有误 %d \r\n",cmd);
+                      WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"数据有误 %d \r\n",cmd);
 
                     ble_data_type type_={0x02,0x18,0,1,1};
                     send_big_data(type_,NULL,0);
@@ -2629,7 +2683,11 @@ void SYN_train_speed_datatCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *t
                 }
             
                 char* buf = (char *)ym_malloc(sizeof(char)*num+1);
-                if(buf==NULL){fclose(fp); return ;}
+                if(buf==NULL){
+                    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] Memory allocation failed for file data - requested_size=%u", num+1);
+                    fclose(fp); 
+                    return ;
+                }
 
                 uint32_t pack=1;
                 if(file_size%num==0)
@@ -2692,7 +2750,7 @@ void SetsteptargetParamCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota
         uint8_t vibration=data[5];
         uint8_t notify=data[6];
 
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"设置步数:%d %d %d %d \r\n",targetStep,ringOn,vibration,notify);
+          WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"设置步数:%d %d %d %d \r\n",targetStep,ringOn,vibration,notify);
 
         set_goal_stepcount(targetStep);
         
@@ -2724,10 +2782,14 @@ uint8_t jsonCheck_weather(uint8_t *buf,uint8_t *check)//json 格式解析 天气
     FILE *fp=fopen("/user/userdata/weather.json","wb+");
     if(fp != NULL)
     {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"jsonCheck_weather len %d",strlen((char *)buf)+1);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] jsonCheck_weather: Writing weather data to file, length=%zu", strlen((char *)buf)+1);
         //fwrite((void*)buf,1,strlen((char *)buf)+1,fp);
-        fputs((char *)buf,fp);
+        if(fputs((char *)buf,fp) == EOF) {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_weather: Failed to write weather data to file");
+        }
         fclose(fp);
+    } else {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jsonCheck_weather: Failed to open weather file for writing - errno=%d", errno);
     }
     return parse_jsonCheck_weather(buf,check);
 }
@@ -2738,14 +2800,15 @@ void parse_jsonCheck_weather_post(uint8_t *buf)//json 格式解析 天气数据
     //   WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"jsonCheck_weather:len: json:%f jsonlen:%d\r\n",0.011,strlen((char *)json));
     cJSON* root = cJSON_Parse((const char *)json);
     if (root == NULL) {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"天气 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] parse_jsonCheck_weather_post: Weather JSON parse failed");
         return ;
     }
-      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开始解析天气 JSON\n");
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开始解析天气 JSON\n");
     cJSON *now_cjson = cJSON_GetObjectItem(root, "now");
     if(now_cjson == NULL)
     {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"天气 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] parse_jsonCheck_weather_post: Missing 'now' field in weather JSON");
+        cJSON_Delete(root);
         return ;
     }
     int humidity=0;
@@ -2889,18 +2952,22 @@ uint8_t parse_jsonCheck_weather(uint8_t *buf,uint8_t *check)//json 格式解析
     uint8_t *json;
     json = buf;
     //   WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"jsonCheck_weather:len: json:%f jsonlen:%d\r\n",0.011,strlen((char *)json));
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] parse_jsonCheck_weather: Parsing weather JSON, length=%zu", strlen((char*)json));
+    
     cJSON* root = cJSON_Parse((const char *)json);
     if (root == NULL) {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"天气 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] parse_jsonCheck_weather: JSON parse failed - data='%s'", (char*)json);
         flag = 2;
         memcpy(check,&flag,1);
         return 0;
     }
-      WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"开始解析天气 JSON\n");
+    
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_DEBUG] parse_jsonCheck_weather: Starting weather JSON parsing");
     cJSON *now_cjson = cJSON_GetObjectItem(root, "now");
     if(now_cjson == NULL)
     {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"天气 JSON解析错误\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] parse_jsonCheck_weather: Missing 'now' field in weather JSON");
+        cJSON_Delete(root);
         return 0;
     }
     int humidity=0;
@@ -3070,7 +3137,7 @@ uint8_t read_jsonHistory_weather(void)
     FILE *fp=fopen("/user/userdata/weather.json","rb");
     if(fp == NULL)
     {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"read_jsonHistory_weather:fopen error\r\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] read_jsonHistory_weather: Failed to open weather file - errno=%d", errno);
         return 0;
     }
     fseek(fp, 0, SEEK_END);
@@ -3078,6 +3145,7 @@ uint8_t read_jsonHistory_weather(void)
     fseek(fp, 0, SEEK_SET);
     if (size == 0)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] read_jsonHistory_weather: Weather file is empty");
         fclose(fp);
         return 0;
     }
@@ -3085,6 +3153,7 @@ uint8_t read_jsonHistory_weather(void)
     buf = (uint8_t*)malloc(size + 1);
     if(buf == NULL)
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] read_jsonHistory_weather: Memory allocation failed - requested_size=%ld", size + 1);
         fclose(fp);
         return 0;
     }
@@ -4262,6 +4331,7 @@ static void aboutDeviceCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota
         value[18] = lrc;
         sendBleData(value,19);
     }
+    
     cJSON_free(json_format);
 }
 //查找手表 01 04
@@ -5972,7 +6042,10 @@ static void Send_json_Data_Cmd(uint8_t day,uint16_t pack_size,uint8_t id)
                 break;
         }
        
-        if(json_format == NULL) return ;
+        if(json_format == NULL) {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] JSON format generation failed - json_format is NULL");
+            return ;
+        }
 
         uint32_t data_len = strlen(json_format);
         uint32_t surplus_len=data_len;
@@ -6450,7 +6523,11 @@ bool Read_Health_BIN_file_buf_send_bin_Data(uint8_t day, uint16_t num,uint16_t i
     }
     
     buf = (char *)ym_malloc(sizeof(char)*num+1);
-    if(buf==NULL){fclose(fp); return false;}
+    if(buf==NULL){
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] Memory allocation failed for file data - requested_size=%u", num+1);
+        fclose(fp); 
+        return false;
+    }
 
     uint32_t pack=1;
     if(file_size%num==0)
@@ -6818,6 +6895,8 @@ void getPhoneInfo_test(void)
       WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"lrc:%d",lrc);
     value[data_len+18] = lrc;
     sendBleData(value,data_len+18);
+    
+    cJSON_free(json_format);
     */
 
     // uint8_t value[128];
@@ -6932,7 +7011,7 @@ uint8_t jscheck_ancs(uint8_t *data)
     json = data;
     cJSON* root = cJSON_Parse((const char *)json);
     if (root == NULL) {
-          WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"信息解析 JSON解析 失败\n");
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jscheck_ancs: Message JSON parse failed");
         return 2;
     }
 
@@ -6945,6 +7024,10 @@ uint8_t jscheck_ancs(uint8_t *data)
     msgBuf = ym_malloc(MSG_BUF_LEN+1);
     if(titleBuf == NULL || msgBuf == NULL)//申请内存失败不在申请
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] jscheck_ancs: Memory allocation failed - titleBuf=%p, msgBuf=%p", titleBuf, msgBuf);
+        if(titleBuf) ym_free(titleBuf);
+        if(msgBuf) ym_free(msgBuf);
+        cJSON_Delete(root);
         return 2;
     }
     memset(titleBuf,0,TITLE_BUF_LEN+1);
@@ -8823,7 +8906,11 @@ static errcode_t check_package_same(uint8_t* lastdata,uint8_t *newdata , uint16_
 errcode_t handle_recv_file(ble_read_data *buffer_handle,uint8_t *data, uint16_t event_size)
 {
 
-    if( event_size == 0 || data == NULL ) return ERRCODE_FAIL;
+    if( event_size == 0 || data == NULL ) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[BLE_EVENT_ERROR] handle_recv_file: Invalid parameters - event_size=%u, data=%p", 
+                      event_size, data);
+        return ERRCODE_FAIL;
+    }
     
     if (buffer_handle->last_data_size == event_size)
     {