From 6bd473de5258b6eafaff480dd3968f2548c8e313 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 29 Sep 2023 15:59:54 +0100 Subject: [PATCH] Bugfix: rvc app docked and charging state remain true (#29257) * Enabled the RvcClean StartUpMode attribute in the zap and mettar files. * Updated the PICS files to note that this device supports testing the StartUpMode attribute for the RVC Clean cluster. * Refactored the run_all_yaml script. * Updated the testing section of the readme to include the test case related to the RvcClean StartUpMode. * Restyled by prettier-markdown * Restyled by shfmt * Fixed bug that was causing the charging and docked states to remain true once set. * Restyled by clang-format --------- Co-authored-by: Restyled.io --- examples/rvc-app/rvc-common/src/rvc-device.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp index d450a635e2e978..da7a8bcccbd262 100644 --- a/examples/rvc-app/rvc-common/src/rvc-device.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -13,6 +13,7 @@ void RvcDevice::SetDeviceToIdleState() { if (mCharging) { + mDocked = true; mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)); } else if (mDocked) @@ -44,6 +45,8 @@ void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::Ch return; } + mCharging = false; + mDocked = false; mRunModeInstance.UpdateCurrentMode(newMode); mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); response.status = to_underlying(ModeBase::StatusCode::kSuccess);