修改协议BUG 387/2 387/head 388/target/1
authorhcj <1224667075@qq.com>
Thu, 27 Jun 2024 02:50:48 +0000 (10:50 +0800)
committerhcj <1224667075@qq.com>
Thu, 27 Jun 2024 02:50:48 +0000 (10:50 +0800)
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c

index 49edcb4..7752579 100644 (file)
@@ -57,6 +57,7 @@ static bool ANCSBigBufFlag = 0;//ANCS多包数据flag
 static uint16_t data_len = 0;\r
 ble_recv_data_info_t ble_recv_data;\r
 ble_recv_msg_callback_t g_recv_msg_toUI = NULL;\r
+static uint8_t TRANSMIT_DATA;\r
 #if 1\r
 #include "app_msg_manager.h"\r
 #include "app_tx_process.h"\r
@@ -1326,10 +1327,12 @@ static uint8_t jsonCheck_time(uint8_t *buf)//json 格式解析
     tmp.tm_min = minute;\r
     tmp.tm_sec = second;\r
     time_t timestamp2 = __tm_to_secs(&tmp);\r
-    uint32_t timezone = (timestamp2-timestamp)/60/15;   \r
+    int16_t timezone = (timestamp2-timestamp)/60/15;   \r
     printf("timezone in quarters %d\n",timezone);\r
     uapi_set_timezone(timezone); //要在uaip_sntp_set_time_utc 之前执行才有效\r
     /********/\r
+    printf("time: %d\n",timestamp );\r
+\r
     uaip_sntp_set_time_utc(timestamp);\r
 \r
     cJSON_Delete(root);\r
@@ -2872,6 +2875,9 @@ static void RemoveFileCmd(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *dat
     {\r
         uint8_t file_type= data[0];//1 ota 2 MP3\r
 \r
+        TRANSMIT_DATA=TRANS_FREE;\r
+        CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1);\r
+\r
         value[17] = 1; //\r
         value[18] = Calculate_CRC(value,18);\r
         sendBleData(value,19);\r
@@ -4007,6 +4013,7 @@ static void GetAiRecordCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *tota
         value[18] = Calculate_CRC(value,18);\r
         sendBleData(value,19);\r
     }\r
+    sendbigDataBufState = false;\r
 }\r
 \r
 \r
@@ -4752,7 +4759,7 @@ void Read_JSON_file_buf_send_bin_Data(uint8_t day, uint8_t num,uint16_t id,char
             free(path);\r
             path = NULL;\r
         }\r
-\r
+       \r
         sendbigDataBufState = false;//分包同步数据不允许打断\r
         return;\r
     }\r
@@ -4778,6 +4785,8 @@ void Read_JSON_file_buf_send_bin_Data(uint8_t day, uint8_t num,uint16_t id,char
     if(heart_data==NULL)\r
     {\r
         printf("解析失败\r\n");\r
+        send_big_data(1,NULL,0,0,1,1,id,1);\r
+        sendbigDataBufState = false;//分包同步数据不允许打断\r
         return;\r
     }\r
     cJSON * heart_data_list=cJSON_GetObjectItem(heart_data,data_item);\r
@@ -5468,7 +5477,7 @@ errcode_t ble_reply_msg(uint8_t msg_cmdtype,uint8_t msg_cmdid,uint8_t replydata)
 \r
 \r
 \r
-uint8_t TRANSMIT_DATA;\r
+\r
 \r
 errcode_t decode_ota_json(ble_read_data *buffer_handle)\r
 {\r
@@ -5838,6 +5847,8 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id)
     if(fp==NULL)\r
     {\r
         printf("fopen fail %s\r\n",file_name);\r
+        free(data);\r
+        sendbigDataBufState = false;\r
         return false;\r
     }\r
 \r
@@ -6464,6 +6475,7 @@ void bleDataRecv(uint8_t *totalData, uint16_t event_size,uint16_t handle)
     }\r
     if(sendbigDataBufState == true)//正在发送大数据不接收任何app指令下发的数据\r
     {\r
+        printf("sendbigDataBufState :(%d) ",sendbigDataBufState);\r
         return;\r
     }\r
     printf("bleDataRecv handle:%d\r\n",handle); \r