Skip to content

Commit

Permalink
Add operational cluster commands to simulated device. (#13777)
Browse files Browse the repository at this point in the history
* Enable cient side clusters.

* Generated Code.
  • Loading branch information
Josh V [Apple] authored Jan 21, 2022
1 parent 5d905ea commit 225a20b
Show file tree
Hide file tree
Showing 18 changed files with 1,186 additions and 48 deletions.
83 changes: 83 additions & 0 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,88 @@ server cluster OnOff = 6 {
command Toggle(): DefaultSuccess = 2;
}

client cluster OperationalCredentials = 62 {
enum NodeOperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
kInvalidNOC = 3;
kMissingCsr = 4;
kTableFull = 5;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
}

struct FabricDescriptor {
fabric_idx fabricIndex = 0;
OCTET_STRING<65> rootPublicKey = 1;
INT16U vendorId = 2;
FABRIC_ID fabricId = 3;
NODE_ID nodeId = 4;
CHAR_STRING<32> label = 5;
}

readonly attribute FabricDescriptor fabricsList[] = 1;
readonly attribute int8u supportedFabrics = 2;
readonly attribute int8u commissionedFabrics = 3;
readonly attribute OCTET_STRING trustedRootCertificates[] = 4;
readonly attribute fabric_idx currentFabricIndex = 5;
readonly global attribute int16u clusterRevision = 65533;

request struct AddNOCRequest {
OCTET_STRING NOCValue = 0;
optional OCTET_STRING ICACValue = 1;
OCTET_STRING IPKValue = 2;
NODE_ID caseAdminNode = 3;
INT16U adminVendorId = 4;
}

request struct AddTrustedRootCertificateRequest {
OCTET_STRING rootCertificate = 0;
}

request struct AttestationRequestRequest {
OCTET_STRING attestationNonce = 0;
}

request struct CertificateChainRequestRequest {
INT8U certificateType = 0;
}

request struct OpCSRRequestRequest {
OCTET_STRING CSRNonce = 0;
}

request struct RemoveFabricRequest {
INT8U fabricIndex = 0;
}

request struct RemoveTrustedRootCertificateRequest {
OCTET_STRING trustedRootIdentifier = 0;
}

request struct UpdateFabricLabelRequest {
CHAR_STRING label = 0;
}

request struct UpdateNOCRequest {
OCTET_STRING NOCValue = 0;
optional OCTET_STRING ICACValue = 1;
}

command AddNOC(AddNOCRequest): NOCResponse = 6;
command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0;
command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2;
command OpCSRRequest(OpCSRRequestRequest): OpCSRResponse = 4;
command RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12;
command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9;
command UpdateNOC(UpdateNOCRequest): NOCResponse = 7;
}

server cluster OperationalCredentials = 62 {
enum NodeOperationalCertStatus : ENUM8 {
kSuccess = 0;
Expand Down Expand Up @@ -714,6 +796,7 @@ endpoint 0 {
server cluster Descriptor;
server cluster GeneralCommissioning;
server cluster NetworkCommissioning;
binding cluster OperationalCredentials;
server cluster OperationalCredentials;
binding cluster TemperatureMeasurement;
server cluster TemperatureMeasurement;
Expand Down
20 changes: 10 additions & 10 deletions examples/placeholder/linux/apps/app1/config.zap
Original file line number Diff line number Diff line change
Expand Up @@ -899,79 +899,79 @@
"mfgCode": null,
"define": "OPERATIONAL_CREDENTIALS_CLUSTER",
"side": "client",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AttestationRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "CertificateChainRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "OpCSRRequest",
"code": 4,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "AddNOC",
"code": 6,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "UpdateNOC",
"code": 7,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "UpdateFabricLabel",
"code": 9,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "RemoveFabric",
"code": 10,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "AddTrustedRootCertificate",
"code": 11,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "RemoveTrustedRootCertificate",
"code": 12,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
}
],
"attributes": [
Expand Down
83 changes: 83 additions & 0 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,88 @@ server cluster OnOff = 6 {
command Toggle(): DefaultSuccess = 2;
}

client cluster OperationalCredentials = 62 {
enum NodeOperationalCertStatus : ENUM8 {
kSuccess = 0;
kInvalidPublicKey = 1;
kInvalidNodeOpId = 2;
kInvalidNOC = 3;
kMissingCsr = 4;
kTableFull = 5;
kInsufficientPrivilege = 8;
kFabricConflict = 9;
kLabelConflict = 10;
kInvalidFabricIndex = 11;
}

struct FabricDescriptor {
fabric_idx fabricIndex = 0;
OCTET_STRING<65> rootPublicKey = 1;
INT16U vendorId = 2;
FABRIC_ID fabricId = 3;
NODE_ID nodeId = 4;
CHAR_STRING<32> label = 5;
}

readonly attribute FabricDescriptor fabricsList[] = 1;
readonly attribute int8u supportedFabrics = 2;
readonly attribute int8u commissionedFabrics = 3;
readonly attribute OCTET_STRING trustedRootCertificates[] = 4;
readonly attribute fabric_idx currentFabricIndex = 5;
readonly global attribute int16u clusterRevision = 65533;

request struct AddNOCRequest {
OCTET_STRING NOCValue = 0;
optional OCTET_STRING ICACValue = 1;
OCTET_STRING IPKValue = 2;
NODE_ID caseAdminNode = 3;
INT16U adminVendorId = 4;
}

request struct AddTrustedRootCertificateRequest {
OCTET_STRING rootCertificate = 0;
}

request struct AttestationRequestRequest {
OCTET_STRING attestationNonce = 0;
}

request struct CertificateChainRequestRequest {
INT8U certificateType = 0;
}

request struct OpCSRRequestRequest {
OCTET_STRING CSRNonce = 0;
}

request struct RemoveFabricRequest {
INT8U fabricIndex = 0;
}

request struct RemoveTrustedRootCertificateRequest {
OCTET_STRING trustedRootIdentifier = 0;
}

request struct UpdateFabricLabelRequest {
CHAR_STRING label = 0;
}

request struct UpdateNOCRequest {
OCTET_STRING NOCValue = 0;
optional OCTET_STRING ICACValue = 1;
}

command AddNOC(AddNOCRequest): NOCResponse = 6;
command AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
command AttestationRequest(AttestationRequestRequest): AttestationResponse = 0;
command CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2;
command OpCSRRequest(OpCSRRequestRequest): OpCSRResponse = 4;
command RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
command RemoveTrustedRootCertificate(RemoveTrustedRootCertificateRequest): DefaultSuccess = 12;
command UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9;
command UpdateNOC(UpdateNOCRequest): NOCResponse = 7;
}

server cluster OperationalCredentials = 62 {
enum NodeOperationalCertStatus : ENUM8 {
kSuccess = 0;
Expand Down Expand Up @@ -714,6 +796,7 @@ endpoint 0 {
server cluster Descriptor;
server cluster GeneralCommissioning;
server cluster NetworkCommissioning;
binding cluster OperationalCredentials;
server cluster OperationalCredentials;
binding cluster TemperatureMeasurement;
server cluster TemperatureMeasurement;
Expand Down
20 changes: 10 additions & 10 deletions examples/placeholder/linux/apps/app2/config.zap
Original file line number Diff line number Diff line change
Expand Up @@ -899,79 +899,79 @@
"mfgCode": null,
"define": "OPERATIONAL_CREDENTIALS_CLUSTER",
"side": "client",
"enabled": 0,
"enabled": 1,
"commands": [
{
"name": "AttestationRequest",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "CertificateChainRequest",
"code": 2,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "OpCSRRequest",
"code": 4,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "AddNOC",
"code": 6,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "UpdateNOC",
"code": 7,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "UpdateFabricLabel",
"code": 9,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "RemoveFabric",
"code": 10,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "AddTrustedRootCertificate",
"code": 11,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
},
{
"name": "RemoveTrustedRootCertificate",
"code": 12,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
"outgoing": 1
}
],
"attributes": [
Expand Down
Loading

0 comments on commit 225a20b

Please sign in to comment.