Skip to content

Commit

Permalink
Implements the Commissioner Control Cluster in Matter SDK (project-ch…
Browse files Browse the repository at this point in the history
…ip#34375)


Co-authored-by: Terence Hampson <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
4 people authored Jul 26, 2024
1 parent 9421127 commit 7d26280
Show file tree
Hide file tree
Showing 4 changed files with 674 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,57 @@ cluster GroupKeyManagement = 63 {
fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4;
}

/** Supports the ability for clients to request the commissioning of themselves or other nodes onto a fabric which the cluster server can commission onto. */
provisional cluster CommissionerControl = 1873 {
revision 1;

bitmap SupportedDeviceCategoryBitmap : bitmap32 {
kFabricSynchronization = 0x1;
}

fabric_sensitive info event access(read: manage) CommissioningRequestResult = 0 {
int64u requestId = 0;
node_id clientNodeId = 1;
enum8 statusCode = 2;
fabric_idx fabricIndex = 254;
}

readonly attribute access(read: manage) SupportedDeviceCategoryBitmap supportedDeviceCategories = 0;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct RequestCommissioningApprovalRequest {
int64u requestId = 0;
vendor_id vendorId = 1;
int16u productId = 2;
optional char_string<64> label = 3;
}

request struct CommissionNodeRequest {
int64u requestId = 0;
int16u responseTimeoutSeconds = 1;
optional octet_string ipAddress = 2;
optional int16u port = 3;
}

response struct ReverseOpenCommissioningWindow = 2 {
int16u commissioningTimeout = 0;
octet_string PAKEPasscodeVerifier = 1;
int16u discriminator = 2;
int32u iterations = 3;
octet_string<32> salt = 4;
}

/** This command is sent by a client to request approval for a future CommissionNode call. */
command access(invoke: manage) RequestCommissioningApproval(RequestCommissioningApprovalRequest): DefaultSuccess = 0;
/** This command is sent by a client to request that the server begins commissioning a previously approved request. */
command access(invoke: manage) CommissionNode(CommissionNodeRequest): ReverseOpenCommissioningWindow = 1;
}

endpoint 0 {
device type ma_rootdevice = 22, version 1;

Expand Down Expand Up @@ -1647,6 +1698,21 @@ endpoint 0 {
handle command KeySetReadAllIndices;
handle command KeySetReadAllIndicesResponse;
}

server cluster CommissionerControl {
emits event CommissioningRequestResult;
ram attribute supportedDeviceCategories default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command RequestCommissioningApproval;
handle command CommissionNode;
handle command ReverseOpenCommissioningWindow;
}
}
endpoint 1 {
device type ma_aggregator = 14, version 1;
Expand Down
158 changes: 158 additions & 0 deletions examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -4003,6 +4003,164 @@
"reportableChange": 0
}
]
},
{
"name": "Commissioner Control",
"code": 1873,
"mfgCode": null,
"define": "COMMISSIONER_CONTROL_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "RequestCommissioningApproval",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "CommissionNode",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "ReverseOpenCommissioningWindow",
"code": 2,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
{
"name": "SupportedDeviceCategories",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "SupportedDeviceCategoryBitmap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
],
"events": [
{
"name": "CommissioningRequestResult",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
}
]
}
]
},
Expand Down
Loading

0 comments on commit 7d26280

Please sign in to comment.