From a7e10e4dad4053f170cf6a307155d6f79a4cd097 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 5 Oct 2024 14:13:35 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD=E5=9B=A0ble?= =?utf8?q?=E8=BF=9E=E6=8E=A5=E4=B8=8D=E7=A8=B3=E5=AE=9A=E5=AF=BC=E8=87=B4?= =?utf8?q?=E7=9A=84=E5=B9=BF=E6=92=AD=E8=AF=AF=E5=85=B3=EF=BC=8C=E6=97=A0?= =?utf8?q?=E6=B3=95=E9=87=8D=E6=96=B0=E5=BC=80=E5=90=AF=E5=B9=BF=E6=92=AD?= =?utf8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E9=87=8D=E8=BF=9E=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/bleservice/bleEvent.c | 15 +-------------- .../service/ble_service/bleservice/bleService.c | 8 ++++---- 2 files changed, 5 insertions(+), 18 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 2a8ad5193..7e2ee1f3f 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -6160,8 +6160,6 @@ void Send_Sleep_Bin_Data(uint8_t day, uint16_t num) send_big_data(type_,NULL,0); //send_big_data(1,NULL,0,0,1,1,0x4b,1); - - sendbigDataBufState = false;//分包同步数据不允许打断 return; } @@ -6281,7 +6279,7 @@ bool Read_Health_BIN_file_buf_send_bin_Data(uint8_t day, uint16_t num,uint16_t i void Read_BIN_file_buf_send_bin_Data(uint8_t day,uint32_t pack_size,uint16_t id) { - sendbigDataBufState = true;//分包同步数据不允许打断 + const char *data=NULL; uint32_t data_len = 0; @@ -6293,7 +6291,6 @@ void Read_BIN_file_buf_send_bin_Data(uint8_t day,uint32_t pack_size,uint16_t id) send_big_data(type_,NULL,0); //send_big_data(1,NULL,0,0,1,1,id,1); - sendbigDataBufState = false;//分包同步数据不允许打断 return; } uint8_t single_data=8; @@ -6383,7 +6380,6 @@ void readDevDataBle(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,u bleSendTypeID=cmd-((cmd/256)*256); // printf("同步第%d天的数据\r\n",data[0]); int num; - sendbigDataBufState = true;//分包同步数据不允许打断 switch (bleSendTypeID) { @@ -6564,7 +6560,6 @@ void readDevDataBle(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,u default: break; } - sendbigDataBufState = false;//分包同步数据不允许打断 //sendReadData(); }else{ sendBuf[18] = 0; @@ -7581,7 +7576,6 @@ static uint32_t file_size=0; bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id) { - sendbigDataBufState = true;//分包同步数据不允许打断 char *data= (char *)malloc(pack_size+1); uint16_t read_size=0; @@ -7595,7 +7589,6 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id) { printf("fopen fail %s\r\n",file_name); free(data); - sendbigDataBufState = false; return false; } @@ -8490,12 +8483,6 @@ void bleDataRecv(uint8_t *totalData, uint16_t event_size,uint16_t handle) printf("event size (%d) is less than msg_header_t (%d) ",event_size,sizeof(msg_header_t)); // return ; } - if(sendbigDataBufState == true)//正在发送大数据不接收任何app指令下发的数据 - { - printf("sendbigDataBufState :(%d)",sendbigDataBufState); - - // return; - } #ifdef BLE_LOG printf("bleDataRecv handle:%d\r\n",handle); #endif diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index a5be1cc21..33f156b7b 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -388,8 +388,6 @@ void svr_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_bl ble_disconnect_ok(); - svr_ble_adv_start(); - g_ble_conn_id=0; //APP断连 @@ -399,13 +397,15 @@ void svr_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_bl { ble_ancs_client_clear(conn_id); } - } else { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "其他连接断开,不做多余处理 \r\n"); } - + //如果ble连接全部断连,则需要重新开启广播 + if(!get_ble_connect()) + svr_ble_adv_start(); } -- 2.17.1