From c1c721d98e236fdc7e7aca6b3461d5936c91858c Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Sat, 24 Aug 2024 17:16:43 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E8=93=9D=E7=89=99=E5=B9=BF?= =?utf8?q?=E6=92=AD=E6=A8=A1=E5=BC=8F,=E9=99=8D=E4=BD=8E=E5=B9=BF=E6=92=AD?= =?utf8?q?=E5=8A=9F=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/bleservice/bleService.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 f15e1516d..d1ed44ea5 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -326,9 +326,11 @@ void svr_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_bl // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GAP_BLE_STATE_DISCONNECTED!!! svr_alipay_get_adv_start_state %d alipay_get_binding_status:%d\r\n",svr_alipay_get_adv_start_state(),alipay_get_binding_status()); // if(AdverFlag == true){ free_ble_data(); - if(cm_custom_ble_service_on_flag()) - svr_ble_adv_start(); - + if(cm_custom_ble_service_on_flag()) + { + svr_ble_adv_start(); + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); + } ble_disconnect_ok(); // } } else { @@ -343,7 +345,7 @@ void svr_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_bl ble_connect_ok(); - + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0); //int ret= a2dp_snk_connect(addr); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "addr: ****%02x%02x%02x%02x \n", @@ -1492,7 +1494,8 @@ void custom_ble_service_start(void) AdverFlag = true; svr_ble_adv_start_param(); - gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE, 0); + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); + // gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE, 0); //gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); } -- 2.17.1