From 16c423bb47f05f45d16f73aa81fc6a7d48ef8c9b Mon Sep 17 00:00:00 2001 From: SnickerSun Date: Thu, 14 Dec 2023 19:23:45 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=AD=A3=E4=B8=8B=E6=8B=89=E8=8F=9C?= =?utf8?q?=E5=8D=95=EF=BC=8C=E5=AE=9E=E7=8E=B0=E9=87=8D=E5=90=AF=E5=92=8C?= =?utf8?q?=E5=85=B3=E6=9C=BA=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/rebootdevice/src/RebootPresenter.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp index 029b718b6..47de858c3 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/rebootdevice/src/RebootPresenter.cpp @@ -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; } -- 2.17.1