Skip to content

Commit

Permalink
Bugfix: rvc app docked and charging state remain true (#29257)
Browse files Browse the repository at this point in the history
* 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 <commits@restyled.io>
  • Loading branch information
hicklin and restyled-commits authored Sep 29, 2023
1 parent 7a85f83 commit 6bd473d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/rvc-app/rvc-common/src/rvc-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void RvcDevice::SetDeviceToIdleState()
{
if (mCharging)
{
mDocked = true;
mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging));
}
else if (mDocked)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6bd473d

Please sign in to comment.