Skip to content

Commit f8f8409

Browse files
committedOct 31, 2024
Updated All-cluster app
1 parent bcc7109 commit f8f8409

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed
 

‎examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <app-common/zap-generated/cluster-objects.h>
2020
#include <app-common/zap-generated/ids/Attributes.h>
2121
#include <app-common/zap-generated/ids/Clusters.h>
22-
#include <app/AttributeAccessInterface.h>
2322
#include <app/AttributeAccessInterfaceRegistry.h>
2423
#include <app/clusters/fan-control-server/fan-control-server.h>
2524
#include <app/util/attribute-storage.h>
@@ -34,13 +33,11 @@ using namespace chip::app::Clusters::FanControl::Attributes;
3433
using Protocols::InteractionModel::Status;
3534

3635
namespace {
37-
class FanControlManager : public AttributeAccessInterface, public Delegate
36+
class FanControlManager : public FanControlAttributeAccessInterface, public Delegate
3837
{
3938
public:
4039
// Register for the FanControl cluster on all endpoints.
41-
FanControlManager(EndpointId aEndpointId) :
42-
AttributeAccessInterface(Optional<EndpointId>(aEndpointId), FanControl::Id), Delegate(aEndpointId)
43-
{}
40+
FanControlManager(EndpointId aEndpointId) : FanControlAttributeAccessInterface(aEndpointId), Delegate(aEndpointId) {}
4441

4542
CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override;
4643
Status HandleStep(StepDirectionEnum aDirection, bool aWrap, bool aLowestOff) override;

‎src/app/clusters/fan-control-server/fan-control-server.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ static_assert(kFanControlDelegateTableSize <= kEmberInvalidEndpointIndex, "FanCo
5151

5252
Delegate * gDelegateTable[kFanControlDelegateTableSize] = { nullptr };
5353

54-
FanControlAttributeAccessInterface gFanControlAttributeAccess;
55-
5654
} // anonymous namespace
5755

5856
namespace chip {
@@ -522,8 +520,3 @@ bool emberAfFanControlClusterStepCallback(app::CommandHandler * commandObj, cons
522520
commandObj->AddStatus(commandPath, status);
523521
return true;
524522
}
525-
526-
void MatterFanControlPluginServerInitCallback()
527-
{
528-
AttributeAccessInterfaceRegistry::Instance().Register(&gFanControlAttributeAccess);
529-
}

‎src/app/clusters/fan-control-server/fan-control-server.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#pragma once
1919

2020
#include "fan-control-delegate.h"
21-
#include <app-common/zap-generated/cluster-objects.h>
2221
#include <app/AttributeAccessInterface.h>
22+
#include <app-common/zap-generated/cluster-objects.h>
2323
#include <app/util/af-types.h>
2424

2525
namespace chip {
@@ -30,7 +30,7 @@ namespace FanControl {
3030
class FanControlAttributeAccessInterface : public AttributeAccessInterface
3131
{
3232
public:
33-
FanControlAttributeAccessInterface() : AttributeAccessInterface(Optional<EndpointId>(), Id) {}
33+
FanControlAttributeAccessInterface(EndpointId aEndpoint) : AttributeAccessInterface(Optional<EndpointId>(aEndpoint), Id) {}
3434

3535
CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override;
3636
CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override { return CHIP_NO_ERROR; }

‎src/app/util/util.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ void MatterProxyConfigurationPluginServerInitCallback() {}
110110
void MatterActivatedCarbonFilterMonitoringPluginServerInitCallback() {}
111111
void MatterHepaFilterMonitoringPluginServerInitCallback() {}
112112
void MatterAirQualityPluginServerInitCallback() {}
113+
void MatterFanControlPluginServerInitCallback() {}
113114
void MatterCarbonMonoxideConcentrationMeasurementPluginServerInitCallback() {}
114115
void MatterCarbonDioxideConcentrationMeasurementPluginServerInitCallback() {}
115116
void MatterFormaldehydeConcentrationMeasurementPluginServerInitCallback() {}

0 commit comments

Comments
 (0)