Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
jadhavrohit924 and bzbarsky-apple authored May 22, 2023
1 parent 7ae9575 commit 76a81c5
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using chip::Protocols::InteractionModel::Status;

static Status resetHandler(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const chip::BitMask<AlarmMap> alarms, const chip::Optional<chip::BitMask<AlarmMap>> mask);

static Status resetHandler(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const chip::BitMask<AlarmMap> alarms, const chip::Optional<chip::BitMask<AlarmMap>> mask)
static Status resetHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, const BitMask<AlarmMap> & alarms, const Optional<BitMask<AlarmMap>> & mask)
{
EndpointId endpoint = commandPath.mEndpointId;

Expand All @@ -44,16 +44,7 @@ static Status resetHandler(app::CommandHandler * commandObj, const app::Concrete
return Status::Failure;
}

uint32_t alarmValue = alarms.Raw();
uint32_t stateValue = state.Raw();

// Flip the bits of alarms (i.e. ~alarms)
alarmValue = 0xFFFF ^ alarmValue;

// Reset state from active to inactive
stateValue = stateValue & alarmValue;

state.SetRaw(stateValue);
state.Clear(alarms);
status = State::Set(endpoint, state);
if (status != EMBER_ZCL_STATUS_SUCCESS)
{
Expand Down

0 comments on commit 76a81c5

Please sign in to comment.