From b1c5317dfa30822d781c407fc545d8574c8ce0cf Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 2 Dec 2024 21:48:39 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E9=9F=B3=E4=B9=90=E6=92=AD?= =?utf8?q?=E6=94=BE=E5=99=A8=E8=93=9D=E7=89=99=E8=80=B3=E6=9C=BA=E8=BF=9E?= =?utf8?q?=E6=8E=A5=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativelauncher/src/NativeLauncher.cpp | 2 +- .../fd230app/nativeui/bluetooth/include/BluetoothModelC.h | 5 +++-- .../fd230app/nativeui/bluetooth/src/BluetoothModel.cpp | 5 ++++- .../fd230app/nativeui/settings/src/SettingModel.cpp | 8 ++++++-- code/sdk/drivers/peripheral/utils/custom_utils.c | 2 ++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp index 4cf44dfae..83908096c 100644 --- a/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp +++ b/code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp @@ -557,7 +557,7 @@ namespace OHOS ScreenModels::GetInstance()->InitKvStorage(); VocassistModel::GetInstance()->Init(); HeartModel::GetInstance()->Init(); - BluetoothModel::GetInstance()->Init(); + // BluetoothModel::GetInstance()->Init(); TraingModel::GetInstance()->Init(); // 训练消息订阅 TakephotosModel::GetInstance()->Init(); // 拍照消息订阅 MessageModel::GetInstance().Init(); // 消息订阅监听 diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h index 8f76d5b50..157c3002e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h @@ -1,8 +1,8 @@ /* * @Author: penglei 1624952103@qq.com * @Date: 2024-08-23 10:50:37 - * @LastEditors: penglei 1624952103@qq.com - * @LastEditTime: 2024-09-23 16:59:22 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-12-02 19:24:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/bluetooth/include/BluetoothModelC.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ @@ -33,6 +33,7 @@ int uapi_reconnect_(void); int get_BT_is_init(void); +void cm_initBluetoothDeviceList(void); #ifdef __cplusplus } #endif 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 0f7384c0c..6cb7f137e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -2011,7 +2011,10 @@ int uapi_open_br_scan(void) // } - +void cm_initBluetoothDeviceList(void) +{ + BluetoothModel::GetInstance()->Init(); +} #ifdef __cplusplus } diff --git a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp index 78459ee2e..1a4e9d81a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-02-18 09:09:13 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-11-27 17:16:20 + * @LastEditTime: 2024-12-02 21:31:22 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingModel.cpp */ #include "settings/include/SettingModel.h" @@ -14,7 +14,7 @@ #include "PhoneService.h" #include "phoneservice/include/PhoneService.h" #include "BluetoothModel.h" - +#include "player/include/MusicPlayerSourceView.h" extern "C" { #include "custom_runtime.h" @@ -127,6 +127,10 @@ namespace OHOS { BluetoothServiceOptionsView::GetInstance()->Button_UPdata(); } + if(MusicPlayerSourceView::GetInstance()) + { + MusicPlayerSourceView::GetInstance()->UpdateBluetoothHeadsetConnectLabel(); + } } // 更新蓝牙连接状态 diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 992bb120f..2ca730c21 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -73,6 +73,7 @@ #include "broadcast_feature.h" #include "battery_service.h" #include "cywee_hal.h" +#include "bluetooth/include/BluetoothModelC.h" errcode_t uapi_create_osThread_custom(app_task_definition_t *task_cfg) { @@ -497,6 +498,7 @@ void startup_post_init_task(void) // cm_initializeVoLTECall(); //initialize4GCapability(); //initializeMotionRecognition(); + cm_initBluetoothDeviceList(); LOS_Msleep(5000); -- 2.17.1