Skip to content

Commit a9128fa

Browse files
Remove redundant checks from the operational state impl in all-clusters-app.
The cluster implementation does those checks.
1 parent 84970a0 commit a9128fa

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp

-18
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_
5555

5656
void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err)
5757
{
58-
OperationalState::OperationalStateEnum state =
59-
static_cast<OperationalState::OperationalStateEnum>(GetInstance()->GetCurrentOperationalState());
60-
61-
if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
62-
{
63-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
64-
return;
65-
}
66-
6758
// placeholder implementation
6859
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
6960
if (error == CHIP_NO_ERROR)
@@ -78,15 +69,6 @@ void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperat
7869

7970
void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err)
8071
{
81-
OperationalState::OperationalStateEnum state =
82-
static_cast<OperationalState::OperationalStateEnum>(GetInstance()->GetCurrentOperationalState());
83-
84-
if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
85-
{
86-
err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
87-
return;
88-
}
89-
9072
// placeholder implementation
9173
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
9274
if (error == CHIP_NO_ERROR)

0 commit comments

Comments
 (0)