Skip to content

Commit

Permalink
regen microwave-oven-app.matter
Browse files Browse the repository at this point in the history
  • Loading branch information
liangpy4 committed Nov 24, 2023
1 parent 2c1b743 commit 4bb3cac
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/microwave-oven-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ using namespace chip::app::Clusters;

static constexpr EndpointId kMicrowwaveOvenEndpointId = 1;

std::unique_ptr<MicrowaveOvenDevice> gMicrowaveOvenDevice;
Platform::UniquePtr<MicrowaveOvenDevice> gMicrowaveOvenDevice;

void ApplicationInit()
{
gMicrowaveOvenDevice = std::make_unique<MicrowaveOvenDevice>(kMicrowwaveOvenEndpointId);
gMicrowaveOvenDevice = Platform::MakeUnique<MicrowaveOvenDevice>(kMicrowwaveOvenEndpointId);
gMicrowaveOvenDevice.get()->Init(kMicrowwaveOvenEndpointId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class ExampleMicrowaveOvenControlDelegate : public MicrowaveOvenControl::Delegat
/**
* define callback binding function
*/
std::unique_ptr<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>
Platform::UniquePtr<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>
mHandleSetCookingParametersCallback;
std::unique_ptr<std::function<Protocols::InteractionModel::Status(uint32_t)>> mHandleAddMoreTimeCallback;
Platform::UniquePtr<std::function<Protocols::InteractionModel::Status(uint32_t)>> mHandleAddMoreTimeCallback;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ class OperationalStateDelegate : public OperationalState::Delegate
/**
* define callback binding function
*/
std::unique_ptr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mPauseCallback;
std::unique_ptr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mResumeCallback;
std::unique_ptr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mStartCallback;
std::unique_ptr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mStopCallback;
std::unique_ptr<std::function<app::DataModel::Nullable<uint32_t>(void)>> mGetCountdownTimeCallback;
Platform::UniquePtr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mPauseCallback;
Platform::UniquePtr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mResumeCallback;
Platform::UniquePtr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mStartCallback;
Platform::UniquePtr<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>> mStopCallback;
Platform::UniquePtr<std::function<app::DataModel::Nullable<uint32_t>(void)>> mGetCountdownTimeCallback;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */
server cluster Identify = 3 {
revision 4;

enum EffectIdentifierEnum : enum8 {
kBlink = 0;
kBreathe = 1;
Expand Down Expand Up @@ -49,6 +51,8 @@ server cluster Identify = 3 {

/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
server cluster Descriptor = 29 {
revision 2;

bitmap Feature : bitmap32 {
kTagList = 0x1;
}
Expand Down Expand Up @@ -82,6 +86,8 @@ server cluster Descriptor = 29 {
and enforce Access Control for the Node's endpoints and their associated
cluster instances. */
server cluster AccessControl = 31 {
revision 1; // NOTE: Default/not specifically set

enum AccessControlEntryAuthModeEnum : enum8 {
kPASE = 1;
kCASE = 2;
Expand Down Expand Up @@ -154,6 +160,8 @@ server cluster AccessControl = 31 {
Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number,
which apply to the whole Node. Also allows setting user device information such as location. */
server cluster BasicInformation = 40 {
revision 3;

enum ColorEnum : enum8 {
kBlack = 0;
kNavy = 1;
Expand Down Expand Up @@ -247,6 +255,8 @@ server cluster BasicInformation = 40 {
standards. As such, Nodes that visually or audibly convey information need a mechanism by which
they can be configured to use a user’s preferred language, units, etc */
server cluster LocalizationConfiguration = 43 {
revision 1; // NOTE: Default/not specifically set

attribute access(write: manage) char_string<35> activeLocale = 0;
readonly attribute char_string supportedLocales[] = 1;
readonly attribute command_id generatedCommandList[] = 65528;
Expand All @@ -262,6 +272,8 @@ server cluster LocalizationConfiguration = 43 {
or audibly convey time information need a mechanism by which they can be configured to use a
user’s preferred format. */
server cluster TimeFormatLocalization = 44 {
revision 1; // NOTE: Default/not specifically set

enum CalendarTypeEnum : enum8 {
kBuddhist = 0;
kChinese = 1;
Expand Down Expand Up @@ -300,6 +312,8 @@ server cluster TimeFormatLocalization = 44 {
user. As such, Nodes that visually or audibly convey measurable values to the user need a
mechanism by which they can be configured to use a user’s preferred unit. */
server cluster UnitLocalization = 45 {
revision 1;

enum TempUnitEnum : enum8 {
kFahrenheit = 0;
kCelsius = 1;
Expand All @@ -321,6 +335,8 @@ server cluster UnitLocalization = 45 {

/** This cluster is used to manage global aspects of the Commissioning flow. */
server cluster GeneralCommissioning = 48 {
revision 1; // NOTE: Default/not specifically set

enum CommissioningErrorEnum : enum8 {
kOK = 0;
kValueOutsideRange = 1;
Expand Down Expand Up @@ -385,6 +401,8 @@ server cluster GeneralCommissioning = 48 {

/** Functionality to configure, enable, disable network credentials and access on a Matter device. */
server cluster NetworkCommissioning = 49 {
revision 1; // NOTE: Default/not specifically set

enum NetworkCommissioningStatusEnum : enum8 {
kSuccess = 0;
kOutOfRange = 1;
Expand Down Expand Up @@ -542,6 +560,8 @@ server cluster NetworkCommissioning = 49 {

/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
server cluster GeneralDiagnostics = 51 {
revision 1; // NOTE: Default/not specifically set

enum BootReasonEnum : enum8 {
kUnspecified = 0;
kPowerOnReboot = 1;
Expand Down Expand Up @@ -653,6 +673,8 @@ server cluster GeneralDiagnostics = 51 {

/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
server cluster WiFiNetworkDiagnostics = 54 {
revision 1; // NOTE: Default/not specifically set

enum AssociationFailureCauseEnum : enum8 {
kUnknown = 0;
kAssociationFailed = 1;
Expand Down Expand Up @@ -727,6 +749,8 @@ server cluster WiFiNetworkDiagnostics = 54 {

/** Commands to trigger a Node to allow a new Administrator to commission it. */
server cluster AdministratorCommissioning = 60 {
revision 1; // NOTE: Default/not specifically set

enum CommissioningWindowStatusEnum : enum8 {
kWindowNotOpen = 0;
kEnhancedWindowOpen = 1;
Expand Down Expand Up @@ -772,6 +796,8 @@ server cluster AdministratorCommissioning = 60 {

/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */
server cluster OperationalCredentials = 62 {
revision 1; // NOTE: Default/not specifically set

enum CertificateChainTypeEnum : enum8 {
kDACCertificate = 1;
kPAICertificate = 2;
Expand Down Expand Up @@ -888,6 +914,8 @@ server cluster OperationalCredentials = 62 {

/** The Group Key Management Cluster is the mechanism by which group keys are managed. */
server cluster GroupKeyManagement = 63 {
revision 1; // NOTE: Default/not specifically set

enum GroupKeySecurityPolicyEnum : enum8 {
kTrustFirst = 0;
kCacheAndSync = 1;
Expand Down Expand Up @@ -960,6 +988,8 @@ server cluster GroupKeyManagement = 63 {

/** Attributes and commands for selecting a mode from a list of supported options. */
provisional server cluster MicrowaveOvenMode = 94 {
revision 1;

enum ModeTag : enum16 {
kNormal = 16384;
kDefrost = 16385;
Expand Down Expand Up @@ -992,6 +1022,8 @@ provisional server cluster MicrowaveOvenMode = 94 {

/** Attributes and commands for configuring the microwave oven control, and reporting cooking stats. */
provisional server cluster MicrowaveOvenControl = 95 {
revision 1; // NOTE: Default/not specifically set

readonly attribute elapsed_s cookTime = 1;
readonly attribute int8u powerSetting = 2;
readonly attribute int8u minPower = 3;
Expand Down Expand Up @@ -1020,6 +1052,8 @@ provisional server cluster MicrowaveOvenControl = 95 {

/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */
server cluster OperationalState = 96 {
revision 1; // NOTE: Default/not specifically set

enum ErrorStateEnum : enum8 {
kNoError = 0;
kUnableToStartOrResume = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ void ExampleMicrowaveOvenControlDelegate::SetMicrowaveOvenControlSetCookingParam
std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)> aCallback)
{
mHandleSetCookingParametersCallback =
std::make_unique<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>(aCallback);
Platform::MakeUnique<std::function<Protocols::InteractionModel::Status(uint8_t, uint32_t, uint8_t)>>(aCallback);
}

void ExampleMicrowaveOvenControlDelegate::SetMicrowaveOvenControlAddMoreTimeCallback(
std::function<Protocols::InteractionModel::Status(uint32_t)> aCallback)
{
mHandleAddMoreTimeCallback = std::make_unique<std::function<Protocols::InteractionModel::Status(uint32_t)>>(aCallback);
mHandleAddMoreTimeCallback = Platform::MakeUnique<std::function<Protocols::InteractionModel::Status(uint32_t)>>(aCallback);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,30 @@ CHIP_ERROR OperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, Ge
void OperationalStateDelegate::SetOpStatePauseCallback(
std::function<void(Clusters::OperationalState::GenericOperationalError & err)> aCallback)
{
mPauseCallback = std::make_unique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
mPauseCallback = Platform::MakeUnique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
}

void OperationalStateDelegate::SetOpStateResumeCallback(
std::function<void(Clusters::OperationalState::GenericOperationalError & err)> aCallback)
{
mResumeCallback = std::make_unique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
mResumeCallback = Platform::MakeUnique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
}

void OperationalStateDelegate::SetOpStateStartCallback(
std::function<void(Clusters::OperationalState::GenericOperationalError & err)> aCallback)
{
mStartCallback = std::make_unique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
mStartCallback = Platform::MakeUnique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
}

void OperationalStateDelegate::SetOpStateStopCallback(
std::function<void(Clusters::OperationalState::GenericOperationalError & err)> aCallback)
{
mStopCallback = std::make_unique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
mStopCallback = Platform::MakeUnique<std::function<void(Clusters::OperationalState::GenericOperationalError & err)>>(aCallback);
}

void OperationalStateDelegate::SetOpStateGetCountdownTimeCallback(std::function<app::DataModel::Nullable<uint32_t>(void)> aCallback)
{
mGetCountdownTimeCallback = std::make_unique<std::function<app::DataModel::Nullable<uint32_t>(void)>>(aCallback);
mGetCountdownTimeCallback = Platform::MakeUnique<std::function<app::DataModel::Nullable<uint32_t>(void)>>(aCallback);
}

app::DataModel::Nullable<uint32_t> OperationalStateDelegate::OperationalStateDelegate::GetCountdownTime()
Expand Down

0 comments on commit 4bb3cac

Please sign in to comment.