Skip to content

Commit

Permalink
Add LogErrorOnFailure
Browse files Browse the repository at this point in the history
  • Loading branch information
hare-siterwell committed Aug 10, 2023
1 parent 229b355 commit 25c27da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ void SmokeCoAlarmServer::SetExpressedStateByPriority(EndpointId endpointId,
break;
}

VerifyOrReturn(alarmState == AlarmStateEnum::kNormal, SetExpressedState(endpointId, priority));
VerifyOrReturn(endOfServiceState == EndOfServiceEnum::kNormal, SetExpressedState(endpointId, priority));
VerifyOrReturn(active == false, SetExpressedState(endpointId, priority));
if ((alarmState != AlarmStateEnum::kNormal) || (endOfServiceState != EndOfServiceEnum::kNormal) || active)
{
LogErrorOnFailure(SetExpressedState(endpointId, priority));
return;
}
}

SetExpressedState(endpointId, ExpressedStateEnum::kNormal);
LogErrorOnFailure(SetExpressedState(endpointId, ExpressedStateEnum::kNormal));
}

bool SmokeCoAlarmServer::SetSmokeState(EndpointId endpointId, AlarmStateEnum newSmokeState)
Expand Down

0 comments on commit 25c27da

Please sign in to comment.