From 15af764f04d34075da6f5bec396ec44409638b86 Mon Sep 17 00:00:00 2001 From: Nivedita Sarkar Date: Fri, 5 Jan 2024 15:23:40 -0800 Subject: [PATCH] Correctly add AliroExpeditedTransactionSupportedProtocolVersions and AliroSupportedBLEUWBProtocolVersions attributes as lists --- .../all-clusters-minimal-app.matter | 4 +- .../rootnode_doorlock_aNKYAreMXE.matter | 4 +- examples/lock-app/lock-common/lock-app.matter | 4 +- examples/lock-app/nxp/zap/lock-app.matter | 4 +- examples/lock-app/qpg/zap/lock.matter | 4 +- .../placeholder/linux/apps/app1/config.matter | 8 +- .../placeholder/linux/apps/app2/config.matter | 8 +- .../virtual-device-app.matter | 4 +- .../door-lock-server/door-lock-server.cpp | 2 +- .../zcl/data-model/chip/door-lock-cluster.xml | 4 +- .../data_model/controller-clusters.matter | 4 +- .../CHIPAttributeTLVValueDecoder.cpp | 34 +++- .../java/zap-generated/CHIPClientCallbacks.h | 4 + .../java/zap-generated/CHIPReadCallbacks.cpp | 146 ++++++++++++++++++ .../python/chip/clusters/Objects.py | 16 +- .../MTRAttributeTLVValueDecoder.mm | 38 ++++- .../CHIP/zap-generated/MTRBaseClusters.h | 12 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 12 +- .../zap-generated/attributes/Accessors.cpp | 62 -------- .../zap-generated/attributes/Accessors.h | 10 -- .../zap-generated/cluster-objects.h | 14 +- .../zap-generated/cluster/Commands.h | 13 +- .../cluster/logging/DataModelLogger.cpp | 4 +- .../zap-generated/cluster/Commands.h | 8 +- 24 files changed, 274 insertions(+), 149 deletions(-) diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 3fafedfa4be7c3..9e037f12be7721 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3018,9 +3018,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 202246eb2d000c..646f2cc00279fa 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1719,9 +1719,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index b96da370ffb9ca..8770be9e0ce955 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -2244,9 +2244,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 1b0c25f46788f2..ea056faf9147ea 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -1506,9 +1506,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 357143ed84bd8c..894974e81b0826 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1900,9 +1900,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index e9f9ace7d33a03..56a4e834143757 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -3612,9 +3612,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; @@ -4263,9 +4263,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 11f8e4786e9ee4..124d94fcd43203 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -3569,9 +3569,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; @@ -4220,9 +4220,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index e06bb63f3e1d01..f2b4890912d2b7 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -2494,9 +2494,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 9bda6c6f6e780f..b51a10e6f02744 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2020 - 2024 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. diff --git a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml index cb68922170691c..1c179f9324422a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml @@ -218,7 +218,7 @@ limitations under the License. - + AliroExpeditedTransactionSupportedProtocolVersions @@ -228,7 +228,7 @@ limitations under the License. - + AliroSupportedBLEUWBProtocolVersions diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index f1e41894e5fc57..cc20dd02aeae3f 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5217,9 +5217,9 @@ cluster DoorLock = 257 { readonly attribute access(read: administer) optional nullable octet_string<65> aliroReaderVerificationKey = 128; readonly attribute access(read: administer) optional nullable octet_string<16> aliroReaderGroupIdentifier = 129; readonly attribute access(read: administer) optional octet_string<16> aliroReaderGroupSubIdentifier = 130; - readonly attribute access(read: administer) optional octet_string<16> aliroExpeditedTransactionSupportedProtocolVersions = 131; + readonly attribute access(read: administer) optional octet_string aliroExpeditedTransactionSupportedProtocolVersions[] = 131; readonly attribute access(read: administer) optional nullable octet_string<16> aliroGroupResolvingKey = 132; - readonly attribute access(read: administer) optional octet_string<16> aliroSupportedBLEUWBProtocolVersions = 133; + readonly attribute access(read: administer) optional octet_string aliroSupportedBLEUWBProtocolVersions[] = 133; readonly attribute access(read: administer) optional int8u aliroBLEAdvertisingVersion = 134; readonly attribute optional int16u numberOfAliroCredentialIssuerKeysSupported = 135; readonly attribute optional int16u numberOfAliroEndpointKeysSupported = 136; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 640f95ed29fcc6..6f9be861d69167 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -23958,10 +23958,19 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jbyteArray valueByteArray = env->NewByteArray(static_cast(cppValue.size())); - env->SetByteArrayRegion(valueByteArray, 0, static_cast(cppValue.size()), - reinterpret_cast(cppValue.data())); - value = valueByteArray; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } case Attributes::AliroGroupResolvingKey::Id: { @@ -23995,10 +24004,19 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jbyteArray valueByteArray = env->NewByteArray(static_cast(cppValue.size())); - env->SetByteArrayRegion(valueByteArray, 0, static_cast(cppValue.size()), - reinterpret_cast(cppValue.data())); - value = valueByteArray; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } case Attributes::AliroBLEAdvertisingVersion::Id: { diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index de2ce285d6513e..14101937393e4c 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -793,6 +793,10 @@ typedef void (*EnergyPreferenceEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*EnergyPreferenceAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*DoorLockAliroExpeditedTransactionSupportedProtocolVersionsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*DoorLockAliroSupportedBLEUWBProtocolVersionsListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DoorLockGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DoorLockAcceptedCommandListListAttributeCallback)(void * context, diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index d0880fdb4b7479..e7ea7995380e1e 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -35190,6 +35190,80 @@ void CHIPDoorLockAliroReaderGroupIdentifierAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPDoorLockAliroExpeditedTransactionSupportedProtocolVersionsAttributeCallback:: +CHIPDoorLockAliroExpeditedTransactionSupportedProtocolVersionsAttributeCallback(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"); + } +} + +CHIPDoorLockAliroExpeditedTransactionSupportedProtocolVersionsAttributeCallback::~ +CHIPDoorLockAliroExpeditedTransactionSupportedProtocolVersionsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPDoorLockAliroExpeditedTransactionSupportedProtocolVersionsAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPDoorLockAliroGroupResolvingKeyAttributeCallback::CHIPDoorLockAliroGroupResolvingKeyAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) @@ -35256,6 +35330,78 @@ void CHIPDoorLockAliroGroupResolvingKeyAttributeCallback::CallbackFn(void * cont env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } +CHIPDoorLockAliroSupportedBLEUWBProtocolVersionsAttributeCallback:: +CHIPDoorLockAliroSupportedBLEUWBProtocolVersionsAttributeCallback(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"); + } +} + +CHIPDoorLockAliroSupportedBLEUWBProtocolVersionsAttributeCallback::~ +CHIPDoorLockAliroSupportedBLEUWBProtocolVersionsAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPDoorLockAliroSupportedBLEUWBProtocolVersionsAttributeCallback::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")); + + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPDoorLockGeneratedCommandListAttributeCallback::CHIPDoorLockGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index a44aa87804ffaf..7c5400de7d8f41 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -25082,9 +25082,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="aliroReaderVerificationKey", Tag=0x00000080, Type=typing.Union[None, Nullable, bytes]), ClusterObjectFieldDescriptor(Label="aliroReaderGroupIdentifier", Tag=0x00000081, Type=typing.Union[None, Nullable, bytes]), ClusterObjectFieldDescriptor(Label="aliroReaderGroupSubIdentifier", Tag=0x00000082, Type=typing.Optional[bytes]), - ClusterObjectFieldDescriptor(Label="aliroExpeditedTransactionSupportedProtocolVersions", Tag=0x00000083, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="aliroExpeditedTransactionSupportedProtocolVersions", Tag=0x00000083, Type=typing.Optional[typing.List[bytes]]), ClusterObjectFieldDescriptor(Label="aliroGroupResolvingKey", Tag=0x00000084, Type=typing.Union[None, Nullable, bytes]), - ClusterObjectFieldDescriptor(Label="aliroSupportedBLEUWBProtocolVersions", Tag=0x00000085, Type=typing.Optional[bytes]), + ClusterObjectFieldDescriptor(Label="aliroSupportedBLEUWBProtocolVersions", Tag=0x00000085, Type=typing.Optional[typing.List[bytes]]), ClusterObjectFieldDescriptor(Label="aliroBLEAdvertisingVersion", Tag=0x00000086, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="numberOfAliroCredentialIssuerKeysSupported", Tag=0x00000087, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="numberOfAliroEndpointKeysSupported", Tag=0x00000088, Type=typing.Optional[uint]), @@ -25135,9 +25135,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: aliroReaderVerificationKey: 'typing.Union[None, Nullable, bytes]' = None aliroReaderGroupIdentifier: 'typing.Union[None, Nullable, bytes]' = None aliroReaderGroupSubIdentifier: 'typing.Optional[bytes]' = None - aliroExpeditedTransactionSupportedProtocolVersions: 'typing.Optional[bytes]' = None + aliroExpeditedTransactionSupportedProtocolVersions: 'typing.Optional[typing.List[bytes]]' = None aliroGroupResolvingKey: 'typing.Union[None, Nullable, bytes]' = None - aliroSupportedBLEUWBProtocolVersions: 'typing.Optional[bytes]' = None + aliroSupportedBLEUWBProtocolVersions: 'typing.Optional[typing.List[bytes]]' = None aliroBLEAdvertisingVersion: 'typing.Optional[uint]' = None numberOfAliroCredentialIssuerKeysSupported: 'typing.Optional[uint]' = None numberOfAliroEndpointKeysSupported: 'typing.Optional[uint]' = None @@ -26802,9 +26802,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bytes]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[bytes]]) - value: 'typing.Optional[bytes]' = None + value: 'typing.Optional[typing.List[bytes]]' = None @dataclass class AliroGroupResolvingKey(ClusterAttributeDescriptor): @@ -26834,9 +26834,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bytes]) + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[bytes]]) - value: 'typing.Optional[bytes]' = None + value: 'typing.Optional[typing.List[bytes]]' = None @dataclass class AliroBLEAdvertisingVersion(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 7d7d351453fb2f..c1aa94bb30c8e6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9408,8 +9408,23 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (*aError != CHIP_NO_ERROR) { return nil; } - NSData * _Nonnull value; - value = AsData(cppValue); + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSData * newElement_0; + newElement_0 = AsData(entry_0); + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } case Attributes::AliroGroupResolvingKey::Id: { @@ -9434,8 +9449,23 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (*aError != CHIP_NO_ERROR) { return nil; } - NSData * _Nonnull value; - value = AsData(cppValue); + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSData * newElement_0; + newElement_0 = AsData(entry_0); + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } case Attributes::AliroBLEAdvertisingVersion::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 476646c7997c26..75ac124745ab66 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -8417,11 +8417,11 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeAliroReaderGroupSubIdentifierWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeAliroGroupResolvingKeyWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeAliroGroupResolvingKeyWithParams:(MTRSubscribeParams *)params @@ -8429,11 +8429,11 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeAliroGroupResolvingKeyWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeAliroSupportedBLEUWBProtocolVersionsWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeAliroBLEAdvertisingVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeAliroBLEAdvertisingVersionWithParams:(MTRSubscribeParams *)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index ae78318df897b9..8b3a1c211d27c5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -56443,7 +56443,7 @@ + (void)readAttributeAliroReaderGroupSubIdentifierWithClusterStateCache:(MTRClus completion:completion]; } -- (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) @@ -56456,7 +56456,7 @@ - (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompl - (void)subscribeAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) @@ -56468,7 +56468,7 @@ - (void)subscribeAttributeAliroExpeditedTransactionSupportedProtocolVersionsWith subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::TypeInfo; [clusterStateCacheContainer @@ -56515,7 +56515,7 @@ + (void)readAttributeAliroGroupResolvingKeyWithClusterStateCache:(MTRClusterStat completion:completion]; } -- (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::TypeInfo; [self.device _readKnownAttributeWithEndpointID:@(self.endpoint) @@ -56528,7 +56528,7 @@ - (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:(void (^ - (void)subscribeAttributeAliroSupportedBLEUWBProtocolVersionsWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSData * _Nullable value, NSError * _Nullable error))reportHandler + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:@(self.endpoint) @@ -56540,7 +56540,7 @@ - (void)subscribeAttributeAliroSupportedBLEUWBProtocolVersionsWithParams:(MTRSub subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeAliroSupportedBLEUWBProtocolVersionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::TypeInfo; [clusterStateCacheContainer 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 06f1b279b3cd97..5960985c1dcc4b 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 @@ -13267,37 +13267,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) } // namespace AliroReaderGroupSubIdentifier -namespace AliroExpeditedTransactionSupportedProtocolVersions { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) -{ - uint8_t zclString[16 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -} // namespace AliroExpeditedTransactionSupportedProtocolVersions - namespace AliroGroupResolvingKey { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) @@ -13347,37 +13316,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace AliroGroupResolvingKey -namespace AliroSupportedBLEUWBProtocolVersions { - -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) -{ - uint8_t zclString[16 + 1]; - EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - - VerifyOrReturnError(value.size() == 16, EMBER_ZCL_STATUS_INVALID_DATA_TYPE); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, EMBER_ZCL_STATUS_CONSTRAINT_ERROR); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -} // namespace AliroSupportedBLEUWBProtocolVersions - namespace AliroBLEAdvertisingVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) 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 2c1941c444a50d..415de298e294d7 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 @@ -2480,11 +2480,6 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); } // namespace AliroReaderGroupSubIdentifier -namespace AliroExpeditedTransactionSupportedProtocolVersions { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // octet_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); -} // namespace AliroExpeditedTransactionSupportedProtocolVersions - namespace AliroGroupResolvingKey { EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // octet_string EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); @@ -2492,11 +2487,6 @@ EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); } // namespace AliroGroupResolvingKey -namespace AliroSupportedBLEUWBProtocolVersions { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // octet_string -EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); -} // namespace AliroSupportedBLEUWBProtocolVersions - namespace AliroBLEAdvertisingVersion { EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); 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 063cc33f40741d..f377c9b28e1e51 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 @@ -24721,14 +24721,13 @@ struct TypeInfo namespace AliroExpeditedTransactionSupportedProtocolVersions { struct TypeInfo { - using Type = chip::ByteSpan; - using DecodableType = chip::ByteSpan; - using DecodableArgType = chip::ByteSpan; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id; } static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 16; } }; } // namespace AliroExpeditedTransactionSupportedProtocolVersions namespace AliroGroupResolvingKey { @@ -24747,14 +24746,13 @@ struct TypeInfo namespace AliroSupportedBLEUWBProtocolVersions { struct TypeInfo { - using Type = chip::ByteSpan; - using DecodableType = chip::ByteSpan; - using DecodableArgType = chip::ByteSpan; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AliroSupportedBLEUWBProtocolVersions::Id; } static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 16; } }; } // namespace AliroSupportedBLEUWBProtocolVersions namespace AliroBLEAdvertisingVersion { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 265b75c5d641d9..ef609f815e453a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -20254,15 +20254,16 @@ void registerClusterDoorLock(Commands & commands, CredentialIssuerCommands * cre make_unique>(Id, "aliro-reader-group-sub-identifier", Attributes::AliroReaderGroupSubIdentifier::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "aliro-expedited-transaction-supported-protocol-versions", - Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "aliro-expedited-transaction-supported-protocol-versions", + Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // make_unique>>( Id, "aliro-group-resolving-key", Attributes::AliroGroupResolvingKey::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "aliro-supported-bleuwbprotocol-versions", - Attributes::AliroSupportedBLEUWBProtocolVersions::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "aliro-supported-bleuwbprotocol-versions", Attributes::AliroSupportedBLEUWBProtocolVersions::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "aliro-bleadvertising-version", 0, UINT8_MAX, Attributes::AliroBLEAdvertisingVersion::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 1fd66cebb57c18..0ba03b409c60d6 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -12399,7 +12399,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("AliroReaderGroupSubIdentifier", 1, value); } case DoorLock::Attributes::AliroExpeditedTransactionSupportedProtocolVersions::Id: { - chip::ByteSpan value; + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AliroExpeditedTransactionSupportedProtocolVersions", 1, value); } @@ -12409,7 +12409,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("AliroGroupResolvingKey", 1, value); } case DoorLock::Attributes::AliroSupportedBLEUWBProtocolVersions::Id: { - chip::ByteSpan value; + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AliroSupportedBLEUWBProtocolVersions", 1, value); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index ba4bb9a7e330b6..05deb7f2f9e93b 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -89936,7 +89936,7 @@ class ReadDoorLockAliroExpeditedTransactionSupportedProtocolVersions : public Re dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { + [cluster readAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AliroExpeditedTransactionSupportedProtocolVersions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -89981,7 +89981,7 @@ class SubscribeAttributeDoorLockAliroExpeditedTransactionSupportedProtocolVersio } [cluster subscribeAttributeAliroExpeditedTransactionSupportedProtocolVersionsWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AliroExpeditedTransactionSupportedProtocolVersions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -90106,7 +90106,7 @@ class ReadDoorLockAliroSupportedBLEUWBProtocolVersions : public ReadAttribute { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { + [cluster readAttributeAliroSupportedBLEUWBProtocolVersionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AliroSupportedBLEUWBProtocolVersions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); @@ -90151,7 +90151,7 @@ class SubscribeAttributeDoorLockAliroSupportedBLEUWBProtocolVersions : public Su } [cluster subscribeAttributeAliroSupportedBLEUWBProtocolVersionsWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AliroSupportedBLEUWBProtocolVersions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value);