Skip to content

Commit

Permalink
compling sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
liangpy4 committed Nov 29, 2023
1 parent 9cf9184 commit 8f3bac4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ using namespace chip::app::Clusters;
using namespace chip::app::Clusters::OperationalState;
using namespace chip::app::Clusters::ModeBase;
using namespace chip::app::Clusters::MicrowaveOvenControl;
template <typename T>
using List = chip::app::DataModel::List<T>;
using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type;
using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalStateEnum;
using Status = Protocols::InteractionModel::Status;

Expand All @@ -43,7 +46,7 @@ ExampleMicrowaveOvenDevice::HandleSetCookingParametersCallback(uint8_t cookMode,
{
// placeholder implementation
Status status;
if((status = mMicrowaveOvenModeInstance.UpdateCurrentMode(cookMode) != Status::Success))
if((status = mMicrowaveOvenModeInstance.UpdateCurrentMode(cookMode)) != Status::Success)
{
return status;
}
Expand All @@ -52,7 +55,7 @@ ExampleMicrowaveOvenDevice::HandleSetCookingParametersCallback(uint8_t cookMode,
return Status::Success;
}

Protocols::InteractionModel::Status ExampleMicrowaveOvenDevice::HandleSetCookTimeCommandCallback(uint32_t finalCookTime)
Protocols::InteractionModel::Status ExampleMicrowaveOvenDevice::HandleSetCookTimeCallback(uint32_t finalCookTime)
{
// placeholder implementation
mMicrowaveOvenControlInstance.SetCookTime(finalCookTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace app {
namespace Clusters {
namespace MicrowaveOvenControl {

Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, Clusters::OperationalState::Instance * aOpStateInstance) :
Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, Clusters::OperationalState::Instance * aOpStateInstance, Clusters::ModeBase::Instance * aMicrowaveOvenModeInstance) :
CommandHandlerInterface(MakeOptional(aEndpointId), aClusterId), AttributeAccessInterface(MakeOptional(aEndpointId), aClusterId),
mDelegate(aDelegate), mEndpointId(aEndpointId), mClusterId(aClusterId),
mOpStateInstance(aOpStateInstance), mMicrowaveOvenModeInstance(aMicrowaveOvenModeInstance)
Expand Down Expand Up @@ -75,7 +75,7 @@ uint32_t Instance::GetCookTime() const

uint8_t Instance::GetPowerSetting() const
{
return mPowerSettng;
return mPowerSetting;
}

void Instance::SetCookTime(uint32_t cookTime)
Expand All @@ -84,17 +84,17 @@ void Instance::SetCookTime(uint32_t cookTime)
mCookTime = cookTime;
if (mCookTime != oldCookTime)
{
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::CookTime::Id));
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::CookTime::Id);
}
}

void Instance::SetPowerSetting(uint8_t powerSetting)
{
uint8_t oldPowerSetting = mPowerSetting;
mPowerSetting = powerSetting;
if (mPowerSettng != oldPowerSetting)
if (mPowerSetting != oldPowerSetting)
{
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PowerSetting::Id));
MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PowerSetting::Id);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface
* set default values
*/
uint32_t mCookTime = kDefaultCookTime;
uint8_t mPowerSettng = kDefaultPowerSetting;
uint8_t mPowerSetting = kDefaultPowerSetting;

/**
* IM-level implementation of read
Expand Down

0 comments on commit 8f3bac4

Please sign in to comment.