Skip to content

Commit 6729164

Browse files
restyled-commitsMichail-Antropov
authored andcommitted
Restyled by clang-format
Fix XML errors
1 parent abbe8ab commit 6729164

File tree

7 files changed

+70
-36
lines changed

7 files changed

+70
-36
lines changed

data_model/clusters/MeterIdentification.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Davis, CA 95616, USA
5757
5858
:xrefstyle: short
5959
-->
60-
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="types types.xsd cluster cluster.xsd" id="0x0B01" name="Meter Identification" revision="1">
60+
<cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="types types.xsd cluster cluster.xsd" id="0x0B01" name="Meter Identification Cluster" revision="1">
6161
<revisionHistory>
6262
<revision revision="1" summary="Initial version"/>
6363
</revisionHistory>

examples/all-clusters-app/all-clusters-common/src/meter-identification-stub.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ void emberAfMeterIdentificationClusterInitCallback(chip::EndpointId endpointId)
3434
gMIDelegate = std::make_unique<MeterIdentificationDelegate>();
3535
if (gMIDelegate)
3636
{
37-
gMIInstance = std::make_unique<MeterIdentificationInstance>(
38-
endpointId, *gMIDelegate,
39-
BitMask<Feature, uint32_t>(Feature::kPowerThreshold));
37+
gMIInstance = std::make_unique<MeterIdentificationInstance>(endpointId, *gMIDelegate,
38+
BitMask<Feature, uint32_t>(Feature::kPowerThreshold));
4039

4140
gMIInstance->Init();
4241
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class MeterIdentificationDelegate : public MeterIdentification::Delegate
4040
DataModel::Nullable<uint64_t> GetPowerThreshold() override { return mPowerThreshold; };
4141
DataModel::Nullable<PowerThresholdSourceEnum> GetPowerThresholdSource() override { return mPowerThresholdSource; };
4242

43-
CHIP_ERROR SetCustomerName(CharSpan &value) override;
43+
CHIP_ERROR SetCustomerName(CharSpan & value) override;
4444

4545
// Internal Application API to set attribute values
4646
CHIP_ERROR SetMeterType(DataModel::Nullable<MeterTypeEnum>);
47-
CHIP_ERROR SetUtilityName(CharSpan &value);
48-
CHIP_ERROR SetPointOfDelivery(CharSpan &value);
47+
CHIP_ERROR SetUtilityName(CharSpan & value);
48+
CHIP_ERROR SetPointOfDelivery(CharSpan & value);
4949
CHIP_ERROR GetPowerThreshold(DataModel::Nullable<uint64_t>);
5050
CHIP_ERROR GetPowerThresholdSource(DataModel::Nullable<PowerThresholdSourceEnum>);
5151

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ using namespace chip::app::Clusters::MeterIdentification::Structs;
3232
using chip::app::Clusters::MeterIdentification::MeterTypeEnum;
3333
using chip::app::Clusters::MeterIdentification::PowerThresholdSourceEnum;
3434

35-
3635
CHIP_ERROR MeterIdentificationInstance::Init()
3736
{
3837
return Instance::Init();
@@ -59,7 +58,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetMeterType(DataModel::Nullable<MeterTy
5958
return CHIP_NO_ERROR;
6059
}
6160

62-
CHIP_ERROR MeterIdentificationDelegate::SetCustomerName(CharSpan &newValue)
61+
CHIP_ERROR MeterIdentificationDelegate::SetCustomerName(CharSpan & newValue)
6362
{
6463
CharSpan oldValue = mCustomerName;
6564

@@ -73,7 +72,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetCustomerName(CharSpan &newValue)
7372
return CHIP_NO_ERROR;
7473
}
7574

76-
CHIP_ERROR MeterIdentificationDelegate::SetUtilityName(CharSpan &newValue)
75+
CHIP_ERROR MeterIdentificationDelegate::SetUtilityName(CharSpan & newValue)
7776
{
7877
CharSpan oldValue = mUtilityName;
7978

@@ -87,7 +86,7 @@ CHIP_ERROR MeterIdentificationDelegate::SetUtilityName(CharSpan &newValue)
8786
return CHIP_NO_ERROR;
8887
}
8988

90-
CHIP_ERROR MeterIdentificationDelegate::SetPointOfDelivery(CharSpan &newValue)
89+
CHIP_ERROR MeterIdentificationDelegate::SetPointOfDelivery(CharSpan & newValue)
9190
{
9291
CharSpan oldValue = mPointOfDelivery;
9392

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <app-common/zap-generated/cluster-enums.h>
2525
#include <app-common/zap-generated/cluster-objects.h>
26+
#include <app/AttributeAccessInterface.h>
2627
#include <app/util/basic-types.h>
2728
#include <lib/core/CHIPError.h>
2829

@@ -42,14 +43,14 @@ struct Delegate
4243

4344
void SetEndpointId(EndpointId aEndpoint) { mEndpointId = aEndpoint; }
4445

45-
virtual DataModel::Nullable<MeterTypeEnum> GetMeterType() = 0;
46-
virtual CharSpan GetCustomerName() = 0;
47-
virtual CharSpan GetUtilityName() = 0;
48-
virtual CharSpan GetPointOfDelivery() = 0;
49-
virtual DataModel::Nullable<uint64_t> GetPowerThreshold() = 0;
46+
virtual DataModel::Nullable<MeterTypeEnum> GetMeterType() = 0;
47+
virtual CharSpan GetCustomerName() = 0;
48+
virtual CharSpan GetUtilityName() = 0;
49+
virtual CharSpan GetPointOfDelivery() = 0;
50+
virtual DataModel::Nullable<uint64_t> GetPowerThreshold() = 0;
5051
virtual DataModel::Nullable<PowerThresholdSourceEnum> GetPowerThresholdSource() = 0;
5152

52-
virtual CHIP_ERROR SetCustomerName(char *value) = 0;
53+
virtual CHIP_ERROR SetCustomerName(char * value) = 0;
5354

5455
protected:
5556
EndpointId mEndpointId = 0;
@@ -59,8 +60,7 @@ class Instance : public AttributeAccessInterface
5960
{
6061
public:
6162
Instance(EndpointId aEndpointId, Delegate & aDelegate, BitMask<Feature> aFeature) :
62-
AttributeAccessInterface(MakeOptional(aEndpointId), Id),
63-
mDelegate(aDelegate), mFeature(aFeature)
63+
AttributeAccessInterface(MakeOptional(aEndpointId), Id), mDelegate(aDelegate), mFeature(aFeature)
6464
{
6565
/* set the base class delegates endpointId */
6666
mDelegate.SetEndpointId(aEndpointId);

src/app/zap-templates/zcl/data-model/chip/meter-identification-cluster.xml

+19-17
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
See the License for the specific language governing permissions and
1212
limitations under the License.
1313
-->
14+
1415
<configurator>
1516
<domain name="Energy Management"/>
16-
<cluster apiMaturity="provisional">
17+
18+
<enum name="MeterTypeEnum" type="enum8">
19+
<cluster code="0x0B01"/>
20+
<item name="Utility" value="0x00"/>
21+
<item name="Private" value="0x01"/>
22+
<item name="Generic" value="0x02"/>
23+
</enum>
24+
25+
<enum name="PowerThresholdSourceEnum" type="enum8">
26+
<cluster code="0x0B01"/>
27+
<item name="Contract" value="0x00"/>
28+
<item name="Regulator" value="0x01"/>
29+
<item name="Equipment" value="0x02"/>
30+
</enum>
31+
32+
<cluster>
1733
<name>Meter Identification</name>
1834
<domain>Energy Management</domain>
1935
<code>0x0B01</code>
@@ -24,7 +40,7 @@ limitations under the License.
2440

2541
<features>
2642
<feature bit="0" code="PWRTHLD" name="PowerThreshold" summary="Supports information about power threshold">
27-
<optionalConform/>
43+
<provisionalConform/>
2844
</feature>
2945
</features>
3046

@@ -36,22 +52,8 @@ limitations under the License.
3652
</attribute>
3753
<attribute code="0x0002" side="server" define="UTILITY_NAME" type="char_string" length="16" isNullable="true">UtilityName</attribute>
3854
<attribute code="0x0003" side="server" define="POINT_OF_DELIVERY" type="char_string" length="16" isNullable="true">PointOfDelivery</attribute>
39-
<attribute code="0x0004" side="server" define="POWER_THRESHOLD" type="power-mW" isNullable="true">PowerThreshold</attribute>
55+
<attribute code="0x0004" side="server" define="POWER_THRESHOLD" type="power_mw" isNullable="true">PowerThreshold</attribute>
4056
<attribute code="0x0005" side="server" define="POWER_THRESHOLD_SOURCE" type="PowerThresholdSourceEnum" isNullable="true">PowerThresholdSource</attribute>
4157
</cluster>
4258

43-
<enum name="MeterTypeEnum" type="enum8">
44-
<cluster code="0x0B01"/>
45-
<item name="Utility" value="0x00"/>
46-
<item name="Private" value="0x01"/>
47-
<item name="Generic" value="0x02"/>
48-
</enum>
49-
50-
<enum name="PowerThresholdSourceEnum" type="enum8">
51-
<cluster code="0x0B01"/>
52-
<item name="Contract" value="0x00"/>
53-
<item name="Regulator" value="0x01"/>
54-
<item name="Equipment" value="0x02"/>
55-
</enum>
56-
5759
</configurator>

src/controller/data_model/controller-clusters.matter

+34
Original file line numberDiff line numberDiff line change
@@ -8810,6 +8810,40 @@ provisional cluster ContentAppObserver = 1296 {
88108810
command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0;
88118811
}
88128812

8813+
/** This cluster provides attributes for determining advanced information about utility metering device. */
8814+
cluster MeterIdentification = 2817 {
8815+
revision 1; // NOTE: Default/not specifically set
8816+
8817+
enum MeterTypeEnum : enum8 {
8818+
kUtility = 0;
8819+
kPrivate = 1;
8820+
kGeneric = 2;
8821+
}
8822+
8823+
enum PowerThresholdSourceEnum : enum8 {
8824+
kContract = 0;
8825+
kRegulator = 1;
8826+
kEquipment = 2;
8827+
}
8828+
8829+
bitmap Feature : bitmap32 {
8830+
kPowerThreshold = 0x1;
8831+
}
8832+
8833+
readonly attribute nullable MeterTypeEnum meterType = 0;
8834+
attribute nullable char_string<64> customerName = 1;
8835+
readonly attribute nullable char_string<16> utilityName = 2;
8836+
readonly attribute nullable char_string<16> pointOfDelivery = 3;
8837+
readonly attribute nullable power_mw powerThreshold = 4;
8838+
readonly attribute nullable PowerThresholdSourceEnum powerThresholdSource = 5;
8839+
readonly attribute command_id generatedCommandList[] = 65528;
8840+
readonly attribute command_id acceptedCommandList[] = 65529;
8841+
readonly attribute event_id eventList[] = 65530;
8842+
readonly attribute attrib_id attributeList[] = 65531;
8843+
readonly attribute bitmap32 featureMap = 65532;
8844+
readonly attribute int16u clusterRevision = 65533;
8845+
}
8846+
88138847
/** Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. */
88148848
deprecated cluster ElectricalMeasurement = 2820 {
88158849
revision 3;

0 commit comments

Comments
 (0)