Skip to content

Commit 9c2a8cc

Browse files
restyled-commitsdrempelg
authored andcommitted
Restyled by clang-format
1 parent da27500 commit 9c2a8cc

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

src/app/clusters/energy-preference-server/energy-preference-server.cpp

+11-12
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include <app-common/zap-generated/callback.h>
2424
#include <app-common/zap-generated/cluster-objects.h>
2525
#include <app-common/zap-generated/ids/Attributes.h>
26-
#include <app/ConcreteAttributePath.h>
2726
#include <app/AttributeAccessInterface.h> // added in case we ever don't need app/util/attribute-storage.h at some point.
27+
#include <app/ConcreteAttributePath.h>
2828
#include <lib/core/CHIPEncoding.h>
2929

3030
using namespace chip;
@@ -54,8 +54,8 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
5454
VerifyOrDie(aPath.mClusterId == EnergyPreference::Id);
5555
EndpointId endpoint = aPath.mEndpointId;
5656
uint32_t ourFeatureMap;
57-
const bool featureMapIsGood = FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS;
58-
const bool balanceSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kEnergyBalance)) != 0);
57+
const bool featureMapIsGood = FeatureMap::Get(aPath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS;
58+
const bool balanceSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kEnergyBalance)) != 0);
5959
const bool lowPowerSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kLowPowerModeSensitivity)) != 0);
6060

6161
switch (aPath.mAttributeId)
@@ -144,8 +144,7 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
144144

145145
} // anonymous namespace
146146

147-
namespace chip::app::Clusters::EnergyPreference
148-
{
147+
namespace chip::app::Clusters::EnergyPreference {
149148

150149
void SetDelegate(Delegate * aDelegate)
151150
{
@@ -157,17 +156,17 @@ Delegate * GetDelegate()
157156
return gsDelegate;
158157
}
159158

160-
} // Set matter energy preferences delegate
159+
} // namespace chip::app::Clusters::EnergyPreference
161160

162-
Status
163-
MatterEnergyPreferenceClusterServerPreAttributeChangedCallback(const ConcreteAttributePath & attributePath,
164-
EmberAfAttributeType attributeType, uint16_t size, uint8_t * value)
161+
Status MatterEnergyPreferenceClusterServerPreAttributeChangedCallback(const ConcreteAttributePath & attributePath,
162+
EmberAfAttributeType attributeType, uint16_t size,
163+
uint8_t * value)
165164
{
166-
EndpointId endpoint = attributePath.mEndpointId;
165+
EndpointId endpoint = attributePath.mEndpointId;
167166
Delegate * delegate = GetDelegate();
168167
uint32_t ourFeatureMap;
169-
const bool featureMapIsGood = FeatureMap::Get(attributePath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS;
170-
const bool balanceSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kEnergyBalance)) != 0);
168+
const bool featureMapIsGood = FeatureMap::Get(attributePath.mEndpointId, &ourFeatureMap) == EMBER_ZCL_STATUS_SUCCESS;
169+
const bool balanceSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kEnergyBalance)) != 0);
171170
const bool lowPowerSupported = featureMapIsGood && ((ourFeatureMap & to_underlying(Feature::kLowPowerModeSensitivity)) != 0);
172171

173172
if (delegate == nullptr)

src/app/clusters/energy-preference-server/energy-preference-server.h

+8-10
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
#include <app/util/basic-types.h>
2525
#include <lib/core/CHIPError.h>
2626

27-
namespace chip::app::Clusters::EnergyPreference
28-
{
27+
namespace chip::app::Clusters::EnergyPreference {
2928

3029
struct Delegate
3130
{
32-
//Note: This delegate does not handle the "Current Active" indexes attributes storage.
33-
//eg: Current Energy Balance and Current Low Power Mode Sensitivity. These can be handled using
34-
//ember built in storage, or via the external callbacks as desired by the implementer.
31+
// Note: This delegate does not handle the "Current Active" indexes attributes storage.
32+
// eg: Current Energy Balance and Current Low Power Mode Sensitivity. These can be handled using
33+
// ember built in storage, or via the external callbacks as desired by the implementer.
3534

3635
virtual ~Delegate() {}
3736

@@ -42,8 +41,9 @@ struct Delegate
4241
* @param aOutBalance The BalanceStruct to copy the data into.
4342
* @return CHIP_ERROR_NOT_FOUND if the index is out of range.
4443
*/
45-
virtual CHIP_ERROR GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex,
46-
chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::Type & aOutBalance) = 0;
44+
virtual CHIP_ERROR
45+
GetEnergyBalanceAtIndex(chip::EndpointId aEndpoint, size_t aIndex,
46+
chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::Type & aOutBalance) = 0;
4747

4848
/**
4949
* Get an Energy Priority.
@@ -55,7 +55,6 @@ struct Delegate
5555
virtual CHIP_ERROR GetEnergyPriorityAtIndex(chip::EndpointId aEndpoint, size_t aIndex,
5656
chip::app::Clusters::EnergyPreference::EnergyPriorityEnum & aOutPriority) = 0;
5757

58-
5958
/**
6059
* Get a Power Sensitity Balance Struct.
6160
* @param aEndpoint The endpoint to query.
@@ -67,7 +66,6 @@ struct Delegate
6766
GetLowPowerModeSensitivityAtIndex(chip::EndpointId aEndpoint, size_t aIndex,
6867
chip::app::Clusters::EnergyPreference::Structs::BalanceStruct::Type & aOutBalance) = 0;
6968

70-
7169
/**
7270
* Get the number of energy balances this endpoint has.
7371
* @param aEndpoint The endpoint to query.
@@ -80,7 +78,7 @@ struct Delegate
8078
* @param aEndpoint The endpoint to query.
8179
* @return the number of balance structs in the list.
8280
*/
83-
virtual size_t GetNumLowPowerModeSensitivities(chip::EndpointId aEndpoint) = 0;
81+
virtual size_t GetNumLowPowerModeSensitivities(chip::EndpointId aEndpoint) = 0;
8482
};
8583

8684
void SetDelegate(Delegate * aDelegate);

0 commit comments

Comments
 (0)