From 883b1a088fb1aaa9bb94bd861024ce5bfaa7f1cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=83=A1=E4=BC=A0=E5=86=9B?= <1224667075@qq.com> Date: Fri, 16 Aug 2024 07:49:22 +0000 Subject: [PATCH] Merge #708 into sdk602patch0626 from refs/changes/708/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 胡传军 * refs/changes/708/head: (5 commits squashed) - 修改br连接接口 改用消息机制 增加回连判断 实际实现传统蓝牙开关关闭则br连接不上(有BUG) - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into 0626 - 增加连接中 UI 及部分蓝牙问题修正 - 重新打开br广播 - 合并 Signed-off-by: aliyun8003852482 <1224667075@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/708 --- .../service/ble_service/bleservice/bleService.c | 14 +++++++++----- 1 file changed, 9 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 0f4087425..461471e8f 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -307,7 +307,7 @@ void svr_ble_connstate_change_cb(unsigned short conn_id, bd_addr_t *addr, gap_bl free_ble_data(); if(cm_custom_ble_service_on_flag()) svr_ble_adv_start(); - + ble_disconnect_ok(); // } } else { @@ -370,8 +370,12 @@ void svr_pair_result_cbt_cb(uint16_t conn_id, const bd_addr_t *addr, errcode_t s uapi_get_br_address(&bdaddr); if(false==(bt_is_acl_connected(&bdaddr))) { - int ret=gap_reconnect_media_device(&bdaddr); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! %X\r\n",ret); + if(cm_get_A2DP_switch() || cm_get_HFP_switch()) + { + int ret=gap_reconnect_media_device(&bdaddr); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_reconnect_media_device!!! %X\r\n",ret); + } + } else { @@ -1452,7 +1456,7 @@ void custom_ble_service_start(void) AdverFlag = true; svr_ble_adv_start_param(); - gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 0); + //gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); } @@ -1461,7 +1465,7 @@ void custom_ble_service_start_(uint8_t data) AdverFlag = true; svr_ble_adv_start_param(); WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "custom_ble_service_start_ "); - gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, data); + gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, data); } #define MODE_BLE_ADV_SRV (0) -- 2.17.1