From 57df6ef665a284db5ddf8170bd51efcb6ef0c186 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Wed, 17 Dec 2025 15:07:15 +0800 Subject: [PATCH] =?utf8?q?ln=E5=8E=BB=E9=99=A4=E9=83=A8=E5=88=86=E4=B8=8D?= =?utf8?q?=E5=BF=85=E8=A6=81=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/bluetooth/src/BluetoothModel.cpp | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index 2137417c3..565b2711b 100644 --- a/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/ln/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -104,7 +104,7 @@ void BluetoothModel::InitBluetoothInfo(void) uint32_t currentUs = uapi_tcxo_get_us(); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "currentUs 0x%x", currentUs); // 设置蓝牙名称 - (void)sprintf_s(watchName, sizeof(watchName), "Watch%x", (currentUs & 0xFFFF)); + (void)sprintf_s(watchName, sizeof(watchName), "LN%x", (currentUs & 0xFFFF)); ret = bluetooth_set_local_name((unsigned char*)watchName, strlen((char*)watchName) + 1); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bluetooth_set_local_name %s ret = %u", watchName, ret); @@ -135,26 +135,12 @@ void BluetoothModel::Init() ret = enable_bt_stack(); WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt enable_bt_stack ret = %u", ret); - // 设置安全连接 - gap_ble_sec_params_t sec_param = { 1, GAP_BLE_IO_CAPABILITY_NOINPUTNOOUTPUT, 1, GAP_BLE_GAP_SECURITY_MODE1_LEVEL3 }; - ret = gap_ble_set_sec_param(&sec_param); - WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "bt gap_ble_set_sec_param ret = %u", ret); - InitBluetoothInfo(); BtInitCallBacks(); - wrapper_ble_register(); - BtInitCallBacksEx(); - BtInitGatts(); - BtInitSpp(); InitBtHeadsetEvent(); // 蓝牙ct和tg适配初始化 PhoneServiceInit(); - // gap_remove_all_pairs(); BtA2dpInit(); - - /* 实验室测试需要,开机开广播 */ - BleAdvStart(); - #endif } @@ -1203,12 +1189,15 @@ static void A2dpSrcConnectstateChanged(bd_addr_t *bdAddr, int connState) } if (connState == PROFILE_STATE_DISCONNECTED) { + + + if(AI_IsVoiceServiceRunning()){ ln_ws_audio_deinit(); } - PhoneAudioManagerSetDeviceConnState(OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_DISCONNECTED); + set_a2dp_is_connect(false); -- 2.17.1