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 <commits@restyled.io>
  • Loading branch information
liangpy4 and restyled-commits authored Jan 26, 2024
1 parent c7383a0 commit 0943f8c
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 0943f8c

Please sign in to comment.