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 840a3846316938..a2242bc7662473 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 @@ -870,6 +870,72 @@ } ] }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Basic", "code": 40, diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 78a2a7b8661456..46a73328487273 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -39,6 +39,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/account-login-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-launcher-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/audio-output-server" diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index c6b1eb1fd336a9..a71393a6880cfa 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -93,6 +93,7 @@ target_sources(${APP_TARGET} PRIVATE ${APP_CLUSTERS}/basic/basic.cpp ${APP_CLUSTERS}/bindings/bindings.cpp ${APP_CLUSTERS}/on-off-server/on-off-server.cpp + ${APP_CLUSTERS}/access-control-server/access-control-server.cpp ${APP_CLUSTERS}/account-login-server/account-login-server.cpp ${APP_CLUSTERS}/application-launcher-server/application-launcher-server.cpp ${APP_CLUSTERS}/audio-output-server/audio-output-server.cpp diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp new file mode 100644 index 00000000000000..25dde950bbd703 --- /dev/null +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -0,0 +1,18 @@ +/** + * + * 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. + */ + +void MatterAccessControlPluginServerInitCallback() {} diff --git a/src/app/tests/suites/TestDescriptorCluster.yaml b/src/app/tests/suites/TestDescriptorCluster.yaml index 41ee3a11fd0955..af0a6f3a91c612 100644 --- a/src/app/tests/suites/TestDescriptorCluster.yaml +++ b/src/app/tests/suites/TestDescriptorCluster.yaml @@ -36,6 +36,7 @@ tests: value: [ 0x0003, # Identify 0x001D, # Descriptor + 0x001F, # Access Control 0x0028, # Basic Information 0x0029, # OTA Software Update Provider 0x002A, # OTA Software Update Requestor diff --git a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml index f060842a271e40..c111973ef8716a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml @@ -67,13 +67,13 @@ limitations under the License. and enforce Access Control for the Node’s endpoints and their associated cluster instances. - + ACL - + Extension diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 2ffebaae0cebed..cf41f657e17142 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -2,6 +2,7 @@ "version": "ZCL Test Data", "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], "xmlFile": [ + "access-control-cluster.xml", "account-login-cluster.xml", "administrator-commissioning-cluster.xml", "application-basic-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 18a0a70f89f547..7f271bfd004000 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -9,10 +9,11 @@ # List of directories in src/app/clusters to build for server clusters. SERVER_CLUSTERS: typing.Dict[str, typing.List[str]] = { - 'ALARM_CLUSTER': [], - 'APPLICATION_BASIC_CLUSTER': ['application-basic-server'], + 'ACCESS_CONTROL_CLUSTER': ['access-control-server'], 'ACCOUNT_LOGIN_CLUSTER': ['account-login-server'], 'ADMINISTRATOR_COMMISSIONING_CLUSTER': ['administrator-commissioning-server'], + 'ALARM_CLUSTER': [], + 'APPLICATION_BASIC_CLUSTER': ['application-basic-server'], 'APPLICATION_LAUNCHER_CLUSTER': ['application-launcher-server'], 'AUDIO_OUTPUT_CLUSTER': ['audio-output-server'], 'BARRIER_CONTROL_CLUSTER': ['barrier-control-server'], @@ -29,13 +30,14 @@ 'DEVICE_TEMP_CLUSTER': [], 'DIAGNOSTIC_LOGS_CLUSTER': ['diagnostic-logs-server'], 'DOOR_LOCK_CLUSTER': ['door-lock-server'], + 'ELECTRICAL_MEASUREMENT_CLUSTER': [], 'ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER': ['ethernet_network_diagnostics_server'], 'FIXED_LABEL_CLUSTER': [], 'FLOW_MEASUREMENT_CLUSTER': [], 'GENERAL_COMMISSIONING_CLUSTER': ['general-commissioning-server'], 'GENERAL_DIAGNOSTICS_CLUSTER': ['general_diagnostics_server'], - 'GROUPS_CLUSTER': ['groups-server'], 'GROUP_KEY_MANAGEMENT_CLUSTER': [], + 'GROUPS_CLUSTER': ['groups-server'], 'IAS_ZONE_CLUSTER': ['ias-zone-server'], 'IDENTIFY_CLUSTER': ['identify-server'], 'ILLUMINANCE_MEASUREMENT_CLUSTER': [], @@ -58,31 +60,31 @@ 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-server'], 'RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER': [], - 'ELECTRICAL_MEASUREMENT_CLUSTER': [], 'SCENES_CLUSTER': ['scenes'], 'SOFTWARE_DIAGNOSTICS_CLUSTER': ['software_diagnostics_server'], 'SWITCH_CLUSTER': [], 'TARGET_NAVIGATOR_CLUSTER': ['target-navigator-server'], 'TEMP_MEASUREMENT_CLUSTER': [], 'TEST_CLUSTER': ['test-cluster-server'], - 'TV_CHANNEL_CLUSTER': ['tv-channel-server'], 'THERMOSTAT_CLUSTER': ['thermostat-server'], - 'THREAD_NETWORK_DIAGNOSTICS_CLUSTER': ['thread_network_diagnostics_server'], - 'WINDOW_COVERING_CLUSTER': ['window-covering-server'], 'THERMOSTAT_UI_CONFIG_CLUSTER': ['thermostat-user-interface-configuration-server'], - 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': ['wifi_network_diagnostics_server'], + 'THREAD_NETWORK_DIAGNOSTICS_CLUSTER': ['thread_network_diagnostics_server'], + 'TV_CHANNEL_CLUSTER': ['tv-channel-server'], 'WAKE_ON_LAN_CLUSTER': [], + 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': ['wifi_network_diagnostics_server'], + 'WINDOW_COVERING_CLUSTER': ['window-covering-server'], 'ZLL_COMMISSIONING_CLUSTER': [] } # List of directories in src/app/clusters to build for client clusters. CLIENT_CLUSTERS: typing.Dict[str, typing.List[str]] = { - 'ALARM_CLUSTER': [], + 'ACCESS_CONTROL_CLUSTER': [], 'ACCOUNT_LOGIN_CLUSTER': [], 'ADMINISTRATOR_COMMISSIONING_CLUSTER': [], + 'ALARM_CLUSTER': [], + 'APPLICATION_BASIC_CLUSTER': [], 'APPLICATION_LAUNCHER_CLUSTER': [], 'AUDIO_OUTPUT_CLUSTER': [], - 'APPLICATION_BASIC_CLUSTER': [], 'BARRIER_CONTROL_CLUSTER': [], 'BASIC_CLUSTER': [], 'BINARY_INPUT_BASIC_CLUSTER': [], @@ -93,17 +95,18 @@ 'COLOR_CONTROL_CLUSTER': [], 'COMMISSIONING_CLUSTER': [], 'CONTENT_LAUNCH_CLUSTER': [], - 'DEVICE_TEMP_CLUSTER': [], 'DESCRIPTOR_CLUSTER': [], + 'DEVICE_TEMP_CLUSTER': [], 'DIAGNOSTIC_LOGS_CLUSTER': [], 'DOOR_LOCK_CLUSTER': [], + 'ELECTRICAL_MEASUREMENT_CLUSTER': [], 'ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER': [], 'FIXED_LABEL_CLUSTER': [], 'FLOW_MEASUREMENT_CLUSTER': [], 'GENERAL_COMMISSIONING_CLUSTER': [], 'GENERAL_DIAGNOSTICS_CLUSTER': [], - 'GROUPS_CLUSTER': [], 'GROUP_KEY_MANAGEMENT_CLUSTER': [], + 'GROUPS_CLUSTER': [], 'IAS_ZONE_CLUSTER': ['ias-zone-client'], 'IDENTIFY_CLUSTER': [], 'ILLUMINANCE_MEASUREMENT_CLUSTER': [], @@ -126,21 +129,20 @@ 'PRESSURE_MEASUREMENT_CLUSTER': [], 'PUMP_CONFIG_CONTROL_CLUSTER': ['pump-configuration-and-control-client'], 'RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER': [], - 'ELECTRICAL_MEASUREMENT_CLUSTER': [], 'SCENES_CLUSTER': [], 'SOFTWARE_DIAGNOSTICS_CLUSTER': [], 'SWITCH_CLUSTER': [], 'TARGET_NAVIGATOR_CLUSTER': [], 'TEMP_MEASUREMENT_CLUSTER': [], 'TEST_CLUSTER': [], - 'TRUSTED_ROOT_CERTIFICATES_CLUSTER': [], - 'TV_CHANNEL_CLUSTER': [], 'THERMOSTAT_CLUSTER': ['thermostat-client'], 'THERMOSTAT_UI_CONFIG_CLUSTER': [], 'THREAD_NETWORK_DIAGNOSTICS_CLUSTER': [], - 'WINDOW_COVERING_CLUSTER': [], - 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': [], + 'TRUSTED_ROOT_CERTIFICATES_CLUSTER': [], + 'TV_CHANNEL_CLUSTER': [], 'WAKE_ON_LAN_CLUSTER': [], + 'WIFI_NETWORK_DIAGNOSTICS_CLUSTER': [], + 'WINDOW_COVERING_CLUSTER': [], 'ZLL_COMMISSIONING_CLUSTER': [] } diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index db8ab8eda2853f..e16ece5694f143 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1343,6 +1343,88 @@ } ] }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [], + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Bridged Actions", "code": 37, diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index 426ebe3e0174e9..422fbd2476193f 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -23,6 +23,12 @@ typedef void (*CHIPDefaultSuccessCallbackType)(void *, const chip::app::DataMode typedef void (*CHIPDefaultWriteSuccessCallbackType)(void *); typedef void (*CHIPDefaultFailureCallbackType)(void *, EmberAfStatus); +typedef void (*CHIPAccessControlClusterAclAttributeCallbackType)( + void *, const chip::app::Clusters::AccessControl::Attributes::Acl::TypeInfo::DecodableType &); +typedef void (*CHIPAccessControlClusterExtensionAttributeCallbackType)( + void *, const chip::app::Clusters::AccessControl::Attributes::Extension::TypeInfo::DecodableType &); +typedef void (*CHIPAccessControlClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::AccessControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPAccountLoginClusterGetSetupPINResponseCallbackType)( void *, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &); diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index e08dea3c1cc44f..f6188370926ea6 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -49,6 +49,15 @@ JNI_METHOD(void, BaseChipCluster, deleteCluster)(JNIEnv * env, jobject self, jlo } } +JNI_METHOD(jlong, AccessControlCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) +{ + chip::DeviceLayer::StackLock lock; + AccessControlCluster * cppCluster = new AccessControlCluster(); + + cppCluster->Associate(reinterpret_cast(devicePtr), endpointId); + return reinterpret_cast(cppCluster); +} + JNI_METHOD(jlong, AccountLoginCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index ac2ee3c2795e04..0f27ed418f12c1 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -30,6 +30,110 @@ #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME +JNI_METHOD(void, AccessControlCluster, readAclAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AccessControl::Attributes::Acl::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::AccessControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, AccessControlCluster, readExtensionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AccessControl::Attributes::Extension::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::AccessControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + +JNI_METHOD(void, AccessControlCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) +{ + chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AccessControl::Attributes::ClusterRevision::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), chip::Platform::Delete); + VerifyOrReturn(onSuccess.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); + + std::unique_ptr onFailure( + chip::Platform::New(callback), chip::Platform::Delete); + VerifyOrReturn(onFailure.get() != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); + + CHIP_ERROR err = CHIP_NO_ERROR; + chip::Controller::AccessControlCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + JNI_METHOD(void, AccountLoginCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 43e4db1f0d0117..73b09360b12e17 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -672,6 +672,257 @@ void CHIPOctetStringAttributeCallback::CallbackFn(void * context, const chip::By env->CallVoidMethod(javaCallbackRef, javaMethod, valueArr); } +CHIPAccessControlAclAttributeCallback::CHIPAccessControlAclAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPAccessControlAclAttributeCallback::~CHIPAccessControlAclAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPAccessControlAclAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$AccessControlCluster$AclAttribute", attributeClass); + VerifyOrReturn(err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$AccessControlCluster$AclAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = + env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find AclAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + chip::FabricIndex fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool privilegeNull = false; + bool privilegeHasValue = true; + + chip::app::Clusters::AccessControl::Privilege privilegeValue = entry.privilege; + + jobject privilege = nullptr; + if (!privilegeNull && privilegeHasValue) + { + jclass privilegeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", privilegeEntryCls); + chip::JniClass privilegeJniClass(privilegeEntryCls); + jmethodID privilegeEntryTypeCtor = env->GetMethodID(privilegeEntryCls, "", "(I)V"); + privilege = env->NewObject(privilegeEntryCls, privilegeEntryTypeCtor, privilegeValue); + } + + bool authModeNull = false; + bool authModeHasValue = true; + + chip::app::Clusters::AccessControl::AuthMode authModeValue = entry.authMode; + + jobject authMode = nullptr; + if (!authModeNull && authModeHasValue) + { + jclass authModeEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", authModeEntryCls); + chip::JniClass authModeJniClass(authModeEntryCls); + jmethodID authModeEntryTypeCtor = env->GetMethodID(authModeEntryCls, "", "(I)V"); + authMode = env->NewObject(authModeEntryCls, authModeEntryTypeCtor, authModeValue); + } + + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, privilege, authMode); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create AclAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + } + VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding AclAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPAccessControlExtensionAttributeCallback::CHIPAccessControlExtensionAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPAccessControlExtensionAttributeCallback::~CHIPAccessControlExtensionAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPAccessControlExtensionAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$AccessControlCluster$ExtensionAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError(Zcl, "Could not find class chip/devicecontroller/ChipClusters$AccessControlCluster$ExtensionAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = env->GetMethodID(attributeClass, "", "(Ljava/lang/Integer;[B)V"); + VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ExtensionAttribute constructor")); + + auto iter = list.begin(); + while (iter.Next()) + { + auto & entry = iter.GetValue(); + (void) entry; + bool fabricIndexNull = false; + bool fabricIndexHasValue = true; + + chip::FabricIndex fabricIndexValue = entry.fabricIndex; + + jobject fabricIndex = nullptr; + if (!fabricIndexNull && fabricIndexHasValue) + { + jclass fabricIndexEntryCls; + chip::JniReferences::GetInstance().GetClassRef(env, "java/lang/Integer", fabricIndexEntryCls); + chip::JniClass fabricIndexJniClass(fabricIndexEntryCls); + jmethodID fabricIndexEntryTypeCtor = env->GetMethodID(fabricIndexEntryCls, "", "(I)V"); + fabricIndex = env->NewObject(fabricIndexEntryCls, fabricIndexEntryTypeCtor, fabricIndexValue); + } + + bool dataNull = false; + bool dataHasValue = true; + + chip::ByteSpan dataValue = entry.data; + + jbyteArray data = nullptr; + if (!dataNull && dataHasValue) + { + data = env->NewByteArray(dataValue.size()); + env->SetByteArrayRegion(data, 0, dataValue.size(), reinterpret_cast(dataValue.data())); + } + + jobject attributeObj = env->NewObject(attributeClass, attributeCtor, fabricIndex, data); + VerifyOrReturn(attributeObj != nullptr, ChipLogError(Zcl, "Could not create ExtensionAttribute object")); + + env->CallBooleanMethod(arrayListObj, arrayListAddMethod, attributeObj); + } + VerifyOrReturn(iter.GetStatus() == CHIP_NO_ERROR, + ChipLogError(Zcl, "Error decoding ExtensionAttribute value: %" CHIP_ERROR_FORMAT, iter.GetStatus().Format())); + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CHIPApplicationLauncherApplicationLauncherListAttributeCallback( jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 215a7c4bd239f0..eb9a57c180f756 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -308,6 +308,59 @@ class CHIPOctetStringAttributeCallback : public chip::Callback::Callback +{ +public: + CHIPAccessControlAclAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPAccessControlAclAttributeCallback(); + + static void maybeDestroy(CHIPAccessControlAclAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPAccessControlExtensionAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPAccessControlExtensionAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPAccessControlExtensionAttributeCallback(); + + static void maybeDestroy(CHIPAccessControlExtensionAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + class CHIPApplicationLauncherApplicationLauncherListAttributeCallback : public chip::Callback::Callback { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index d769c8f70a0fae..fa8175ce3f9176 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -98,6 +98,105 @@ protected void finalize() throws Throwable { } } + public static class AccessControlCluster extends BaseChipCluster { + public AccessControlCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + public static long clusterId() { + return Long.parseUnsignedLong("31"); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public static class AclAttribute { + public Integer fabricIndex; + public Integer privilege; + public Integer authMode; + + public AclAttribute(Integer fabricIndex, Integer privilege, Integer authMode) { + this.fabricIndex = fabricIndex; + this.privilege = privilege; + this.authMode = authMode; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); + output.append("\n"); + + output.append("int privilege: "); + output.append(this.privilege); + output.append("\n"); + + output.append("int authMode: "); + output.append(this.authMode); + output.append("\n"); + + return output.toString(); + } + } + + public interface AclAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + } + + public static class ExtensionAttribute { + public Integer fabricIndex; + public byte[] data; + + public ExtensionAttribute(Integer fabricIndex, byte[] data) { + this.fabricIndex = fabricIndex; + this.data = data; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(""); + output.append("int fabricIndex: "); + output.append(this.fabricIndex); + output.append("\n"); + + output.append("byte[] "); + output.append(Arrays.toString(data)); + output.append("\n"); + + return output.toString(); + } + } + + public interface ExtensionAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + } + + public void readAclAttribute(AclAttributeCallback callback) { + readAclAttribute(chipClusterPtr, callback); + } + + public void readExtensionAttribute(ExtensionAttributeCallback callback) { + readExtensionAttribute(chipClusterPtr, callback); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + private native void readAclAttribute(long chipClusterPtr, AclAttributeCallback callback); + + private native void readExtensionAttribute( + long chipClusterPtr, ExtensionAttributeCallback callback); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + } + public static class AccountLoginCluster extends BaseChipCluster { public AccountLoginCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index e018fc5f6dd8fd..c3072a0df8a8c6 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -221,6 +221,59 @@ public void onError(Exception e) { } } + public static class DelegatedAclAttributeCallback + implements ChipClusters.AccessControlCluster.AclAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedExtensionAttributeCallback + implements ChipClusters.AccessControlCluster.ExtensionAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedGetSetupPINResponseCallback implements ChipClusters.AccountLoginCluster.GetSetupPINResponseCallback, DelegatedClusterCallback { @@ -2948,6 +3001,11 @@ public Map getClusterMap() { public Map initializeClusterMap() { Map clusterMap = new HashMap<>(); + ClusterInfo accessControlClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.AccessControlCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("accessControl", accessControlClusterInfo); ClusterInfo accountLoginClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.AccountLoginCluster(ptr, endpointId), @@ -3244,6 +3302,7 @@ public Map initializeClusterMap() { public void combineCommand( Map destination, Map> source) { + destination.get("accessControl").combineCommands(source.get("accessControl")); destination.get("accountLogin").combineCommands(source.get("accountLogin")); destination .get("administratorCommissioning") @@ -3327,6 +3386,8 @@ public void combineCommand( @SuppressWarnings("unchecked") public Map> getCommandMap() { Map> commandMap = new HashMap<>(); + Map accessControlClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("accessControl", accessControlClusterInteractionInfoMap); Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); Map accountLogingetSetupPINCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 92e31f9978fccb..e4321da16da6e2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -29,6 +29,46 @@ public class ClusterReadMapping { public Map> getReadAttributeMap() { Map> readAttributeMap = new HashMap<>(); + Map readAccessControlInteractionInfo = new LinkedHashMap<>(); + Map readAccessControlAclCommandParams = + new LinkedHashMap(); + InteractionInfo readAccessControlAclAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AccessControlCluster) cluster) + .readAclAttribute( + (ChipClusters.AccessControlCluster.AclAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedAclAttributeCallback(), + readAccessControlAclCommandParams); + readAccessControlInteractionInfo.put( + "readAclAttribute", readAccessControlAclAttributeInteractionInfo); + Map readAccessControlExtensionCommandParams = + new LinkedHashMap(); + InteractionInfo readAccessControlExtensionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AccessControlCluster) cluster) + .readExtensionAttribute( + (ChipClusters.AccessControlCluster.ExtensionAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedExtensionAttributeCallback(), + readAccessControlExtensionCommandParams); + readAccessControlInteractionInfo.put( + "readExtensionAttribute", readAccessControlExtensionAttributeInteractionInfo); + Map readAccessControlClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readAccessControlClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.AccessControlCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readAccessControlClusterRevisionCommandParams); + readAccessControlInteractionInfo.put( + "readClusterRevisionAttribute", readAccessControlClusterRevisionAttributeInteractionInfo); + readAttributeMap.put("accessControl", readAccessControlInteractionInfo); Map readAccountLoginInteractionInfo = new LinkedHashMap<>(); Map readAccountLoginClusterRevisionCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java index 2ade2a6dd15e0e..676f6a853b8e33 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterWriteMapping.java @@ -29,6 +29,8 @@ public class ClusterWriteMapping { public Map> getWriteAttributeMap() { Map> writeAttributeMap = new HashMap<>(); + Map writeAccessControlInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("accessControl", writeAccessControlInteractionInfo); Map writeAccountLoginInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("accountLogin", writeAccountLoginInteractionInfo); Map writeAdministratorCommissioningInteractionInfo = diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 2bec056d79a87c..5778f8f7524139 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -30,6 +30,33 @@ class ChipClusters: SUCCESS_DELEGATE = ctypes.CFUNCTYPE(None) FAILURE_DELEGATE = ctypes.CFUNCTYPE(None, ctypes.c_uint8) + _ACCESS_CONTROL_CLUSTER_INFO = { + "clusterName": "AccessControl", + "clusterId": 0x0000001F, + "commands": { + }, + "attributes": { + 0x00000000: { + "attributeName": "Acl", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + "writable": True, + }, + 0x00000001: { + "attributeName": "Extension", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + "writable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + }, + }, + } _ACCOUNT_LOGIN_CLUSTER_INFO = { "clusterName": "AccountLogin", "clusterId": 0x0000050E, @@ -5187,6 +5214,7 @@ class ChipClusters: } _CLUSTER_ID_DICT = { + 0x0000001F: _ACCESS_CONTROL_CLUSTER_INFO, 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x0000003C: _ADMINISTRATOR_COMMISSIONING_CLUSTER_INFO, 0x0000050D: _APPLICATION_BASIC_CLUSTER_INFO, @@ -5248,6 +5276,7 @@ class ChipClusters: } _CLUSTER_NAME_DICT = { + "AccessControl": _ACCESS_CONTROL_CLUSTER_INFO, "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "AdministratorCommissioning": _ADMINISTRATOR_COMMISSIONING_CLUSTER_INFO, "ApplicationBasic": _APPLICATION_BASIC_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index bea22788661c43..4ace723bee4481 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -4382,6 +4382,147 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = None +@dataclass +class AccessControl(Cluster): + id: typing.ClassVar[int] = 0x001F + + class Enums: + class AuthMode(IntEnum): + kPase = 0x01 + kCase = 0x02 + kGroup = 0x03 + + class Privilege(IntEnum): + kView = 0x01 + kProxyView = 0x02 + kOperate = 0x03 + kManage = 0x04 + kAdminister = 0x05 + + class Structs: + @dataclass + class Target(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="cluster", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor( + Label="endpoint", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor( + Label="deviceType", Tag=2, Type=typing.Union[Nullable, uint]), + ]) + + cluster: 'typing.Union[Nullable, uint]' = None + endpoint: 'typing.Union[Nullable, uint]' = None + deviceType: 'typing.Union[Nullable, uint]' = None + + @dataclass + class AccessControlEntry(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="privilege", Tag=1, Type=AccessControl.Enums.Privilege), + ClusterObjectFieldDescriptor( + Label="authMode", Tag=2, Type=AccessControl.Enums.AuthMode), + ClusterObjectFieldDescriptor( + Label="subjects", Tag=3, Type=typing.Union[Nullable, typing.List[uint]]), + ClusterObjectFieldDescriptor( + Label="targets", Tag=4, Type=typing.Union[Nullable, typing.List[AccessControl.Structs.Target]]), + ]) + + fabricIndex: 'uint' = None + privilege: 'AccessControl.Enums.Privilege' = None + authMode: 'AccessControl.Enums.AuthMode' = None + subjects: 'typing.Union[Nullable, typing.List[uint]]' = None + targets: 'typing.Union[Nullable, typing.List[AccessControl.Structs.Target]]' = None + + @dataclass + class ExtensionEntry(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="fabricIndex", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="data", Tag=1, Type=bytes), + ]) + + fabricIndex: 'uint' = None + data: 'bytes' = None + + class Attributes: + @dataclass + class Acl(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[AccessControl.Structs.AccessControlEntry]) + + value: 'typing.List[AccessControl.Structs.AccessControlEntry]' = None + + @dataclass + class Extension(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[AccessControl.Structs.ExtensionEntry]) + + value: 'typing.List[AccessControl.Structs.ExtensionEntry]' = None + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x001F + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = None + + @dataclass class PollControl(Cluster): id: typing.ClassVar[int] = 0x0020 diff --git a/src/controller/python/test/test_scripts/cluster_objects.py b/src/controller/python/test/test_scripts/cluster_objects.py index ccc79a04cb5d50..ca4f612c987996 100644 --- a/src/controller/python/test/test_scripts/cluster_objects.py +++ b/src/controller/python/test/test_scripts/cluster_objects.py @@ -28,13 +28,25 @@ NODE_ID = 1 LIGHTING_ENDPOINT_ID = 1 +# Ignore failures decoding these attributes (e.g. not yet implemented) +ignoreAttributeDecodeFailureList = [ + '0/31/0', '0/31/1' +] + + +def _IgnoreAttributeDecodeFailure(path): + return str(path) in ignoreAttributeDecodeFailureList + def _AssumeAttributesDecodeSuccess(values): for k, v in values['Attributes'].items(): print(f"{k} = {v}") if isinstance(v.Data, ValueDecodeFailure): - raise AssertionError( - f"Cannot decode value for path {k}, got error: '{str(v.Data.Reason)}', raw TLV data: '{v.Data.TLVValue}'") + if _IgnoreAttributeDecodeFailure(k): + print(f"Ignoring attribute decode failure for path {k}") + else: + raise AssertionError( + f"Cannot decode value for path {k}, got error: '{str(v.Data.Reason)}', raw TLV data: '{v.Data.TLVValue}'") def _AssumeEventsDecodeSuccess(values): diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 1a00316efad506..69dca81e72584c 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -197,6 +197,7 @@ CHIPDevice * GetConnectedDevice() {{#chip_client_clusters}} {{#unless (isStrEqual "Test Cluster" name)}} +{{#unless (isStrEqual "Access Control" name)}} {{#unless (isStrEqual "Basic" name)}} {{#unless (isStrEqual "Thermostat" name)}} {{#chip_server_cluster_attributes}} @@ -254,6 +255,7 @@ CHIPDevice * GetConnectedDevice() {{/unless}} {{/unless}} {{/unless}} +{{/unless}} {{/chip_client_clusters}} @end diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index d036e1cbf27f75..f1636b68600873 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -30,6 +30,7 @@ const appHelper = require('../../../../../src/app/zap-templates/templates/ function asExpectedEndpointForCluster(clusterName) { switch (clusterName) { + case 'AccessControl': case 'AdministratorCommissioning': case 'Basic': case 'Descriptor': diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 4d90a0c2cf9d5c..aa76d421eef1f8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -285,6 +285,97 @@ DispatchSuccess(context, objCValue); }; +void CHIPAccessControlAclListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & + value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPAccessControlClusterAccessControlEntry * newElement_0; + newElement_0 = [CHIPAccessControlClusterAccessControlEntry new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; + newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; + if (entry_0.subjects.IsNull()) { + newElement_0.subjects = nil; + } else { + auto * array_NaN = [NSMutableArray new]; + auto iter_NaN = entry_0.subjects.Value().begin(); + while (iter_NaN.Next()) { + auto & entry_NaN = iter_NaN.GetValue(); + NSNumber * newElement_NaN; + newElement_NaN = [NSNumber numberWithUnsignedLongLong:entry_NaN]; + [array_NaN addObject:newElement_NaN]; + } + if (iter_NaN.GetStatus() != CHIP_NO_ERROR) { + } + newElement_0.subjects = array_NaN; + } + if (entry_0.targets.IsNull()) { + newElement_0.targets = nil; + } else { + auto * array_NaN = [NSMutableArray new]; + auto iter_NaN = entry_0.targets.Value().begin(); + while (iter_NaN.Next()) { + auto & entry_NaN = iter_NaN.GetValue(); + CHIPAccessControlClusterTarget * newElement_NaN; + newElement_NaN = [CHIPAccessControlClusterTarget new]; + if (entry_NaN.cluster.IsNull()) { + newElement_NaN.cluster = nil; + } else { + newElement_NaN.cluster = [NSNumber numberWithUnsignedInt:entry_NaN.cluster.Value()]; + } + if (entry_NaN.endpoint.IsNull()) { + newElement_NaN.endpoint = nil; + } else { + newElement_NaN.endpoint = [NSNumber numberWithUnsignedShort:entry_NaN.endpoint.Value()]; + } + if (entry_NaN.deviceType.IsNull()) { + newElement_NaN.deviceType = nil; + } else { + newElement_NaN.deviceType = [NSNumber numberWithUnsignedInt:entry_NaN.deviceType.Value()]; + } + [array_NaN addObject:newElement_NaN]; + } + if (iter_NaN.GetStatus() != CHIP_NO_ERROR) { + } + newElement_0.targets = array_NaN; + } + [array_0 addObject:newElement_0]; + } + if (iter_0.GetStatus() != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + +void CHIPAccessControlExtensionListAttributeCallbackBridge::OnSuccessFn(void * context, + const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + CHIPAccessControlClusterExtensionEntry * newElement_0; + newElement_0 = [CHIPAccessControlClusterExtensionEntry new]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + newElement_0.data = [NSData dataWithBytes:entry_0.data.data() length:entry_0.data.size()]; + [array_0 addObject:newElement_0]; + } + if (iter_0.GetStatus() != CHIP_NO_ERROR) { + OnFailureFn(context, EMBER_ZCL_STATUS_INVALID_VALUE); + return; + } + objCValue = array_0; + DispatchSuccess(context, objCValue); +}; + void CHIPApplicationLauncherApplicationLauncherListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index cabe08c01511a7..8b772e0fe11ebf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -454,6 +454,32 @@ class CHIPNullableVendorIdAttributeCallbackBridge : public CHIPCallbackBridge & value); }; +class CHIPAccessControlAclListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPAccessControlAclListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & + value); +}; + +class CHIPAccessControlExtensionListAttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPAccessControlExtensionListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn( + void * context, + const chip::app::DataModel::DecodableList & + value); +}; + class CHIPApplicationLauncherApplicationLauncherListListAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 15264926e1595c..df922751260512 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -30,6 +30,24 @@ typedef void (^StatusCompletion)(NSError * _Nullable error); NS_ASSUME_NONNULL_BEGIN +/** + * Cluster Access Control + * + */ +@interface CHIPAccessControl : CHIPCluster + +- (void)readAttributeAclWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeAclWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; + +- (void)readAttributeExtensionWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; + +@end + /** * Cluster Account Login * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 98d018edcac12c..6170c524f3480e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -34,6 +34,218 @@ using chip::Callback::Cancelable; using namespace chip::app::Clusters; +@implementation CHIPAccessControl + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)readAttributeAclWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPAccessControlAclListAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = AccessControl::Attributes::Acl::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeAclWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AccessControl::Attributes::Acl::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPAccessControlClusterAccessControlEntry class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPAccessControlClusterAccessControlEntry *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].privilege + = static_castmList[i_0].privilege)>>( + element_0.privilege.unsignedCharValue); + listHolder_0->mList[i_0].authMode + = static_castmList[i_0].authMode)>>( + element_0.authMode.unsignedCharValue); + if (element_0.subjects == nil) { + listHolder_0->mList[i_0].subjects.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].subjects.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.subjects.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.subjects.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.subjects.count; ++i_3) { + if (![element_0.subjects[i_3] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (NSNumber *) element_0.subjects[i_3]; + listHolder_3->mList[i_3] = element_3.unsignedLongLongValue; + } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.subjects.count); + } else { + nonNullValue_2 = ListType_3(); + } + } + } + if (element_0.targets == nil) { + listHolder_0->mList[i_0].targets.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].targets.SetNonNull(); + { + using ListType_3 = std::remove_reference_t; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_0.targets.count != 0) { + auto * listHolder_3 = new ListHolder(element_0.targets.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_0.targets.count; ++i_3) { + if (![element_0.targets[i_3] isKindOfClass:[CHIPAccessControlClusterTarget class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (CHIPAccessControlClusterTarget *) element_0.targets[i_3]; + if (element_3.cluster == nil) { + listHolder_3->mList[i_3].cluster.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].cluster.SetNonNull(); + nonNullValue_5 = element_3.cluster.unsignedIntValue; + } + if (element_3.endpoint == nil) { + listHolder_3->mList[i_3].endpoint.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].endpoint.SetNonNull(); + nonNullValue_5 = element_3.endpoint.unsignedShortValue; + } + if (element_3.deviceType == nil) { + listHolder_3->mList[i_3].deviceType.SetNull(); + } else { + auto & nonNullValue_5 = listHolder_3->mList[i_3].deviceType.SetNonNull(); + nonNullValue_5 = element_3.deviceType.unsignedIntValue; + } + } + nonNullValue_2 = ListType_3(listHolder_3->mList, element_0.targets.count); + } else { + nonNullValue_2 = ListType_3(); + } + } + } + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeExtensionWithCompletionHandler:(void (^)( + NSArray * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPAccessControlExtensionListAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = AccessControl::Attributes::Extension::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AccessControl::Attributes::Extension::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if (![value[i_0] isKindOfClass:[CHIPAccessControlClusterExtensionEntry class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (CHIPAccessControlClusterExtensionEntry *) value[i_0]; + listHolder_0->mList[i_0].fabricIndex = element_0.fabricIndex.unsignedCharValue; + listHolder_0->mList[i_0].data = [self asByteSpan:element_0.data]; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)readAttributeClusterRevisionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt16uAttributeCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable value) { + completionHandler(value, error); + }, + ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + @implementation CHIPAccountLogin - (chip::Controller::ClusterBase *)getCluster diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h index 1ef8001ef4dee5..6f02994136a54d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc_internal.h @@ -21,6 +21,10 @@ #import "CHIPDevice.h" +@interface CHIPAccessControl () +@property (readonly) chip::Controller::AccessControlCluster cppCluster; +@end + @interface CHIPAccountLogin () @property (readonly) chip::Controller::AccountLoginCluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h index 3db676581fb675..a026f458afa222 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.h @@ -61,6 +61,28 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)init; @end +@interface CHIPAccessControlClusterTarget : NSObject +@property (strong, nonatomic) NSNumber * _Nullable cluster; +@property (strong, nonatomic) NSNumber * _Nullable endpoint; +@property (strong, nonatomic) NSNumber * _Nullable deviceType; +- (instancetype)init; +@end + +@interface CHIPAccessControlClusterAccessControlEntry : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSNumber * _Nonnull privilege; +@property (strong, nonatomic) NSNumber * _Nonnull authMode; +@property (strong, nonatomic) NSArray * _Nullable subjects; +@property (strong, nonatomic) NSArray * _Nullable targets; +- (instancetype)init; +@end + +@interface CHIPAccessControlClusterExtensionEntry : NSObject +@property (strong, nonatomic) NSNumber * _Nonnull fabricIndex; +@property (strong, nonatomic) NSData * _Nonnull data; +- (instancetype)init; +@end + @interface CHIPBridgedActionsClusterActionStruct : NSObject @property (strong, nonatomic) NSNumber * _Nonnull actionID; @property (strong, nonatomic) NSString * _Nonnull name; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm index 058c1dbb6af809..f1bddc34343ffa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPStructsObjc.mm @@ -100,6 +100,53 @@ - (instancetype)init } @end +@implementation CHIPAccessControlClusterTarget +- (instancetype)init +{ + if (self = [super init]) { + + _cluster = nil; + + _endpoint = nil; + + _deviceType = nil; + } + return self; +} +@end + +@implementation CHIPAccessControlClusterAccessControlEntry +- (instancetype)init +{ + if (self = [super init]) { + + _fabricIndex = @(0); + + _privilege = @(0); + + _authMode = @(0); + + _subjects = nil; + + _targets = nil; + } + return self; +} +@end + +@implementation CHIPAccessControlClusterExtensionEntry +- (instancetype)init +{ + if (self = [super init]) { + + _fabricIndex = @(0); + + _data = [NSData data]; + } + return self; +} +@end + @implementation CHIPBridgedActionsClusterActionStruct - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h index fa73c746f6750b..8094191fb45cbc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.h @@ -23,6 +23,16 @@ NS_ASSUME_NONNULL_BEGIN +/** + * Cluster Access Control + * + */ +@interface CHIPTestAccessControl : CHIPAccessControl + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; + +@end + /** * Cluster Account Login * diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm index 251d7373f573cc..5056ec8b3d339c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPTestClustersObjc.mm @@ -33,6 +33,37 @@ using chip::Callback::Cancelable; using namespace chip::app::Clusters; +@interface CHIPTestAccessControl () +@property (readonly) chip::Controller::AccessControlClusterTest cppCluster; +@end + +@implementation CHIPTestAccessControl + +- (chip::Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(NSError * _Nullable error, id _Nullable ignored) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedShortValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +@end + @interface CHIPTestAccountLogin () @property (readonly) chip::Controller::AccountLoginClusterTest cppCluster; @end diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index b0651e928b5998..58f9c7d310ad90 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -29781,26 +29781,27 @@ - (void)testSendClusterTestDescriptorCluster_000002_ReadAttribute { id actualValue = value; - XCTAssertEqual([actualValue count], 19); + XCTAssertEqual([actualValue count], 20); XCTAssertEqual([actualValue[0] unsignedIntValue], 3UL); XCTAssertEqual([actualValue[1] unsignedIntValue], 29UL); - XCTAssertEqual([actualValue[2] unsignedIntValue], 40UL); - XCTAssertEqual([actualValue[3] unsignedIntValue], 41UL); - XCTAssertEqual([actualValue[4] unsignedIntValue], 42UL); - XCTAssertEqual([actualValue[5] unsignedIntValue], 46UL); - XCTAssertEqual([actualValue[6] unsignedIntValue], 48UL); - XCTAssertEqual([actualValue[7] unsignedIntValue], 49UL); - XCTAssertEqual([actualValue[8] unsignedIntValue], 50UL); - XCTAssertEqual([actualValue[9] unsignedIntValue], 51UL); - XCTAssertEqual([actualValue[10] unsignedIntValue], 52UL); - XCTAssertEqual([actualValue[11] unsignedIntValue], 53UL); - XCTAssertEqual([actualValue[12] unsignedIntValue], 54UL); - XCTAssertEqual([actualValue[13] unsignedIntValue], 55UL); - XCTAssertEqual([actualValue[14] unsignedIntValue], 60UL); - XCTAssertEqual([actualValue[15] unsignedIntValue], 62UL); - XCTAssertEqual([actualValue[16] unsignedIntValue], 1029UL); - XCTAssertEqual([actualValue[17] unsignedIntValue], 61440UL); - XCTAssertEqual([actualValue[18] unsignedIntValue], 61444UL); + XCTAssertEqual([actualValue[2] unsignedIntValue], 31UL); + XCTAssertEqual([actualValue[3] unsignedIntValue], 40UL); + XCTAssertEqual([actualValue[4] unsignedIntValue], 41UL); + XCTAssertEqual([actualValue[5] unsignedIntValue], 42UL); + XCTAssertEqual([actualValue[6] unsignedIntValue], 46UL); + XCTAssertEqual([actualValue[7] unsignedIntValue], 48UL); + XCTAssertEqual([actualValue[8] unsignedIntValue], 49UL); + XCTAssertEqual([actualValue[9] unsignedIntValue], 50UL); + XCTAssertEqual([actualValue[10] unsignedIntValue], 51UL); + XCTAssertEqual([actualValue[11] unsignedIntValue], 52UL); + XCTAssertEqual([actualValue[12] unsignedIntValue], 53UL); + XCTAssertEqual([actualValue[13] unsignedIntValue], 54UL); + XCTAssertEqual([actualValue[14] unsignedIntValue], 55UL); + XCTAssertEqual([actualValue[15] unsignedIntValue], 60UL); + XCTAssertEqual([actualValue[16] unsignedIntValue], 62UL); + XCTAssertEqual([actualValue[17] unsignedIntValue], 1029UL); + XCTAssertEqual([actualValue[18] unsignedIntValue], 61440UL); + XCTAssertEqual([actualValue[19] unsignedIntValue], 61444UL); } [expectation fulfill]; diff --git a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h index 3f5c36cce8e594..82034fa0785e5b 100644 --- a/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/all-clusters-app/zap-generated/PluginApplicationCallbacks.h @@ -22,6 +22,7 @@ #include #define MATTER_PLUGINS_INIT \ + MatterAccessControlPluginServerInitCallback(); \ MatterAccountLoginPluginServerInitCallback(); \ MatterAdministratorCommissioningPluginServerInitCallback(); \ MatterApplicationBasicPluginServerInitCallback(); \ diff --git a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp index c895a1b465d390..7adb8e9dad7948 100644 --- a/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/attribute-size.cpp @@ -79,6 +79,60 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo uint16_t entryLength = 0; switch (clusterId) { + case 0x001F: // Access Control Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x0000: // ACL + { + entryLength = 21; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _AccessControlEntry + _AccessControlEntry * entry = reinterpret_cast<_AccessControlEntry *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write, + &entryOffset, sizeof(entry->FabricIndex)); // fabric_idx + copyListMember(write ? dest : (uint8_t *) &entry->Privilege, write ? (uint8_t *) &entry->Privilege : src, write, + &entryOffset, sizeof(entry->Privilege)); // Privilege + copyListMember(write ? dest : (uint8_t *) &entry->AuthMode, write ? (uint8_t *) &entry->AuthMode : src, write, + &entryOffset, sizeof(entry->AuthMode)); // AuthMode + copyListMember(write ? dest : (uint8_t *) &entry->Subjects, write ? (uint8_t *) &entry->Subjects : src, write, + &entryOffset, sizeof(entry->Subjects)); // INT64U + copyListMember(write ? dest : (uint8_t *) &entry->Targets, write ? (uint8_t *) &entry->Targets : src, write, + &entryOffset, sizeof(entry->Targets)); // Target + break; + } + case 0x0001: // Extension + { + entryLength = 257; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + // Struct _ExtensionEntry + _ExtensionEntry * entry = reinterpret_cast<_ExtensionEntry *>(write ? src : dest); + copyListMember(write ? dest : (uint8_t *) &entry->FabricIndex, write ? (uint8_t *) &entry->FabricIndex : src, write, + &entryOffset, sizeof(entry->FabricIndex)); // fabric_idx + ByteSpan * DataSpan = &entry->Data; // OCTET_STRING + if (CHIP_NO_ERROR != + (write ? WriteByteSpan(dest + entryOffset, 256, DataSpan) : ReadByteSpan(src + entryOffset, 256, DataSpan))) + { + ChipLogError(Zcl, "Index %" PRId32 " is invalid. Not enough remaining space", index); + return 0; + } + entryOffset = static_cast(entryOffset + 256); + break; + } + } + break; + } case 0x050C: // Application Launcher Cluster { uint16_t entryOffset = kSizeLengthInBytes; @@ -1146,6 +1200,19 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut uint16_t entryLength = 0; switch (clusterId) { + case 0x001F: // Access Control Cluster + switch (attributeId) + { + case 0x0000: // ACL + // Struct _AccessControlEntry + entryLength = 21; + break; + case 0x0001: // Extension + // Struct _ExtensionEntry + entryLength = 257; + break; + } + break; case 0x050C: // Application Launcher Cluster switch (attributeId) { diff --git a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp index 9add63fa52704c..4876296c80e626 100644 --- a/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/callback-stub.cpp @@ -29,6 +29,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { switch (clusterId) { + case ZCL_ACCESS_CONTROL_CLUSTER_ID: + emberAfAccessControlClusterInitCallback(endpoint); + break; case ZCL_ACCOUNT_LOGIN_CLUSTER_ID: emberAfAccountLoginClusterInitCallback(endpoint); break; @@ -212,6 +215,11 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) } } +void __attribute__((weak)) emberAfAccessControlClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfAccountLoginClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index cf8f6e7501d4b3..4b11068a754ed7 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1367,7 +1367,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 556 +#define GENERATED_ATTRIBUTE_COUNT 559 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1385,6 +1385,13 @@ { 0xFFFD, ZAP_TYPE(INT16U), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), \ ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ + /* Endpoint: 0, Cluster: Access Control (server) */ \ + { 0x0000, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* ACL */ \ + { 0x0001, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_EMPTY_DEFAULT() }, /* Extension */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ /* Endpoint: 0, Cluster: Basic (server) */ \ { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_SIMPLE_DEFAULT(1) }, /* InteractionModelVersion */ \ { 0x0001, ZAP_TYPE(CHAR_STRING), 33, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ @@ -2202,7 +2209,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 66 +#define GENERATED_CLUSTER_COUNT 67 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -2214,241 +2221,244 @@ { \ 0x001D, ZAP_ATTRIBUTE_INDEX(3), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Descriptor (server) */ \ + { \ + 0x001F, ZAP_ATTRIBUTE_INDEX(8), 3, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Access Control (server) */ \ { 0x0028, \ - ZAP_ATTRIBUTE_INDEX(8), \ + ZAP_ATTRIBUTE_INDEX(11), \ 20, \ 687, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayBasicServer }, /* Endpoint: 0, Cluster: Basic (server) */ \ { \ - 0x0029, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0029, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Provider (server) */ \ { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(29), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002A, ZAP_ATTRIBUTE_INDEX(32), 3, 20, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: OTA Software Update Requestor (server) */ \ { \ - 0x002E, ZAP_ATTRIBUTE_INDEX(32), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(35), 2, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Power Source Configuration (server) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(34), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(37), 6, 270, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Commissioning (server) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(40), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(43), 2, 6, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Network Commissioning (server) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(42), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(45), 0, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Diagnostic Logs (server) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(42), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(45), 9, 17, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: General Diagnostics (server) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(51), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(54), 6, 30, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(57), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(60), 65, 247, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(122), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(125), 15, 58, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(137), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(140), 11, 57, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Ethernet Network Diagnostics (server) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(148), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(151), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: AdministratorCommissioning (server) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(149), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(152), 6, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(155), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(158), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Relative Humidity Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(159), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(162), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(160), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(163), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(163), \ + ZAP_ATTRIBUTE_INDEX(166), \ 3, \ 5, \ 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(166), \ + ZAP_ATTRIBUTE_INDEX(169), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(168), \ + ZAP_ATTRIBUTE_INDEX(171), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(174), \ + ZAP_ATTRIBUTE_INDEX(177), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/Off (server) */ \ { \ - 0x0007, ZAP_ATTRIBUTE_INDEX(181), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0007, ZAP_ATTRIBUTE_INDEX(184), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(184), \ + ZAP_ATTRIBUTE_INDEX(187), \ 15, \ 23, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x000F, ZAP_ATTRIBUTE_INDEX(199), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x000F, ZAP_ATTRIBUTE_INDEX(202), 4, 5, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(203), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(206), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(208), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0025, ZAP_ATTRIBUTE_INDEX(211), 4, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (server) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(212), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(215), 11, 88, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Power Source (server) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(223), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(226), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (server) */ \ { \ - 0x003B, ZAP_ATTRIBUTE_INDEX(224), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x003B, ZAP_ATTRIBUTE_INDEX(227), 5, 9, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Switch (server) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(229), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(232), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (server) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(231), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(234), 2, 3, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (server) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(233), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(236), 6, 38, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(239), \ + ZAP_ATTRIBUTE_INDEX(242), \ 8, \ 14, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(247), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(250), 20, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(267), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(270), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ 0x0200, \ - ZAP_ATTRIBUTE_INDEX(272), \ + ZAP_ATTRIBUTE_INDEX(275), \ 26, \ 54, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayPumpConfigurationAndControlServer \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(298), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(301), 19, 34, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { \ 0x0204, \ - ZAP_ATTRIBUTE_INDEX(317), \ + ZAP_ATTRIBUTE_INDEX(320), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayThermostatUserInterfaceConfigurationServer \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(321), \ + ZAP_ATTRIBUTE_INDEX(324), \ 53, \ 341, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(374), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(377), 6, 11, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(380), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(383), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(385), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(388), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(389), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(392), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(394), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(397), 5, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(399), \ + ZAP_ATTRIBUTE_INDEX(402), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOccupancySensingServer }, /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(403), \ + ZAP_ATTRIBUTE_INDEX(406), \ 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) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(409), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(412), 2, 35, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(411), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(414), 4, 322, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (server) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(415), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(418), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (server) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(417), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(420), 9, 59, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (server) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(426), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(429), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Media Input (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(429), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(432), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(430), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(433), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (server) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(431), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(434), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (server) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(434), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(437), 3, 257, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (server) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(437), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(440), 4, 258, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(441), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(444), 8, 108, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(449), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(452), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Account Login (server) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(450), 77, 2285, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(453), 77, 2285, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(527), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(530), 12, 28, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(539), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(542), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(540), \ + ZAP_ATTRIBUTE_INDEX(543), \ 7, \ 13, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 2, Cluster: On/Off (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(547), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(550), 5, 0, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 2, Cluster: Descriptor (server) */ \ { 0x0406, \ - ZAP_ATTRIBUTE_INDEX(552), \ + ZAP_ATTRIBUTE_INDEX(555), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2460,7 +2470,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 19, 1927 }, { ZAP_CLUSTER_INDEX(19), 44, 5400 }, { ZAP_CLUSTER_INDEX(63), 3, 18 }, \ + { ZAP_CLUSTER_INDEX(0), 20, 1929 }, { ZAP_CLUSTER_INDEX(20), 44, 5400 }, { ZAP_CLUSTER_INDEX(64), 3, 18 }, \ } // Largest attribute size is needed for various buffers @@ -2470,7 +2480,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (689) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (7345) +#define ATTRIBUTE_MAX_SIZE (7347) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) diff --git a/zzz_generated/all-clusters-app/zap-generated/gen_config.h b/zzz_generated/all-clusters-app/zap-generated/gen_config.h index b2da54d083c4c7..b35545b642546b 100644 --- a/zzz_generated/all-clusters-app/zap-generated/gen_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/gen_config.h @@ -29,6 +29,7 @@ #define EMBER_APS_UNICAST_MESSAGE_COUNT 10 /**** Cluster endpoint counts ****/ +#define EMBER_AF_ACCESS_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -91,6 +92,11 @@ /**** Cluster Plugins ****/ +// Use this macro to check if the server side of the Access Control cluster is included +#define ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL_SERVER +#define EMBER_AF_PLUGIN_ACCESS_CONTROL + // Use this macro to check if the server side of the Account Login cluster is included #define ZCL_USING_ACCOUNT_LOGIN_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ACCOUNT_LOGIN_SERVER diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index c832afb892371e..44cc3aa0840b0d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -99,6 +99,24 @@ typedef struct _ContentLaunchParamater /* TYPE WARNING: array array defaults to */ uint8_t * ExternalIDList; } ContentLaunchParamater; +// Struct for Target +typedef struct _Target +{ + uint32_t Cluster; + uint16_t Endpoint; + uint32_t DeviceType; +} Target; + +// Struct for AccessControlEntry +typedef struct _AccessControlEntry +{ + chip::FabricIndex FabricIndex; + uint8_t Privilege; + uint8_t AuthMode; + /* TYPE WARNING: array array defaults to */ uint8_t * Subjects; + /* TYPE WARNING: array array defaults to */ uint8_t * Targets; +} AccessControlEntry; + // Struct for ActionStruct typedef struct _ActionStruct { @@ -195,6 +213,13 @@ typedef struct _EndpointListStruct /* TYPE WARNING: array array defaults to */ uint8_t * Endpoints; } EndpointListStruct; +// Struct for ExtensionEntry +typedef struct _ExtensionEntry +{ + chip::FabricIndex FabricIndex; + chip::ByteSpan Data; +} ExtensionEntry; + // Struct for FabricDescriptor typedef struct _FabricDescriptor { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 1f3a6ba93ab379..f82fa242c008f5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -238,6 +238,14 @@ #define ZCL_CLIENT_LIST_ATTRIBUTE_ID (0x0002) #define ZCL_PARTS_LIST_ATTRIBUTE_ID (0x0003) +// Attribute ids for cluster: Access Control + +// Client attributes + +// Server attributes +#define ZCL_ACL_ATTRIBUTE_ID (0x0000) +#define ZCL_EXTENSION_ATTRIBUTE_ID (0x0001) + // Attribute ids for cluster: Poll Control // Client attributes diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index a8e0ffb86d941f..9a83154eff3fd5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -3823,6 +3823,12 @@ namespace Attributes { } // namespace Attributes } // namespace Descriptor +namespace AccessControl { +namespace Attributes { + +} // namespace Attributes +} // namespace AccessControl + namespace PollControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e571c62eadbe97..065042aeb8f04b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -744,6 +744,12 @@ namespace Attributes { } // namespace Attributes } // namespace Descriptor +namespace AccessControl { +namespace Attributes { + +} // namespace Attributes +} // namespace AccessControl + namespace PollControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 69bdb5c3bafd06..7fee030179593f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -158,6 +158,14 @@ void emberAfApplianceControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfDescriptorClusterInitCallback(chip::EndpointId endpoint); +/** @brief Access Control Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfAccessControlClusterInitCallback(chip::EndpointId endpoint); + /** @brief Poll Control Cluster Init * * Cluster Init @@ -2406,6 +2414,112 @@ void emberAfDescriptorClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfDescriptorClusterClientTickCallback(chip::EndpointId endpoint); +// +// Access Control Cluster +// + +/** @brief Access Control Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfAccessControlClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Access Control Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfAccessControlClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Access Control Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterAccessControlClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Access Control Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterAccessControlClusterClientAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Access Control Cluster Server Message Sent + * + * Server Message Sent + * + * @param destination The destination 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 emberAfAccessControlClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Access Control Cluster Client Message Sent + * + * Client Message Sent + * + * @param destination The destination 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 emberAfAccessControlClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Access Control Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterAccessControlClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Access Control Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterAccessControlClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Access Control Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfAccessControlClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Access Control Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfAccessControlClusterClientTickCallback(chip::EndpointId endpoint); + // // Poll Control Cluster // diff --git a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h index dbbd3f2d6c2af5..649b7d3019e02e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h +++ b/zzz_generated/app-common/app-common/zap-generated/callbacks/PluginCallbacks.h @@ -47,6 +47,8 @@ void __attribute__((weak)) MatterApplianceControlPluginClientInitCallback() {} void MatterApplianceControlPluginServerInitCallback(); void __attribute__((weak)) MatterDescriptorPluginClientInitCallback() {} void MatterDescriptorPluginServerInitCallback(); +void __attribute__((weak)) MatterAccessControlPluginClientInitCallback() {} +void MatterAccessControlPluginServerInitCallback(); void __attribute__((weak)) MatterPollControlPluginClientInitCallback() {} void MatterPollControlPluginServerInitCallback(); void __attribute__((weak)) MatterBridgedActionsPluginClientInitCallback() {} diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h index 75bfff980f33c4..2c627c51dc6ed6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h @@ -64,6 +64,9 @@ static constexpr chip::ClusterId ZCL_APPLIANCE_CONTROL_CLUSTER_ID = 0x001B; // Definitions for cluster: Descriptor static constexpr chip::ClusterId ZCL_DESCRIPTOR_CLUSTER_ID = 0x001D; +// Definitions for cluster: Access Control +static constexpr chip::ClusterId ZCL_ACCESS_CONTROL_CLUSTER_ID = 0x001F; + // Definitions for cluster: Poll Control static constexpr chip::ClusterId ZCL_POLL_CONTROL_CLUSTER_ID = 0x0020; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 083ca4faf8963e..32d3866d716a1b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -3570,6 +3570,153 @@ namespace Events { } // namespace Events } // namespace Descriptor +namespace AccessControl { +namespace Structs { +namespace Target { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCluster)), cluster)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kEndpoint)), endpoint)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kDeviceType)), deviceType)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCluster): + ReturnErrorOnFailure(DataModel::Decode(reader, cluster)); + break; + case to_underlying(Fields::kEndpoint): + ReturnErrorOnFailure(DataModel::Decode(reader, endpoint)); + break; + case to_underlying(Fields::kDeviceType): + ReturnErrorOnFailure(DataModel::Decode(reader, deviceType)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace Target +namespace AccessControlEntry { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrivilege)), privilege)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kAuthMode)), authMode)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kSubjects)), subjects)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTargets)), targets)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; + case to_underlying(Fields::kPrivilege): + ReturnErrorOnFailure(DataModel::Decode(reader, privilege)); + break; + case to_underlying(Fields::kAuthMode): + ReturnErrorOnFailure(DataModel::Decode(reader, authMode)); + break; + case to_underlying(Fields::kSubjects): + ReturnErrorOnFailure(DataModel::Decode(reader, subjects)); + break; + case to_underlying(Fields::kTargets): + ReturnErrorOnFailure(DataModel::Decode(reader, targets)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace AccessControlEntry +namespace ExtensionEntry { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kData)), data)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; + case to_underlying(Fields::kData): + ReturnErrorOnFailure(DataModel::Decode(reader, data)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace ExtensionEntry +} // namespace Structs + +namespace Commands { +} // namespace Commands + +namespace Events { +} // namespace Events + +} // namespace AccessControl namespace PollControl { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 90408879629d8c..16c853557b2d14 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -5635,6 +5635,154 @@ struct TypeInfo } // namespace ClusterRevision } // namespace Attributes } // namespace Descriptor +namespace AccessControl { +// Enum for AuthMode +enum class AuthMode : uint8_t +{ + kPase = 0x01, + kCase = 0x02, + kGroup = 0x03, +}; +// Enum for Privilege +enum class Privilege : uint8_t +{ + kView = 0x01, + kProxyView = 0x02, + kOperate = 0x03, + kManage = 0x04, + kAdminister = 0x05, +}; + +namespace Structs { +namespace Target { +enum class Fields +{ + kCluster = 0, + kEndpoint = 1, + kDeviceType = 2, +}; + +struct Type +{ +public: + DataModel::Nullable cluster; + DataModel::Nullable endpoint; + DataModel::Nullable deviceType; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +using DecodableType = Type; + +} // namespace Target +namespace AccessControlEntry { +enum class Fields +{ + kFabricIndex = 0, + kPrivilege = 1, + kAuthMode = 2, + kSubjects = 3, + kTargets = 4, +}; + +struct Type +{ +public: + chip::FabricIndex fabricIndex; + Privilege privilege; + AuthMode authMode; + DataModel::Nullable> subjects; + DataModel::Nullable> targets; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + chip::FabricIndex fabricIndex; + Privilege privilege; + AuthMode authMode; + DataModel::Nullable> subjects; + DataModel::Nullable> targets; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +} // namespace AccessControlEntry +namespace ExtensionEntry { +enum class Fields +{ + kFabricIndex = 0, + kData = 1, +}; + +struct Type +{ +public: + chip::FabricIndex fabricIndex; + chip::ByteSpan data; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; + +using DecodableType = Type; + +} // namespace ExtensionEntry +} // namespace Structs + +namespace Attributes { +namespace Acl { +struct TypeInfo +{ + using Type = DataModel::List; + using DecodableType = DataModel::DecodableList; + using DecodableArgType = const DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Acl::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Acl +namespace Extension { +struct TypeInfo +{ + using Type = DataModel::List; + using DecodableType = DataModel::DecodableList; + using DecodableArgType = const DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Extension::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Extension +namespace FeatureMap { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::FeatureMap::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::AccessControl::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ClusterRevision::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ClusterRevision +} // namespace Attributes +} // namespace AccessControl namespace PollControl { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 63286642c6bc6c..6d327f13dd49a8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -747,6 +747,28 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace Descriptor +namespace AccessControl { +namespace Attributes { + +namespace Acl { +static constexpr AttributeId Id = 0x00000000; +} // namespace Acl + +namespace Extension { +static constexpr AttributeId Id = 0x00000001; +} // namespace Extension + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace AccessControl + namespace PollControl { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 1b77ffe8e173b1..d4e16013f80a0f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -67,6 +67,9 @@ static constexpr ClusterId Id = 0x0000001B; namespace Descriptor { static constexpr ClusterId Id = 0x0000001D; } // namespace Descriptor +namespace AccessControl { +static constexpr ClusterId Id = 0x0000001F; +} // namespace AccessControl namespace PollControl { static constexpr ClusterId Id = 0x00000020; } // namespace PollControl diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index a2195d2a294b05..55eebfde75329d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -108,6 +108,12 @@ #define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER #endif +#if defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER { ZCL_ACCESS_CONTROL_CLUSTER_ID, 31, "Access Control" }, +#else +#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER +#endif + #if defined(ZCL_USING_POLL_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_POLL_CONTROL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER { ZCL_POLL_CONTROL_CLUSTER_ID, 32, "Poll Control" }, #else @@ -785,6 +791,7 @@ CHIP_PRINTCLUSTER_POWER_PROFILE_CLUSTER \ CHIP_PRINTCLUSTER_APPLIANCE_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER \ + CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_POLL_CONTROL_CLUSTER \ CHIP_PRINTCLUSTER_BRIDGED_ACTIONS_CLUSTER \ CHIP_PRINTCLUSTER_BASIC_CLUSTER \ diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index f9b7b99da73e7e..83b8bd2cec5496 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -49,6 +49,12 @@ CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::PowerProfile::Structs::TransferredPhase::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Descriptor::Structs::DeviceType::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::Target::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::AccessControlEntry::DecodableType & value); +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::ExtensionEntry::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType & value); CHIP_ERROR LogValue(const char * label, size_t indent, @@ -417,6 +423,107 @@ CHIP_ERROR LogValue(const char * label, size_t indent, ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); return CHIP_NO_ERROR; } +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::Target::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("Cluster", indent + 1, value.cluster); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Cluster'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Endpoint", indent + 1, value.endpoint); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Endpoint'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("DeviceType", indent + 1, value.deviceType); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'DeviceType'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::AccessControlEntry::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Privilege", indent + 1, value.privilege); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Privilege'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("AuthMode", indent + 1, value.authMode); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'AuthMode'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Subjects", indent + 1, value.subjects); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Subjects'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Targets", indent + 1, value.targets); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Targets'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} +CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::AccessControl::Structs::ExtensionEntry::DecodableType & value) +{ + ChipLogProgress(chipTool, "%s%s: {", IndentStr(indent).c_str(), label); + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'FabricIndex'", IndentStr(indent + 1).c_str()); + return err; + } + } + { + CHIP_ERROR err = LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(chipTool, "%sStruct truncated due to invalid value for 'Data'", IndentStr(indent + 1).c_str()); + return err; + } + } + ChipLogProgress(chipTool, "%s}", IndentStr(indent).c_str()); + return CHIP_NO_ERROR; +} CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::BridgedActions::Structs::ActionStruct::DecodableType & value) { @@ -2317,6 +2424,27 @@ static void OnCharStringAttributeResponse(void * context, const chip::CharSpan v command->SetCommandExitStatus(CHIP_NO_ERROR); } +static void OnAccessControlAclListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + CHIP_ERROR err = LogValue("OnAccessControlAclListAttributeResponse", 0, list); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +} + +static void OnAccessControlExtensionListAttributeResponse( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + CHIP_ERROR err = LogValue("OnAccessControlExtensionListAttributeResponse", 0, list); + + ModelCommand * command = static_cast(context); + command->SetCommandExitStatus(err); +} + static void OnApplicationLauncherApplicationLauncherListListAttributeResponse(void * context, const chip::app::DataModel::DecodableList & list) @@ -3892,6 +4020,7 @@ static void OnTestClusterTestSpecificResponseSuccess( /*----------------------------------------------------------------------------*\ | Cluster Name | ID | |---------------------------------------------------------------------+--------| +| AccessControl | 0x001F | | AccountLogin | 0x050E | | AdministratorCommissioning | 0x003C | | ApplicationBasic | 0x050D | @@ -3952,6 +4081,120 @@ static void OnTestClusterTestSpecificResponseSuccess( | WindowCovering | 0x0102 | \*----------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------*\ +| Cluster AccessControl | 0x001F | +|------------------------------------------------------------------------------| +| Commands: | | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Acl | 0x0000 | +| * Extension | 0x0001 | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Attribute Acl + */ +class ReadAccessControlAcl : public ModelCommand +{ +public: + ReadAccessControlAcl() : ModelCommand("read") + { + AddArgument("attr-name", "acl"); + ModelCommand::AddArguments(); + } + + ~ReadAccessControlAcl() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeAcl(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnAccessControlAclListAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute Extension + */ +class ReadAccessControlExtension : public ModelCommand +{ +public: + ReadAccessControlExtension() : ModelCommand("read") + { + AddArgument("attr-name", "extension"); + ModelCommand::AddArguments(); + } + + ~ReadAccessControlExtension() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeExtension(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnAccessControlExtensionListAttributeResponse, + this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute ClusterRevision + */ +class ReadAccessControlClusterRevision : public ModelCommand +{ +public: + ReadAccessControlClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadAccessControlClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x001F) command (0x00) on endpoint %" PRIu8, endpointId); + + chip::Controller::AccessControlCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /*----------------------------------------------------------------------------*\ | Cluster AccountLogin | 0x050E | |------------------------------------------------------------------------------| @@ -55229,6 +55472,18 @@ class ReportWindowCoveringClusterRevision : public ModelCommand /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ +void registerClusterAccessControl(Commands & commands) +{ + const char * clusterName = "AccessControl"; + + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + make_unique(), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterAccountLogin(Commands & commands) { const char * clusterName = "AccountLogin"; @@ -57030,6 +57285,7 @@ void registerClusterWindowCovering(Commands & commands) void registerClusters(Commands & commands) { + registerClusterAccessControl(commands); registerClusterAccountLogin(commands); registerClusterAdministratorCommissioning(commands); registerClusterApplicationBasic(commands); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index eb749fa2490543..85f7f867be93dd 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -46653,40 +46653,42 @@ class TestDescriptorCluster : public TestCommand VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 1)); VerifyOrReturn(CheckValue("serverList[1]", iter.GetValue(), 29UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 2)); - VerifyOrReturn(CheckValue("serverList[2]", iter.GetValue(), 40UL)); + VerifyOrReturn(CheckValue("serverList[2]", iter.GetValue(), 31UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 3)); - VerifyOrReturn(CheckValue("serverList[3]", iter.GetValue(), 41UL)); + VerifyOrReturn(CheckValue("serverList[3]", iter.GetValue(), 40UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 4)); - VerifyOrReturn(CheckValue("serverList[4]", iter.GetValue(), 42UL)); + VerifyOrReturn(CheckValue("serverList[4]", iter.GetValue(), 41UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 5)); - VerifyOrReturn(CheckValue("serverList[5]", iter.GetValue(), 46UL)); + VerifyOrReturn(CheckValue("serverList[5]", iter.GetValue(), 42UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 6)); - VerifyOrReturn(CheckValue("serverList[6]", iter.GetValue(), 48UL)); + VerifyOrReturn(CheckValue("serverList[6]", iter.GetValue(), 46UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 7)); - VerifyOrReturn(CheckValue("serverList[7]", iter.GetValue(), 49UL)); + VerifyOrReturn(CheckValue("serverList[7]", iter.GetValue(), 48UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 8)); - VerifyOrReturn(CheckValue("serverList[8]", iter.GetValue(), 50UL)); + VerifyOrReturn(CheckValue("serverList[8]", iter.GetValue(), 49UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 9)); - VerifyOrReturn(CheckValue("serverList[9]", iter.GetValue(), 51UL)); + VerifyOrReturn(CheckValue("serverList[9]", iter.GetValue(), 50UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 10)); - VerifyOrReturn(CheckValue("serverList[10]", iter.GetValue(), 52UL)); + VerifyOrReturn(CheckValue("serverList[10]", iter.GetValue(), 51UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 11)); - VerifyOrReturn(CheckValue("serverList[11]", iter.GetValue(), 53UL)); + VerifyOrReturn(CheckValue("serverList[11]", iter.GetValue(), 52UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 12)); - VerifyOrReturn(CheckValue("serverList[12]", iter.GetValue(), 54UL)); + VerifyOrReturn(CheckValue("serverList[12]", iter.GetValue(), 53UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 13)); - VerifyOrReturn(CheckValue("serverList[13]", iter.GetValue(), 55UL)); + VerifyOrReturn(CheckValue("serverList[13]", iter.GetValue(), 54UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 14)); - VerifyOrReturn(CheckValue("serverList[14]", iter.GetValue(), 60UL)); + VerifyOrReturn(CheckValue("serverList[14]", iter.GetValue(), 55UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 15)); - VerifyOrReturn(CheckValue("serverList[15]", iter.GetValue(), 62UL)); + VerifyOrReturn(CheckValue("serverList[15]", iter.GetValue(), 60UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 16)); - VerifyOrReturn(CheckValue("serverList[16]", iter.GetValue(), 1029UL)); + VerifyOrReturn(CheckValue("serverList[16]", iter.GetValue(), 62UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 17)); - VerifyOrReturn(CheckValue("serverList[17]", iter.GetValue(), 61440UL)); + VerifyOrReturn(CheckValue("serverList[17]", iter.GetValue(), 1029UL)); VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 18)); - VerifyOrReturn(CheckValue("serverList[18]", iter.GetValue(), 61444UL)); - VerifyOrReturn(CheckNoMoreListItems("serverList", iter, 19)); + VerifyOrReturn(CheckValue("serverList[18]", iter.GetValue(), 61440UL)); + VerifyOrReturn(CheckNextListItemDecodes("serverList", iter, 19)); + VerifyOrReturn(CheckValue("serverList[19]", iter.GetValue(), 61444UL)); + VerifyOrReturn(CheckNoMoreListItems("serverList", iter, 20)); NextTest(); } diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp index 3b0bb2adbf2020..8cc857e23c3a88 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.cpp @@ -134,6 +134,48 @@ namespace { // Singleton instance of the callbacks manager app::CHIPDeviceCallbacksMgr & gCallbacks = app::CHIPDeviceCallbacksMgr::GetInstance(); +void AccessControlClusterAclListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + +void AccessControlClusterExtensionListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + chip::app::DataModel::DecodableList list; + CHIP_ERROR err = Decode(*tlvData, list); + if (err != CHIP_NO_ERROR) + { + if (onFailureCallback != nullptr) + { + Callback::Callback * cb = + Callback::Callback::FromCancelable(onFailureCallback); + cb->mCall(cb->mContext, EMBER_ZCL_STATUS_INVALID_VALUE); + } + return; + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, list); +} + void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(TLV::TLVReader * tlvData, Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h index f30f8f1dfafdd4..772e9c24ab1439 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClientCallbacks.h @@ -137,6 +137,17 @@ typedef void (*TestClusterClusterTestNullableOptionalResponseCallback)(void * co typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); // List specific responses +void AccessControlClusterAclListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlAclListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & + data); +void AccessControlClusterExtensionListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, + chip::Callback::Cancelable * onFailureCallback); +typedef void (*AccessControlExtensionListAttributeCallback)( + void * context, + const chip::app::DataModel::DecodableList & data); void ApplicationLauncherClusterApplicationLauncherListListAttributeFilter(chip::TLV::TLVReader * data, chip::Callback::Cancelable * onSuccessCallback, chip::Callback::Cancelable * onFailureCallback); diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp index 272c1a7db4265f..5747e07db75eb0 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.cpp @@ -34,6 +34,41 @@ namespace Controller { // TODO(#4503): length should be passed to commands when byte string is in argument list. // TODO(#4503): Commands should take group id as an argument. +// AccessControl Cluster Commands +// AccessControl Cluster Attributes +CHIP_ERROR AccessControlCluster::ReadAttributeAcl(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000000; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + AccessControlClusterAclListAttributeFilter); +} + +CHIP_ERROR AccessControlCluster::ReadAttributeExtension(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x00000001; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + AccessControlClusterExtensionListAttributeFilter); +} + +CHIP_ERROR AccessControlCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + app::AttributePathParams attributePath; + attributePath.mEndpointId = mEndpoint; + attributePath.mClusterId = mClusterId; + attributePath.mAttributeId = 0x0000FFFD; + return mDevice->SendReadAttributeRequest(attributePath, onSuccessCallback, onFailureCallback, + BasicAttributeFilter); +} + // AccountLogin Cluster Commands CHIP_ERROR AccountLoginCluster::GetSetupPIN(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::CharSpan tempAccountIdentifier) diff --git a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h index 13e45a664ef1ba..ebe089a4df8b06 100644 --- a/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h +++ b/zzz_generated/controller-clusters/zap-generated/CHIPClusters.h @@ -30,6 +30,18 @@ namespace chip { namespace Controller { +class DLL_EXPORT AccessControlCluster : public ClusterBase +{ +public: + AccessControlCluster() : ClusterBase(app::Clusters::AccessControl::Id) {} + ~AccessControlCluster() {} + + // Cluster Attributes + CHIP_ERROR ReadAttributeAcl(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeExtension(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); +}; + class DLL_EXPORT AccountLoginCluster : public ClusterBase { public: diff --git a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h index 3b0d93fc98c034..4146faaa2554e7 100644 --- a/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/controller-clusters/zap-generated/PluginApplicationCallbacks.h @@ -22,6 +22,7 @@ #include #define MATTER_PLUGINS_INIT \ + MatterAccessControlPluginClientInitCallback(); \ MatterAccountLoginPluginClientInitCallback(); \ MatterAdministratorCommissioningPluginClientInitCallback(); \ MatterApplicationBasicPluginClientInitCallback(); \ diff --git a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp index 7e315dec568069..7f36d9c8471683 100644 --- a/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp +++ b/zzz_generated/controller-clusters/zap-generated/callback-stub.cpp @@ -29,6 +29,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { switch (clusterId) { + case ZCL_ACCESS_CONTROL_CLUSTER_ID: + emberAfAccessControlClusterInitCallback(endpoint); + break; case ZCL_ACCOUNT_LOGIN_CLUSTER_ID: emberAfAccountLoginClusterInitCallback(endpoint); break; @@ -209,6 +212,11 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) } } +void __attribute__((weak)) emberAfAccessControlClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfAccountLoginClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h index d177bcc76d6f75..ebdcc4291f551c 100644 --- a/zzz_generated/controller-clusters/zap-generated/endpoint_config.h +++ b/zzz_generated/controller-clusters/zap-generated/endpoint_config.h @@ -123,7 +123,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 63 +#define GENERATED_ATTRIBUTE_COUNT 64 #define GENERATED_ATTRIBUTES \ { \ \ @@ -151,6 +151,9 @@ /* Endpoint: 1, Cluster: Descriptor (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* ClusterRevision */ \ \ + /* Endpoint: 1, Cluster: Access Control (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ + \ /* Endpoint: 1, Cluster: Bridged Actions (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ @@ -314,7 +317,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 58 +#define GENERATED_CLUSTER_COUNT 59 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -334,150 +337,153 @@ 0x001D, ZAP_ATTRIBUTE_INDEX(7), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (client) */ \ { \ - 0x0025, ZAP_ATTRIBUTE_INDEX(8), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x001F, ZAP_ATTRIBUTE_INDEX(8), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Access Control (client) */ \ + { \ + 0x0025, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Bridged Actions (client) */ \ - { 0x0028, ZAP_ATTRIBUTE_INDEX(9), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Basic (client) */ \ + { 0x0028, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Basic (client) */ \ { \ - 0x0029, ZAP_ATTRIBUTE_INDEX(10), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0029, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: OTA Software Update Provider (client) */ \ { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(11), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x002A, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: OTA Software Update Requestor (client) */ \ { \ - 0x002E, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x002E, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Power Source Configuration (client) */ \ { \ - 0x002F, ZAP_ATTRIBUTE_INDEX(13), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x002F, ZAP_ATTRIBUTE_INDEX(14), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Power Source (client) */ \ { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(14), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0030, ZAP_ATTRIBUTE_INDEX(15), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: General Commissioning (client) */ \ { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(16), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0031, ZAP_ATTRIBUTE_INDEX(17), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Network Commissioning (client) */ \ { \ - 0x0032, ZAP_ATTRIBUTE_INDEX(18), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0032, ZAP_ATTRIBUTE_INDEX(19), 0, 0, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Diagnostic Logs (client) */ \ { \ - 0x0033, ZAP_ATTRIBUTE_INDEX(18), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0033, ZAP_ATTRIBUTE_INDEX(19), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: General Diagnostics (client) */ \ { \ - 0x0034, ZAP_ATTRIBUTE_INDEX(19), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0034, ZAP_ATTRIBUTE_INDEX(20), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Software Diagnostics (client) */ \ { \ - 0x0035, ZAP_ATTRIBUTE_INDEX(21), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0035, ZAP_ATTRIBUTE_INDEX(22), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thread Network Diagnostics (client) */ \ { \ - 0x0036, ZAP_ATTRIBUTE_INDEX(23), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0036, ZAP_ATTRIBUTE_INDEX(24), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: WiFi Network Diagnostics (client) */ \ { \ - 0x0037, ZAP_ATTRIBUTE_INDEX(24), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0037, ZAP_ATTRIBUTE_INDEX(25), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Ethernet Network Diagnostics (client) */ \ { \ - 0x0039, ZAP_ATTRIBUTE_INDEX(26), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0039, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Bridged Device Basic (client) */ \ - { 0x003B, ZAP_ATTRIBUTE_INDEX(27), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Switch (client) */ \ + { 0x003B, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Switch (client) */ \ { \ - 0x003C, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x003C, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: AdministratorCommissioning (client) */ \ { \ - 0x003E, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x003E, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ { \ - 0x0040, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0040, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Fixed Label (client) */ \ { \ - 0x0045, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0045, ZAP_ATTRIBUTE_INDEX(32), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Boolean State (client) */ \ { \ - 0x0050, ZAP_ATTRIBUTE_INDEX(32), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0050, ZAP_ATTRIBUTE_INDEX(33), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Mode Select (client) */ \ { \ - 0x0101, ZAP_ATTRIBUTE_INDEX(33), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0101, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Door Lock (client) */ \ { \ - 0x0102, ZAP_ATTRIBUTE_INDEX(34), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0102, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Window Covering (client) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(35), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(36), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (client) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(36), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(37), 2, 6, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (client) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(38), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (client) */ \ { \ - 0x0204, ZAP_ATTRIBUTE_INDEX(39), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0204, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (client) */ \ { \ - 0x0300, ZAP_ATTRIBUTE_INDEX(40), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0300, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Color Control (client) */ \ { \ - 0x0400, ZAP_ATTRIBUTE_INDEX(41), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0400, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Illuminance Measurement (client) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(42), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (client) */ \ { \ - 0x0403, ZAP_ATTRIBUTE_INDEX(43), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0403, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Pressure Measurement (client) */ \ { \ - 0x0404, ZAP_ATTRIBUTE_INDEX(44), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0404, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Flow Measurement (client) */ \ { \ - 0x0405, ZAP_ATTRIBUTE_INDEX(45), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0405, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Relative Humidity Measurement (client) */ \ { \ - 0x0406, ZAP_ATTRIBUTE_INDEX(46), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0406, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Occupancy Sensing (client) */ \ { \ - 0x0503, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0503, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Wake on LAN (client) */ \ { \ - 0x0504, ZAP_ATTRIBUTE_INDEX(48), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0504, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: TV Channel (client) */ \ { \ - 0x0505, ZAP_ATTRIBUTE_INDEX(49), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0505, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Target Navigator (client) */ \ { \ - 0x0506, ZAP_ATTRIBUTE_INDEX(50), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0506, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Playback (client) */ \ { \ - 0x0507, ZAP_ATTRIBUTE_INDEX(51), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0507, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Media Input (client) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Low Power (client) */ \ { \ - 0x0509, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0509, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Keypad Input (client) */ \ { \ - 0x050A, ZAP_ATTRIBUTE_INDEX(54), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050A, ZAP_ATTRIBUTE_INDEX(55), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Content Launcher (client) */ \ { \ - 0x050B, ZAP_ATTRIBUTE_INDEX(55), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050B, ZAP_ATTRIBUTE_INDEX(56), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Audio Output (client) */ \ { \ - 0x050C, ZAP_ATTRIBUTE_INDEX(56), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050C, ZAP_ATTRIBUTE_INDEX(57), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Launcher (client) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(57), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(58), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0x050E, ZAP_ATTRIBUTE_INDEX(58), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050E, ZAP_ATTRIBUTE_INDEX(59), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0x050F, ZAP_ATTRIBUTE_INDEX(59), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(60), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { \ - 0x0B04, ZAP_ATTRIBUTE_INDEX(60), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x0B04, ZAP_ATTRIBUTE_INDEX(61), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Electrical Measurement (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(61), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF000, ZAP_ATTRIBUTE_INDEX(62), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(62), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(63), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -486,7 +492,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 58, 138 }, \ + { ZAP_CLUSTER_INDEX(0), 59, 140 }, \ } // Largest attribute size is needed for various buffers @@ -496,7 +502,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (4) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (138) +#define ATTRIBUTE_MAX_SIZE (140) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) diff --git a/zzz_generated/controller-clusters/zap-generated/gen_config.h b/zzz_generated/controller-clusters/zap-generated/gen_config.h index 06c9a4166e52e1..7a8812f1853548 100644 --- a/zzz_generated/controller-clusters/zap-generated/gen_config.h +++ b/zzz_generated/controller-clusters/zap-generated/gen_config.h @@ -29,6 +29,7 @@ #define EMBER_APS_UNICAST_MESSAGE_COUNT 10 /**** Cluster endpoint counts ****/ +#define EMBER_AF_ACCESS_CONTROL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_ADMINISTRATOR_COMMISSIONING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_APPLICATION_BASIC_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -90,6 +91,10 @@ /**** Cluster Plugins ****/ +// Use this macro to check if the client side of the Access Control cluster is included +#define ZCL_USING_ACCESS_CONTROL_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_ACCESS_CONTROL_CLIENT + // Use this macro to check if the client side of the Account Login cluster is included #define ZCL_USING_ACCOUNT_LOGIN_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_ACCOUNT_LOGIN_CLIENT diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp index 291dc2e11d2b0f..9c2b33cb73080c 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.cpp @@ -33,6 +33,17 @@ using namespace chip::Encoding::LittleEndian; namespace chip { namespace Controller { +CHIP_ERROR AccessControlClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + app::WriteClientHandle handle; + ReturnErrorOnFailure( + app::InteractionModelEngine::GetInstance()->NewWriteClient(handle, mDevice->GetInteractionModelDelegate())); + ReturnErrorOnFailure(handle.EncodeAttributeWritePayload( + chip::app::AttributePathParams(mEndpoint, mClusterId, AccessControl::Attributes::ClusterRevision::Id), value)); + return mDevice->SendWriteAttributeRequest(std::move(handle), onSuccessCallback, onFailureCallback); +} + CHIP_ERROR AccountLoginClusterTest::WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t value) { diff --git a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h index 99b33ce74d289a..0a0d7d199d389e 100644 --- a/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h +++ b/zzz_generated/controller-clusters/zap-generated/tests/CHIPClustersTest.h @@ -24,6 +24,16 @@ namespace chip { namespace Controller { +class DLL_EXPORT AccessControlClusterTest : public AccessControlCluster +{ +public: + AccessControlClusterTest() : AccessControlCluster() {} + ~AccessControlClusterTest() {} + + CHIP_ERROR WriteAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); +}; + class DLL_EXPORT AccountLoginClusterTest : public AccountLoginCluster { public: