Skip to content

Commit d9557cf

Browse files
yufengwangcatehampsonbzbarsky-applerestyled-commits
authored andcommitted
Implements the Commissioner Control Cluster in Matter SDK (project-chip#34375)
Co-authored-by: Terence Hampson <thampson@google.com> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent df14757 commit d9557cf

File tree

4 files changed

+674
-0
lines changed

4 files changed

+674
-0
lines changed

examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter

+66
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,57 @@ cluster GroupKeyManagement = 63 {
13341334
fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4;
13351335
}
13361336

1337+
/** Supports the ability for clients to request the commissioning of themselves or other nodes onto a fabric which the cluster server can commission onto. */
1338+
provisional cluster CommissionerControl = 1873 {
1339+
revision 1;
1340+
1341+
bitmap SupportedDeviceCategoryBitmap : bitmap32 {
1342+
kFabricSynchronization = 0x1;
1343+
}
1344+
1345+
fabric_sensitive info event access(read: manage) CommissioningRequestResult = 0 {
1346+
int64u requestId = 0;
1347+
node_id clientNodeId = 1;
1348+
enum8 statusCode = 2;
1349+
fabric_idx fabricIndex = 254;
1350+
}
1351+
1352+
readonly attribute access(read: manage) SupportedDeviceCategoryBitmap supportedDeviceCategories = 0;
1353+
readonly attribute command_id generatedCommandList[] = 65528;
1354+
readonly attribute command_id acceptedCommandList[] = 65529;
1355+
readonly attribute event_id eventList[] = 65530;
1356+
readonly attribute attrib_id attributeList[] = 65531;
1357+
readonly attribute bitmap32 featureMap = 65532;
1358+
readonly attribute int16u clusterRevision = 65533;
1359+
1360+
request struct RequestCommissioningApprovalRequest {
1361+
int64u requestId = 0;
1362+
vendor_id vendorId = 1;
1363+
int16u productId = 2;
1364+
optional char_string<64> label = 3;
1365+
}
1366+
1367+
request struct CommissionNodeRequest {
1368+
int64u requestId = 0;
1369+
int16u responseTimeoutSeconds = 1;
1370+
optional octet_string ipAddress = 2;
1371+
optional int16u port = 3;
1372+
}
1373+
1374+
response struct ReverseOpenCommissioningWindow = 2 {
1375+
int16u commissioningTimeout = 0;
1376+
octet_string PAKEPasscodeVerifier = 1;
1377+
int16u discriminator = 2;
1378+
int32u iterations = 3;
1379+
octet_string<32> salt = 4;
1380+
}
1381+
1382+
/** This command is sent by a client to request approval for a future CommissionNode call. */
1383+
command access(invoke: manage) RequestCommissioningApproval(RequestCommissioningApprovalRequest): DefaultSuccess = 0;
1384+
/** This command is sent by a client to request that the server begins commissioning a previously approved request. */
1385+
command access(invoke: manage) CommissionNode(CommissionNodeRequest): ReverseOpenCommissioningWindow = 1;
1386+
}
1387+
13371388
endpoint 0 {
13381389
device type ma_rootdevice = 22, version 1;
13391390

@@ -1647,6 +1698,21 @@ endpoint 0 {
16471698
handle command KeySetReadAllIndices;
16481699
handle command KeySetReadAllIndicesResponse;
16491700
}
1701+
1702+
server cluster CommissionerControl {
1703+
emits event CommissioningRequestResult;
1704+
ram attribute supportedDeviceCategories default = 0;
1705+
callback attribute generatedCommandList;
1706+
callback attribute acceptedCommandList;
1707+
callback attribute eventList;
1708+
callback attribute attributeList;
1709+
ram attribute featureMap default = 0;
1710+
ram attribute clusterRevision default = 1;
1711+
1712+
handle command RequestCommissioningApproval;
1713+
handle command CommissionNode;
1714+
handle command ReverseOpenCommissioningWindow;
1715+
}
16501716
}
16511717
endpoint 1 {
16521718
device type ma_aggregator = 14, version 1;

examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap

+158
Original file line numberDiff line numberDiff line change
@@ -4003,6 +4003,164 @@
40034003
"reportableChange": 0
40044004
}
40054005
]
4006+
},
4007+
{
4008+
"name": "Commissioner Control",
4009+
"code": 1873,
4010+
"mfgCode": null,
4011+
"define": "COMMISSIONER_CONTROL_CLUSTER",
4012+
"side": "server",
4013+
"enabled": 1,
4014+
"apiMaturity": "provisional",
4015+
"commands": [
4016+
{
4017+
"name": "RequestCommissioningApproval",
4018+
"code": 0,
4019+
"mfgCode": null,
4020+
"source": "client",
4021+
"isIncoming": 1,
4022+
"isEnabled": 1
4023+
},
4024+
{
4025+
"name": "CommissionNode",
4026+
"code": 1,
4027+
"mfgCode": null,
4028+
"source": "client",
4029+
"isIncoming": 1,
4030+
"isEnabled": 1
4031+
},
4032+
{
4033+
"name": "ReverseOpenCommissioningWindow",
4034+
"code": 2,
4035+
"mfgCode": null,
4036+
"source": "server",
4037+
"isIncoming": 0,
4038+
"isEnabled": 1
4039+
}
4040+
],
4041+
"attributes": [
4042+
{
4043+
"name": "SupportedDeviceCategories",
4044+
"code": 0,
4045+
"mfgCode": null,
4046+
"side": "server",
4047+
"type": "SupportedDeviceCategoryBitmap",
4048+
"included": 1,
4049+
"storageOption": "RAM",
4050+
"singleton": 0,
4051+
"bounded": 0,
4052+
"defaultValue": "0",
4053+
"reportable": 1,
4054+
"minInterval": 1,
4055+
"maxInterval": 65534,
4056+
"reportableChange": 0
4057+
},
4058+
{
4059+
"name": "GeneratedCommandList",
4060+
"code": 65528,
4061+
"mfgCode": null,
4062+
"side": "server",
4063+
"type": "array",
4064+
"included": 1,
4065+
"storageOption": "External",
4066+
"singleton": 0,
4067+
"bounded": 0,
4068+
"defaultValue": null,
4069+
"reportable": 1,
4070+
"minInterval": 1,
4071+
"maxInterval": 65534,
4072+
"reportableChange": 0
4073+
},
4074+
{
4075+
"name": "AcceptedCommandList",
4076+
"code": 65529,
4077+
"mfgCode": null,
4078+
"side": "server",
4079+
"type": "array",
4080+
"included": 1,
4081+
"storageOption": "External",
4082+
"singleton": 0,
4083+
"bounded": 0,
4084+
"defaultValue": null,
4085+
"reportable": 1,
4086+
"minInterval": 1,
4087+
"maxInterval": 65534,
4088+
"reportableChange": 0
4089+
},
4090+
{
4091+
"name": "EventList",
4092+
"code": 65530,
4093+
"mfgCode": null,
4094+
"side": "server",
4095+
"type": "array",
4096+
"included": 1,
4097+
"storageOption": "External",
4098+
"singleton": 0,
4099+
"bounded": 0,
4100+
"defaultValue": null,
4101+
"reportable": 1,
4102+
"minInterval": 1,
4103+
"maxInterval": 65534,
4104+
"reportableChange": 0
4105+
},
4106+
{
4107+
"name": "AttributeList",
4108+
"code": 65531,
4109+
"mfgCode": null,
4110+
"side": "server",
4111+
"type": "array",
4112+
"included": 1,
4113+
"storageOption": "External",
4114+
"singleton": 0,
4115+
"bounded": 0,
4116+
"defaultValue": null,
4117+
"reportable": 1,
4118+
"minInterval": 1,
4119+
"maxInterval": 65534,
4120+
"reportableChange": 0
4121+
},
4122+
{
4123+
"name": "FeatureMap",
4124+
"code": 65532,
4125+
"mfgCode": null,
4126+
"side": "server",
4127+
"type": "bitmap32",
4128+
"included": 1,
4129+
"storageOption": "RAM",
4130+
"singleton": 0,
4131+
"bounded": 0,
4132+
"defaultValue": "0",
4133+
"reportable": 1,
4134+
"minInterval": 1,
4135+
"maxInterval": 65534,
4136+
"reportableChange": 0
4137+
},
4138+
{
4139+
"name": "ClusterRevision",
4140+
"code": 65533,
4141+
"mfgCode": null,
4142+
"side": "server",
4143+
"type": "int16u",
4144+
"included": 1,
4145+
"storageOption": "RAM",
4146+
"singleton": 0,
4147+
"bounded": 0,
4148+
"defaultValue": "1",
4149+
"reportable": 1,
4150+
"minInterval": 1,
4151+
"maxInterval": 65534,
4152+
"reportableChange": 0
4153+
}
4154+
],
4155+
"events": [
4156+
{
4157+
"name": "CommissioningRequestResult",
4158+
"code": 0,
4159+
"mfgCode": null,
4160+
"side": "server",
4161+
"included": 1
4162+
}
4163+
]
40064164
}
40074165
]
40084166
},

0 commit comments

Comments
 (0)