From: hcj <1224667075@qq.com> Date: Tue, 8 Oct 2024 07:41:05 +0000 (+0800) Subject: ble对接调试窗口 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=aabfc36427035938cef23a398f6b1fd3f12a67bc;p=mirrors%2FFD230.git ble对接调试窗口 --- 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 f0a03b5af..bbb73ee17 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -178,7 +178,7 @@ static void clean_phone_info(uint16_t conn_id)//保存手机信息 包含手机m } -static bool get_ble_connect()//保存手机信息 包含手机mac地址 +bool get_ble_connect(void)//保存手机信息 包含手机mac地址 { for(int i=0;i #include #include +#include "bleService.h" namespace OHOS { @@ -119,7 +120,7 @@ namespace OHOS { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DebugOutputViewEventListener::get_bt_runtime_status_t"); std::string result = "bt_powerOn:" + std::to_string(uapi_dev_runtime_get_bt_powerstat()) + " "; - result += "bt_ble_connectstat:" + std::to_string(uapi_dev_runtime_get_ble_connect_stat()) + " "; + result += "bt_ble_connectstat:" + std::to_string(get_ble_connect()) + " "; result += "bt_br_connectstat:" + std::to_string(uapi_dev_runtime_get_br_connect_stat()) + " "; result += "bt_earphone_connectstat:" + std::to_string(uapi_dev_runtime_get_earphone_connect_stat()) + " "; result += "android_app_connected:" + std::to_string(uapi_dev_runtime_get_android_connection_status()) + " "; @@ -133,7 +134,7 @@ namespace OHOS result += "spp_service_handler: "; result += "hfp_service_handler: "; result += "localAddress:" + (getCurrentWatchMacAddress()) + " "; - result += "ble广播状态:" + std::to_string(BluetoothModel::GetInstance()->GetAdvStartState()); + result += "ble广播状态:" + std::to_string(get_ble_adv_status()); // 蓝牙ble广播开关,基础信息如,地址,广播状态 @@ -288,8 +289,10 @@ namespace OHOS std::string str; if (viewId == DEBUGOUTPUTBLESERVICELABELBUTTON) // 开启ble广播 { - if (BluetoothModel::GetInstance()->GetAdvStartState() == false) // 如果广播是关的就去开启广播 - BleAdvStart(); + // if (BluetoothModel::GetInstance()->GetAdvStartState() == false) // 如果广播是关的就去开启广播 + // BleAdvStart(); + + svr_ble_adv_start(); return true; } else if (viewId == DEBUGOUTPUTLABELBUTTON) // 点击的是刷新按钮