@@ -52,8 +52,8 @@ Delegate * gsDelegate = nullptr;
52
52
CHIP_ERROR EnergyPrefAttrAccess::Read (const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
53
53
{
54
54
VerifyOrDie (aPath.mClusterId == EnergyPreference::Id);
55
- EndpointId endpoint = aPath.mEndpointId ;
56
- uint32_t ourFeatureMap = 0 ;
55
+ EndpointId endpoint = aPath.mEndpointId ;
56
+ uint32_t ourFeatureMap = 0 ;
57
57
const bool featureMapIsGood = FeatureMap::Get (aPath.mEndpointId , &ourFeatureMap) == Status::Success;
58
58
const bool balanceSupported = featureMapIsGood && ((ourFeatureMap & to_underlying (Feature::kEnergyBalance )) != 0 );
59
59
const bool lowPowerSupported = featureMapIsGood && ((ourFeatureMap & to_underlying (Feature::kLowPowerModeSensitivity )) != 0 );
@@ -71,12 +71,13 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
71
71
return aEncoder.EncodeList ([endpoint](const auto & encoder) -> CHIP_ERROR {
72
72
chip::Percent step;
73
73
char buffer[64 ];
74
- chip::Optional<chip::MutableCharSpan> label{chip::MutableCharSpan (buffer)};
74
+ chip::Optional<chip::MutableCharSpan> label{ chip::MutableCharSpan (buffer) };
75
75
size_t index = 0 ;
76
76
CHIP_ERROR err = CHIP_NO_ERROR;
77
77
while ((err = gsDelegate->GetEnergyBalanceAtIndex (endpoint, index , step, label)) == CHIP_NO_ERROR)
78
78
{
79
- BalanceStruct::Type balance = { step, label.HasValue () ? Optional<CharSpan>(label.Value ()) : Optional<CharSpan>() };
79
+ BalanceStruct::Type balance = { step,
80
+ label.HasValue () ? Optional<CharSpan>(label.Value ()) : Optional<CharSpan>() };
80
81
ReturnErrorOnFailure (encoder.Encode (balance));
81
82
index ++;
82
83
}
@@ -124,12 +125,13 @@ CHIP_ERROR EnergyPrefAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
124
125
return aEncoder.EncodeList ([endpoint](const auto & encoder) -> CHIP_ERROR {
125
126
chip::Percent step;
126
127
char buffer[64 ];
127
- chip::Optional<chip::MutableCharSpan> label{chip::MutableCharSpan (buffer)};
128
+ chip::Optional<chip::MutableCharSpan> label{ chip::MutableCharSpan (buffer) };
128
129
size_t index = 0 ;
129
130
CHIP_ERROR err = CHIP_NO_ERROR;
130
131
while ((err = gsDelegate->GetLowPowerModeSensitivityAtIndex (endpoint, index , step, label)) == CHIP_NO_ERROR)
131
132
{
132
- BalanceStruct::Type balance = { step, label.HasValue () ? Optional<CharSpan>(label.Value ()) : Optional<CharSpan>() };
133
+ BalanceStruct::Type balance = { step,
134
+ label.HasValue () ? Optional<CharSpan>(label.Value ()) : Optional<CharSpan>() };
133
135
ReturnErrorOnFailure (encoder.Encode (balance));
134
136
index ++;
135
137
}
0 commit comments