修复ble广播无法关闭BUG 972/3 972/head 973/target/1
authorhcj <1224667075@qq.com>
Sat, 14 Sep 2024 04:07:15 +0000 (12:07 +0800)
committerhcj <1224667075@qq.com>
Sat, 14 Sep 2024 04:07:15 +0000 (12:07 +0800)
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleService.c
code/sdk/drivers/peripheral/utils/custom_utils.c

index 4050444..68612e5 100644 (file)
@@ -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 */\r
         bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */\r
     //效果不好\r
-    if(!cm_custom_ble_service_on_flag())\r
+    if(!uapi_dev_runtime_get_bt_powerstat())\r
     {\r
         gap_disconnect_remote_device(bdAddr);\r
     }\r
index 5386694..ee8b706 100644 (file)
@@ -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());\r
         // if(AdverFlag == true){\r
             free_ble_data(); \r
-            if(cm_custom_ble_service_on_flag()) \r
+            if(uapi_dev_runtime_get_bt_powerstat()) \r
             {\r
                 svr_ble_adv_start();\r
                 //gap_br_set_bt_scan_mode(GAP_SCAN_MODE_CONNECTABLE, 0); \r
@@ -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())\r
         ble_ancs_client_cmd_setup_and_subscribe(g_ble_conn_id);\r
 \r
-        if(get_ctkd_flag() && cm_custom_ble_service_on_flag())\r
+        if(get_ctkd_flag() && uapi_dev_runtime_get_bt_powerstat())\r
         {\r
             gap_br_set_bt_scan_mode(GAP_SCAN_MODE_NONE, 20);\r
             \r
index 1b73976..de86dbe 100644 (file)
@@ -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);
     }