Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 891cacb

Browse files
committedJul 9, 2024·
Address review comments
1 parent adcefe6 commit 891cacb

File tree

14 files changed

+115
-43
lines changed

14 files changed

+115
-43
lines changed
 

‎src/app/zap-templates/zcl/data-model/chip/commissioner-control-cluster.xml

+29-24
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ limitations under the License.
1616
-->
1717
<configurator>
1818
<domain name="CHIP"/>
19-
2019
<bitmap name="SupportedDeviceCategoryBitmap" type="bitmap32">
21-
<cluster code="0x0751"/>
22-
<field name="FabricSynchronization" mask="0x1"/>
20+
<cluster code="0x0751"/>
21+
<field name="FabricSynchronization" mask="0x1"/>
2322
</bitmap>
2423

25-
<cluster>
24+
<cluster apiMaturity="provisional">
2625
<domain>General</domain>
2726
<name>Commissioner Control</name>
2827
<code>0x0751</code>
@@ -31,41 +30,47 @@ limitations under the License.
3130
<server init="false" tick="false">true</server>
3231
<description>Supports the ability for clients to request the commissioning of themselves or other nodes onto a fabric which the cluster server can commission onto.</description>
3332

34-
<attribute side="server" code="0x0000" define="SUPPORTED_DEVICE_CATEGORIES" type="SupportedDeviceCategoryBitmap" default="0" writable="false" optional="false">SupportedDeviceCategories</attribute>
33+
<!-- cluster revision -->
34+
<globalAttribute side="either" code="0xFFFD" value="1"/>
35+
<attribute side="server" code="0x0000" define="SUPPORTED_DEVICE_CATEGORIES" type="SupportedDeviceCategoryBitmap" default="0" min="0x00000000" max="0x00000001">
36+
<description>SupportedDeviceCategories</description>
37+
<access op="read" privilege="manage"/>
38+
</attribute>
3539

3640
<command source="client" code="0x00" name="RequestCommissioningApproval" optional="false">
3741
<description>This command is sent by a client to request approval for a future CommissionNode call.</description>
38-
<arg name="RequestId" type="int64u" optional="false"/>
39-
<arg name="VendorId" type="vendor_id" optional="false"/>
40-
<arg name="ProductId" type="int16u" optional="false"/>
41-
<arg name="Label" type="char_string" lenght="64" optional="true"/>
42+
<arg id="0" name="RequestId" type="int64u"/>
43+
<arg id="1" name="VendorId" type="vendor_id"/>
44+
<arg id="2" name="ProductId" type="int16u"/>
45+
<arg id="3" name="Label" type="char_string" optional="true" length="64"/>
4246
<access op="invoke" privilege="manage"/>
4347
</command>
4448

4549
<command source="client" code="0x01" name="CommissionNode" response="ReverseOpenCommissioningWindow" optional="false">
4650
<description>This command is sent by a client to request that the server begins commissioning a previously approved request.</description>
47-
<arg name="RequestId" type="int64u" optional="false"/>
48-
<arg name="ResponseTimeoutSeconds" type="int16u" min="30" max="120" default="30" optional="false"/>
49-
<arg name="IpAddress" type="octet_string" optional="true"/> <!-- Note: ipadr is not supported yet, use its base type (octet_string) here -->
50-
<arg name="Port" type="int16u" optional="true"/>
51+
<arg id="0" name="RequestId" type="int64u"/>
52+
<arg id="2" name="ResponseTimeoutSeconds" type="int16u" min="30" max="120" default="30"/>
53+
<arg id="3" name="IpAddress" type="octet_string" optional="true" min="4" max="16"/>
54+
<!-- Note: ipadr is not supported yet, use its base type (octet_string) here -->
55+
<arg id="4" name="Port" type="int16u" optional="true"/>
5156
<access op="invoke" privilege="manage"/>
5257
</command>
5358

5459
<command source="server" code="0x02" name="ReverseOpenCommissioningWindow" optional="false">
5560
<description>When received within the timeout specified by CommissionNode, the client SHALL open a commissioning window on to the node which the client called RequestCommissioningApproval to have commissioned.</description>
56-
<arg name="CommissioningTimeout" type="int16u" optional="false"/>
57-
<arg name="PAKEPasscodeVerifier" type="octet_string" optional="false"/>
58-
<arg name="Discriminator" type="int16u" min="0" max="4095" optional="false"/>
59-
<arg name="Iterations" type="int32u" min="1000" max="100000" optional="false"/>
60-
<arg name="Salt" type="octet_string" length="32" optional="false"/>
61-
<access op="invoke" privilege="manage"/>
62-
</command>
61+
<arg id="0" name="CommissioningTimeout" type="int16u"/>
62+
<arg id="1" name="PAKEPasscodeVerifier" type="octet_string"/>
63+
<arg id="2" name="Discriminator" type="int16u" min="0" max="4095"/>
64+
<arg id="3" name="Iterations" type="int32u" min="1000" max="100000"/>
65+
<arg id="4" name="Salt" type="octet_string" length="32" minLength="16"/>
66+
</command>
6367

64-
<event code="0x00" name="CommissioningRequestResult" priority="info" side="server" optional="false">
68+
<event code="0x00" name="CommissioningRequestResult" priority="info" side="server" isFabricSensitive="true">
6569
<description>This event SHALL be sent by the server following a RequestCommissioningApproval command which the server responded to with SUCCESS.</description>
66-
<field id="0" name="RequestId" type="int64u" optional="false"/>
67-
<field id="1" name="ClientNodeId" type="node_id" optional="false"/>
68-
<field id="2" name="StatusCode" type="enum8" optional="false"/>
70+
<field id="0" name="RequestId" type="int64u"/>
71+
<field id="1" name="ClientNodeId" type="node_id"/>
72+
<field id="2" name="StatusCode" type="enum8"/>
73+
<access op="read" privilege="manage"/>
6974
</event>
7075

7176
</cluster>

‎src/app/zap_cluster_list.json

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"CHANNEL_CLUSTER": [],
2424
"CLIENT_MONITORING_CLUSTER": [],
2525
"COLOR_CONTROL_CLUSTER": [],
26+
"COMMISSIONER_CONTROL_CLUSTER_CLUSTER": [],
2627
"COMMISSIONING_CLUSTER": [],
2728
"CONTENT_LAUNCHER_CLUSTER": [],
2829
"CONTENT_CONTROL_CLUSTER": [],
@@ -168,6 +169,7 @@
168169
],
169170
"CHANNEL_CLUSTER": ["channel-server"],
170171
"COLOR_CONTROL_CLUSTER": ["color-control-server"],
172+
"COMMISSIONER_CONTROL_CLUSTER_CLUSTER": [],
171173
"COMMISSIONING_CLUSTER": [],
172174
"CONTENT_LAUNCHER_CLUSTER": ["content-launch-server"],
173175
"CONTENT_CONTROL_CLUSTER": ["content-control-server"],

‎src/controller/data_model/controller-clusters.matter

+6-5
Original file line numberDiff line numberDiff line change
@@ -9135,20 +9135,21 @@ provisional cluster ContentAppObserver = 1296 {
91359135
}
91369136

91379137
/** Supports the ability for clients to request the commissioning of themselves or other nodes onto a fabric which the cluster server can commission onto. */
9138-
cluster CommissionerControl = 1873 {
9139-
revision 1; // NOTE: Default/not specifically set
9138+
provisional cluster CommissionerControl = 1873 {
9139+
revision 1;
91409140

91419141
bitmap SupportedDeviceCategoryBitmap : bitmap32 {
91429142
kFabricSynchronization = 0x1;
91439143
}
91449144

9145-
info event CommissioningRequestResult = 0 {
9145+
fabric_sensitive info event access(read: manage) CommissioningRequestResult = 0 {
91469146
int64u requestId = 0;
91479147
node_id clientNodeId = 1;
91489148
enum8 statusCode = 2;
9149+
fabric_idx fabricIndex = 254;
91499150
}
91509151

9151-
readonly attribute SupportedDeviceCategoryBitmap supportedDeviceCategories = 0;
9152+
readonly attribute access(read: manage) SupportedDeviceCategoryBitmap supportedDeviceCategories = 0;
91529153
readonly attribute command_id generatedCommandList[] = 65528;
91539154
readonly attribute command_id acceptedCommandList[] = 65529;
91549155
readonly attribute event_id eventList[] = 65530;
@@ -9160,7 +9161,7 @@ cluster CommissionerControl = 1873 {
91609161
int64u requestId = 0;
91619162
vendor_id vendorId = 1;
91629163
int16u productId = 2;
9163-
optional char_string label = 3;
9164+
optional char_string<64> label = 3;
91649165
}
91659166

91669167
request struct CommissionNodeRequest {

‎src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java

+17-2
Original file line numberDiff line numberDiff line change
@@ -5950,25 +5950,30 @@ public static class CommissionerControlClusterCommissioningRequestResultEvent {
59505950
public Long requestId;
59515951
public Long clientNodeId;
59525952
public Integer statusCode;
5953+
public Integer fabricIndex;
59535954
private static final long REQUEST_ID_ID = 0L;
59545955
private static final long CLIENT_NODE_ID_ID = 1L;
59555956
private static final long STATUS_CODE_ID = 2L;
5957+
private static final long FABRIC_INDEX_ID = 254L;
59565958

59575959
public CommissionerControlClusterCommissioningRequestResultEvent(
59585960
Long requestId,
59595961
Long clientNodeId,
5960-
Integer statusCode
5962+
Integer statusCode,
5963+
Integer fabricIndex
59615964
) {
59625965
this.requestId = requestId;
59635966
this.clientNodeId = clientNodeId;
59645967
this.statusCode = statusCode;
5968+
this.fabricIndex = fabricIndex;
59655969
}
59665970

59675971
public StructType encodeTlv() {
59685972
ArrayList<StructElement> values = new ArrayList<>();
59695973
values.add(new StructElement(REQUEST_ID_ID, new UIntType(requestId)));
59705974
values.add(new StructElement(CLIENT_NODE_ID_ID, new UIntType(clientNodeId)));
59715975
values.add(new StructElement(STATUS_CODE_ID, new UIntType(statusCode)));
5976+
values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex)));
59725977

59735978
return new StructType(values);
59745979
}
@@ -5980,6 +5985,7 @@ public static CommissionerControlClusterCommissioningRequestResultEvent decodeTl
59805985
Long requestId = null;
59815986
Long clientNodeId = null;
59825987
Integer statusCode = null;
5988+
Integer fabricIndex = null;
59835989
for (StructElement element: ((StructType)tlvValue).value()) {
59845990
if (element.contextTagNum() == REQUEST_ID_ID) {
59855991
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -5996,12 +6002,18 @@ public static CommissionerControlClusterCommissioningRequestResultEvent decodeTl
59966002
UIntType castingValue = element.value(UIntType.class);
59976003
statusCode = castingValue.value(Integer.class);
59986004
}
6005+
} else if (element.contextTagNum() == FABRIC_INDEX_ID) {
6006+
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
6007+
UIntType castingValue = element.value(UIntType.class);
6008+
fabricIndex = castingValue.value(Integer.class);
6009+
}
59996010
}
60006011
}
60016012
return new CommissionerControlClusterCommissioningRequestResultEvent(
60026013
requestId,
60036014
clientNodeId,
6004-
statusCode
6015+
statusCode,
6016+
fabricIndex
60056017
);
60066018
}
60076019

@@ -6018,6 +6030,9 @@ public String toString() {
60186030
output.append("\tstatusCode: ");
60196031
output.append(statusCode);
60206032
output.append("\n");
6033+
output.append("\tfabricIndex: ");
6034+
output.append(fabricIndex);
6035+
output.append("\n");
60216036
output.append("}\n");
60226037
return output.toString();
60236038
}

‎src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt

+6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
2626
val requestId: ULong,
2727
val clientNodeId: ULong,
2828
val statusCode: UInt,
29+
val fabricIndex: UInt,
2930
) {
3031
override fun toString(): String = buildString {
3132
append("CommissionerControlClusterCommissioningRequestResultEvent {\n")
3233
append("\trequestId : $requestId\n")
3334
append("\tclientNodeId : $clientNodeId\n")
3435
append("\tstatusCode : $statusCode\n")
36+
append("\tfabricIndex : $fabricIndex\n")
3537
append("}\n")
3638
}
3739

@@ -41,6 +43,7 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
4143
put(ContextSpecificTag(TAG_REQUEST_ID), requestId)
4244
put(ContextSpecificTag(TAG_CLIENT_NODE_ID), clientNodeId)
4345
put(ContextSpecificTag(TAG_STATUS_CODE), statusCode)
46+
put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex)
4447
endStructure()
4548
}
4649
}
@@ -49,6 +52,7 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
4952
private const val TAG_REQUEST_ID = 0
5053
private const val TAG_CLIENT_NODE_ID = 1
5154
private const val TAG_STATUS_CODE = 2
55+
private const val TAG_FABRIC_INDEX = 254
5256

5357
fun fromTlv(
5458
tlvTag: Tag,
@@ -58,13 +62,15 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
5862
val requestId = tlvReader.getULong(ContextSpecificTag(TAG_REQUEST_ID))
5963
val clientNodeId = tlvReader.getULong(ContextSpecificTag(TAG_CLIENT_NODE_ID))
6064
val statusCode = tlvReader.getUInt(ContextSpecificTag(TAG_STATUS_CODE))
65+
val fabricIndex = tlvReader.getUInt(ContextSpecificTag(TAG_FABRIC_INDEX))
6166

6267
tlvReader.exitContainer()
6368

6469
return CommissionerControlClusterCommissioningRequestResultEvent(
6570
requestId,
6671
clientNodeId,
6772
statusCode,
73+
fabricIndex,
6874
)
6975
}
7076
}

‎src/controller/java/generated/java/matter/controller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt

+6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
2626
val requestId: ULong,
2727
val clientNodeId: ULong,
2828
val statusCode: UByte,
29+
val fabricIndex: UByte,
2930
) {
3031
override fun toString(): String = buildString {
3132
append("CommissionerControlClusterCommissioningRequestResultEvent {\n")
3233
append("\trequestId : $requestId\n")
3334
append("\tclientNodeId : $clientNodeId\n")
3435
append("\tstatusCode : $statusCode\n")
36+
append("\tfabricIndex : $fabricIndex\n")
3537
append("}\n")
3638
}
3739

@@ -41,6 +43,7 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
4143
put(ContextSpecificTag(TAG_REQUEST_ID), requestId)
4244
put(ContextSpecificTag(TAG_CLIENT_NODE_ID), clientNodeId)
4345
put(ContextSpecificTag(TAG_STATUS_CODE), statusCode)
46+
put(ContextSpecificTag(TAG_FABRIC_INDEX), fabricIndex)
4447
endStructure()
4548
}
4649
}
@@ -49,6 +52,7 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
4952
private const val TAG_REQUEST_ID = 0
5053
private const val TAG_CLIENT_NODE_ID = 1
5154
private const val TAG_STATUS_CODE = 2
55+
private const val TAG_FABRIC_INDEX = 254
5256

5357
fun fromTlv(
5458
tlvTag: Tag,
@@ -58,13 +62,15 @@ class CommissionerControlClusterCommissioningRequestResultEvent(
5862
val requestId = tlvReader.getULong(ContextSpecificTag(TAG_REQUEST_ID))
5963
val clientNodeId = tlvReader.getULong(ContextSpecificTag(TAG_CLIENT_NODE_ID))
6064
val statusCode = tlvReader.getUByte(ContextSpecificTag(TAG_STATUS_CODE))
65+
val fabricIndex = tlvReader.getUByte(ContextSpecificTag(TAG_FABRIC_INDEX))
6166

6267
tlvReader.exitContainer()
6368

6469
return CommissionerControlClusterCommissioningRequestResultEvent(
6570
requestId,
6671
clientNodeId,
6772
statusCode,
73+
fabricIndex,
6874
)
6975
}
7076
}

‎src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp

+12-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/controller/python/chip/clusters/Objects.py

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)