diff --git a/examples/chef/common/chef-rvc-mode-delegate.cpp b/examples/chef/common/chef-rvc-mode-delegate.cpp index 11e02b24de34a1..d5a85a68682456 100644 --- a/examples/chef/common/chef-rvc-mode-delegate.cpp +++ b/examples/chef/common/chef-rvc-mode-delegate.cpp @@ -109,7 +109,8 @@ void RvcRunMode::Shutdown() } chip::Protocols::InteractionModel::Status chefRvcRunModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) { chip::Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success; @@ -117,12 +118,12 @@ chip::Protocols::InteractionModel::Status chefRvcRunModeWriteCallback(chip::Endp VerifyOrDie(gRvcRunModeInstance != nullptr); ModeBase::Instance * clusterInstance = gRvcRunModeInstance; - chip::AttributeId attributeId = attributeMetadata->attributeId; + chip::AttributeId attributeId = attributeMetadata->attributeId; switch (attributeId) { case chip::app::Clusters::RvcRunMode::Attributes::CurrentMode::Id: { - uint8_t m = static_cast(buffer[0]); + uint8_t m = static_cast(buffer[0]); chip::Protocols::InteractionModel::Status status = clusterInstance->UpdateCurrentMode(m); if (chip::Protocols::InteractionModel::Status::Success == status) { @@ -142,8 +143,8 @@ chip::Protocols::InteractionModel::Status chefRvcRunModeWriteCallback(chip::Endp } chip::Protocols::InteractionModel::Status chefRvcRunModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) { return chip::Protocols::InteractionModel::Status::Success; @@ -243,7 +244,8 @@ void RvcCleanMode::Shutdown() } chip::Protocols::InteractionModel::Status chefRvcCleanModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) { chip::Protocols::InteractionModel::Status ret = Protocols::InteractionModel::Status::Success; @@ -251,12 +253,12 @@ chip::Protocols::InteractionModel::Status chefRvcCleanModeWriteCallback(chip::En VerifyOrDie(gRvcCleanModeInstance != nullptr); ModeBase::Instance * clusterInstance = gRvcCleanModeInstance; - chip::AttributeId attributeId = attributeMetadata->attributeId; + chip::AttributeId attributeId = attributeMetadata->attributeId; switch (attributeId) { case chip::app::Clusters::RvcCleanMode::Attributes::CurrentMode::Id: { - uint8_t m = static_cast(buffer[0]); + uint8_t m = static_cast(buffer[0]); Protocols::InteractionModel::Status status = clusterInstance->UpdateCurrentMode(m); if (Protocols::InteractionModel::Status::Success == status) { @@ -276,8 +278,8 @@ chip::Protocols::InteractionModel::Status chefRvcCleanModeWriteCallback(chip::En } chip::Protocols::InteractionModel::Status chefRvcCleanModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength) + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) { return chip::Protocols::InteractionModel::Status::Success; } diff --git a/examples/chef/common/chef-rvc-mode-delegate.h b/examples/chef/common/chef-rvc-mode-delegate.h index ddd28c56577632..359c90c5a08162 100644 --- a/examples/chef/common/chef-rvc-mode-delegate.h +++ b/examples/chef/common/chef-rvc-mode-delegate.h @@ -123,16 +123,18 @@ void Shutdown(); #ifdef MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER chip::Protocols::InteractionModel::Status chefRvcRunModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); chip::Protocols::InteractionModel::Status chefRvcRunModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); #endif // MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER #ifdef MATTER_DM_PLUGIN_RVC_CLEAN_MODE_SERVER chip::Protocols::InteractionModel::Status chefRvcCleanModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); chip::Protocols::InteractionModel::Status chefRvcCleanModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength); + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); #endif // MATTER_DM_PLUGIN_RVC_CLEAN_MODE_SERVER diff --git a/examples/chef/common/chef-rvc-operational-state-delegate.cpp b/examples/chef/common/chef-rvc-operational-state-delegate.cpp index af6303753f0f16..6639e72b1fac01 100644 --- a/examples/chef/common/chef-rvc-operational-state-delegate.cpp +++ b/examples/chef/common/chef-rvc-operational-state-delegate.cpp @@ -31,7 +31,6 @@ using chip::Protocols::InteractionModel::Status; static RvcOperationalState::Instance * gRvcOperationalStateInstance = nullptr; static RvcOperationalStateDelegate * gRvcOperationalStateDelegate = nullptr; - static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data); DataModel::Nullable RvcOperationalStateDelegate::GetCountdownTime() @@ -184,19 +183,21 @@ void RvcOperationalState::Shutdown() } } -chip::Protocols::InteractionModel::Status chefRvcOperationalStateWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer) +chip::Protocols::InteractionModel::Status chefRvcOperationalStateWriteCallback(chip::EndpointId endpointId, + chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) { chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(gRvcOperationalStateInstance != nullptr); - chip::AttributeId attributeId = attributeMetadata->attributeId; + chip::AttributeId attributeId = attributeMetadata->attributeId; switch (attributeId) { case chip::app::Clusters::RvcOperationalState::Attributes::CurrentPhase::Id: { - uint8_t m = static_cast(buffer[0]); - DataModel::Nullable aPhase(m); + uint8_t m = static_cast(buffer[0]); + DataModel::Nullable aPhase(m); CHIP_ERROR err = gRvcOperationalStateInstance->SetCurrentPhase(aPhase); if (CHIP_NO_ERROR == err) { @@ -207,7 +208,7 @@ chip::Protocols::InteractionModel::Status chefRvcOperationalStateWriteCallback(c } break; case chip::app::Clusters::RvcOperationalState::Attributes::OperationalState::Id: { - uint8_t m = static_cast(buffer[0]); + uint8_t m = static_cast(buffer[0]); CHIP_ERROR err = gRvcOperationalStateInstance->SetOperationalState(m); if (CHIP_NO_ERROR == err) { @@ -226,10 +227,9 @@ chip::Protocols::InteractionModel::Status chefRvcOperationalStateWriteCallback(c return ret; } -chip::Protocols::InteractionModel::Status -chefRvcOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength) +chip::Protocols::InteractionModel::Status chefRvcOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) { return chip::Protocols::InteractionModel::Status::Success; } @@ -239,7 +239,7 @@ void emberAfRvcOperationalStateClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(gRvcOperationalStateInstance == nullptr && gRvcOperationalStateDelegate == nullptr); - gRvcOperationalStateDelegate = new chip::app::Clusters::RvcOperationalState::RvcOperationalStateDelegate(); + gRvcOperationalStateDelegate = new chip::app::Clusters::RvcOperationalState::RvcOperationalStateDelegate(); EndpointId operationalStateEndpoint = 0x01; gRvcOperationalStateInstance = new RvcOperationalState::Instance(gRvcOperationalStateDelegate, operationalStateEndpoint); diff --git a/examples/chef/common/chef-rvc-operational-state-delegate.h b/examples/chef/common/chef-rvc-operational-state-delegate.h index b956345f705294..75d719f47e0774 100644 --- a/examples/chef/common/chef-rvc-operational-state-delegate.h +++ b/examples/chef/common/chef-rvc-operational-state-delegate.h @@ -36,11 +36,7 @@ namespace RvcOperationalState { class RvcOperationalStateDelegate : public RvcOperationalState::Delegate { public: - - RvcOperationalStateDelegate() - { - mOperationalStateList = Span(rvcOpStateList); - } + RvcOperationalStateDelegate() { mOperationalStateList = Span(rvcOpStateList); } /** * Get the countdown time. This attribute is not used in this application. @@ -100,6 +96,7 @@ class RvcOperationalStateDelegate : public RvcOperationalState::Delegate uint32_t mRunningTime = 0; uint32_t mPausedTime = 0; app::DataModel::Nullable mCountDownTime; + private: Span mOperationalStateList; Span mOperationalPhaseList; @@ -123,11 +120,10 @@ void Shutdown(); } // namespace app } // namespace chip -chip::Protocols::InteractionModel::Status -chefRvcOperationalStateWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); -chip::Protocols::InteractionModel::Status -chefRvcOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, - const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer, - uint16_t maxReadLength); +chip::Protocols::InteractionModel::Status chefRvcOperationalStateWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefRvcOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); #endif // MATTER_DM_PLUGIN_RVC_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 4f63e68557cfa0..bbb6660c292a24 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -19,8 +19,7 @@ #include "chef-concentration-measurement.h" #endif -#if defined(MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER) || \ - defined(MATTER_DM_PLUGIN_RVC_CLEAN_MODE_SERVER) +#if defined(MATTER_DM_PLUGIN_RVC_RUN_MODE_SERVER) || defined(MATTER_DM_PLUGIN_RVC_CLEAN_MODE_SERVER) #include "chef-rvc-mode-delegate.h" #endif