From 06459345cde6337922b78b7bbd644d21da719ae2 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Thu, 27 Jun 2024 10:50:48 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E5=8D=8F=E8=AE=AEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/bleservice/bleEvent.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) 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 49edcb441..775257982 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -57,6 +57,7 @@ static bool ANCSBigBufFlag = 0;//ANCS多包数据flag static uint16_t data_len = 0; ble_recv_data_info_t ble_recv_data; ble_recv_msg_callback_t g_recv_msg_toUI = NULL; +static uint8_t TRANSMIT_DATA; #if 1 #include "app_msg_manager.h" #include "app_tx_process.h" @@ -1326,10 +1327,12 @@ static uint8_t jsonCheck_time(uint8_t *buf)//json 格式解析 tmp.tm_min = minute; tmp.tm_sec = second; time_t timestamp2 = __tm_to_secs(&tmp); - uint32_t timezone = (timestamp2-timestamp)/60/15; + int16_t timezone = (timestamp2-timestamp)/60/15; printf("timezone in quarters %d\n",timezone); uapi_set_timezone(timezone); //要在uaip_sntp_set_time_utc 之前执行才有效 /********/ + printf("time: %d\n",timestamp ); + uaip_sntp_set_time_utc(timestamp); cJSON_Delete(root); @@ -2872,6 +2875,9 @@ static void RemoveFileCmd(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *dat { uint8_t file_type= data[0];//1 ota 2 MP3 + TRANSMIT_DATA=TRANS_FREE; + CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); + value[17] = 1; // value[18] = Calculate_CRC(value,18); sendBleData(value,19); @@ -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); sendBleData(value,19); } + sendbigDataBufState = false; } @@ -4752,7 +4759,7 @@ void Read_JSON_file_buf_send_bin_Data(uint8_t day, uint8_t num,uint16_t id,char free(path); path = NULL; } - + sendbigDataBufState = false;//分包同步数据不允许打断 return; } @@ -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) { printf("解析失败\r\n"); + send_big_data(1,NULL,0,0,1,1,id,1); + sendbigDataBufState = false;//分包同步数据不允许打断 return; } cJSON * heart_data_list=cJSON_GetObjectItem(heart_data,data_item); @@ -5468,7 +5477,7 @@ errcode_t ble_reply_msg(uint8_t msg_cmdtype,uint8_t msg_cmdid,uint8_t replydata) -uint8_t TRANSMIT_DATA; + errcode_t decode_ota_json(ble_read_data *buffer_handle) { @@ -5838,6 +5847,8 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id) if(fp==NULL) { printf("fopen fail %s\r\n",file_name); + free(data); + sendbigDataBufState = false; return false; } @@ -6464,6 +6475,7 @@ void bleDataRecv(uint8_t *totalData, uint16_t event_size,uint16_t handle) } if(sendbigDataBufState == true)//正在发送大数据不接收任何app指令下发的数据 { + printf("sendbigDataBufState :(%d) ",sendbigDataBufState); return; } printf("bleDataRecv handle:%d\r\n",handle); -- 2.17.1