From: SnickerSun Date: Thu, 14 Dec 2023 11:23:45 +0000 (+0800) Subject: 修正下拉菜单,实现重启和关机能力 X-Git-Tag: release_V1.2.70_20241020_135402~1404 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=16c423bb47f05f45d16f73aa81fc6a7d48ef8c9b;p=mirrors%2FFD230.git 修正下拉菜单,实现重启和关机能力 --- 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; }