From: hcj <1224667075@qq.com> Date: Sat, 14 Sep 2024 04:07:15 +0000 (+0800) Subject: 修复ble广播无法关闭BUG X-Git-Tag: release_V1.2.70_20241020_135402~482 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F972%2Fhead;p=mirrors%2FFD230.git 修复ble广播无法关闭BUG --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index 405044427..68612e5ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -1053,7 +1053,7 @@ void GapAclStateChangedCallback(const bd_addr_t *bdAddr, gap_acl_state_t state, bdAddr->addr[5], bdAddr->addr[4], bdAddr->addr[3], /* mac下标 0 1 2 3 4 5 */ bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */ //效果不好 - if(!cm_custom_ble_service_on_flag()) + if(!uapi_dev_runtime_get_bt_powerstat()) { gap_disconnect_remote_device(bdAddr); } 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 5386694ef..ee8b70658 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -326,7 +326,7 @@ 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()) + if(uapi_dev_runtime_get_bt_powerstat()) { svr_ble_adv_start(); //gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); @@ -376,7 +376,7 @@ void svr_pair_result_cbt_cb(uint16_t conn_id, const bd_addr_t *addr, errcode_t s if(get_ble_pair()) ble_ancs_client_cmd_setup_and_subscribe(g_ble_conn_id); - if(get_ctkd_flag() && cm_custom_ble_service_on_flag()) + if(get_ctkd_flag() && uapi_dev_runtime_get_bt_powerstat()) { gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 20); diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 1b73976e9..de86dbea4 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -286,7 +286,7 @@ bool start_custom_ble_service(void) PRINT("start custom protocol classic bt ble service !\r\n"); bluetooth_enable_all(); #endif - if(!uapi_dev_runtime_get_saveele_status()) + //if(!uapi_dev_runtime_get_saveele_status()) { uapi_dev_runtime_set_bt_powerstat(1); } @@ -300,7 +300,7 @@ bool stop_custom_ble_service(void) PRINT("stop custom protocol classic bt ble service !\r\n"); bluetooth_close_all(); #endif - if(!uapi_dev_runtime_get_saveele_status()) + //if(!uapi_dev_runtime_get_saveele_status()) { uapi_dev_runtime_set_bt_powerstat(0); }