Skip to content

Commit b663c8e

Browse files
Fix build cpp errors
1 parent f79c1e1 commit b663c8e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

examples/energy-management-app/energy-management-common/include/MeterIdentificationDelegate.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class MeterIdentificationDelegate : public MeterIdentification::Delegate
4646
CHIP_ERROR SetMeterType(DataModel::Nullable<MeterTypeEnum>);
4747
CHIP_ERROR SetUtilityName(CharSpan & value);
4848
CHIP_ERROR SetPointOfDelivery(CharSpan & value);
49-
CHIP_ERROR GetPowerThreshold(DataModel::Nullable<uint64_t>);
50-
CHIP_ERROR GetPowerThresholdSource(DataModel::Nullable<PowerThresholdSourceEnum>);
49+
CHIP_ERROR SetPowerThreshold(DataModel::Nullable<uint64_t>);
50+
CHIP_ERROR SetPowerThresholdSource(DataModel::Nullable<PowerThresholdSourceEnum>);
5151

5252
private:
5353
// Attribute storage

examples/energy-management-app/energy-management-common/src/MeterIdentificationDelegate.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ using namespace chip::app::DataModel;
2727
using namespace chip::app::Clusters;
2828
using namespace chip::app::Clusters::MeterIdentification;
2929
using namespace chip::app::Clusters::MeterIdentification::Attributes;
30-
using namespace chip::app::Clusters::MeterIdentification::Structs;
3130

3231
using chip::app::Clusters::MeterIdentification::MeterTypeEnum;
3332
using chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum;
@@ -63,7 +62,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetCustomerName(CharSpan & newValue)
6362
CharSpan oldValue = mCustomerName;
6463

6564
mCustomerName = newValue;
66-
if (oldValue != newValue)
65+
if (!oldValue.data_equal(newValue))
6766
{
6867
// We won't log raw values since these could change frequently
6968
MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, CustomerName::Id);
@@ -77,7 +76,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetUtilityName(CharSpan & newValue)
7776
CharSpan oldValue = mUtilityName;
7877

7978
mUtilityName = newValue;
80-
if (oldValue != newValue)
79+
if (!oldValue.data_equal(newValue))
8180
{
8281
// We won't log raw values since these could change frequently
8382
MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, UtilityName::Id);
@@ -91,7 +90,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetPointOfDelivery(CharSpan & newValue)
9190
CharSpan oldValue = mPointOfDelivery;
9291

9392
mPointOfDelivery = newValue;
94-
if (oldValue != newValue)
93+
if (!oldValue.data_equal(newValue))
9594
{
9695
// We won't log raw values since these could change frequently
9796
MatterReportingAttributeChangeCallback(mEndpointId, MeterIdentification::Id, PointOfDelivery::Id);

src/app/clusters/meter-identification-server/meter-identification-server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct Delegate
5050
virtual DataModel::Nullable<uint64_t> GetPowerThreshold() = 0;
5151
virtual DataModel::Nullable<PowerThresholdSourceEnum> GetPowerThresholdSource() = 0;
5252

53-
virtual CHIP_ERROR SetCustomerName(char * value) = 0;
53+
virtual CHIP_ERROR SetCustomerName(CharSpan & value) = 0;
5454

5555
protected:
5656
EndpointId mEndpointId = 0;

0 commit comments

Comments
 (0)