Skip to content

Commit

Permalink
Added initial implementation of PCC server cluster (#17097)
Browse files Browse the repository at this point in the history
* * Added initial implementation of PCC server cluster. Mirroring the attributes as a start.

* Restyled by clang-format

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
tlykkeberg-grundfos and restyled-commits authored Apr 11, 2022
1 parent a19cb2f commit 60f338d
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

#include <app/util/af.h>

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-event.h>
#include <app/util/attribute-storage.h>

using namespace chip;
using namespace chip::app::Clusters::PumpConfigurationAndControl::Attributes;

void emberAfPumpConfigurationAndControlClusterServerInitCallback(EndpointId endpoint)
{
Expand All @@ -33,7 +36,24 @@ void MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback(cons
{
emberAfDebugPrintln("PCC Server Cluster Attribute changed [EP:%d, ID:0x%x]", attributePath.mEndpointId,
(unsigned int) attributePath.mAttributeId);
// TODO

switch (attributePath.mAttributeId)
{
case ControlMode::Id: {
uint8_t value;
ControlMode::Get(attributePath.mEndpointId, &value);
EffectiveControlMode::Set(attributePath.mEndpointId, value);
}
break;
case OperationMode::Id: {
uint8_t value;
OperationMode::Get(attributePath.mEndpointId, &value);
EffectiveOperationMode::Set(attributePath.mEndpointId, value);
}
break;
default:
emberAfDebugPrintln("PCC Server: unhandled attribute ID");
}
}

void MatterPumpConfigurationAndControlPluginServerInitCallback() {}

0 comments on commit 60f338d

Please sign in to comment.