增加ble未注册函数注册
authorhcj <1224667075@qq.com>
Mon, 13 Oct 2025 07:49:20 +0000 (15:49 +0800)
committerhcj <1224667075@qq.com>
Mon, 13 Oct 2025 07:49:20 +0000 (15:49 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp

index 1fd98fa..402fb5d 100644 (file)
 #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