Skip to content

Commit

Permalink
[Microwave Oven] Fix build error for Microwave Oven APP (#31619)
Browse files Browse the repository at this point in the history
* fix #31525

* Restyled by whitespace

* Restyled by clang-format

* update MWO sdk for checking watt setting

* Restyled by clang-format

* add static-cast

* try fix darwin issue

* Restyled by clang-format

* update code after reviewed

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Mar 1, 2024
1 parent cccc37e commit 1553068
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ void Instance::HandleSetCookingParameters(HandlerContext & ctx, const Commands::
VerifyOrExit(
mSupportedWattLevels > 0,
ChipLogError(Zcl, "Microwave Oven Control: Failed to set wattSettingIndex, count of supported watt levels is 0"));

reqWattSettingIndex = wattSettingIndex.ValueOr(mSupportedWattLevels - 1);
VerifyOrExit(reqWattSettingIndex <= (mSupportedWattLevels - 1), status = Status::ConstraintError;
uint8_t maxWattSettingIndex = static_cast<uint8_t>(mSupportedWattLevels - 1);
reqWattSettingIndex = wattSettingIndex.ValueOr(maxWattSettingIndex);
VerifyOrExit(reqWattSettingIndex <= maxWattSettingIndex, status = Status::ConstraintError;
ChipLogError(Zcl, "Microwave Oven Control: Failed to set wattSettingIndex, wattSettingIndex is out of range"));

status = mDelegate->HandleSetCookingParametersCallback(reqCookMode, reqCookTimeSec, reqStartAfterSetting, NullOptional,
Expand Down

0 comments on commit 1553068

Please sign in to comment.