diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 017ff384f4d258..92cb661131484f 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -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; @@ -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; diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 19ccbc3b128072..eb9f6618c3eae4 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -899,7 +899,7 @@ "mfgCode": null, "define": "OPERATIONAL_CREDENTIALS_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AttestationRequest", @@ -907,7 +907,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "CertificateChainRequest", @@ -915,7 +915,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "OpCSRRequest", @@ -923,7 +923,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddNOC", @@ -931,7 +931,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "UpdateNOC", @@ -939,7 +939,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "UpdateFabricLabel", @@ -947,7 +947,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveFabric", @@ -955,7 +955,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddTrustedRootCertificate", @@ -963,7 +963,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveTrustedRootCertificate", @@ -971,7 +971,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 017ff384f4d258..92cb661131484f 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -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; @@ -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; diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 19ccbc3b128072..eb9f6618c3eae4 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -899,7 +899,7 @@ "mfgCode": null, "define": "OPERATIONAL_CREDENTIALS_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "AttestationRequest", @@ -907,7 +907,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "CertificateChainRequest", @@ -915,7 +915,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "OpCSRRequest", @@ -923,7 +923,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddNOC", @@ -931,7 +931,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "UpdateNOC", @@ -939,7 +939,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "UpdateFabricLabel", @@ -947,7 +947,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveFabric", @@ -955,7 +955,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "AddTrustedRootCertificate", @@ -963,7 +963,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 }, { "name": "RemoveTrustedRootCertificate", @@ -971,7 +971,7 @@ "mfgCode": null, "source": "client", "incoming": 1, - "outgoing": 0 + "outgoing": 1 } ], "attributes": [ diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.cpp index 1aa6b5273b27ce..21d8ab34731566 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.cpp @@ -130,3 +130,46 @@ namespace { // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); + +void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h index 249491128ed06d..62a13342120598 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClientCallbacks.h @@ -37,3 +37,15 @@ // Cluster Specific Response Callbacks // List specific responses +void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsTrustedRootCertificatesListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.cpp b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.cpp index e6b78e8de68b0f..13cc9f6dad651e 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.cpp @@ -34,6 +34,398 @@ namespace Controller { // TODO(#4503): length should be passed to commands when byte string is in argument list. // TODO(#4503): Commands should take group id as an argument. +// OperationalCredentials Cluster Commands +CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, + chip::NodeId caseAdminNode, uint16_t adminVendorId) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::AddNOC::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + // IPKValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), IPKValue)); + // caseAdminNode: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), caseAdminNode)); + // adminVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), adminVendorId)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan rootCertificate) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::AddTrustedRootCertificate::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // rootCertificate: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rootCertificate)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan attestationNonce) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::AttestationRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // attestationNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), attestationNonce)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t certificateType) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::CertificateChainRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // certificateType: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), certificateType)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan CSRNonce) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::OpCSRRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // CSRNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), CSRNonce)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t fabricIndex) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveFabric::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // fabricIndex: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), fabricIndex)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan trustedRootIdentifier) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveTrustedRootCertificate::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // trustedRootIdentifier: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), trustedRootIdentifier)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan label) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::UpdateFabricLabel::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // label: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), label)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, + chip::ByteSpan ICACValue) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::UpdateNOC::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + // TemperatureMeasurement Cluster Commands } // namespace Controller diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h index c92f1da04b192f..4b13ffea5f52a7 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h @@ -30,6 +30,33 @@ namespace chip { namespace Controller { +class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase +{ +public: + OperationalCredentialsCluster() : ClusterBase(app::Clusters::OperationalCredentials::Id) {} + ~OperationalCredentialsCluster() {} + + // Cluster Commands + CHIP_ERROR AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, + chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, chip::NodeId caseAdminNode, uint16_t adminVendorId); + CHIP_ERROR AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan rootCertificate); + CHIP_ERROR AttestationRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan attestationNonce); + CHIP_ERROR CertificateChainRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t certificateType); + CHIP_ERROR OpCSRRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan CSRNonce); + CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t fabricIndex); + CHIP_ERROR RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan trustedRootIdentifier); + CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan label); + CHIP_ERROR UpdateNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue); +}; + class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase { public: diff --git a/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h index c13fc55f449e00..6edb4e997bf5ae 100644 --- a/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h @@ -31,6 +31,7 @@ MatterLevelControlPluginServerInitCallback(); \ MatterNetworkCommissioningPluginServerInitCallback(); \ MatterOnOffPluginServerInitCallback(); \ + MatterOperationalCredentialsPluginClientInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterScenesPluginServerInitCallback(); \ MatterTemperatureMeasurementPluginClientInitCallback(); \ diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index 1d1ff20f683692..39661bd75b0ee0 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -197,7 +197,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 90 +#define GENERATED_ATTRIBUTE_COUNT 91 #define GENERATED_ATTRIBUTES \ { \ \ @@ -254,6 +254,9 @@ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ + /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000001, ZAP_TYPE(ARRAY), 320, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ @@ -368,7 +371,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 14 +#define GENERATED_CLUSTER_COUNT 15 #define GENERATED_CLUSTERS \ { \ { \ @@ -387,52 +390,55 @@ 0x00000031, ZAP_ATTRIBUTE_INDEX(28), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(38), 6, 324, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ + { \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(39), 6, 324, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 0, Cluster: Temperature Measurement (client) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(45), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(46), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Temperature Measurement (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(49), \ + ZAP_ATTRIBUTE_INDEX(50), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(52), \ + ZAP_ATTRIBUTE_INDEX(53), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(54), \ + ZAP_ATTRIBUTE_INDEX(55), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(60), \ + ZAP_ATTRIBUTE_INDEX(61), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(62), \ + ZAP_ATTRIBUTE_INDEX(63), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(64), \ + ZAP_ATTRIBUTE_INDEX(65), \ 20, \ 687, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(84), \ + ZAP_ATTRIBUTE_INDEX(85), \ 6, \ 11, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -444,7 +450,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 7, 1345 }, { ZAP_CLUSTER_INDEX(7), 7, 720 }, \ + { ZAP_CLUSTER_INDEX(0), 8, 1347 }, { ZAP_CLUSTER_INDEX(8), 7, 720 }, \ } // Largest attribute size is needed for various buffers @@ -454,7 +460,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1374) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2065) +#define ATTRIBUTE_MAX_SIZE (2067) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/placeholder/app1/zap-generated/gen_config.h b/zzz_generated/placeholder/app1/zap-generated/gen_config.h index b20bb1ab5337a6..8797362c26b15e 100644 --- a/zzz_generated/placeholder/app1/zap-generated/gen_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/gen_config.h @@ -38,6 +38,7 @@ #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -98,6 +99,10 @@ #define EMBER_AF_PLUGIN_ON_OFF_SERVER #define EMBER_AF_PLUGIN_ON_OFF +// Use this macro to check if the client side of the Operational Credentials cluster is included +#define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_CLIENT + // Use this macro to check if the server side of the Operational Credentials cluster is included #define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER diff --git a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.cpp index 1aa6b5273b27ce..21d8ab34731566 100644 --- a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.cpp @@ -130,3 +130,46 @@ namespace { // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); + +void OperationalCredentialsClusterFabricsListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(TLV::TLVReader * tlvData, + Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} diff --git a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h index 249491128ed06d..62a13342120598 100644 --- a/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/placeholder/app2/zap-generated/CHIPClientCallbacks.h @@ -37,3 +37,15 @@ // Cluster Specific Response Callbacks // List specific responses +void OperationalCredentialsClusterFabricsListListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsFabricsListListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & data); +void OperationalCredentialsClusterTrustedRootCertificatesListAttributeFilter(chip::TLV::TLVReader * data, + chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*OperationalCredentialsTrustedRootCertificatesListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); diff --git a/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.cpp b/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.cpp index e6b78e8de68b0f..13cc9f6dad651e 100644 --- a/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.cpp @@ -34,6 +34,398 @@ namespace Controller { // TODO(#4503): length should be passed to commands when byte string is in argument list. // TODO(#4503): Commands should take group id as an argument. +// OperationalCredentials Cluster Commands +CHIP_ERROR OperationalCredentialsCluster::AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, + chip::NodeId caseAdminNode, uint16_t adminVendorId) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::AddNOC::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + // IPKValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), IPKValue)); + // caseAdminNode: nodeId + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), caseAdminNode)); + // adminVendorId: int16u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), adminVendorId)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan rootCertificate) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::AddTrustedRootCertificate::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // rootCertificate: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), rootCertificate)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::AttestationRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan attestationNonce) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::AttestationRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // attestationNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), attestationNonce)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::CertificateChainRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t certificateType) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::CertificateChainRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // certificateType: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), certificateType)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::OpCSRRequest(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan CSRNonce) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::OpCSRRequest::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // CSRNonce: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), CSRNonce)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t fabricIndex) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveFabric::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // fabricIndex: int8u + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), fabricIndex)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, + chip::ByteSpan trustedRootIdentifier) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::RemoveTrustedRootCertificate::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // trustedRootIdentifier: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), trustedRootIdentifier)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::CharSpan label) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, + OperationalCredentials::Commands::UpdateFabricLabel::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // label: charString + SuccessOrExit(err = writer->PutString(TLV::ContextTag(argSeqNumber++), label)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + +CHIP_ERROR OperationalCredentialsCluster::UpdateNOC(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, + chip::ByteSpan ICACValue) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVWriter * writer = nullptr; + uint8_t argSeqNumber = 0; + + // Used when encoding non-empty command. Suppress error message when encoding empty commands. + (void) writer; + (void) argSeqNumber; + + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, OperationalCredentials::Commands::UpdateNOC::Id, + (app::CommandPathFlags::kEndpointIdValid) }; + + CommandSenderHandle sender( + Platform::New(mDevice->GetInteractionModelDelegate(), mDevice->GetExchangeManager())); + + VerifyOrReturnError(sender != nullptr, CHIP_ERROR_NO_MEMORY); + + SuccessOrExit(err = sender->PrepareCommand(cmdParams)); + + VerifyOrExit((writer = sender->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + // NOCValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), NOCValue)); + // ICACValue: octetString + SuccessOrExit(err = writer->Put(TLV::ContextTag(argSeqNumber++), ICACValue)); + + SuccessOrExit(err = sender->FinishCommand()); + + // #6308: This is a temporary solution before we fully support IM on application side and should be replaced by IMDelegate. + mDevice->AddIMResponseHandler(sender.get(), onSuccessCallback, onFailureCallback); + + SuccessOrExit(err = mDevice->SendCommands(sender.get())); + + // We have successfully sent the command, and the callback handler will be responsible to free the object, release the object + // now. + sender.release(); +exit: + return err; +} + // TemperatureMeasurement Cluster Commands } // namespace Controller diff --git a/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.h b/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.h index c92f1da04b192f..4b13ffea5f52a7 100644 --- a/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.h +++ b/zzz_generated/placeholder/app2/zap-generated/CHIPClusters.h @@ -30,6 +30,33 @@ namespace chip { namespace Controller { +class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase +{ +public: + OperationalCredentialsCluster() : ClusterBase(app::Clusters::OperationalCredentials::Id) {} + ~OperationalCredentialsCluster() {} + + // Cluster Commands + CHIP_ERROR AddNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan NOCValue, + chip::ByteSpan ICACValue, chip::ByteSpan IPKValue, chip::NodeId caseAdminNode, uint16_t adminVendorId); + CHIP_ERROR AddTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan rootCertificate); + CHIP_ERROR AttestationRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan attestationNonce); + CHIP_ERROR CertificateChainRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t certificateType); + CHIP_ERROR OpCSRRequest(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan CSRNonce); + CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t fabricIndex); + CHIP_ERROR RemoveTrustedRootCertificate(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan trustedRootIdentifier); + CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::CharSpan label); + CHIP_ERROR UpdateNOC(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan NOCValue, chip::ByteSpan ICACValue); +}; + class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase { public: diff --git a/zzz_generated/placeholder/app2/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/placeholder/app2/zap-generated/PluginApplicationCallbacks.h index c13fc55f449e00..6edb4e997bf5ae 100644 --- a/zzz_generated/placeholder/app2/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/placeholder/app2/zap-generated/PluginApplicationCallbacks.h @@ -31,6 +31,7 @@ MatterLevelControlPluginServerInitCallback(); \ MatterNetworkCommissioningPluginServerInitCallback(); \ MatterOnOffPluginServerInitCallback(); \ + MatterOperationalCredentialsPluginClientInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterScenesPluginServerInitCallback(); \ MatterTemperatureMeasurementPluginClientInitCallback(); \ diff --git a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h index 1d1ff20f683692..39661bd75b0ee0 100644 --- a/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/endpoint_config.h @@ -197,7 +197,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 90 +#define GENERATED_ATTRIBUTE_COUNT 91 #define GENERATED_ATTRIBUTES \ { \ \ @@ -254,6 +254,9 @@ { 0x0000FFFC, ZAP_TYPE(BITMAP32), 4, 0, ZAP_LONG_DEFAULTS_INDEX(282) }, /* FeatureMap */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ + /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ + { 0x0000FFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { 0x00000001, ZAP_TYPE(ARRAY), 320, 0, ZAP_LONG_DEFAULTS_INDEX(286) }, /* fabrics list */ \ { 0x00000002, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* SupportedFabrics */ \ @@ -368,7 +371,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 14 +#define GENERATED_CLUSTER_COUNT 15 #define GENERATED_CLUSTERS \ { \ { \ @@ -387,52 +390,55 @@ 0x00000031, ZAP_ATTRIBUTE_INDEX(28), 10, 60, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0000003E, ZAP_ATTRIBUTE_INDEX(38), 6, 324, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 0, Cluster: Operational Credentials (client) */ \ + { \ + 0x0000003E, ZAP_ATTRIBUTE_INDEX(39), 6, 324, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 0, Cluster: Temperature Measurement (client) */ \ { \ - 0x00000402, ZAP_ATTRIBUTE_INDEX(45), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x00000402, ZAP_ATTRIBUTE_INDEX(46), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Temperature Measurement (server) */ \ { 0x00000003, \ - ZAP_ATTRIBUTE_INDEX(49), \ + ZAP_ATTRIBUTE_INDEX(50), \ 3, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x00000004, \ - ZAP_ATTRIBUTE_INDEX(52), \ + ZAP_ATTRIBUTE_INDEX(53), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x00000005, \ - ZAP_ATTRIBUTE_INDEX(54), \ + ZAP_ATTRIBUTE_INDEX(55), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x00000006, \ - ZAP_ATTRIBUTE_INDEX(60), \ + ZAP_ATTRIBUTE_INDEX(61), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { 0x00000008, \ - ZAP_ATTRIBUTE_INDEX(62), \ + ZAP_ATTRIBUTE_INDEX(63), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { 0x00000028, \ - ZAP_ATTRIBUTE_INDEX(64), \ + ZAP_ATTRIBUTE_INDEX(65), \ 20, \ 687, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 1, Cluster: Basic (server) */ \ { 0x00000300, \ - ZAP_ATTRIBUTE_INDEX(84), \ + ZAP_ATTRIBUTE_INDEX(85), \ 6, \ 11, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -444,7 +450,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 7, 1345 }, { ZAP_CLUSTER_INDEX(7), 7, 720 }, \ + { ZAP_CLUSTER_INDEX(0), 8, 1347 }, { ZAP_CLUSTER_INDEX(8), 7, 720 }, \ } // Largest attribute size is needed for various buffers @@ -454,7 +460,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (1374) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (2065) +#define ATTRIBUTE_MAX_SIZE (2067) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/zzz_generated/placeholder/app2/zap-generated/gen_config.h b/zzz_generated/placeholder/app2/zap-generated/gen_config.h index b20bb1ab5337a6..8797362c26b15e 100644 --- a/zzz_generated/placeholder/app2/zap-generated/gen_config.h +++ b/zzz_generated/placeholder/app2/zap-generated/gen_config.h @@ -38,6 +38,7 @@ #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -98,6 +99,10 @@ #define EMBER_AF_PLUGIN_ON_OFF_SERVER #define EMBER_AF_PLUGIN_ON_OFF +// Use this macro to check if the client side of the Operational Credentials cluster is included +#define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_CLIENT + // Use this macro to check if the server side of the Operational Credentials cluster is included #define ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS_SERVER