From 4b6d5057b222189a2c8dc3b25533cb89e0edd95e Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Mon, 13 Oct 2025 15:49:20 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0ble=E6=9C=AA=E6=B3=A8=E5=86=8C?= =?utf8?q?=E5=87=BD=E6=95=B0=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/RebootAndShutdownModel.cpp | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp index 1fd98fa0c..402fb5d27 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp @@ -23,6 +23,11 @@ #include "bleService.h" #endif #include "uiservice/include/ui_service.h" +#include "custom_runtime.h" +#include "ConfigModelC.h" +#ifdef SUPPORT_CYWEE_SERVICE +#include "cywee_service.h" +#endif #ifdef FD230_650 #include "dial_sos_c.h" @@ -140,9 +145,82 @@ namespace OHOS #ifdef BLE_INSTRUCT #include "bleEvent.h" #include "bleInstruct.h" + + void ble_connect_ok_(void) + { + SendMsgToUIService(PHONE_CONNECTED_TO_UI, 0, nullptr, 0); + } + + void ble_disconnect_ok_(void) + { + SendMsgToUIService(PHONE_DISCONNECTED_TO_UI, 0, nullptr, 0); + } + + void Set_RaiseToWake_(bool value) //抬婉亮屏开关 + { + if(uapi_sleep_mode_flag_get()) + { + return; + } + + mmi_flip_wrist_switch_set(value); + if(true == value) + { + #ifdef SUPPORT_CYWEE_SERVICE + cywee_hand_wake_switch(1); // 关闭抬腕亮屏,和息屏 + #endif + } + else + { + #ifdef SUPPORT_CYWEE_SERVICE + cywee_hand_wake_switch(0); // 关闭抬腕亮屏,和息屏 + #endif + } + + SendMsgToUIService(UI_UPDATE_RAISETOBRIGHTNESS,0,nullptr,0); + return; + } + + int Get_RaiseToWake_(void) //获取抬婉亮屏开关 + { + return mmi_flip_wrist_switch_get(); + } + + void Set_SystemVolume_(int value) //设置系统音量 + { + uapi_systemVolumeSet(value); + SendMsgToUIService(UI_UPDATE_SYSTEM_VOLUME,0,nullptr,0); + return; + } + + int Get_SystemVolume_(void) //获取系统音量 + { + return uapi_systemVolumeGet(); + } + void Set_CallVolume_(int value) //设置通话音量 + { + uapi_callVolumeSet(value); + SendMsgToUIService(UI_UPDATE_CALL_VOLUME,0,nullptr,0); + return; + } + + int Get_CallVolume_(void) //获取通话音量 + { + return uapi_callVolumeGet(); + } + + void ble_watch_first_paired(void) { bleInstruct_t.hand_watch_first_time_Paired = HandWatchFirstTimePaired; + bleInstruct_t.ble_connect_ok = ble_connect_ok_; + bleInstruct_t.ble_disconnect_ok = ble_disconnect_ok_; + bleInstruct_t.Set_RaiseToWake = Set_RaiseToWake_; + bleInstruct_t.Get_RaiseToWake = Get_RaiseToWake_; + bleInstruct_t.Set_SystemVolume = Set_SystemVolume_; + bleInstruct_t.Get_SystemVolume = Get_SystemVolume_; + bleInstruct_t.Set_CallVolume = Set_CallVolume_; + bleInstruct_t.Get_CallVolume = Get_CallVolume_; } #endif -- 2.17.1