Skip to content

Commit

Permalink
Clarified comments following reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
hicklin committed Dec 13, 2023
1 parent 020b326 commit 3d8a267
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/rvc-app/rvc-common/src/rvc-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ void RvcDevice::HandleOpStatePauseCallback(Clusters::OperationalState::GenericOp

void RvcDevice::HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err)
{
// This method is only called if the device is in a resume-compatible state, i.e. `Charging`, `Docked` or `Paused`.
auto error = CHIP_NO_ERROR;
switch (mOperationalStateInstance.GetCurrentOperationalState())
{
Expand Down Expand Up @@ -136,9 +135,13 @@ void RvcDevice::HandleOpStateResumeCallback(Clusters::OperationalState::GenericO
}
}
break;
default:
// This method is only called if the device is in a resume-compatible state, i.e. `Charging`, `Docked` or
// `Paused`. Therefor, we do not expect to ever enter this branch.
err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
return;
}

// populate the response.
if (error == CHIP_NO_ERROR)
{
err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
Expand Down

0 comments on commit 3d8a267

Please sign in to comment.