diff --git a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp index ff29f84fb95ba9..a5ee5b6e383734 100644 --- a/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp +++ b/src/app/clusters/refrigerator-alarm-server/refrigerator-alarm-server.cpp @@ -32,7 +32,7 @@ using chip::Protocols::InteractionModel::Status; static Status resetHandler(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const chip::BitMask alarms, const chip::Optional> mask); -static Status resetHandler(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const chip::BitMask alarms, const chip::Optional> mask) +static Status resetHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, const BitMask & alarms, const Optional> & mask) { EndpointId endpoint = commandPath.mEndpointId; @@ -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) {