Implement Operational Credentials Cluster for initial Fabric support (#6096)
* Initial implementation of OpCreds cluster
* Enable opCreds cluster in zap files
* Regen all files
diff --git a/examples/all-clusters-app/all-clusters-common/BUILD.gn b/examples/all-clusters-app/all-clusters-common/BUILD.gn
index a558a82..41fb5bc 100644
--- a/examples/all-clusters-app/all-clusters-common/BUILD.gn
+++ b/examples/all-clusters-app/all-clusters-common/BUILD.gn
@@ -39,6 +39,7 @@
"media-playback-server",
"network-commissioning",
"on-off-server",
+ "operational-credentials",
"ota-server",
"scenes",
"target-navigator-server",
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index 4d793aa..63e0b42 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -1421,6 +1421,107 @@
]
},
{
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "GetFabricId",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "GetFabricIdResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "fabrics list",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
"name": "Door Lock",
"code": 257,
"mfgCode": null,
diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
index ec977ef..e283502 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp
@@ -7013,6 +7013,200 @@
} // namespace OnOff
+namespace OperationalCredentials {
+
+void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
+{
+ {
+ switch (aCommandId)
+ {
+ case ZCL_GET_FABRIC_ID_COMMAND_ID: {
+
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfOperationalCredentialsClusterGetFabricIdCallback();
+ break;
+ }
+ case ZCL_REMOVE_FABRIC_COMMAND_ID: {
+ // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV
+ // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error.
+ // Any error value TLVUnpackError means we have received an illegal value.
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR;
+ chip::FabricId FabricId;
+ bool FabricIdExists = false;
+ chip::NodeId NodeId;
+ bool NodeIdExists = false;
+ uint16_t VendorId;
+ bool VendorIdExists = false;
+ uint32_t validArgumentCount = 0;
+
+ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(aDataTlv.GetTag()))
+ {
+ case 0:
+ if (FabricIdExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ TLVUnpackError = aDataTlv.Get(FabricId);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ FabricIdExists = true;
+ validArgumentCount++;
+ }
+ break;
+ case 1:
+ if (NodeIdExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ TLVUnpackError = aDataTlv.Get(NodeId);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ NodeIdExists = true;
+ validArgumentCount++;
+ }
+ break;
+ case 2:
+ if (VendorIdExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ TLVUnpackError = aDataTlv.Get(VendorId);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ VendorIdExists = true;
+ validArgumentCount++;
+ }
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVUnpackError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError);
+ break;
+ }
+ }
+
+ if (CHIP_END_OF_TLV == TLVError)
+ {
+ // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error.
+ TLVError = CHIP_NO_ERROR;
+ }
+ else
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError);
+ }
+
+ // TODO(#5590) We should encode a response of status code for invalid TLV.
+ if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
+ {
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfOperationalCredentialsClusterRemoveFabricCallback(FabricId, NodeId, VendorId);
+ }
+ else
+ {
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogProgress(
+ Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32,
+ 3, validArgumentCount, TLVError, TLVUnpackError);
+ }
+ break;
+ }
+ case ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID: {
+ // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV
+ // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error.
+ // Any error value TLVUnpackError means we have received an illegal value.
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR;
+ const uint8_t * Label;
+ bool LabelExists = false;
+ uint32_t validArgumentCount = 0;
+
+ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(aDataTlv.GetTag()))
+ {
+ case 0:
+ if (LabelExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types.
+ TLVUnpackError = aDataTlv.GetDataPtr(Label);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ LabelExists = true;
+ validArgumentCount++;
+ }
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVUnpackError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError);
+ break;
+ }
+ }
+
+ if (CHIP_END_OF_TLV == TLVError)
+ {
+ // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error.
+ TLVError = CHIP_NO_ERROR;
+ }
+ else
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError);
+ }
+
+ // TODO(#5590) We should encode a response of status code for invalid TLV.
+ if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount)
+ {
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(const_cast<uint8_t *>(Label));
+ }
+ else
+ {
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogProgress(
+ Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32,
+ 1, validArgumentCount, TLVError, TLVUnpackError);
+ }
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId,
+ ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ break;
+ }
+ }
+ }
+}
+
+} // namespace OperationalCredentials
+
namespace Scenes {
void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
@@ -7703,6 +7897,9 @@
case ZCL_ON_OFF_CLUSTER_ID:
clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ clusters::OperationalCredentials::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
+ break;
case ZCL_SCENES_CLUSTER_ID:
clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader);
break;
diff --git a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp
index 8e795bb..a2af3ff 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp
@@ -190,6 +190,35 @@
}
break;
}
+ case 0x003E: // Operational Credentials Cluster
+ {
+ uint16_t entryOffset = kSizeLengthInBytes;
+ switch (am->attributeId)
+ {
+ case 0x0001: // fabrics list
+ {
+ entryLength = 50;
+ if (((index - 1) * entryLength) > (am->size - entryLength))
+ {
+ ChipLogError(Zcl, "Index %l is invalid.", index);
+ return 0;
+ }
+ entryOffset = static_cast<uint16_t>(entryOffset + ((index - 1) * entryLength));
+ // Struct _FabricDescriptor
+ _FabricDescriptor * entry = reinterpret_cast<_FabricDescriptor *>(write ? src : dest);
+ copyListMember(write ? dest : (uint8_t *) &entry->FabricId, write ? (uint8_t *) &entry->FabricId : src, write,
+ &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID
+ copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write,
+ &entryOffset, sizeof(entry->VendorId)); // INT16U
+ copyListMember(write ? dest : (uint8_t *) &entry->Label, write ? (uint8_t *) &entry->Label : src, write, &entryOffset,
+ 32); // OCTET_STRING
+ copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset,
+ sizeof(entry->NodeId)); // NODE_ID
+ break;
+ }
+ }
+ break;
+ }
}
return entryLength;
@@ -243,6 +272,15 @@
break;
}
break;
+ case 0x003E: // Operational Credentials Cluster
+ switch (attributeId)
+ {
+ case 0x0001: // fabrics list
+ // Struct _FabricDescriptor
+ entryLength = 50;
+ break;
+ }
+ break;
}
uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength);
diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-type.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/attribute-type.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
index e770d20..0408ac4 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp
@@ -46,6 +46,7 @@
EmberAfStatus emberAfOtaSoftwareUpdateClientClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOtaSoftwareUpdateServerClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd);
+EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfThermostatClusterServerCommandParse(EmberAfClusterCommand * cmd);
@@ -147,6 +148,9 @@
case ZCL_ON_OFF_CLUSTER_ID:
result = emberAfOnOffClusterServerCommandParse(cmd);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ result = emberAfOperationalCredentialsClusterServerCommandParse(cmd);
+ break;
case ZCL_SCENES_CLUSTER_ID:
result = emberAfScenesClusterServerCommandParse(cmd);
break;
@@ -2280,6 +2284,66 @@
}
return status(wasHandled, true, cmd->mfgSpecific);
}
+EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClusterCommand * cmd)
+{
+ bool wasHandled = false;
+
+ if (!cmd->mfgSpecific)
+ {
+ switch (cmd->commandId)
+ {
+ case ZCL_GET_FABRIC_ID_COMMAND_ID: {
+ wasHandled = emberAfOperationalCredentialsClusterGetFabricIdCallback();
+ break;
+ }
+ case ZCL_REMOVE_FABRIC_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ chip::FabricId FabricId;
+ chip::NodeId NodeId;
+ uint16_t VendorId;
+
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast<uint16_t>(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ NodeId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+ payloadOffset = static_cast<uint16_t>(payloadOffset + 8);
+ if (cmd->bufLen < payloadOffset + 2)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ VendorId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(FabricId, NodeId, VendorId);
+ break;
+ }
+ case ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ uint8_t * Label;
+
+ if (cmd->bufLen < payloadOffset + 1u)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ Label = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(Label);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ break;
+ }
+ }
+ }
+ return status(wasHandled, true, cmd->mfgSpecific);
+}
EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
index 43b9839..251784b 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp
@@ -83,6 +83,9 @@
case ZCL_ON_OFF_CLUSTER_ID:
emberAfOnOffClusterInitCallback(endpoint);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ emberAfOperationalCredentialsClusterInitCallback(endpoint);
+ break;
case ZCL_SCENES_CLUSTER_ID:
emberAfScenesClusterInitCallback(endpoint);
break;
@@ -188,6 +191,11 @@
// To prevent warning
(void) endpoint;
}
+void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint)
+{
+ // To prevent warning
+ (void) endpoint;
+}
void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h
index 7f40d32..06fe431 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/callback.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h
@@ -183,6 +183,14 @@
*/
void emberAfOnOffClusterInitCallback(chip::EndpointId endpoint);
+/** @brief Operational Credentials Cluster Init
+ *
+ * Cluster Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterInitCallback(chip::EndpointId endpoint);
+
/** @brief Scenes Cluster Init
*
* Cluster Init
@@ -1473,6 +1481,77 @@
void emberAfOnOffClusterServerTickCallback(chip::EndpointId endpoint);
//
+// Operational Credentials Cluster server
+//
+
+/** @brief Operational Credentials Cluster Server Init
+ *
+ * Server Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterServerInitCallback(chip::EndpointId endpoint);
+
+/** @brief Operational Credentials Cluster Server Attribute Changed
+ *
+ * Server Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ */
+void emberAfOperationalCredentialsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
+
+/** @brief Operational Credentials Cluster Server Manufacturer Specific Attribute Changed
+ *
+ * Server Manufacturer Specific Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ * @param manufacturerCode Manufacturer Code of the attribute that changed
+ */
+void emberAfOperationalCredentialsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ uint16_t manufacturerCode);
+
+/** @brief Operational Credentials Cluster Server Message Sent
+ *
+ * Server Message Sent
+ *
+ * @param type The type of message sent
+ * @param indexOrDestination The destination or address to which the message was sent
+ * @param apsFrame The APS frame for the message
+ * @param msgLen The length of the message
+ * @param message The message that was sent
+ * @param status The status of the sent message
+ */
+void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
+ EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
+ EmberStatus status);
+
+/** @brief Operational Credentials Cluster Server Pre Attribute Changed
+ *
+ * server Pre Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+EmberAfStatus emberAfOperationalCredentialsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ EmberAfAttributeType attributeType,
+ uint8_t size, uint8_t * value);
+
+/** @brief Operational Credentials Cluster Server Tick
+ *
+ * server Tick
+ *
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfOperationalCredentialsClusterServerTickCallback(chip::EndpointId endpoint);
+
+//
// Scenes Cluster server
//
@@ -2381,6 +2460,28 @@
bool emberAfOnOffClusterToggleCallback();
/**
+ * @brief Operational Credentials Cluster GetFabricId Command callback
+ */
+
+bool emberAfOperationalCredentialsClusterGetFabricIdCallback();
+
+/**
+ * @brief Operational Credentials Cluster RemoveFabric Command callback
+ * @param fabricId
+ * @param nodeId
+ * @param vendorId
+ */
+
+bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::FabricId FabricId, chip::NodeId NodeId, uint16_t VendorId);
+
+/**
+ * @brief Operational Credentials Cluster UpdateFabricLabel Command callback
+ * @param label
+ */
+
+bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(uint8_t * Label);
+
+/**
* @brief Scenes Cluster AddScene Command callback
* @param groupId
* @param sceneId
diff --git a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/all-clusters-app/all-clusters-common/gen/command-id.h b/examples/all-clusters-app/all-clusters-common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/command-id.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
index ec94fca..3fdceb7 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h
@@ -126,7 +126,7 @@
/* 1268 - Default for cluster: "General Commissioning", attribute: "Breadcrumb". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1276 - Default for cluster: "Group Key Management", attribute: "groups". side: server, big-endian */ \
+ /* 1276 - Default for cluster: "Operational Credentials", attribute: "fabrics list". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -142,7 +142,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1530 - Default for cluster: "Group Key Management", attribute: "group keys". side: server, big-endian */ \
+ /* 1530 - Default for cluster: "Group Key Management", attribute: "groups". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -158,7 +158,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1784 - Default for cluster: "Descriptor", attribute: "device list". side: server, big-endian */ \
+ /* 1784 - Default for cluster: "Group Key Management", attribute: "group keys". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -174,7 +174,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2038 - Default for cluster: "Descriptor", attribute: "server list". side: server, big-endian */ \
+ /* 2038 - Default for cluster: "Descriptor", attribute: "device list". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -190,7 +190,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2292 - Default for cluster: "Descriptor", attribute: "client list". side: server, big-endian */ \
+ /* 2292 - Default for cluster: "Descriptor", attribute: "server list". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -206,7 +206,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2546 - Default for cluster: "Descriptor", attribute: "parts list". side: server, big-endian */ \
+ /* 2546 - Default for cluster: "Descriptor", attribute: "client list". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -222,7 +222,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2800 - Default for cluster: "Color Control", attribute: "compensation text". side: server, big-endian */ \
+ /* 2800 - Default for cluster: "Descriptor", attribute: "parts list". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -238,18 +238,34 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3054 - Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, big-endian */ \
+ /* 3054 - Default for cluster: "Color Control", attribute: "compensation text". side: server, big-endian */ \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ \
+ /* 3308 - Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3062 - Default for cluster: "Application Basic", attribute: "vendor name". side: server, big-endian */ \
+ /* 3316 - Default for cluster: "Application Basic", attribute: "vendor name". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3094 - Default for cluster: "Application Basic", attribute: "application name". side: server, big-endian */ \
+ /* 3348 - Default for cluster: "Application Basic", attribute: "application name". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3126 - Default for cluster: "Application Basic", attribute: "application id". side: server, big-endian */ \
+ /* 3380 - Default for cluster: "Application Basic", attribute: "application id". side: server, big-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
}
@@ -357,7 +373,7 @@
/* 1268 - Default for cluster: "General Commissioning", attribute: "Breadcrumb". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1276 - Default for cluster: "Group Key Management", attribute: "groups". side: server, little-endian */ \
+ /* 1276 - Default for cluster: "Operational Credentials", attribute: "fabrics list". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -373,7 +389,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1530 - Default for cluster: "Group Key Management", attribute: "group keys". side: server, little-endian */ \
+ /* 1530 - Default for cluster: "Group Key Management", attribute: "groups". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -389,7 +405,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 1784 - Default for cluster: "Descriptor", attribute: "device list". side: server, little-endian */ \
+ /* 1784 - Default for cluster: "Group Key Management", attribute: "group keys". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -405,7 +421,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2038 - Default for cluster: "Descriptor", attribute: "server list". side: server, little-endian */ \
+ /* 2038 - Default for cluster: "Descriptor", attribute: "device list". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -421,7 +437,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2292 - Default for cluster: "Descriptor", attribute: "client list". side: server, little-endian */ \
+ /* 2292 - Default for cluster: "Descriptor", attribute: "server list". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -437,7 +453,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2546 - Default for cluster: "Descriptor", attribute: "parts list". side: server, little-endian */ \
+ /* 2546 - Default for cluster: "Descriptor", attribute: "client list". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -453,7 +469,7 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 2800 - Default for cluster: "Color Control", attribute: "compensation text". side: server, little-endian */ \
+ /* 2800 - Default for cluster: "Descriptor", attribute: "parts list". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
@@ -469,25 +485,41 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3054 - Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, little-endian */ \
+ /* 3054 - Default for cluster: "Color Control", attribute: "compensation text". side: server, little-endian */ \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
+ \
+ /* 3308 - Default for cluster: "IAS Zone", attribute: "IAS CIE address". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3062 - Default for cluster: "Application Basic", attribute: "vendor name". side: server, little-endian */ \
+ /* 3316 - Default for cluster: "Application Basic", attribute: "vendor name". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3094 - Default for cluster: "Application Basic", attribute: "application name". side: server, little-endian */ \
+ /* 3348 - Default for cluster: "Application Basic", attribute: "application name". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
\
- /* 3126 - Default for cluster: "Application Basic", attribute: "application id". side: server, little-endian */ \
+ /* 3380 - Default for cluster: "Application Basic", attribute: "application id". side: server, little-endian */ \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
}
#endif // BIGENDIAN_CPU
-#define GENERATED_DEFAULTS_COUNT (24)
+#define GENERATED_DEFAULTS_COUNT (25)
#define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
#define ZAP_LONG_DEFAULTS_INDEX(index) \
@@ -515,14 +547,14 @@
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
-#define GENERATED_ATTRIBUTE_COUNT 133
+#define GENERATED_ATTRIBUTE_COUNT 135
#define GENERATED_ATTRIBUTES \
{ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Descriptor (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(0) }, /* Descriptor (server): device list */ \
+ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(0) }, /* Descriptor (server): device list */ \
{ 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(254) }, /* Descriptor (server): server list */ \
{ 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(508) }, /* Descriptor (server): client list */ \
{ 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(762) }, /* Descriptor (server): parts list */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Descriptor (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \
ZAP_SIMPLE_DEFAULT(3) }, /* Basic (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), \
@@ -544,18 +576,22 @@
{ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \
ZAP_LONG_DEFAULTS_INDEX(1192) }, /* Basic (server): SoftwareVersion */ \
{ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), \
- ZAP_LONG_DEFAULTS_INDEX(1196) }, /* Basic (server): SoftwareVersionString */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* General Commissioning (server): cluster revision */ \
+ ZAP_LONG_DEFAULTS_INDEX(1196) }, /* Basic (server): SoftwareVersionString */ \
{ 0x0000, ZAP_TYPE(OCTET_STRING), 8, 0, \
ZAP_LONG_DEFAULTS_INDEX(1260) }, /* General Commissioning (server): FabricId */ \
{ 0x0001, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \
ZAP_LONG_DEFAULTS_INDEX(1268) }, /* General Commissioning (server): Breadcrumb */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* General Commissioning (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Network Commissioning (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Binding (server): cluster revision */ \
+ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, \
+ ZAP_LONG_DEFAULTS_INDEX(1276) }, /* Operational Credentials (server): fabrics list */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, \
+ ZAP_SIMPLE_DEFAULT(0x0001) }, /* Operational Credentials (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Binding (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* Group Key Management (server): groups */ \
+ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1784) }, /* Group Key Management (server): group keys */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Group Key Management (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1276) }, /* Group Key Management (server): groups */ \
- { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1530) }, /* Group Key Management (server): group keys */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* Identify (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* Identify (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \
ZAP_SIMPLE_DEFAULT(0x0000) }, /* Identify (server): identify time */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Groups (server): cluster revision */ \
@@ -570,11 +606,11 @@
{ 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* On/off (server): on/off */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Level Control (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Level Control (server): current level */ \
+ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2038) }, /* Descriptor (server): device list */ \
+ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2292) }, /* Descriptor (server): server list */ \
+ { 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2546) }, /* Descriptor (server): client list */ \
+ { 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2800) }, /* Descriptor (server): parts list */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Descriptor (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1784) }, /* Descriptor (server): device list */ \
- { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2038) }, /* Descriptor (server): server list */ \
- { 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2292) }, /* Descriptor (server): client list */ \
- { 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2546) }, /* Descriptor (server): parts list */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, \
ZAP_SIMPLE_DEFAULT(0x0001) }, /* OTA Software Update Server (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, \
@@ -606,7 +642,7 @@
{ 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* Color Control (server): current y */ \
{ 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Color Control (server): drift compensation */ \
{ 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, \
- ZAP_LONG_DEFAULTS_INDEX(2800) }, /* Color Control (server): compensation text */ \
+ ZAP_LONG_DEFAULTS_INDEX(3054) }, /* Color Control (server): compensation text */ \
{ 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* Color Control (server): color temperature */ \
{ 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Color Control (server): color mode */ \
{ 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), \
@@ -675,17 +711,17 @@
{ 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* IAS Zone (server): zone type */ \
{ 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* IAS Zone (server): zone status */ \
{ 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \
- ZAP_LONG_DEFAULTS_INDEX(3054) }, /* IAS Zone (server): IAS CIE address */ \
- { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* IAS Zone (server): Zone ID */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3062) }, /* Application Basic (server): vendor name */ \
+ ZAP_LONG_DEFAULTS_INDEX(3308) }, /* IAS Zone (server): IAS CIE address */ \
+ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* IAS Zone (server): Zone ID */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3316) }, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): vendor id */ \
{ 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(3094) }, /* Application Basic (server): application name */ \
- { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ ZAP_LONG_DEFAULTS_INDEX(3348) }, /* Application Basic (server): application name */ \
+ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(3126) }, /* Application Basic (server): application id */ \
+ ZAP_LONG_DEFAULTS_INDEX(3380) }, /* Application Basic (server): application id */ \
{ 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
{ 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* On/off (server): cluster revision */ \
@@ -729,7 +765,7 @@
};
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
-#define GENERATED_CLUSTER_COUNT 23
+#define GENERATED_CLUSTER_COUNT 24
#define GENERATED_CLUSTERS \
{ \
{ \
@@ -748,86 +784,89 @@
0x0031, ZAP_ATTRIBUTE_INDEX(20), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \
{ \
- 0xF000, ZAP_ATTRIBUTE_INDEX(21), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x003E, ZAP_ATTRIBUTE_INDEX(21), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \
+ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \
+ { \
+ 0xF000, ZAP_ATTRIBUTE_INDEX(23), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 0, Cluster: Binding (server) */ \
{ \
- 0xF004, ZAP_ATTRIBUTE_INDEX(22), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0xF004, ZAP_ATTRIBUTE_INDEX(24), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 0, Cluster: Group Key Management (server) */ \
{ 0x0003, \
- ZAP_ATTRIBUTE_INDEX(25), \
+ ZAP_ATTRIBUTE_INDEX(27), \
2, \
4, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \
chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \
{ 0x0004, \
- ZAP_ATTRIBUTE_INDEX(27), \
+ ZAP_ATTRIBUTE_INDEX(29), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \
{ 0x0005, \
- ZAP_ATTRIBUTE_INDEX(29), \
+ ZAP_ATTRIBUTE_INDEX(31), \
6, \
8, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(35), \
+ ZAP_ATTRIBUTE_INDEX(37), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/off (server) */ \
{ 0x0008, \
- ZAP_ATTRIBUTE_INDEX(37), \
+ ZAP_ATTRIBUTE_INDEX(39), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \
{ \
- 0x001D, ZAP_ATTRIBUTE_INDEX(39), 5, 1018, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x001D, ZAP_ATTRIBUTE_INDEX(41), 5, 1018, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Descriptor (server) */ \
{ \
- 0x0029, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0029, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: OTA Software Update Server (server) */ \
{ \
- 0x002A, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x002A, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: OTA Software Update Client (server) */ \
{ 0x0101, \
- ZAP_ATTRIBUTE_INDEX(46), \
+ ZAP_ATTRIBUTE_INDEX(48), \
4, \
5, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \
chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \
{ \
- 0x0103, ZAP_ATTRIBUTE_INDEX(50), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0103, ZAP_ATTRIBUTE_INDEX(52), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Barrier Control (server) */ \
{ \
- 0x0201, ZAP_ATTRIBUTE_INDEX(55), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0201, ZAP_ATTRIBUTE_INDEX(57), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Thermostat (server) */ \
{ 0x0300, \
- ZAP_ATTRIBUTE_INDEX(61), \
+ ZAP_ATTRIBUTE_INDEX(63), \
51, \
336, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \
{ \
- 0x0402, ZAP_ATTRIBUTE_INDEX(112), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0402, ZAP_ATTRIBUTE_INDEX(114), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \
{ 0x0500, \
- ZAP_ATTRIBUTE_INDEX(116), \
+ ZAP_ATTRIBUTE_INDEX(118), \
6, \
16, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \
ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \
chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \
{ \
- 0x0508, ZAP_ATTRIBUTE_INDEX(122), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x0508, ZAP_ATTRIBUTE_INDEX(124), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Low Power (server) */ \
{ \
- 0x050D, ZAP_ATTRIBUTE_INDEX(123), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
+ 0x050D, ZAP_ATTRIBUTE_INDEX(125), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \
}, /* Endpoint: 1, Cluster: Application Basic (server) */ \
{ 0x0006, \
- ZAP_ATTRIBUTE_INDEX(131), \
+ ZAP_ATTRIBUTE_INDEX(133), \
2, \
3, \
ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
@@ -839,7 +878,7 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
- { ZAP_CLUSTER_INDEX(0), 6, 1804 }, { ZAP_CLUSTER_INDEX(6), 16, 1532 }, { ZAP_CLUSTER_INDEX(22), 1, 3 }, \
+ { ZAP_CLUSTER_INDEX(0), 7, 2060 }, { ZAP_CLUSTER_INDEX(7), 16, 1532 }, { ZAP_CLUSTER_INDEX(23), 1, 3 }, \
}
// Largest attribute size is needed for various buffers
@@ -849,7 +888,7 @@
#define ATTRIBUTE_SINGLETONS_SIZE (254)
// Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (3339)
+#define ATTRIBUTE_MAX_SIZE (3595)
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (3)
@@ -893,7 +932,7 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (127)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (131)
#define GENERATED_COMMANDS \
{ \
{ 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (server): Identify */ \
@@ -973,6 +1012,10 @@
{ 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): DisableNetworkResponse */ \
{ 0x0031, 0x10, \
ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): GetLastNetworkCommissioningResult */ \
+ { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (server): GetFabricId */ \
+ { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Operational Credentials (server): GetFabricIdResponse */ \
+ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (server): UpdateFabricLabel */ \
+ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (server): RemoveFabric */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (server): LockDoor */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Door Lock (server): LockDoorResponse */ \
{ 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (server): UnlockDoor */ \
diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
index dcc7a1b..714ee1b 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h
@@ -47,6 +47,7 @@
#define EMBER_AF_OTA_CLIENT_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_OTA_SERVER_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2)
+#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_SERVER_ENDPOINT_COUNT (1)
#define EMBER_AF_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1)
@@ -153,6 +154,11 @@
#define EMBER_AF_PLUGIN_ON_OFF_SERVER
#define EMBER_AF_PLUGIN_ON_OFF
+// 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
+#define EMBER_AF_PLUGIN_OPERATIONAL_CREDENTIALS
+
// Use this macro to check if the server side of the Scenes cluster is included
#define ZCL_USING_SCENES_CLUSTER_SERVER
#define EMBER_AF_PLUGIN_SCENES_SERVER
diff --git a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
+++ b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt
index 8288c00..0fd8b5b 100644
--- a/examples/all-clusters-app/esp32/main/CMakeLists.txt
+++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt
@@ -40,6 +40,7 @@
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/content-launch-server"
+ "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-playback-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-server"
diff --git a/examples/all-clusters-app/esp32/main/component.mk b/examples/all-clusters-app/esp32/main/component.mk
index ce2a427..db198b6 100644
--- a/examples/all-clusters-app/esp32/main/component.mk
+++ b/examples/all-clusters-app/esp32/main/component.mk
@@ -42,6 +42,7 @@
../third_party/connectedhomeip/src/app/clusters/low-power-server \
../third_party/connectedhomeip/src/app/clusters/keypad-input-server \
../third_party/connectedhomeip/src/app/clusters/media-playback-server \
+ ../third_party/connectedhomeip/src/app/clusters/operational-credentials \
../third_party/connectedhomeip/src/app/clusters/media-input-server \
../third_party/connectedhomeip/src/app/clusters/network-commissioning \
../third_party/connectedhomeip/src/app/clusters/ota-server \
diff --git a/examples/bridge-app/bridge-common/gen/af-structs.h b/examples/bridge-app/bridge-common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/bridge-app/bridge-common/gen/af-structs.h
+++ b/examples/bridge-app/bridge-common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/bridge-app/bridge-common/gen/attribute-id.h b/examples/bridge-app/bridge-common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/bridge-app/bridge-common/gen/attribute-id.h
+++ b/examples/bridge-app/bridge-common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/bridge-app/bridge-common/gen/attribute-size.h b/examples/bridge-app/bridge-common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/bridge-app/bridge-common/gen/attribute-size.h
+++ b/examples/bridge-app/bridge-common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/bridge-app/bridge-common/gen/attribute-type.h b/examples/bridge-app/bridge-common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/bridge-app/bridge-common/gen/attribute-type.h
+++ b/examples/bridge-app/bridge-common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/bridge-app/bridge-common/gen/client-command-macro.h b/examples/bridge-app/bridge-common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/bridge-app/bridge-common/gen/client-command-macro.h
+++ b/examples/bridge-app/bridge-common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/bridge-app/bridge-common/gen/cluster-id.h b/examples/bridge-app/bridge-common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/bridge-app/bridge-common/gen/cluster-id.h
+++ b/examples/bridge-app/bridge-common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/bridge-app/bridge-common/gen/command-id.h b/examples/bridge-app/bridge-common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/bridge-app/bridge-common/gen/command-id.h
+++ b/examples/bridge-app/bridge-common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/bridge-app/bridge-common/gen/print-cluster.h b/examples/bridge-app/bridge-common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/bridge-app/bridge-common/gen/print-cluster.h
+++ b/examples/bridge-app/bridge-common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/chip-tool/chip-tool.zap b/examples/chip-tool/chip-tool.zap
index d105a93..6ef9cf4 100644
--- a/examples/chip-tool/chip-tool.zap
+++ b/examples/chip-tool/chip-tool.zap
@@ -86,6 +86,16 @@
"define": "IDENTIFY_CLUSTER",
"side": "server",
"enabled": 0,
+ "commands": [
+ {
+ "name": "IdentifyQueryResponse",
+ "code": 0,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
"attributes": [
{
"name": "identify time",
@@ -117,16 +127,6 @@
"maxInterval": 65344,
"reportableChange": 0
}
- ],
- "commands": [
- {
- "name": "IdentifyQueryResponse",
- "code": 0,
- "mfgCode": null,
- "source": "server",
- "incoming": 1,
- "outgoing": 1
- }
]
},
{
@@ -1511,6 +1511,107 @@
]
},
{
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "client",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "GetFabricId",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "GetFabricIdResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "fabrics list",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
"name": "Door Lock",
"code": 257,
"mfgCode": null,
@@ -4274,4 +4375,4 @@
}
],
"log": []
-}
+}
\ No newline at end of file
diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h
index bd7e5e3..fb0d0ea 100644
--- a/examples/chip-tool/commands/clusters/Commands.h
+++ b/examples/chip-tool/commands/clusters/Commands.h
@@ -423,6 +423,14 @@
command->SetCommandExitStatus(true);
}
+static void OnOperationalCredentialsClusterGetFabricIdResponse(void * context, chip::FabricId FabricId)
+{
+ ChipLogProgress(chipTool, "OperationalCredentialsClusterGetFabricIdResponse");
+
+ ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
+ command->SetCommandExitStatus(true);
+}
+
static void OnScenesClusterAddSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
ChipLogProgress(chipTool, "ScenesClusterAddSceneResponse");
@@ -562,6 +570,23 @@
command->SetCommandExitStatus(true);
}
+static void OnOperationalCredentialsFabricsListListAttributeResponse(void * context, uint16_t count, _FabricDescriptor * entries)
+{
+ ChipLogProgress(chipTool, "OnOperationalCredentialsFabricsListListAttributeResponse: %lu entries", count);
+
+ for (uint16_t i = 0; i < count; i++)
+ {
+ ChipLogProgress(chipTool, "FabricDescriptor[%lu]:", i);
+ ChipLogProgress(chipTool, " FabricId: %" PRIu64 "", entries[i].FabricId);
+ ChipLogProgress(chipTool, " VendorId: %" PRIu16 "", entries[i].VendorId);
+ ChipLogProgress(chipTool, " Label: %s", entries[i].Label);
+ ChipLogProgress(chipTool, " NodeId: %" PRIu64 "", entries[i].NodeId);
+ }
+
+ ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
+ command->SetCommandExitStatus(true);
+}
+
/*----------------------------------------------------------------------------*\
| Cluster Name | ID |
|---------------------------------------------------------------------+--------|
@@ -580,6 +605,7 @@
| LowPower | 0x0508 |
| NetworkCommissioning | 0x0031 |
| OnOff | 0x0006 |
+| OperationalCredentials | 0x003E |
| Scenes | 0x0005 |
| TemperatureMeasurement | 0x0402 |
| Thermostat | 0x0201 |
@@ -600,6 +626,7 @@
constexpr chip::ClusterId kLowPowerClusterId = 0x0508;
constexpr chip::ClusterId kNetworkCommissioningClusterId = 0x0031;
constexpr chip::ClusterId kOnOffClusterId = 0x0006;
+constexpr chip::ClusterId kOperationalCredentialsClusterId = 0x003E;
constexpr chip::ClusterId kScenesClusterId = 0x0005;
constexpr chip::ClusterId kTemperatureMeasurementClusterId = 0x0402;
constexpr chip::ClusterId kThermostatClusterId = 0x0201;
@@ -8777,6 +8804,221 @@
};
/*----------------------------------------------------------------------------*\
+| Cluster OperationalCredentials | 0x003E |
+|------------------------------------------------------------------------------|
+| Commands: | |
+| * GetFabricId | 0x00 |
+| * RemoveFabric | 0x0A |
+| * UpdateFabricLabel | 0x09 |
+|------------------------------------------------------------------------------|
+| Attributes: | |
+| * FabricsList | 0x0001 |
+| * ClusterRevision | 0xFFFD |
+\*----------------------------------------------------------------------------*/
+
+/*
+ * Command GetFabricId
+ */
+class OperationalCredentialsGetFabricId : public ModelCommand
+{
+public:
+ OperationalCredentialsGetFabricId() : ModelCommand("get-fabric-id") { ModelCommand::AddArguments(); }
+ ~OperationalCredentialsGetFabricId()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.GetFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback> * onSuccessCallback =
+ new chip::Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback>(
+ OnOperationalCredentialsClusterGetFabricIdResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Command RemoveFabric
+ */
+class OperationalCredentialsRemoveFabric : public ModelCommand
+{
+public:
+ OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric")
+ {
+ AddArgument("fabricId", 0, UINT64_MAX, &mFabricId);
+ AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
+ AddArgument("vendorId", 0, UINT16_MAX, &mVendorId);
+ ModelCommand::AddArguments();
+ }
+ ~OperationalCredentialsRemoveFabric()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0A) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.RemoveFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mFabricId, mNodeId, mVendorId);
+ }
+
+private:
+ chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
+ new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+ chip::FabricId mFabricId;
+ chip::NodeId mNodeId;
+ uint16_t mVendorId;
+};
+
+/*
+ * Command UpdateFabricLabel
+ */
+class OperationalCredentialsUpdateFabricLabel : public ModelCommand
+{
+public:
+ OperationalCredentialsUpdateFabricLabel() : ModelCommand("update-fabric-label")
+ {
+ AddArgument("label", &mLabel);
+ ModelCommand::AddArguments();
+ }
+ ~OperationalCredentialsUpdateFabricLabel()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x09) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.UpdateFabricLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
+ chip::ByteSpan(chip::Uint8::from_char(mLabel), strlen(mLabel)));
+ }
+
+private:
+ chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
+ new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+ char * mLabel;
+};
+
+/*
+ * Discover Attributes
+ */
+class DiscoverOperationalCredentialsAttributes : public ModelCommand
+{
+public:
+ DiscoverOperationalCredentialsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }
+
+ ~DiscoverOperationalCredentialsAttributes()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
+ new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute FabricsList
+ */
+class ReadOperationalCredentialsFabricsList : public ModelCommand
+{
+public:
+ ReadOperationalCredentialsFabricsList() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "fabrics-list");
+ ModelCommand::AddArguments();
+ }
+
+ ~ReadOperationalCredentialsFabricsList()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeFabricsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>(
+ OnOperationalCredentialsFabricsListListAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*
+ * Attribute ClusterRevision
+ */
+class ReadOperationalCredentialsClusterRevision : public ModelCommand
+{
+public:
+ ReadOperationalCredentialsClusterRevision() : ModelCommand("read")
+ {
+ AddArgument("attr-name", "cluster-revision");
+ ModelCommand::AddArguments();
+ }
+
+ ~ReadOperationalCredentialsClusterRevision()
+ {
+ delete onSuccessCallback;
+ delete onFailureCallback;
+ }
+
+ CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
+ {
+ ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);
+
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, endpointId);
+ return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
+ }
+
+private:
+ chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
+ new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
+ chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
+ new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
+};
+
+/*----------------------------------------------------------------------------*\
| Cluster Scenes | 0x0005 |
|------------------------------------------------------------------------------|
| Commands: | |
@@ -10467,6 +10709,18 @@
commands.Register(clusterName, clusterCommands);
}
+void registerClusterOperationalCredentials(Commands & commands)
+{
+ const char * clusterName = "OperationalCredentials";
+
+ commands_list clusterCommands = {
+ make_unique<OperationalCredentialsGetFabricId>(), make_unique<OperationalCredentialsRemoveFabric>(),
+ make_unique<OperationalCredentialsUpdateFabricLabel>(), make_unique<DiscoverOperationalCredentialsAttributes>(),
+ make_unique<ReadOperationalCredentialsFabricsList>(), make_unique<ReadOperationalCredentialsClusterRevision>(),
+ };
+
+ commands.Register(clusterName, clusterCommands);
+}
void registerClusterScenes(Commands & commands)
{
const char * clusterName = "Scenes";
@@ -10537,6 +10791,7 @@
registerClusterLowPower(commands);
registerClusterNetworkCommissioning(commands);
registerClusterOnOff(commands);
+ registerClusterOperationalCredentials(commands);
registerClusterScenes(commands);
registerClusterTemperatureMeasurement(commands);
registerClusterThermostat(commands);
diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.cpp b/examples/chip-tool/gen/CHIPClientCallbacks.cpp
index beea3a3..434c58a 100644
--- a/examples/chip-tool/gen/CHIPClientCallbacks.cpp
+++ b/examples/chip-tool/gen/CHIPClientCallbacks.cpp
@@ -475,6 +475,36 @@
}
}
break;
+ case 0x003E:
+ switch (attributeId)
+ {
+ case 0x0001: // FabricDescriptor
+ {
+ _FabricDescriptor data[count];
+ for (size_t i = 0; i < count; i++)
+ {
+ data[i].FabricId = emberAfGetInt64u(message, 0, messageLen);
+ message += 8;
+ CHECK_MESSAGE_LENGTH(8);
+ data[i].VendorId = emberAfGetInt16u(message, 0, messageLen);
+ message += 2;
+ CHECK_MESSAGE_LENGTH(2);
+ data[i].Label = emberAfGetString(message, 0, messageLen);
+ message += 32;
+ CHECK_MESSAGE_LENGTH(32);
+ data[i].NodeId = emberAfGetInt64u(message, 0, messageLen);
+ message += 8;
+ CHECK_MESSAGE_LENGTH(8);
+ }
+
+ Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> * cb =
+ Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>::FromCancelable(
+ onSuccessCallback);
+ cb->mCall(cb->mContext, count, data);
+ break;
+ }
+ }
+ break;
}
break;
}
@@ -1576,6 +1606,19 @@
return true;
}
+bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::FabricId FabricId)
+{
+ ChipLogProgress(Zcl, "GetFabricIdResponse:");
+ ChipLogProgress(Zcl, " FabricId: %" PRIu64 "", FabricId);
+
+ GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterGetFabricIdResponseCallback");
+
+ Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback> * cb =
+ Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback>::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, FabricId);
+ return true;
+}
+
bool emberAfScenesClusterAddSceneResponseCallback(uint8_t status, uint16_t groupId, uint8_t sceneId)
{
ChipLogProgress(Zcl, "AddSceneResponse:");
diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.h b/examples/chip-tool/gen/CHIPClientCallbacks.h
index e74b3eb..1e495f1 100644
--- a/examples/chip-tool/gen/CHIPClientCallbacks.h
+++ b/examples/chip-tool/gen/CHIPClientCallbacks.h
@@ -93,6 +93,7 @@
uint8_t * debugText);
typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode,
uint8_t * debugText);
+typedef void (*OperationalCredentialsClusterGetFabricIdResponseCallback)(void * context, chip::FabricId FabricId);
typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId);
typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t capacity, uint16_t groupId,
uint8_t sceneCount,
@@ -117,3 +118,4 @@
typedef void (*DescriptorPartsListListAttributeCallback)(void * context, uint16_t count, chip::EndpointId * entries);
typedef void (*GroupKeyManagementGroupsListAttributeCallback)(void * context, uint16_t count, _GroupState * entries);
typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)(void * context, uint16_t count, _GroupKey * entries);
+typedef void (*OperationalCredentialsFabricsListListAttributeCallback)(void * context, uint16_t count, _FabricDescriptor * entries);
diff --git a/examples/chip-tool/gen/CHIPClustersObjc.h b/examples/chip-tool/gen/CHIPClustersObjc.h
index 6f10c95..802bf64 100644
--- a/examples/chip-tool/gen/CHIPClustersObjc.h
+++ b/examples/chip-tool/gen/CHIPClustersObjc.h
@@ -577,6 +577,24 @@
@end
/**
+ * Cluster Operational Credentials
+ *
+ */
+@interface CHIPOperationalCredentials : CHIPCluster
+
+- (void)getFabricId:(ResponseHandler)completionHandler;
+- (void)removeFabric:(uint64_t)fabricId
+ nodeId:(uint64_t)nodeId
+ vendorId:(uint16_t)vendorId
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler;
+
+- (void)readAttributeFabricsList:(ResponseHandler)completionHandler;
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
+
+@end
+
+/**
* Cluster Scenes
*
*/
diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm
index 016afe7..c3f896b 100644
--- a/examples/chip-tool/gen/CHIPClustersObjc.mm
+++ b/examples/chip-tool/gen/CHIPClustersObjc.mm
@@ -1608,6 +1608,38 @@
dispatch_queue_t mQueue;
};
+class CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge
+ : public Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback> {
+public:
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
+ : Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback>(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ {
+ }
+
+ ~CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge() {};
+
+ static void CallbackFn(void * context, chip::FabricId FabricId)
+ {
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * callback
+ = reinterpret_cast<CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge *>(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ {
+ @"FabricId" : [NSNumber numberWithUnsignedLongLong:FabricId],
+ });
+ callback->Cancel();
+ delete callback;
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+};
+
class CHIPScenesClusterAddSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterAddSceneResponseCallback> {
public:
CHIPScenesClusterAddSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
@@ -2106,6 +2138,46 @@
dispatch_queue_t mQueue;
};
+class CHIPOperationalCredentialsFabricsListAttributeCallbackBridge
+ : public Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> {
+public:
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
+ : Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ {
+ }
+
+ ~CHIPOperationalCredentialsFabricsListAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entries)
+ {
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * callback
+ = reinterpret_cast<CHIPOperationalCredentialsFabricsListAttributeCallbackBridge *>(context);
+ if (callback && callback->mQueue) {
+ id values[count];
+ for (uint16_t i = 0; i < count; i++) {
+ values[i] =
+ [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId],
+ @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId",
+ [NSData dataWithBytes:entries[i].Label + 1u length:emberAfStringLength(entries[i].Label)],
+ @"Label", [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil];
+ }
+
+ id array = [NSArray arrayWithObjects:values count:count];
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : array });
+ callback->Cancel();
+ delete callback;
+ });
+ }
+ }
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+};
+
@interface CHIPCluster ()
@property (readonly, nonatomic) dispatch_queue_t callbackQueue;
- (Controller::ClusterBase *)getCluster;
@@ -7463,6 +7535,139 @@
@end
+@interface CHIPOperationalCredentials ()
+@property (readonly) Controller::OperationalCredentialsCluster cppCluster;
+@end
+
+@implementation CHIPOperationalCredentials
+
+- (Controller::ClusterBase *)getCluster
+{
+ return &_cppCluster;
+}
+
+- (void)getFabricId:(ResponseHandler)completionHandler
+{
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess
+ = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.GetFabricId(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)removeFabric:(uint64_t)fabricId
+ nodeId:(uint64_t)nodeId
+ vendorId:(uint16_t)vendorId
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateFabricLabel(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [label dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [label lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeFabricsList:(ResponseHandler)completionHandler
+{
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * onSuccess
+ = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeFabricsList(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+@end
+
@interface CHIPScenes ()
@property (readonly) Controller::ScenesCluster cppCluster;
@end
diff --git a/examples/chip-tool/gen/IMClusterCommandHandler.cpp b/examples/chip-tool/gen/IMClusterCommandHandler.cpp
index aea0bf9..d86b8b2 100644
--- a/examples/chip-tool/gen/IMClusterCommandHandler.cpp
+++ b/examples/chip-tool/gen/IMClusterCommandHandler.cpp
@@ -3527,6 +3527,94 @@
} // namespace NetworkCommissioning
+namespace OperationalCredentials {
+
+void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
+{
+ {
+ switch (aCommandId)
+ {
+ case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: {
+ // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV
+ // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error.
+ // Any error value TLVUnpackError means we have received an illegal value.
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR;
+ chip::FabricId FabricId;
+ bool FabricIdExists = false;
+ uint32_t validArgumentCount = 0;
+
+ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(aDataTlv.GetTag()))
+ {
+ case 0:
+ if (FabricIdExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ TLVUnpackError = aDataTlv.Get(FabricId);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ FabricIdExists = true;
+ validArgumentCount++;
+ }
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVUnpackError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError);
+ break;
+ }
+ }
+
+ if (CHIP_END_OF_TLV == TLVError)
+ {
+ // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error.
+ TLVError = CHIP_NO_ERROR;
+ }
+ else
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError);
+ }
+
+ // TODO(#5590) We should encode a response of status code for invalid TLV.
+ if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount)
+ {
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(FabricId);
+ }
+ else
+ {
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogProgress(
+ Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32,
+ 1, validArgumentCount, TLVError, TLVUnpackError);
+ }
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId,
+ ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ break;
+ }
+ }
+ }
+}
+
+} // namespace OperationalCredentials
+
namespace Scenes {
void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
diff --git a/examples/chip-tool/gen/af-structs.h b/examples/chip-tool/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/chip-tool/gen/af-structs.h
+++ b/examples/chip-tool/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/chip-tool/gen/attribute-id.h b/examples/chip-tool/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/chip-tool/gen/attribute-id.h
+++ b/examples/chip-tool/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/chip-tool/gen/attribute-size.h b/examples/chip-tool/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/chip-tool/gen/attribute-size.h
+++ b/examples/chip-tool/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/chip-tool/gen/attribute-type.h b/examples/chip-tool/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/chip-tool/gen/attribute-type.h
+++ b/examples/chip-tool/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/chip-tool/gen/call-command-handler.cpp b/examples/chip-tool/gen/call-command-handler.cpp
index 7acf422..10c0f2b 100644
--- a/examples/chip-tool/gen/call-command-handler.cpp
+++ b/examples/chip-tool/gen/call-command-handler.cpp
@@ -43,6 +43,7 @@
EmberAfStatus emberAfLowPowerClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfNetworkCommissioningClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOnOffClusterClientCommandParse(EmberAfClusterCommand * cmd);
+EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfThermostatClusterClientCommandParse(EmberAfClusterCommand * cmd);
@@ -131,6 +132,9 @@
// No commands are enabled for cluster On/off
result = status(false, true, cmd->mfgSpecific);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ result = emberAfOperationalCredentialsClusterClientCommandParse(cmd);
+ break;
case ZCL_SCENES_CLUSTER_ID:
result = emberAfScenesClusterClientCommandParse(cmd);
break;
@@ -1069,6 +1073,35 @@
}
return status(wasHandled, true, cmd->mfgSpecific);
}
+EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClusterCommand * cmd)
+{
+ bool wasHandled = false;
+
+ if (!cmd->mfgSpecific)
+ {
+ switch (cmd->commandId)
+ {
+ case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ chip::FabricId FabricId;
+
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(FabricId);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ break;
+ }
+ }
+ }
+ return status(wasHandled, true, cmd->mfgSpecific);
+}
EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
diff --git a/examples/chip-tool/gen/callback-stub.cpp b/examples/chip-tool/gen/callback-stub.cpp
index dc9c5c2..ef7969e 100644
--- a/examples/chip-tool/gen/callback-stub.cpp
+++ b/examples/chip-tool/gen/callback-stub.cpp
@@ -74,6 +74,9 @@
case ZCL_ON_OFF_CLUSTER_ID:
emberAfOnOffClusterInitCallback(endpoint);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ emberAfOperationalCredentialsClusterInitCallback(endpoint);
+ break;
case ZCL_SCENES_CLUSTER_ID:
emberAfScenesClusterInitCallback(endpoint);
break;
@@ -164,6 +167,11 @@
// To prevent warning
(void) endpoint;
}
+void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint)
+{
+ // To prevent warning
+ (void) endpoint;
+}
void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
diff --git a/examples/chip-tool/gen/callback.h b/examples/chip-tool/gen/callback.h
index e659ff4..ff58f5c 100644
--- a/examples/chip-tool/gen/callback.h
+++ b/examples/chip-tool/gen/callback.h
@@ -159,6 +159,14 @@
*/
void emberAfOnOffClusterInitCallback(chip::EndpointId endpoint);
+/** @brief Operational Credentials Cluster Init
+ *
+ * Cluster Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterInitCallback(chip::EndpointId endpoint);
+
/** @brief Scenes Cluster Init
*
* Cluster Init
@@ -1237,6 +1245,77 @@
void emberAfOnOffClusterClientTickCallback(chip::EndpointId endpoint);
//
+// Operational Credentials Cluster client
+//
+
+/** @brief Operational Credentials Cluster Client Init
+ *
+ * Client Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterClientInitCallback(chip::EndpointId endpoint);
+
+/** @brief Operational Credentials Cluster Client Attribute Changed
+ *
+ * Client Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ */
+void emberAfOperationalCredentialsClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
+
+/** @brief Operational Credentials Cluster Client Manufacturer Specific Attribute Changed
+ *
+ * Client Manufacturer Specific Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ * @param manufacturerCode Manufacturer Code of the attribute that changed
+ */
+void emberAfOperationalCredentialsClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ uint16_t manufacturerCode);
+
+/** @brief Operational Credentials Cluster Client Message Sent
+ *
+ * Client Message Sent
+ *
+ * @param type The type of message sent
+ * @param indexOrDestination The destination or address to which the message was sent
+ * @param apsFrame The APS frame for the message
+ * @param msgLen The length of the message
+ * @param message The message that was sent
+ * @param status The status of the sent message
+ */
+void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
+ EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
+ EmberStatus status);
+
+/** @brief Operational Credentials Cluster Client Pre Attribute Changed
+ *
+ * client Pre Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+EmberAfStatus emberAfOperationalCredentialsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ EmberAfAttributeType attributeType,
+ uint8_t size, uint8_t * value);
+
+/** @brief Operational Credentials Cluster Client Tick
+ *
+ * client Tick
+ *
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfOperationalCredentialsClusterClientTickCallback(chip::EndpointId endpoint);
+
+//
// Scenes Cluster client
//
@@ -1778,6 +1857,13 @@
bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(uint8_t errorCode, uint8_t * debugText);
/**
+ * @brief Operational Credentials Cluster GetFabricIdResponse Command callback
+ * @param fabricId
+ */
+
+bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::FabricId FabricId);
+
+/**
* @brief Scenes Cluster AddSceneResponse Command callback
* @param status
* @param groupId
diff --git a/examples/chip-tool/gen/client-command-macro.h b/examples/chip-tool/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/chip-tool/gen/client-command-macro.h
+++ b/examples/chip-tool/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/chip-tool/gen/cluster-id.h b/examples/chip-tool/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/chip-tool/gen/cluster-id.h
+++ b/examples/chip-tool/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/chip-tool/gen/command-id.h b/examples/chip-tool/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/chip-tool/gen/command-id.h
+++ b/examples/chip-tool/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/chip-tool/gen/endpoint_config.h b/examples/chip-tool/gen/endpoint_config.h
index 0e71838..a22cee7 100644
--- a/examples/chip-tool/gen/endpoint_config.h
+++ b/examples/chip-tool/gen/endpoint_config.h
@@ -63,7 +63,7 @@
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
-#define GENERATED_ATTRIBUTE_COUNT 18
+#define GENERATED_ATTRIBUTE_COUNT 19
#define GENERATED_ATTRIBUTES \
{ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
@@ -85,6 +85,8 @@
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(0x0001) }, /* Network Commissioning (client): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
+ ZAP_SIMPLE_DEFAULT(0x0001) }, /* Operational Credentials (client): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(3) }, /* Door Lock (client): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(0x0001) }, /* Barrier Control (client): cluster revision */ \
@@ -111,7 +113,7 @@
#define GENERATED_FUNCTION_ARRAYS
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
-#define GENERATED_CLUSTER_COUNT 18
+#define GENERATED_CLUSTER_COUNT 19
#define GENERATED_CLUSTERS \
{ \
{ 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \
@@ -132,31 +134,34 @@
0x0031, ZAP_ATTRIBUTE_INDEX(8), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Network Commissioning (client) */ \
{ \
- 0x0101, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x003E, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ }, /* Endpoint: 1, Cluster: Operational Credentials (client) */ \
+ { \
+ 0x0101, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Door Lock (client) */ \
{ \
- 0x0103, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0103, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Barrier Control (client) */ \
{ \
- 0x0201, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0201, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Thermostat (client) */ \
{ \
- 0x0300, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0300, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Color Control (client) */ \
{ \
- 0x0402, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0402, ZAP_ATTRIBUTE_INDEX(14), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \
{ \
- 0x0508, ZAP_ATTRIBUTE_INDEX(14), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0508, ZAP_ATTRIBUTE_INDEX(15), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Low Power (client) */ \
{ \
- 0x050D, ZAP_ATTRIBUTE_INDEX(15), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x050D, ZAP_ATTRIBUTE_INDEX(16), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Application Basic (client) */ \
{ \
- 0xF000, ZAP_ATTRIBUTE_INDEX(16), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0xF000, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Binding (client) */ \
{ \
- 0xF004, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0xF004, ZAP_ATTRIBUTE_INDEX(18), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Group Key Management (client) */ \
}
@@ -165,7 +170,7 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
- { ZAP_CLUSTER_INDEX(0), 18, 36 }, \
+ { ZAP_CLUSTER_INDEX(0), 19, 38 }, \
}
// Largest attribute size is needed for various buffers
@@ -175,7 +180,7 @@
#define ATTRIBUTE_SINGLETONS_SIZE (2)
// Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (36)
+#define ATTRIBUTE_MAX_SIZE (38)
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (1)
@@ -219,7 +224,7 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (138)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (142)
#define GENERATED_COMMANDS \
{ \
{ 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (client): Identify */ \
@@ -288,6 +293,10 @@
{ 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (client): DisableNetworkResponse */ \
{ 0x0031, 0x10, \
ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (client): GetLastNetworkCommissioningResult */ \
+ { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): GetFabricId */ \
+ { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Operational Credentials (client): GetFabricIdResponse */ \
+ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): UpdateFabricLabel */ \
+ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): RemoveFabric */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (client): LockDoor */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Door Lock (client): LockDoorResponse */ \
{ 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (client): UnlockDoor */ \
diff --git a/examples/chip-tool/gen/gen_config.h b/examples/chip-tool/gen/gen_config.h
index 6dad30e..55be45d 100644
--- a/examples/chip-tool/gen/gen_config.h
+++ b/examples/chip-tool/gen/gen_config.h
@@ -44,6 +44,7 @@
#define EMBER_AF_LOW_POWER_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
+#define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_SCENES_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
@@ -110,6 +111,10 @@
#define ZCL_USING_ON_OFF_CLUSTER_CLIENT
#define EMBER_AF_PLUGIN_ON_OFF_CLIENT
+// 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 client side of the Scenes cluster is included
#define ZCL_USING_SCENES_CLUSTER_CLIENT
#define EMBER_AF_PLUGIN_SCENES_CLIENT
diff --git a/examples/chip-tool/gen/print-cluster.h b/examples/chip-tool/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/chip-tool/gen/print-cluster.h
+++ b/examples/chip-tool/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/lighting-app/lighting-common/gen/af-structs.h b/examples/lighting-app/lighting-common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/lighting-app/lighting-common/gen/af-structs.h
+++ b/examples/lighting-app/lighting-common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/lighting-app/lighting-common/gen/attribute-id.h b/examples/lighting-app/lighting-common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/lighting-app/lighting-common/gen/attribute-id.h
+++ b/examples/lighting-app/lighting-common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/lighting-app/lighting-common/gen/attribute-size.h b/examples/lighting-app/lighting-common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/lighting-app/lighting-common/gen/attribute-size.h
+++ b/examples/lighting-app/lighting-common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/lighting-app/lighting-common/gen/attribute-type.h b/examples/lighting-app/lighting-common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/lighting-app/lighting-common/gen/attribute-type.h
+++ b/examples/lighting-app/lighting-common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/lighting-app/lighting-common/gen/client-command-macro.h b/examples/lighting-app/lighting-common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/lighting-app/lighting-common/gen/client-command-macro.h
+++ b/examples/lighting-app/lighting-common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/lighting-app/lighting-common/gen/cluster-id.h b/examples/lighting-app/lighting-common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/lighting-app/lighting-common/gen/cluster-id.h
+++ b/examples/lighting-app/lighting-common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/lighting-app/lighting-common/gen/command-id.h b/examples/lighting-app/lighting-common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/lighting-app/lighting-common/gen/command-id.h
+++ b/examples/lighting-app/lighting-common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/lighting-app/lighting-common/gen/print-cluster.h b/examples/lighting-app/lighting-common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/lighting-app/lighting-common/gen/print-cluster.h
+++ b/examples/lighting-app/lighting-common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/lock-app/lock-common/gen/af-structs.h b/examples/lock-app/lock-common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/lock-app/lock-common/gen/af-structs.h
+++ b/examples/lock-app/lock-common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/lock-app/lock-common/gen/attribute-id.h b/examples/lock-app/lock-common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/lock-app/lock-common/gen/attribute-id.h
+++ b/examples/lock-app/lock-common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/lock-app/lock-common/gen/attribute-size.h b/examples/lock-app/lock-common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/lock-app/lock-common/gen/attribute-size.h
+++ b/examples/lock-app/lock-common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/lock-app/lock-common/gen/attribute-type.h b/examples/lock-app/lock-common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/lock-app/lock-common/gen/attribute-type.h
+++ b/examples/lock-app/lock-common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/lock-app/lock-common/gen/client-command-macro.h b/examples/lock-app/lock-common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/lock-app/lock-common/gen/client-command-macro.h
+++ b/examples/lock-app/lock-common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/lock-app/lock-common/gen/cluster-id.h b/examples/lock-app/lock-common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/lock-app/lock-common/gen/cluster-id.h
+++ b/examples/lock-app/lock-common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/lock-app/lock-common/gen/command-id.h b/examples/lock-app/lock-common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/lock-app/lock-common/gen/command-id.h
+++ b/examples/lock-app/lock-common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/lock-app/lock-common/gen/print-cluster.h b/examples/lock-app/lock-common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/lock-app/lock-common/gen/print-cluster.h
+++ b/examples/lock-app/lock-common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/temperature-measurement-app/esp32/main/gen/attribute-size.h b/examples/temperature-measurement-app/esp32/main/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/attribute-size.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/temperature-measurement-app/esp32/main/gen/attribute-type.h b/examples/temperature-measurement-app/esp32/main/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/attribute-type.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/temperature-measurement-app/esp32/main/gen/command-id.h b/examples/temperature-measurement-app/esp32/main/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/command-id.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h
+++ b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/tv-app/tv-common/gen/af-structs.h b/examples/tv-app/tv-common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/tv-app/tv-common/gen/af-structs.h
+++ b/examples/tv-app/tv-common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/tv-app/tv-common/gen/attribute-id.h b/examples/tv-app/tv-common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/tv-app/tv-common/gen/attribute-id.h
+++ b/examples/tv-app/tv-common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/tv-app/tv-common/gen/attribute-size.h b/examples/tv-app/tv-common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/tv-app/tv-common/gen/attribute-size.h
+++ b/examples/tv-app/tv-common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/tv-app/tv-common/gen/attribute-type.h b/examples/tv-app/tv-common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/tv-app/tv-common/gen/attribute-type.h
+++ b/examples/tv-app/tv-common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/tv-app/tv-common/gen/client-command-macro.h b/examples/tv-app/tv-common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/tv-app/tv-common/gen/client-command-macro.h
+++ b/examples/tv-app/tv-common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/tv-app/tv-common/gen/cluster-id.h b/examples/tv-app/tv-common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/tv-app/tv-common/gen/cluster-id.h
+++ b/examples/tv-app/tv-common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/tv-app/tv-common/gen/command-id.h b/examples/tv-app/tv-common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/tv-app/tv-common/gen/command-id.h
+++ b/examples/tv-app/tv-common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h
index 4deef9b..6c62cfe 100644
--- a/examples/tv-app/tv-common/gen/endpoint_config.h
+++ b/examples/tv-app/tv-common/gen/endpoint_config.h
@@ -334,44 +334,44 @@
#define GENERATED_ATTRIBUTE_COUNT 149
#define GENERATED_ATTRIBUTES \
{ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* On/off (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* On/off (server): on/off */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Media Playback (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Media Playback (server): current state */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Content Launch (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* On/off (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* On/off (server): on/off */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Level Control (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Level Control (server): current level */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Content Launch (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* On/off (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* On/off (server): on/off */ \
+ { 0x0000, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Media Playback (server): current state */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Media Playback (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Content Launch (server): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* On/off (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* On/off (server): on/off */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Level Control (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* Level Control (server): current level */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Content Launch (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(0) }, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): vendor id */ \
{ 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(32) }, /* Application Basic (server): application name */ \
- { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
- { 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(64) }, /* Application Basic (server): application id */ \
- { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
- { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
+ ZAP_LONG_DEFAULTS_INDEX(32) }, /* Application Basic (server): application name */ \
+ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
+ { 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
+ ZAP_LONG_DEFAULTS_INDEX(64) }, /* Application Basic (server): application id */ \
+ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
+ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
{ 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(96) }, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): vendor id */ \
{ 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(128) }, /* Application Basic (server): application name */ \
- { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ ZAP_LONG_DEFAULTS_INDEX(128) }, /* Application Basic (server): application name */ \
+ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
ZAP_LONG_DEFAULTS_INDEX(160) }, /* Application Basic (server): application id */ \
{ 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
{ 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Content Launch (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(192) }, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): vendor id */ \
{ 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(224) }, /* Application Basic (server): application name */ \
- { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ ZAP_LONG_DEFAULTS_INDEX(224) }, /* Application Basic (server): application name */ \
+ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
ZAP_LONG_DEFAULTS_INDEX(256) }, /* Application Basic (server): application id */ \
{ 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
@@ -412,11 +412,11 @@
{ 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), \
ZAP_LONG_DEFAULTS_INDEX(464) }, /* Basic (server): SoftwareVersion */ \
{ 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), \
- ZAP_LONG_DEFAULTS_INDEX(468) }, /* Basic (server): SoftwareVersionString */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* General Commissioning (server): cluster revision */ \
+ ZAP_LONG_DEFAULTS_INDEX(468) }, /* Basic (server): SoftwareVersionString */ \
{ 0x0000, ZAP_TYPE(OCTET_STRING), 8, 0, ZAP_LONG_DEFAULTS_INDEX(532) }, /* General Commissioning (server): FabricId */ \
{ 0x0001, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \
ZAP_LONG_DEFAULTS_INDEX(540) }, /* General Commissioning (server): Breadcrumb */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* General Commissioning (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Network Commissioning (server): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Door Lock (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* Door Lock (server): lock state */ \
@@ -504,23 +504,23 @@
{ 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* IAS Zone (server): zone type */ \
{ 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* IAS Zone (server): zone status */ \
{ 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \
- ZAP_LONG_DEFAULTS_INDEX(802) }, /* IAS Zone (server): IAS CIE address */ \
- { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* IAS Zone (server): Zone ID */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
+ ZAP_LONG_DEFAULTS_INDEX(802) }, /* IAS Zone (server): IAS CIE address */ \
+ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* IAS Zone (server): Zone ID */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Low Power (server): cluster revision */ \
{ 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(810) }, /* Application Basic (server): vendor name */ \
{ 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): vendor id */ \
{ 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(842) }, /* Application Basic (server): application name */ \
- { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ ZAP_LONG_DEFAULTS_INDEX(842) }, /* Application Basic (server): application name */ \
+ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): product id */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Application Basic (server): cluster revision */ \
{ 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, \
- ZAP_LONG_DEFAULTS_INDEX(874) }, /* Application Basic (server): application id */ \
- { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
- { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Binding (server): cluster revision */ \
- { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Group Key Management (server): cluster revision */ \
- { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(906) }, /* Group Key Management (server): groups */ \
+ ZAP_LONG_DEFAULTS_INDEX(874) }, /* Application Basic (server): application id */ \
+ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* Application Basic (server): catalog vendor id */ \
+ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Application Basic (server): application satus */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Binding (server): cluster revision */ \
+ { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(906) }, /* Group Key Management (server): groups */ \
{ 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1160) }, /* Group Key Management (server): group keys */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Group Key Management (server): cluster revision */ \
}
// This is an array of EmberAfCluster structures.
diff --git a/examples/tv-app/tv-common/gen/print-cluster.h b/examples/tv-app/tv-common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/tv-app/tv-common/gen/print-cluster.h
+++ b/examples/tv-app/tv-common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/examples/window-app/common/gen/af-structs.h b/examples/window-app/common/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/examples/window-app/common/gen/af-structs.h
+++ b/examples/window-app/common/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/examples/window-app/common/gen/attribute-id.h b/examples/window-app/common/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/examples/window-app/common/gen/attribute-id.h
+++ b/examples/window-app/common/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/examples/window-app/common/gen/attribute-size.h b/examples/window-app/common/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/examples/window-app/common/gen/attribute-size.h
+++ b/examples/window-app/common/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/examples/window-app/common/gen/attribute-type.h b/examples/window-app/common/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/examples/window-app/common/gen/attribute-type.h
+++ b/examples/window-app/common/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/examples/window-app/common/gen/client-command-macro.h b/examples/window-app/common/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/examples/window-app/common/gen/client-command-macro.h
+++ b/examples/window-app/common/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/examples/window-app/common/gen/cluster-id.h b/examples/window-app/common/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/examples/window-app/common/gen/cluster-id.h
+++ b/examples/window-app/common/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/examples/window-app/common/gen/command-id.h b/examples/window-app/common/gen/command-id.h
index fae33f4..49031b9 100644
--- a/examples/window-app/common/gen/command-id.h
+++ b/examples/window-app/common/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/examples/window-app/common/gen/print-cluster.h b/examples/window-app/common/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/examples/window-app/common/gen/print-cluster.h
+++ b/examples/window-app/common/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/src/app/chip-zcl-zpro-codec-api.h b/src/app/chip-zcl-zpro-codec-api.h
index 8b0b9b5..3f5a209 100644
--- a/src/app/chip-zcl-zpro-codec-api.h
+++ b/src/app/chip-zcl-zpro-codec-api.h
@@ -44,6 +44,7 @@
| LowPower | 0x0508 |
| NetworkCommissioning | 0x0031 |
| OnOff | 0x0006 |
+| OperationalCredentials | 0x003E |
| Scenes | 0x0005 |
| TemperatureMeasurement | 0x0402 |
| Thermostat | 0x0201 |
@@ -2029,6 +2030,64 @@
chip::EndpointId destinationEndpoint);
/*----------------------------------------------------------------------------*\
+| Cluster OperationalCredentials | 0x003E |
+|------------------------------------------------------------------------------|
+| Commands: | |
+| * GetFabricId | 0x00 |
+| * RemoveFabric | 0x0A |
+| * UpdateFabricLabel | 0x09 |
+|------------------------------------------------------------------------------|
+| Attributes: | |
+| * FabricsList | 0x0001 |
+| * ClusterRevision | 0xFFFD |
+\*----------------------------------------------------------------------------*/
+
+/**
+ * @brief
+ * Encode an GetFabricId command for Operational Credentials server into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle encodeOperationalCredentialsClusterGetFabricIdCommand(uint8_t seqNum,
+ chip::EndpointId destinationEndpoint);
+
+/**
+ * @brief
+ * Encode an RemoveFabric command for Operational Credentials server into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle encodeOperationalCredentialsClusterRemoveFabricCommand(uint8_t seqNum,
+ chip::EndpointId destinationEndpoint,
+ chip::FabricId fabricId,
+ chip::NodeId nodeId, uint16_t vendorId);
+
+/**
+ * @brief
+ * Encode an UpdateFabricLabel command for Operational Credentials server into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle encodeOperationalCredentialsClusterUpdateFabricLabelCommand(uint8_t seqNum,
+ chip::EndpointId destinationEndpoint,
+ chip::ByteSpan label);
+
+/**
+ * @brief
+ * Encode a Operational Credentials server discover command into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle encodeOperationalCredentialsClusterDiscoverAttributes(uint8_t seqNum,
+ chip::EndpointId destinationEndpoint);
+
+/**
+ * @brief
+ * Encode a Operational Credentials server read command for the fabrics list attribute into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle encodeOperationalCredentialsClusterReadFabricsListAttribute(uint8_t seqNum,
+ chip::EndpointId destinationEndpoint);
+
+/**
+ * @brief
+ * Encode a Operational Credentials server read command for the cluster revision attribute into buffer including the APS frame
+ */
+chip::System::PacketBufferHandle
+encodeOperationalCredentialsClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint);
+
+/*----------------------------------------------------------------------------*\
| Cluster Scenes | 0x0005 |
|------------------------------------------------------------------------------|
| Commands: | |
diff --git a/src/app/clusters/operational-credentials/operational-credentials.cpp b/src/app/clusters/operational-credentials/operational-credentials.cpp
new file mode 100644
index 0000000..515b63c
--- /dev/null
+++ b/src/app/clusters/operational-credentials/operational-credentials.cpp
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright (c) 2021 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/****************************************************************************
+ * @file
+ * @brief Implementation for the Operational Credentials Cluster
+ ***************************************************************************/
+
+#include "af.h"
+#include <app/util/attribute-storage.h>
+#include <support/CodeUtils.h>
+#include <support/logging/CHIPLogging.h>
+
+#include "gen/af-structs.h"
+#include "gen/attribute-id.h"
+#include "gen/attribute-type.h"
+#include "gen/cluster-id.h"
+#include "gen/command-id.h"
+
+using namespace chip;
+
+bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId)
+{
+ // Go through admin pairing table and remove the element
+ // Then fetch the attribute list and find the right element (or maybe just use the admin pairing table index)
+ // Then rewrite the entire attribute list (no choice for now)
+ emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln
+ EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE;
+ emberAfSendImmediateDefaultResponse(status);
+ return true;
+}
+
+bool emberAfOperationalCredentialsClusterGetFabricIdCallback()
+{
+ emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: GetFabricId");
+ EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE;
+ emberAfSendImmediateDefaultResponse(status);
+ return true;
+}
+
+bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(uint8_t * Label)
+{
+ emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: UpdateFabricLabel");
+ // Go look at admin table using fabricId + update the label
+ // Then find equivalent value in attribute list and update it.
+ EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE;
+ emberAfSendImmediateDefaultResponse(status);
+ return true;
+}
diff --git a/src/app/encoder.cpp b/src/app/encoder.cpp
index 0eeff97..2bfca2c 100644
--- a/src/app/encoder.cpp
+++ b/src/app/encoder.cpp
@@ -115,6 +115,7 @@
| LowPower | 0x0508 |
| NetworkCommissioning | 0x0031 |
| OnOff | 0x0006 |
+| OperationalCredentials | 0x003E |
| Scenes | 0x0005 |
| TemperatureMeasurement | 0x0402 |
| Thermostat | 0x0201 |
@@ -253,6 +254,11 @@
#define ZCL_ON_COMMAND_ID (0x01)
#define ZCL_TOGGLE_COMMAND_ID (0x02)
+#define OPERATIONAL_CREDENTIALS_CLUSTER_ID 0x003E
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+
#define SCENES_CLUSTER_ID 0x0005
#define ZCL_ADD_SCENE_COMMAND_ID (0x00)
#define ZCL_GET_SCENE_MEMBERSHIP_COMMAND_ID (0x06)
@@ -3544,6 +3550,96 @@
}
/*----------------------------------------------------------------------------*\
+| Cluster OperationalCredentials | 0x003E |
+|------------------------------------------------------------------------------|
+| Commands: | |
+| * GetFabricId | 0x00 |
+| * RemoveFabric | 0x0A |
+| * UpdateFabricLabel | 0x09 |
+|------------------------------------------------------------------------------|
+| Attributes: | |
+| * FabricsList | 0x0001 |
+| * ClusterRevision | 0xFFFD |
+\*----------------------------------------------------------------------------*/
+
+/*
+ * Command GetFabricId
+ */
+PacketBufferHandle encodeOperationalCredentialsClusterGetFabricIdCommand(uint8_t seqNum, EndpointId destinationEndpoint)
+{
+ COMMAND_HEADER("GetFabricId", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_GET_FABRIC_ID_COMMAND_ID);
+ COMMAND_FOOTER();
+}
+
+/*
+ * Command RemoveFabric
+ */
+PacketBufferHandle encodeOperationalCredentialsClusterRemoveFabricCommand(uint8_t seqNum, EndpointId destinationEndpoint,
+ chip::FabricId fabricId, chip::NodeId nodeId,
+ uint16_t vendorId)
+{
+ COMMAND_HEADER("RemoveFabric", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+
+ buf.Put8(kFrameControlClusterSpecificCommand)
+ .Put8(seqNum)
+ .Put8(ZCL_REMOVE_FABRIC_COMMAND_ID)
+ .Put64(fabricId)
+ .Put64(nodeId)
+ .Put16(vendorId);
+ COMMAND_FOOTER();
+}
+
+/*
+ * Command UpdateFabricLabel
+ */
+PacketBufferHandle encodeOperationalCredentialsClusterUpdateFabricLabelCommand(uint8_t seqNum, EndpointId destinationEndpoint,
+ chip::ByteSpan label)
+{
+ COMMAND_HEADER("UpdateFabricLabel", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ size_t labelStrLen = label.size();
+ if (!CanCastTo<uint8_t>(labelStrLen))
+ {
+ ChipLogError(Zcl, "Error encoding %s command. String too long: %d", kName, labelStrLen);
+ return PacketBufferHandle();
+ }
+
+ buf.Put8(kFrameControlClusterSpecificCommand)
+ .Put8(seqNum)
+ .Put8(ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID)
+ .Put(static_cast<uint8_t>(labelStrLen))
+ .Put(label.data(), label.size());
+ COMMAND_FOOTER();
+}
+
+PacketBufferHandle encodeOperationalCredentialsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
+{
+ COMMAND_HEADER("DiscoverOperationalCredentialsAttributes", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF);
+ COMMAND_FOOTER();
+}
+
+/*
+ * Attribute FabricsList
+ */
+PacketBufferHandle encodeOperationalCredentialsClusterReadFabricsListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
+{
+ COMMAND_HEADER("ReadOperationalCredentialsFabricsList", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0001);
+ COMMAND_FOOTER();
+}
+
+/*
+ * Attribute ClusterRevision
+ */
+PacketBufferHandle encodeOperationalCredentialsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
+{
+ COMMAND_HEADER("ReadOperationalCredentialsClusterRevision", OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD);
+ COMMAND_FOOTER();
+}
+
+/*----------------------------------------------------------------------------*\
| Cluster Scenes | 0x0005 |
|------------------------------------------------------------------------------|
| Commands: | |
diff --git a/src/app/util/basic-types.h b/src/app/util/basic-types.h
index b6f7212..2475691 100644
--- a/src/app/util/basic-types.h
+++ b/src/app/util/basic-types.h
@@ -40,4 +40,5 @@
typedef uint32_t DeviceTypeId;
typedef uint8_t FieldId;
typedef uint16_t ListIndex;
+typedef uint64_t FabricId;
} // namespace chip
diff --git a/src/app/zap-templates/common/ChipTypesHelper.js b/src/app/zap-templates/common/ChipTypesHelper.js
index 2c45056..62152bf 100644
--- a/src/app/zap-templates/common/ChipTypesHelper.js
+++ b/src/app/zap-templates/common/ChipTypesHelper.js
@@ -29,6 +29,7 @@
case 'chip::DeviceTypeId':
return 'uint32_t';
case 'chip::NodeId':
+ case 'chip::FabricId':
return 'uint64_t';
default:
return type;
diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js
index cfa36dc..afa8e95 100644
--- a/src/app/zap-templates/common/override.js
+++ b/src/app/zap-templates/common/override.js
@@ -30,6 +30,8 @@
return 'chip::ClusterId';
case 'device_type_id':
return 'chip::DeviceTypeId';
+ case 'fabric_id':
+ return 'chip::FabricId';
case 'ieee_address':
return 'uint64_t';
default:
diff --git a/src/app/zap-templates/zcl/custom-types.xml b/src/app/zap-templates/zcl/custom-types.xml
index c75eb08..cdc8745 100644
--- a/src/app/zap-templates/zcl/custom-types.xml
+++ b/src/app/zap-templates/zcl/custom-types.xml
@@ -21,6 +21,7 @@
<type id="0xF4" name="command_id" size="1" description="Command Id" discrete="true" />
<type id="0xF5" name="node_id" size="8" description="Node Id" discrete="true" />
<type id="0xF6" name="device_type_id" size="4" description="Device Type Id" discrete="true" />
+ <type id="0xF7" name="fabric_id" size="8" description="Fabric Id" discrete="true" />
</atomic>
<enum name="GroupKeySecurityPolicy" type="ENUM8">
<item name="Standard" value="0x00"/>
@@ -42,4 +43,10 @@
<item name="type" type="DEVICE_TYPE_ID"/>
<item name="revision" type="INT16U"/>
</struct>
+ <struct name="FabricDescriptor">
+ <item name="FabricId" type="FABRIC_ID"/>
+ <item name="VendorId" type="INT16U"/> // Change INT16U to new type VendorID #2395
+ <item name="Label" type="OCTET_STRING" length="32"/> // Change this to CHAR_STRING once it is supported #6112
+ <item name="NodeId" type="NODE_ID"/>
+ </struct>
</configurator>
diff --git a/src/app/zap-templates/zcl/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/operational-credentials-cluster.xml
new file mode 100644
index 0000000..e0942dc
--- /dev/null
+++ b/src/app/zap-templates/zcl/operational-credentials-cluster.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+Copyright (c) 2021 Project CHIP Authors
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<configurator>
+ <domain name="CHIP"/>
+ <cluster>
+ <domain>General</domain>
+ <name>Operational Credentials</name>
+ <code>0x003E</code> // Change to correct clusterID once it is decided in the spec #2396
+ <define>OPERATIONAL_CREDENTIALS_CLUSTER</define>
+ <description>This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics.</description>
+
+ <attribute side="server" code="0x0001" define="FABRICS" type="ARRAY" entryType="FabricDescriptor" length="254" writable="false" optional="false">fabrics list</attribute>
+
+ <command source="client" code="0x09" name="UpdateFabricLabel" optional="false">
+ <description>This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute.</description>
+ <arg name="Label" type="CHAR_STRING" length="32"/>
+ </command>
+
+ <command source="client" code="0x0a" name="RemoveFabric" optional="false">
+ <description>This command is used by Administrative Nodes to remove a given Fabric and delete all associated
+fabric-scoped data.</description>
+ <arg name="FabricId" type="FABRIC_ID"/>
+ <arg name="NodeId" type="NODE_ID"/>
+ <arg name="VendorId" type="INT16U"/>
+ </command>
+
+ <command source="client" code="0x00" name="GetFabricId" optional="false">
+ <description>Retrieve the fabricID of the admin executing this command.</description>
+ </command>
+
+ <command source="server" code="0x01" name="GetFabricIdResponse" optional="false">
+ <description>Sender expects GetFabricIdResponse command if the GetFabricId command was correctly received</description>
+ <arg name="FabricId" type="FABRIC_ID"/>
+ </command>
+
+ </cluster>
+</configurator>
diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json
index dc1d553..37accfb 100644
--- a/src/app/zap-templates/zcl/zcl.json
+++ b/src/app/zap-templates/zcl/zcl.json
@@ -21,6 +21,7 @@
"descriptor-cluster.xml",
"types.xml",
"general.xml",
+ "operational-credentials-cluster.xml",
"general-commissioning-cluster.xml",
"group-key-mgmt-cluster.xml",
"ha.xml",
diff --git a/src/controller/CHIPClusters.cpp b/src/controller/CHIPClusters.cpp
index a2bb15f..23d5c87 100644
--- a/src/controller/CHIPClusters.cpp
+++ b/src/controller/CHIPClusters.cpp
@@ -3765,6 +3765,122 @@
return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
}
+// OperationalCredentials Cluster Commands
+CHIP_ERROR OperationalCredentialsCluster::GetFabricId(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback)
+{
+#if CHIP_ENABLE_INTERACTION_MODEL
+ VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE);
+ (void) onSuccessCallback;
+ (void) onFailureCallback;
+
+ app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetFabricIdCommandId,
+ (chip::app::Command::CommandPathFlags::kEndpointIdValid) };
+ app::Command * ZCLcommand = mDevice->GetCommandSender();
+
+ ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams));
+
+ // Command takes no arguments.
+
+ ReturnErrorOnFailure(ZCLcommand->FinishCommand());
+
+ return mDevice->SendCommands();
+#else
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterGetFabricIdCommand(seqNum, mEndpoint);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+#endif
+}
+
+CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback, chip::FabricId fabricId,
+ chip::NodeId nodeId, uint16_t vendorId)
+{
+#if CHIP_ENABLE_INTERACTION_MODEL
+ VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE);
+ (void) onSuccessCallback;
+ (void) onFailureCallback;
+
+ app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId,
+ (chip::app::Command::CommandPathFlags::kEndpointIdValid) };
+ app::Command * ZCLcommand = mDevice->GetCommandSender();
+
+ ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams));
+
+ TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter();
+ uint8_t argSeqNumber = 0;
+ // fabricId: fabricId
+ ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId));
+ // nodeId: nodeId
+ ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId));
+ // vendorId: int16u
+ ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId));
+
+ ReturnErrorOnFailure(ZCLcommand->FinishCommand());
+
+ return mDevice->SendCommands();
+#else
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand =
+ encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+#endif
+}
+
+CHIP_ERROR OperationalCredentialsCluster::UpdateFabricLabel(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback, chip::ByteSpan label)
+{
+#if CHIP_ENABLE_INTERACTION_MODEL
+ VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE);
+ (void) onSuccessCallback;
+ (void) onFailureCallback;
+
+ app::Command::CommandParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kUpdateFabricLabelCommandId,
+ (chip::app::Command::CommandPathFlags::kEndpointIdValid) };
+ app::Command * ZCLcommand = mDevice->GetCommandSender();
+
+ ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams));
+
+ TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter();
+ uint8_t argSeqNumber = 0;
+ // label: charString
+ ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), label));
+
+ ReturnErrorOnFailure(ZCLcommand->FinishCommand());
+
+ return mDevice->SendCommands();
+#else
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand =
+ encodeOperationalCredentialsClusterUpdateFabricLabelCommand(seqNum, mEndpoint, label);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+#endif
+}
+
+// OperationalCredentials Cluster Attributes
+CHIP_ERROR OperationalCredentialsCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback)
+{
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterDiscoverAttributes(seqNum, mEndpoint);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+}
+CHIP_ERROR OperationalCredentialsCluster::ReadAttributeFabricsList(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback)
+{
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterReadFabricsListAttribute(seqNum, mEndpoint);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+}
+
+CHIP_ERROR OperationalCredentialsCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback,
+ Callback::Cancelable * onFailureCallback)
+{
+ uint8_t seqNum = mDevice->GetNextSequenceNumber();
+ System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterReadClusterRevisionAttribute(seqNum, mEndpoint);
+ return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback);
+}
+
// Scenes Cluster Commands
CHIP_ERROR ScenesCluster::AddScene(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, chip::ByteSpan sceneName,
diff --git a/src/controller/CHIPClusters.h b/src/controller/CHIPClusters.h
index 37ca408..54e673a 100644
--- a/src/controller/CHIPClusters.h
+++ b/src/controller/CHIPClusters.h
@@ -43,6 +43,7 @@
constexpr ClusterId kLowPowerClusterId = 0x0508;
constexpr ClusterId kNetworkCommissioningClusterId = 0x0031;
constexpr ClusterId kOnOffClusterId = 0x0006;
+constexpr ClusterId kOperationalCredentialsClusterId = 0x003E;
constexpr ClusterId kScenesClusterId = 0x0005;
constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402;
constexpr ClusterId kThermostatClusterId = 0x0201;
@@ -649,6 +650,30 @@
static constexpr CommandId kToggleCommandId = 0x02;
};
+class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase
+{
+public:
+ OperationalCredentialsCluster() : ClusterBase(kOperationalCredentialsClusterId) {}
+ ~OperationalCredentialsCluster() {}
+
+ // Cluster Commands
+ CHIP_ERROR GetFabricId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
+ CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
+ chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId);
+ CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback,
+ chip::ByteSpan label);
+
+ // Cluster Attributes
+ CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
+ CHIP_ERROR ReadAttributeFabricsList(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
+ CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback);
+
+private:
+ static constexpr CommandId kGetFabricIdCommandId = 0x00;
+ static constexpr CommandId kRemoveFabricCommandId = 0x0A;
+ static constexpr CommandId kUpdateFabricLabelCommandId = 0x09;
+};
+
class DLL_EXPORT ScenesCluster : public ClusterBase
{
public:
diff --git a/src/controller/controller-clusters.zap b/src/controller/controller-clusters.zap
index aaec69c..a64fbb2 100644
--- a/src/controller/controller-clusters.zap
+++ b/src/controller/controller-clusters.zap
@@ -24,7 +24,7 @@
},
{
"pathRelativity": "relativeToZap",
- "path": "../app/zap-templates/chip-templates.json",
+ "path": "../app/zap-templates/app-templates.json",
"version": "chip-v1",
"type": "gen-templates-json"
}
@@ -1511,6 +1511,107 @@
]
},
{
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "client",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "GetFabricId",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "GetFabricIdResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "fabrics list",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
"name": "Door Lock",
"code": 257,
"mfgCode": null,
diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp
index 85b49b7..d628980 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.cpp
+++ b/src/controller/python/chip/clusters/CHIPClusters.cpp
@@ -1888,6 +1888,48 @@
}
// End of Cluster OnOff
+// Cluster OperationalCredentials
+
+CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_GetFabricId(chip::Controller::Device * device,
+ chip::EndpointId ZCLendpointId, chip::GroupId)
+{
+ VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, ZCLendpointId);
+ return cluster.GetFabricId(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel());
+}
+CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveFabric(chip::Controller::Device * device,
+ chip::EndpointId ZCLendpointId, chip::GroupId,
+ chip::FabricId fabricId, chip::NodeId nodeId,
+ uint16_t vendorId)
+{
+ VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, ZCLendpointId);
+ return cluster.RemoveFabric(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), fabricId, nodeId, vendorId);
+}
+CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel(chip::Controller::Device * device,
+ chip::EndpointId ZCLendpointId, chip::GroupId,
+ const uint8_t * label, uint32_t label_Len)
+{
+ VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, ZCLendpointId);
+ return cluster.UpdateFabricLabel(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(),
+ chip::ByteSpan(label, label_Len));
+}
+
+CHIP_ERROR chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision(chip::Controller::Device * device,
+ chip::EndpointId ZCLendpointId,
+ chip::GroupId /* ZCLgroupId */)
+{
+ VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
+ chip::Controller::OperationalCredentialsCluster cluster;
+ cluster.Associate(device, ZCLendpointId);
+ return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel());
+}
+
+// End of Cluster OperationalCredentials
// Cluster Scenes
CHIP_ERROR chip_ime_AppendCommand_Scenes_AddScene(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId,
diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py
index 466a03c..a89e6a6 100644
--- a/src/controller/python/chip/clusters/CHIPClusters.py
+++ b/src/controller/python/chip/clusters/CHIPClusters.py
@@ -402,6 +402,18 @@
"Toggle": {
},
},
+ "OperationalCredentials": {
+ "GetFabricId": {
+ },
+ "RemoveFabric": {
+ "fabricId": "int",
+ "nodeId": "int",
+ "vendorId": "int",
+ },
+ "UpdateFabricLabel": {
+ "label": "bytes",
+ },
+ },
"Scenes": {
"AddScene": {
"groupId": "int",
@@ -622,6 +634,9 @@
"OnOff",
"ClusterRevision",
],
+ "OperationalCredentials": [
+ "ClusterRevision",
+ ],
"Scenes": [
"SceneCount",
"CurrentScene",
@@ -984,6 +999,19 @@
return self._chipLib.chip_ime_AppendCommand_OnOff_Toggle(
device, ZCLendpoint, ZCLgroupid
)
+ def ClusterOperationalCredentials_CommandGetFabricId(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int):
+ return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId(
+ device, ZCLendpoint, ZCLgroupid
+ )
+ def ClusterOperationalCredentials_CommandRemoveFabric(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, fabricId: int, nodeId: int, vendorId: int):
+ return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric(
+ device, ZCLendpoint, ZCLgroupid, fabricId, nodeId, vendorId
+ )
+ def ClusterOperationalCredentials_CommandUpdateFabricLabel(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, label: bytes):
+ label = label.encode("utf-8") + b'\x00'
+ return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel(
+ device, ZCLendpoint, ZCLgroupid, label, len(label)
+ )
def ClusterScenes_CommandAddScene(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, groupId: int, sceneId: int, transitionTime: int, sceneName: bytes, clusterId: int, length: int, value: int):
sceneName = sceneName.encode("utf-8") + b'\x00'
return self._chipLib.chip_ime_AppendCommand_Scenes_AddScene(
@@ -1296,6 +1324,8 @@
return self._chipLib.chip_ime_ConfigureAttribute_OnOff_OnOff(device, ZCLendpoint, minInterval, maxInterval, change)
def ClusterOnOff_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int):
return self._chipLib.chip_ime_ReadAttribute_OnOff_ClusterRevision(device, ZCLendpoint, ZCLgroupid)
+ def ClusterOperationalCredentials_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int):
+ return self._chipLib.chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision(device, ZCLendpoint, ZCLgroupid)
def ClusterScenes_ReadAttributeSceneCount(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int):
return self._chipLib.chip_ime_ReadAttribute_Scenes_SceneCount(device, ZCLendpoint, ZCLgroupid)
def ClusterScenes_ReadAttributeCurrentScene(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int):
@@ -1956,6 +1986,19 @@
# Cluster OnOff ReadAttribute ClusterRevision
self._chipLib.chip_ime_ReadAttribute_OnOff_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16]
self._chipLib.chip_ime_ReadAttribute_OnOff_ClusterRevision.restype = ctypes.c_uint32
+ # Cluster OperationalCredentials
+ # Cluster OperationalCredentials Command GetFabricId
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16]
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId.restype = ctypes.c_uint32
+ # Cluster OperationalCredentials Command RemoveFabric
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint16]
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric.restype = ctypes.c_uint32
+ # Cluster OperationalCredentials Command UpdateFabricLabel
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32]
+ self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel.restype = ctypes.c_uint32
+ # Cluster OperationalCredentials ReadAttribute ClusterRevision
+ self._chipLib.chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16]
+ self._chipLib.chip_ime_ReadAttribute_OperationalCredentials_ClusterRevision.restype = ctypes.c_uint32
# Cluster Scenes
# Cluster Scenes Command AddScene
self._chipLib.chip_ime_AppendCommand_Scenes_AddScene.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32, ctypes.c_uint16, ctypes.c_uint8, ctypes.c_uint8]
diff --git a/src/controller/python/gen/af-structs.h b/src/controller/python/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/src/controller/python/gen/af-structs.h
+++ b/src/controller/python/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/src/controller/python/gen/attribute-id.h b/src/controller/python/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/src/controller/python/gen/attribute-id.h
+++ b/src/controller/python/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/src/controller/python/gen/attribute-size.h b/src/controller/python/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/src/controller/python/gen/attribute-size.h
+++ b/src/controller/python/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/src/controller/python/gen/attribute-type.h b/src/controller/python/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/src/controller/python/gen/attribute-type.h
+++ b/src/controller/python/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/src/controller/python/gen/client-command-macro.h b/src/controller/python/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/src/controller/python/gen/client-command-macro.h
+++ b/src/controller/python/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/src/controller/python/gen/cluster-id.h b/src/controller/python/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/src/controller/python/gen/cluster-id.h
+++ b/src/controller/python/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/src/controller/python/gen/command-id.h b/src/controller/python/gen/command-id.h
index fae33f4..49031b9 100644
--- a/src/controller/python/gen/command-id.h
+++ b/src/controller/python/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/src/controller/python/gen/print-cluster.h b/src/controller/python/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/src/controller/python/gen/print-cluster.h
+++ b/src/controller/python/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \
diff --git a/src/darwin/Framework/CHIP/chip-tool.zap b/src/darwin/Framework/CHIP/chip-tool.zap
index 7f4dfdf..22f563c 100644
--- a/src/darwin/Framework/CHIP/chip-tool.zap
+++ b/src/darwin/Framework/CHIP/chip-tool.zap
@@ -1,5 +1,5 @@
{
- "featureLevel": 19,
+ "featureLevel": 26,
"creator": "zap",
"keyValuePairs": [
{
@@ -18,13 +18,13 @@
"package": [
{
"pathRelativity": "relativeToZap",
- "path": "../../../connectedhomeip-1/src/app/zap-templates/zcl/zcl.json",
+ "path": "../../../app/zap-templates/zcl/zcl.json",
"version": "ZCL Test Data",
"type": "zcl-properties"
},
{
"pathRelativity": "relativeToZap",
- "path": "../../../connectedhomeip-1/src/app/zap-templates/app-templates.json",
+ "path": "../../../app/zap-templates/app-templates.json",
"version": "chip-v1",
"type": "gen-templates-json"
}
@@ -98,21 +98,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "identify time",
"code": 0,
"mfgCode": null,
@@ -126,6 +111,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -247,21 +247,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "name support",
"code": 0,
"mfgCode": null,
@@ -275,6 +260,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -420,21 +420,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "scene count",
"code": 0,
"mfgCode": null,
@@ -508,6 +493,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -572,21 +572,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "on/off",
"code": 0,
"mfgCode": null,
@@ -600,6 +585,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -704,21 +704,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "current level",
"code": 0,
"mfgCode": null,
@@ -732,6 +717,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -771,21 +771,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "device list",
"code": 0,
"mfgCode": null,
@@ -844,6 +829,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -858,7 +858,7 @@
{
"name": "MfgSpecificPing",
"code": 0,
- "mfgCode": "4098",
+ "mfgCode": 4098,
"source": "client",
"incoming": 0,
"outgoing": 1
@@ -1274,21 +1274,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "FabricId",
"code": 0,
"mfgCode": null,
@@ -1317,6 +1302,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -1511,6 +1511,107 @@
]
},
{
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "client",
+ "enabled": 1,
+ "commands": [
+ {
+ "name": "GetFabricId",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "UpdateFabricLabel",
+ "code": 9,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ },
+ {
+ "name": "RemoveFabric",
+ "code": 10,
+ "mfgCode": null,
+ "source": "client",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "client",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
+ "name": "Operational Credentials",
+ "code": 62,
+ "mfgCode": null,
+ "define": "OPERATIONAL_CREDENTIALS_CLUSTER",
+ "side": "server",
+ "enabled": 0,
+ "commands": [
+ {
+ "name": "GetFabricIdResponse",
+ "code": 1,
+ "mfgCode": null,
+ "source": "server",
+ "incoming": 1,
+ "outgoing": 1
+ }
+ ],
+ "attributes": [
+ {
+ "name": "fabrics list",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ }
+ ]
+ },
+ {
"name": "Door Lock",
"code": 257,
"mfgCode": null,
@@ -1932,21 +2033,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "lock state",
"code": 0,
"mfgCode": null,
@@ -2365,6 +2451,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -2421,21 +2522,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "barrier moving state",
"code": 1,
"mfgCode": null,
@@ -2494,6 +2580,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -2646,21 +2747,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "current hue",
"code": 0,
"mfgCode": null,
@@ -3261,36 +3347,6 @@
"reportableChange": 0
},
{
- "name": "couple color temp to level min-mireds",
- "code": 16397,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
- "name": "start up color temperature mireds",
- "code": 16400,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "enhanced current hue",
"code": 16384,
"mfgCode": null,
@@ -3409,6 +3465,51 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "couple color temp to level min-mireds",
+ "code": 16397,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "start up color temperature mireds",
+ "code": 16400,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -3448,21 +3549,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "3",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "measured value",
"code": 0,
"mfgCode": null,
@@ -3521,6 +3607,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "3",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -3586,21 +3687,6 @@
],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "2",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "zone state",
"code": 0,
"mfgCode": null,
@@ -3674,6 +3760,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "2",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -3774,21 +3875,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "vendor name",
"code": 0,
"mfgCode": null,
@@ -3892,6 +3978,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
},
@@ -4000,21 +4101,6 @@
"commands": [],
"attributes": [
{
- "name": "cluster revision",
- "code": 65533,
- "mfgCode": null,
- "side": "server",
- "included": 1,
- "storageOption": "RAM",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": "0x0001",
- "reportable": 0,
- "minInterval": 0,
- "maxInterval": 65344,
- "reportableChange": 0
- },
- {
"name": "groups",
"code": 0,
"mfgCode": null,
@@ -4043,6 +4129,21 @@
"minInterval": 0,
"maxInterval": 65344,
"reportableChange": 0
+ },
+ {
+ "name": "cluster revision",
+ "code": 65533,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1,
+ "storageOption": "RAM",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "0x0001",
+ "reportable": 0,
+ "minInterval": 0,
+ "maxInterval": 65344,
+ "reportableChange": 0
}
]
}
@@ -4059,4 +4160,4 @@
}
],
"log": []
-}
+}
\ No newline at end of file
diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp
index beea3a3..434c58a 100644
--- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp
+++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp
@@ -475,6 +475,36 @@
}
}
break;
+ case 0x003E:
+ switch (attributeId)
+ {
+ case 0x0001: // FabricDescriptor
+ {
+ _FabricDescriptor data[count];
+ for (size_t i = 0; i < count; i++)
+ {
+ data[i].FabricId = emberAfGetInt64u(message, 0, messageLen);
+ message += 8;
+ CHECK_MESSAGE_LENGTH(8);
+ data[i].VendorId = emberAfGetInt16u(message, 0, messageLen);
+ message += 2;
+ CHECK_MESSAGE_LENGTH(2);
+ data[i].Label = emberAfGetString(message, 0, messageLen);
+ message += 32;
+ CHECK_MESSAGE_LENGTH(32);
+ data[i].NodeId = emberAfGetInt64u(message, 0, messageLen);
+ message += 8;
+ CHECK_MESSAGE_LENGTH(8);
+ }
+
+ Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> * cb =
+ Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>::FromCancelable(
+ onSuccessCallback);
+ cb->mCall(cb->mContext, count, data);
+ break;
+ }
+ }
+ break;
}
break;
}
@@ -1576,6 +1606,19 @@
return true;
}
+bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::FabricId FabricId)
+{
+ ChipLogProgress(Zcl, "GetFabricIdResponse:");
+ ChipLogProgress(Zcl, " FabricId: %" PRIu64 "", FabricId);
+
+ GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterGetFabricIdResponseCallback");
+
+ Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback> * cb =
+ Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback>::FromCancelable(onSuccessCallback);
+ cb->mCall(cb->mContext, FabricId);
+ return true;
+}
+
bool emberAfScenesClusterAddSceneResponseCallback(uint8_t status, uint16_t groupId, uint8_t sceneId)
{
ChipLogProgress(Zcl, "AddSceneResponse:");
diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h
index 7e2107a..152ea46 100644
--- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h
+++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h
@@ -93,6 +93,7 @@
uint8_t * debugText);
typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode,
uint8_t * debugText);
+typedef void (*OperationalCredentialsClusterGetFabricIdResponseCallback)(void * context, chip::FabricId FabricId);
typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId);
typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t capacity, uint16_t groupId,
uint8_t sceneCount,
@@ -111,3 +112,4 @@
typedef void (*DescriptorPartsListListAttributeCallback)(void * context, uint16_t count, chip::EndpointId * entries);
typedef void (*GroupKeyManagementGroupsListAttributeCallback)(void * context, uint16_t count, _GroupState * entries);
typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)(void * context, uint16_t count, _GroupKey * entries);
+typedef void (*OperationalCredentialsFabricsListListAttributeCallback)(void * context, uint16_t count, _FabricDescriptor * entries);
diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h
index 4ddef34..77b35ce 100644
--- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h
+++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h
@@ -577,6 +577,24 @@
@end
/**
+ * Cluster Operational Credentials
+ *
+ */
+@interface CHIPOperationalCredentials : CHIPCluster
+
+- (void)getFabricId:(ResponseHandler)completionHandler;
+- (void)removeFabric:(uint64_t)fabricId
+ nodeId:(uint64_t)nodeId
+ vendorId:(uint16_t)vendorId
+ completionHandler:(ResponseHandler)completionHandler;
+- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler;
+
+- (void)readAttributeFabricsList:(ResponseHandler)completionHandler;
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler;
+
+@end
+
+/**
* Cluster Scenes
*
*/
diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm
index e3fc298..7e3ee40 100644
--- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm
+++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm
@@ -1608,6 +1608,38 @@
dispatch_queue_t mQueue;
};
+class CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge
+ : public Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback> {
+public:
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
+ : Callback::Callback<OperationalCredentialsClusterGetFabricIdResponseCallback>(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ {
+ }
+
+ ~CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge() {};
+
+ static void CallbackFn(void * context, chip::FabricId FabricId)
+ {
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * callback
+ = reinterpret_cast<CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge *>(context);
+ if (callback && callback->mQueue) {
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ {
+ @"FabricId" : [NSNumber numberWithUnsignedLongLong:FabricId],
+ });
+ callback->Cancel();
+ delete callback;
+ });
+ }
+ };
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+};
+
class CHIPScenesClusterAddSceneResponseCallbackBridge : public Callback::Callback<ScenesClusterAddSceneResponseCallback> {
public:
CHIPScenesClusterAddSceneResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
@@ -2032,6 +2064,46 @@
dispatch_queue_t mQueue;
};
+class CHIPOperationalCredentialsFabricsListAttributeCallbackBridge
+ : public Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> {
+public:
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue)
+ : Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>(CallbackFn, this)
+ , mHandler(handler)
+ , mQueue(queue)
+ {
+ }
+
+ ~CHIPOperationalCredentialsFabricsListAttributeCallbackBridge() {};
+
+ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entries)
+ {
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * callback
+ = reinterpret_cast<CHIPOperationalCredentialsFabricsListAttributeCallbackBridge *>(context);
+ if (callback && callback->mQueue) {
+ id values[count];
+ for (uint16_t i = 0; i < count; i++) {
+ values[i] =
+ [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId],
+ @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId",
+ [NSData dataWithBytes:entries[i].Label + 1u length:emberAfStringLength(entries[i].Label)],
+ @"Label", [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil];
+ }
+
+ id array = [NSArray arrayWithObjects:values count:count];
+ dispatch_async(callback->mQueue, ^{
+ callback->mHandler(nil, @ { @"value" : array });
+ callback->Cancel();
+ delete callback;
+ });
+ }
+ }
+
+private:
+ ResponseHandler mHandler;
+ dispatch_queue_t mQueue;
+};
+
@interface CHIPCluster ()
@property (readonly, nonatomic) dispatch_queue_t callbackQueue;
- (Controller::ClusterBase *)getCluster;
@@ -7389,6 +7461,139 @@
@end
+@interface CHIPOperationalCredentials ()
+@property (readonly) Controller::OperationalCredentialsCluster cppCluster;
+@end
+
+@implementation CHIPOperationalCredentials
+
+- (Controller::ClusterBase *)getCluster
+{
+ return &_cppCluster;
+}
+
+- (void)getFabricId:(ResponseHandler)completionHandler
+{
+ CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess
+ = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.GetFabricId(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)removeFabric:(uint64_t)fabricId
+ nodeId:(uint64_t)nodeId
+ vendorId:(uint16_t)vendorId
+ completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId);
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler
+{
+ CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.UpdateFabricLabel(onSuccess->Cancel(), onFailure->Cancel(),
+ chip::ByteSpan((const uint8_t *) [label dataUsingEncoding:NSUTF8StringEncoding].bytes,
+ [label lengthOfBytesUsingEncoding:NSUTF8StringEncoding]));
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeFabricsList:(ResponseHandler)completionHandler
+{
+ CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * onSuccess
+ = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeFabricsList(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler
+{
+ CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onSuccess) {
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]);
+ if (!onFailure) {
+ delete onSuccess;
+ completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil);
+ return;
+ }
+
+ CHIP_ERROR err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
+ if (err != CHIP_NO_ERROR) {
+ delete onSuccess;
+ delete onFailure;
+ completionHandler([CHIPError errorForCHIPErrorCode:err], nil);
+ }
+}
+
+@end
+
@interface CHIPScenes ()
@property (readonly) Controller::ScenesCluster cppCluster;
@end
diff --git a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp
index 7185b07..2c0f6a5 100644
--- a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp
+++ b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp
@@ -3527,6 +3527,94 @@
} // namespace NetworkCommissioning
+namespace OperationalCredentials {
+
+void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
+{
+ {
+ switch (aCommandId)
+ {
+ case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: {
+ // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV
+ // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error.
+ // Any error value TLVUnpackError means we have received an illegal value.
+ CHIP_ERROR TLVError = CHIP_NO_ERROR;
+ CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR;
+ chip::FabricId FabricId;
+ bool FabricIdExists = false;
+ uint32_t validArgumentCount = 0;
+
+ while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR)
+ {
+ switch (TLV::TagNumFromTag(aDataTlv.GetTag()))
+ {
+ case 0:
+ if (FabricIdExists)
+ {
+ ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag()));
+ TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT;
+ break;
+ }
+ TLVUnpackError = aDataTlv.Get(FabricId);
+ if (CHIP_NO_ERROR == TLVUnpackError)
+ {
+ FabricIdExists = true;
+ validArgumentCount++;
+ }
+ break;
+ default:
+ // Unsupported tag, ignore it.
+ ChipLogProgress(Zcl, "Unknown TLV tag during processing.");
+ break;
+ }
+ if (TLVUnpackError != CHIP_NO_ERROR)
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32,
+ TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError);
+ break;
+ }
+ }
+
+ if (CHIP_END_OF_TLV == TLVError)
+ {
+ // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error.
+ TLVError = CHIP_NO_ERROR;
+ }
+ else
+ {
+ ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError);
+ }
+
+ // TODO(#5590) We should encode a response of status code for invalid TLV.
+ if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount)
+ {
+ // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
+ emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(FabricId);
+ }
+ else
+ {
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogProgress(
+ Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32,
+ 1, validArgumentCount, TLVError, TLVUnpackError);
+ }
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound,
+ Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure);
+ ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId,
+ ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID);
+ break;
+ }
+ }
+ }
+}
+
+} // namespace OperationalCredentials
+
namespace Scenes {
void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv)
diff --git a/src/darwin/Framework/CHIP/gen/af-structs.h b/src/darwin/Framework/CHIP/gen/af-structs.h
index 7c32c68..e9e59d3 100644
--- a/src/darwin/Framework/CHIP/gen/af-structs.h
+++ b/src/darwin/Framework/CHIP/gen/af-structs.h
@@ -185,6 +185,15 @@
uint8_t attributeAccessControl;
} EmberAfExtendedDiscoverAttributesInfoRecord;
+// Struct for FabricDescriptor
+typedef struct _FabricDescriptor
+{
+ chip::FabricId FabricId;
+ uint16_t VendorId;
+ uint8_t * Label;
+ chip::NodeId NodeId;
+} EmberAfFabricDescriptor;
+
// Struct for GpPairingConfigurationGroupList
typedef struct _GpPairingConfigurationGroupList
{
diff --git a/src/darwin/Framework/CHIP/gen/attribute-id.h b/src/darwin/Framework/CHIP/gen/attribute-id.h
index 61c5325..43d1087 100644
--- a/src/darwin/Framework/CHIP/gen/attribute-id.h
+++ b/src/darwin/Framework/CHIP/gen/attribute-id.h
@@ -421,6 +421,13 @@
// Server attributes
+// Attribute ids for cluster: Operational Credentials
+
+// Client attributes
+
+// Server attributes
+#define ZCL_FABRICS_ATTRIBUTE_ID (0x0001)
+
// Attribute ids for cluster: Shade Configuration
// Client attributes
diff --git a/src/darwin/Framework/CHIP/gen/attribute-size.h b/src/darwin/Framework/CHIP/gen/attribute-size.h
index ee211ce..1dea3de 100644
--- a/src/darwin/Framework/CHIP/gen/attribute-size.h
+++ b/src/darwin/Framework/CHIP/gen/attribute-size.h
@@ -34,4 +34,4 @@
ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_UTC_TIME_ATTRIBUTE_TYPE, 4, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 2, ZCL_ATTRIBUTE_ID_ATTRIBUTE_TYPE,
2, ZCL_BACNET_OID_ATTRIBUTE_TYPE, 4, ZCL_IEEE_ADDRESS_ATTRIBUTE_TYPE, 8, ZCL_SECURITY_KEY_ATTRIBUTE_TYPE, 16,
ZCL_ENDPOINT_ID_ATTRIBUTE_TYPE, 1, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 1, ZCL_NODE_ID_ATTRIBUTE_TYPE,
- 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4,
+ 8, ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8,
diff --git a/src/darwin/Framework/CHIP/gen/attribute-type.h b/src/darwin/Framework/CHIP/gen/attribute-type.h
index 6f12999..bcf9ee3 100644
--- a/src/darwin/Framework/CHIP/gen/attribute-type.h
+++ b/src/darwin/Framework/CHIP/gen/attribute-type.h
@@ -83,5 +83,6 @@
ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xF4, // Command Id
ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF5, // Node Id
ZCL_DEVICE_TYPE_ID_ATTRIBUTE_TYPE = 0xF6, // Device Type Id
+ ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF7, // Fabric Id
ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown
};
diff --git a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp
index 377448a..299b632 100644
--- a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp
+++ b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp
@@ -43,6 +43,7 @@
EmberAfStatus emberAfLowPowerClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfNetworkCommissioningClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfOnOffClusterClientCommandParse(EmberAfClusterCommand * cmd);
+EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd);
EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd);
@@ -130,6 +131,9 @@
// No commands are enabled for cluster On/off
result = status(false, true, cmd->mfgSpecific);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ result = emberAfOperationalCredentialsClusterClientCommandParse(cmd);
+ break;
case ZCL_SCENES_CLUSTER_ID:
result = emberAfScenesClusterClientCommandParse(cmd);
break;
@@ -1065,6 +1069,35 @@
}
return status(wasHandled, true, cmd->mfgSpecific);
}
+EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClusterCommand * cmd)
+{
+ bool wasHandled = false;
+
+ if (!cmd->mfgSpecific)
+ {
+ switch (cmd->commandId)
+ {
+ case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: {
+ uint16_t payloadOffset = cmd->payloadStartIndex;
+ chip::FabricId FabricId;
+
+ if (cmd->bufLen < payloadOffset + 8)
+ {
+ return EMBER_ZCL_STATUS_MALFORMED_COMMAND;
+ }
+ FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen);
+
+ wasHandled = emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(FabricId);
+ break;
+ }
+ default: {
+ // Unrecognized command ID, error status will apply.
+ break;
+ }
+ }
+ }
+ return status(wasHandled, true, cmd->mfgSpecific);
+}
EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd)
{
bool wasHandled = false;
diff --git a/src/darwin/Framework/CHIP/gen/callback-stub.cpp b/src/darwin/Framework/CHIP/gen/callback-stub.cpp
index 0ff0367..1782c06 100644
--- a/src/darwin/Framework/CHIP/gen/callback-stub.cpp
+++ b/src/darwin/Framework/CHIP/gen/callback-stub.cpp
@@ -74,6 +74,9 @@
case ZCL_ON_OFF_CLUSTER_ID:
emberAfOnOffClusterInitCallback(endpoint);
break;
+ case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID:
+ emberAfOperationalCredentialsClusterInitCallback(endpoint);
+ break;
case ZCL_SCENES_CLUSTER_ID:
emberAfScenesClusterInitCallback(endpoint);
break;
@@ -161,6 +164,11 @@
// To prevent warning
(void) endpoint;
}
+void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint)
+{
+ // To prevent warning
+ (void) endpoint;
+}
void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint)
{
// To prevent warning
diff --git a/src/darwin/Framework/CHIP/gen/callback.h b/src/darwin/Framework/CHIP/gen/callback.h
index 4623cde..f971c6e 100644
--- a/src/darwin/Framework/CHIP/gen/callback.h
+++ b/src/darwin/Framework/CHIP/gen/callback.h
@@ -159,6 +159,14 @@
*/
void emberAfOnOffClusterInitCallback(chip::EndpointId endpoint);
+/** @brief Operational Credentials Cluster Init
+ *
+ * Cluster Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterInitCallback(chip::EndpointId endpoint);
+
/** @brief Scenes Cluster Init
*
* Cluster Init
@@ -1229,6 +1237,77 @@
void emberAfOnOffClusterClientTickCallback(chip::EndpointId endpoint);
//
+// Operational Credentials Cluster client
+//
+
+/** @brief Operational Credentials Cluster Client Init
+ *
+ * Client Init
+ *
+ * @param endpoint Endpoint that is being initialized
+ */
+void emberAfOperationalCredentialsClusterClientInitCallback(chip::EndpointId endpoint);
+
+/** @brief Operational Credentials Cluster Client Attribute Changed
+ *
+ * Client Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ */
+void emberAfOperationalCredentialsClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
+
+/** @brief Operational Credentials Cluster Client Manufacturer Specific Attribute Changed
+ *
+ * Client Manufacturer Specific Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute that changed
+ * @param manufacturerCode Manufacturer Code of the attribute that changed
+ */
+void emberAfOperationalCredentialsClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ uint16_t manufacturerCode);
+
+/** @brief Operational Credentials Cluster Client Message Sent
+ *
+ * Client Message Sent
+ *
+ * @param type The type of message sent
+ * @param indexOrDestination The destination or address to which the message was sent
+ * @param apsFrame The APS frame for the message
+ * @param msgLen The length of the message
+ * @param message The message that was sent
+ * @param status The status of the sent message
+ */
+void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
+ EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
+ EmberStatus status);
+
+/** @brief Operational Credentials Cluster Client Pre Attribute Changed
+ *
+ * client Pre Attribute Changed
+ *
+ * @param endpoint Endpoint that is being initialized
+ * @param attributeId Attribute to be changed
+ * @param attributeType Attribute type
+ * @param size Attribute size
+ * @param value Attribute value
+ */
+EmberAfStatus emberAfOperationalCredentialsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint,
+ chip::AttributeId attributeId,
+ EmberAfAttributeType attributeType,
+ uint8_t size, uint8_t * value);
+
+/** @brief Operational Credentials Cluster Client Tick
+ *
+ * client Tick
+ *
+ * @param endpoint Endpoint that is being served
+ */
+void emberAfOperationalCredentialsClusterClientTickCallback(chip::EndpointId endpoint);
+
+//
// Scenes Cluster client
//
@@ -1700,6 +1779,13 @@
bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(uint8_t errorCode, uint8_t * debugText);
/**
+ * @brief Operational Credentials Cluster GetFabricIdResponse Command callback
+ * @param fabricId
+ */
+
+bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::FabricId FabricId);
+
+/**
* @brief Scenes Cluster AddSceneResponse Command callback
* @param status
* @param groupId
diff --git a/src/darwin/Framework/CHIP/gen/client-command-macro.h b/src/darwin/Framework/CHIP/gen/client-command-macro.h
index deb0680..0fb791f 100644
--- a/src/darwin/Framework/CHIP/gen/client-command-macro.h
+++ b/src/darwin/Framework/CHIP/gen/client-command-macro.h
@@ -2223,6 +2223,49 @@
\
ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs);
+/** @brief Command description for GetFabricId
+ *
+ * Command: GetFabricId
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_COMMAND_ID, "", );
+
+/** @brief Command description for GetFabricIdResponse
+ *
+ * Command: GetFabricIdResponse
+ * @param FabricId FABRIC_ID
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterGetFabricIdResponse(FabricId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId);
+
+/** @brief Command description for UpdateFabricLabel
+ *
+ * Command: UpdateFabricLabel
+ * @param Label CHAR_STRING
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterUpdateFabricLabel(Label) emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID, "u", Label);
+
+/** @brief Command description for RemoveFabric
+ *
+ * Command: RemoveFabric
+ * @param FabricId FABRIC_ID
+ * @param NodeId NODE_ID
+ * @param VendorId INT16U
+ */
+#define emberAfFillCommandOperational \
+ CredentialsClusterRemoveFabric(FabricId, NodeId, VendorId) \
+ emberAfFillExternalBuffer(mask, \
+ \
+ ZCL_REMOVE_FABRIC_COMMAND_ID, "uuu", FabricId, NodeId, VendorId);
+
/** @brief Command description for LockDoor
*
* Command: LockDoor
diff --git a/src/darwin/Framework/CHIP/gen/cluster-id.h b/src/darwin/Framework/CHIP/gen/cluster-id.h
index b1be293..3aea880 100644
--- a/src/darwin/Framework/CHIP/gen/cluster-id.h
+++ b/src/darwin/Framework/CHIP/gen/cluster-id.h
@@ -98,6 +98,9 @@
// Definitions for cluster: Network Commissioning
#define ZCL_NETWORK_COMMISSIONING_CLUSTER_ID (0x0031)
+// Definitions for cluster: Operational Credentials
+#define ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID (0x003E)
+
// Definitions for cluster: Shade Configuration
#define ZCL_SHADE_CONFIG_CLUSTER_ID (0x0100)
diff --git a/src/darwin/Framework/CHIP/gen/command-id.h b/src/darwin/Framework/CHIP/gen/command-id.h
index fae33f4..49031b9 100644
--- a/src/darwin/Framework/CHIP/gen/command-id.h
+++ b/src/darwin/Framework/CHIP/gen/command-id.h
@@ -267,6 +267,12 @@
#define ZCL_DISABLE_NETWORK_RESPONSE_COMMAND_ID (0x0F)
#define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10)
+// Commands for cluster: Operational Credentials
+#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00)
+#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01)
+#define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09)
+#define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A)
+
// Commands for cluster: Door Lock
#define ZCL_LOCK_DOOR_COMMAND_ID (0x00)
#define ZCL_LOCK_DOOR_RESPONSE_COMMAND_ID (0x00)
diff --git a/src/darwin/Framework/CHIP/gen/endpoint_config.h b/src/darwin/Framework/CHIP/gen/endpoint_config.h
index c0681f2..4bd9f3d 100644
--- a/src/darwin/Framework/CHIP/gen/endpoint_config.h
+++ b/src/darwin/Framework/CHIP/gen/endpoint_config.h
@@ -63,7 +63,7 @@
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
// This is an array of EmberAfAttributeMetadata structures.
-#define GENERATED_ATTRIBUTE_COUNT 17
+#define GENERATED_ATTRIBUTE_COUNT 18
#define GENERATED_ATTRIBUTES \
{ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
@@ -85,6 +85,8 @@
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(0x0001) }, /* Network Commissioning (client): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
+ ZAP_SIMPLE_DEFAULT(0x0001) }, /* Operational Credentials (client): cluster revision */ \
+ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(3) }, /* Door Lock (client): cluster revision */ \
{ 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), \
ZAP_SIMPLE_DEFAULT(0x0001) }, /* Barrier Control (client): cluster revision */ \
@@ -109,7 +111,7 @@
#define GENERATED_FUNCTION_ARRAYS
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
-#define GENERATED_CLUSTER_COUNT 17
+#define GENERATED_CLUSTER_COUNT 18
#define GENERATED_CLUSTERS \
{ \
{ 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \
@@ -130,28 +132,31 @@
0x0031, ZAP_ATTRIBUTE_INDEX(8), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Network Commissioning (client) */ \
{ \
- 0x0101, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x003E, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ }, /* Endpoint: 1, Cluster: Operational Credentials (client) */ \
+ { \
+ 0x0101, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Door Lock (client) */ \
{ \
- 0x0103, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0103, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Barrier Control (client) */ \
{ \
- 0x0300, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0300, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Color Control (client) */ \
{ \
- 0x0402, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0402, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \
{ \
- 0x0508, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x0508, ZAP_ATTRIBUTE_INDEX(14), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Low Power (client) */ \
{ \
- 0x050D, ZAP_ATTRIBUTE_INDEX(14), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0x050D, ZAP_ATTRIBUTE_INDEX(15), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Application Basic (client) */ \
{ \
- 0xF000, ZAP_ATTRIBUTE_INDEX(15), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0xF000, ZAP_ATTRIBUTE_INDEX(16), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Binding (client) */ \
{ \
- 0xF004, ZAP_ATTRIBUTE_INDEX(16), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
+ 0xF004, ZAP_ATTRIBUTE_INDEX(17), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \
}, /* Endpoint: 1, Cluster: Group Key Management (client) */ \
}
@@ -160,7 +165,7 @@
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES \
{ \
- { ZAP_CLUSTER_INDEX(0), 17, 34 }, \
+ { ZAP_CLUSTER_INDEX(0), 18, 36 }, \
}
// Largest attribute size is needed for various buffers
@@ -170,7 +175,7 @@
#define ATTRIBUTE_SINGLETONS_SIZE (2)
// Total size of attribute storage
-#define ATTRIBUTE_MAX_SIZE (34)
+#define ATTRIBUTE_MAX_SIZE (36)
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT (1)
@@ -214,7 +219,7 @@
// Array of EmberAfCommandMetadata structs.
#define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
-#define EMBER_AF_GENERATED_COMMAND_COUNT (131)
+#define EMBER_AF_GENERATED_COMMAND_COUNT (135)
#define GENERATED_COMMANDS \
{ \
{ 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify (client): Identify */ \
@@ -283,6 +288,10 @@
{ 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (client): DisableNetworkResponse */ \
{ 0x0031, 0x10, \
ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (client): GetLastNetworkCommissioningResult */ \
+ { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): GetFabricId */ \
+ { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Operational Credentials (client): GetFabricIdResponse */ \
+ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): UpdateFabricLabel */ \
+ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Operational Credentials (client): RemoveFabric */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (client): LockDoor */ \
{ 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Door Lock (client): LockDoorResponse */ \
{ 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Door Lock (client): UnlockDoor */ \
diff --git a/src/darwin/Framework/CHIP/gen/gen_config.h b/src/darwin/Framework/CHIP/gen/gen_config.h
index 600167c..2f96c3d 100644
--- a/src/darwin/Framework/CHIP/gen/gen_config.h
+++ b/src/darwin/Framework/CHIP/gen/gen_config.h
@@ -44,6 +44,7 @@
#define EMBER_AF_LOW_POWER_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
+#define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_SCENES_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1)
@@ -109,6 +110,10 @@
#define ZCL_USING_ON_OFF_CLUSTER_CLIENT
#define EMBER_AF_PLUGIN_ON_OFF_CLIENT
+// 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 client side of the Scenes cluster is included
#define ZCL_USING_SCENES_CLUSTER_CLIENT
#define EMBER_AF_PLUGIN_SCENES_CLIENT
diff --git a/src/darwin/Framework/CHIP/gen/print-cluster.h b/src/darwin/Framework/CHIP/gen/print-cluster.h
index 49b2c31..68d3e99 100644
--- a/src/darwin/Framework/CHIP/gen/print-cluster.h
+++ b/src/darwin/Framework/CHIP/gen/print-cluster.h
@@ -180,6 +180,12 @@
#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER
#endif
+#if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT)
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, 62, "Operational Credentials" },
+#else
+#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER
+#endif
+
#if defined(ZCL_USING_SHADE_CONFIG_CLUSTER_SERVER) || defined(ZCL_USING_SHADE_CONFIG_CLUSTER_CLIENT)
#define CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER { ZCL_SHADE_CONFIG_CLUSTER_ID, 256, "Shade Configuration" },
#else
@@ -888,6 +894,7 @@
CHIP_PRINTCLUSTER_OTA_CLIENT_CLUSTER \
CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER \
CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER \
+ CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \
CHIP_PRINTCLUSTER_SHADE_CONFIG_CLUSTER \
CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER \
CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER \