修正下拉菜单,实现重启和关机能力
authorSnickerSun <snickersun@163.com>
Thu, 14 Dec 2023 11:23:45 +0000 (19:23 +0800)
committerSnickerSun <snickersun@163.com>
Thu, 14 Dec 2023 11:23:45 +0000 (19:23 +0800)
code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp

index 029b718..47de858 100755 (executable)
@@ -43,6 +43,10 @@ void RebootPresenter::OnResume(void) {}
 
 void RebootPresenter::OnStop(void) {}
 
+extern "C" {
+    uint32_t mcu_os_sys_reset(uint8_t *para, uint32_t para_len);
+    void uapi_sys_shipmode(uint32_t arg);
+}
 bool RebootPresenter::OnClick(UIView& view, const ClickEvent& event)
 {
     UNUSED(event);
@@ -54,11 +58,14 @@ bool RebootPresenter::OnClick(UIView& view, const ClickEvent& event)
     } else if (strcmp(view.GetViewId(), REBOOTDEVICE_BUTTON) == 0) {
         // 重启
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "REBOOTDEVICE_BUTTON OnClick");
-        //GetPMSDefaultInterface()->RebootDevice(NULL, NULL);
+        mcu_os_sys_reset(NULL,NULL);
+
     } else if (strcmp(view.GetViewId(), SHUTDOWNDEVICE_BUTTON) == 0) {
         // 关机
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SHUTDOWNDEVICE_BUTTON OnClick");
-        //GetPMSDefaultInterface()->ShutDownDevice(NULL, NULL);
+        // GetPMSDefaultInterface()->ShutDownDevice(NULL, NULL);
+        uapi_sys_shipmode(0);
+
     }
     return true;
 }