diff --git a/build/chip/chip_codegen.cmake b/build/chip/chip_codegen.cmake index dd7e4a645d92f9..77c65ba6a4ea52 100644 --- a/build/chip/chip_codegen.cmake +++ b/build/chip/chip_codegen.cmake @@ -162,11 +162,6 @@ function(chip_zapgen TARGET_NAME) # out links of template files and zap files and such SET(EXTRA_DEPENDENCIES "${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/command_request_response.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/command_request_struct.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/command_response_struct.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/structure_definition.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/structure_member.zapt" "${CHIP_ROOT}/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClientCallbacks.zapt" @@ -174,7 +169,6 @@ function(chip_zapgen TARGET_NAME) "${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/gen_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt" - "${CHIP_ROOT}/src/app/zap-templates/templates/app/MatterIDL.zapt" ) SET(OUTPUT_SUBDIR "zap-generated") else() diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja index 9af7eb5712c40f..596cc5d4feef67 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja @@ -86,11 +86,11 @@ #include #include +#include #include #include #include -#include #include #include @@ -104,17 +104,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, {{cluster.name | capitalcase}}Cluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - {{cluster.name | capitalcase}}Cluster * cppCluster = new {{cluster.name | capitalcase}}Cluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -131,8 +133,8 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - {{cluster.name | capitalcase}}Cluster * cppCluster; - + ClusterBase * cppCluster; + ListFreer listFreer; chip::app::Clusters::{{cluster.name | capitalcase}}::Commands::{{command.name | capitalcase}}::Type request; @@ -142,8 +144,8 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, {%- for field in (cluster.structs | named(command.input_param)).fields -%} {{ encode_value( "request." + (field.name | lowercaseFirst), - (field.name | lowercaseFirst), - 0, + (field.name | lowercaseFirst), + 0, field | asEncodable(typeLookup) )}} {%- endfor -%} @@ -156,7 +158,7 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, VerifyOrReturn(onSuccess.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast<{{cluster.name | capitalcase}}Cluster *>(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); @@ -194,7 +196,7 @@ JNI_METHOD(void, {{cluster.name}}Cluster, subscribe{{attr.definition.name | capi 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; - {{cluster.name}}Cluster * cppCluster = reinterpret_cast<{{cluster.name}}Cluster *>(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::{{cluster.name}}::Attributes::{{attr.definition.name | capitalcase}}::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja index e75779cf790624..96572922054095 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, read{{attr.definition.na 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::{{cluster.name | capitalcase}}Cluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp index 31bd11a9f16249..7766e049220c95 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, DemoClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - DemoClusterCluster * cppCluster = new DemoClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, DemoClusterCluster, subscribeArmFailsafesAttribute)(JNIEnv * en 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; - DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::DemoCluster::Attributes::ArmFailsafes::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp index 3976dcbd9243df..400f3dee271a2a 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, DemoClusterCluster, readArmFailsafesAttribute)(JNIEnv * env, jo 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::DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp index c91759c71b12f2..1a5bbad380cb30 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, DemoClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - DemoClusterCluster * cppCluster = new DemoClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, DemoClusterCluster, subscribeSomeLabelsAttribute)(JNIEnv * env, 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; - DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::DemoCluster::Attributes::SomeLabels::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp index 1059cd32fe92da..243f4a46273139 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, DemoClusterCluster, readSomeLabelsAttribute)(JNIEnv * env, jobj 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::DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp index f55394ec269721..7365fbcdb62384 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, MyClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - MyClusterCluster * cppCluster = new MyClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -37,8 +39,8 @@ JNI_METHOD(void, MyClusterCluster, { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MyClusterCluster * cppCluster; - + ClusterBase * cppCluster; + ListFreer listFreer; chip::app::Clusters::MyCluster::Commands::Foo::Type request; @@ -60,7 +62,7 @@ JNI_METHOD(void, MyClusterCluster, VerifyOrReturn(onSuccess.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp index 57d84d3501b751..30a766dd4563aa 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp index 753863ee7814c4..6f25efc37a1eb6 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, FirstCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - FirstCluster * cppCluster = new FirstCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, FirstCluster, subscribeSomeIntegerAttribute)(JNIEnv * env, jobj 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; - FirstCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::First::Attributes::SomeInteger::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp index 11efe7541f40b6..0d09a2adced29f 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, FirstCluster, readSomeIntegerAttribute)(JNIEnv * env, jobject s 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::FirstCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp index 671610e33cdc7f..f459123ba675e1 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, SecondCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - SecondCluster * cppCluster = new SecondCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, SecondCluster, subscribeSomeBytesAttribute)(JNIEnv * env, jobje 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; - SecondCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Second::Attributes::SomeBytes::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp index 8d07cda4cac889..9f718035cd39f5 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, SecondCluster, readSomeBytesAttribute)(JNIEnv * env, jobject se 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::SecondCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp index 2a7256ffbb526d..8ff4a4cbd77c5b 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, ThirdCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - ThirdCluster * cppCluster = new ThirdCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, ThirdCluster, subscribeSomeEnumAttribute)(JNIEnv * env, jobject 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; - ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Third::Attributes::SomeEnum::TypeInfo; @@ -62,7 +64,7 @@ JNI_METHOD(void, ThirdCluster, subscribeSomeEnumAttribute)(JNIEnv * env, jobject 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; - ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Third::Attributes::Options::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp index 31012d0240eb99..5799f7a6f4a3e0 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, ThirdCluster, readSomeEnumAttribute)(JNIEnv * env, jobject self 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::ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); @@ -47,7 +47,7 @@ JNI_METHOD(void, ThirdCluster, readOptionsAttribute)(JNIEnv * env, jobject self, 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::ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp index b6a4957c3a7d83..3aa51bc87b99a8 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, MyClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - MyClusterCluster * cppCluster = new MyClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, MyClusterCluster, subscribeClusterAttrAttribute)(JNIEnv * env, 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; - MyClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::MyCluster::Attributes::ClusterAttr::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp index b8a9ef3264b3cb..504996a2928a51 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, MyClusterCluster, readClusterAttrAttribute)(JNIEnv * env, jobje 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::MyClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * 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()); diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index a4d36a7cbc730e..6bcc94d734f22c 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -113,7 +113,7 @@ def runArgumentsParser() -> CmdLineArgs: # # All the rest of the files (app-templates.json) are generally built at # compile time. - default_templates = 'src/app/zap-templates/matter-idl.json' + default_templates = 'src/app/zap-templates/matter-idl-server.json' parser = argparse.ArgumentParser( description='Generate artifacts from .zapt templates') diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 94407cae55b634..80229e108d2a90 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -90,10 +90,13 @@ class ZapDistinctOutput: class ZAPGenerateTarget: @staticmethod - def MatterIdlTarget(zap_config): - # NOTE: this assumes `src/app/zap-templates/matter-idl.json` is the - # DEFAULT generation target and it needs no output_dir - return ZAPGenerateTarget(zap_config, template=None, output_dir=None) + def MatterIdlTarget(zap_config, client_side=False): + if client_side: + return ZAPGenerateTarget(zap_config, template="src/app/zap-templates/matter-idl-client.json", output_dir=None) + else: + # NOTE: this assumes `src/app/zap-templates/matter-idl-server.json` is the + # DEFAULT generation target and it needs no output_dir + return ZAPGenerateTarget(zap_config, template=None, output_dir=None) def __init__(self, zap_config, template, output_dir=None): self.script = './scripts/tools/zap/generate.py' @@ -347,7 +350,7 @@ def getGlobalTemplatesTargets(): 'zzz_generated', generate_subdir, 'zap-generated') targets.append(ZAPGenerateTarget.MatterIdlTarget(filepath)) - targets.append(ZAPGenerateTarget.MatterIdlTarget('src/controller/data_model/controller-clusters.zap')) + targets.append(ZAPGenerateTarget.MatterIdlTarget('src/controller/data_model/controller-clusters.zap', client_side=True)) # This generates app headers for darwin only, for easier/clearer include # in .pbxproj files. diff --git a/src/app/zap-templates/matter-idl-client.json b/src/app/zap-templates/matter-idl-client.json new file mode 100644 index 00000000000000..98bddf36ffaad1 --- /dev/null +++ b/src/app/zap-templates/matter-idl-client.json @@ -0,0 +1,50 @@ +{ + "name": "CHIP Application templates", + "version": "chip-v1", + "helpers": [ + "partials/helper.js", + "common/ListHelper.js", + "common/StringHelper.js", + "common/ChipTypesHelper.js", + "templates/app/helper.js", + "templates/chip/helper.js" + ], + "override": "common/override.js", + "partials": [ + { + "name": "idl_structure_definition", + "path": "partials/idl/structure_definition.zapt" + }, + { + "name": "idl_structure_member", + "path": "partials/idl/structure_member.zapt" + }, + { + "name": "idl_command_request_response", + "path": "partials/idl/command_request_response.zapt" + }, + { + "name": "idl_command_request_struct", + "path": "partials/idl/command_request_struct.zapt" + }, + { + "name": "idl_command_response_struct", + "path": "partials/idl/command_response_struct.zapt" + }, + { + "name": "idl_attribute_definition", + "path": "partials/idl/attribute_definition.zapt" + }, + { + "name": "idl_cluster_definition", + "path": "partials/idl/cluster_definition.zapt" + } + ], + "templates": [ + { + "path": "templates/app/MatterIDL_Client.zapt", + "name": "Human-readable Matter IDL (All client clusters)", + "output": "Clusters.matter" + } + ] +} diff --git a/src/app/zap-templates/matter-idl.json b/src/app/zap-templates/matter-idl-server.json similarity index 83% rename from src/app/zap-templates/matter-idl.json rename to src/app/zap-templates/matter-idl-server.json index eda0b9e59db7ae..6b39f04826d6ee 100644 --- a/src/app/zap-templates/matter-idl.json +++ b/src/app/zap-templates/matter-idl-server.json @@ -34,12 +34,16 @@ { "name": "idl_attribute_definition", "path": "partials/idl/attribute_definition.zapt" + }, + { + "name": "idl_cluster_definition", + "path": "partials/idl/cluster_definition.zapt" } ], "templates": [ { - "path": "templates/app/MatterIDL.zapt", - "name": "Human-readable Matter IDL", + "path": "templates/app/MatterIDL_Server.zapt", + "name": "Human-readable Matter IDL (Server-side)", "output": "Clusters.matter" } ] diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt similarity index 66% rename from src/app/zap-templates/templates/app/MatterIDL.zapt rename to src/app/zap-templates/partials/idl/cluster_definition.zapt index 9802426b29f942..01943b176c6da7 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -1,15 +1,6 @@ -// This IDL was generated automatically by ZAP. -// It is for view/code review purposes only. - -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{>idl_structure_definition extraIndent=0}} - -{{/if}} -{{/zcl_structs}} -{{#all_user_clusters~}} /** {{description}} */ -{{side}} cluster {{asUpperCamelCase name}} = {{code}} { +{{#if generateClientCluster}}client {{else}}server {{/if~}} +cluster {{asUpperCamelCase name}} = {{code}} { {{#zcl_enums}} enum {{asUpperCamelCase name}} : ENUM{{multiply size 8}} { {{#zcl_enum_items}} @@ -46,7 +37,7 @@ } {{/zcl_events}} - {{#if (is_client side)}} + {{#if generateClientCluster}} {{#zcl_attributes_server}} {{#if clusterRef}} {{! ensure indent }}{{>idl_attribute_definition}} @@ -71,14 +62,14 @@ readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; {{!--Open:Generating command request structs for all incoming commands into server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_incoming_commands_for_cluster name side}} {{~>idl_command_request_struct}} {{/all_incoming_commands_for_cluster}} - {{/if}} + {{/unless}} {{~!--Close:Generating command request structs for all incoming commands into server side--~}} {{~!--Open:Generating command request structs for all outgoing commands from client side--~}} - {{#if (is_client side)}} + {{#if generateClientCluster}} {{#zcl_commands}} {{#if (isStrEqual source "client")}} {{~>idl_command_request_struct}} @@ -91,69 +82,21 @@ {{~!--Open:Generating command response structs for all incoming commands into client side--~}} {{~!--Close:Generating command response structs for all incoming commands into client side--~}} {{~!--Open:Generating command response structs for all outgoing commands from server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_outgoing_commands_for_cluster name side}} {{~>idl_command_response_struct}} {{/all_outgoing_commands_for_cluster}} - {{/if}} + {{/unless}} {{~!--Close:Generating command response structs for all outgoing commands from server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_incoming_commands_for_cluster name side}} {{~>idl_command_request_response}}{{~new_line 1~}} {{/all_incoming_commands_for_cluster}} - {{/if}} - {{#if (is_client side)}} + {{/unless}} + {{#if generateClientCluster}} {{#zcl_commands_source_client}} {{~>idl_command_request_response}}{{~new_line 1~}} {{/zcl_commands_source_client}} {{/if}} } -{{/all_user_clusters}} -{{#user_endpoints}} -endpoint {{endpointId}} { - {{#if deviceIdentifier}} - device type {{chip_friendly_endpoint_type_name}} = {{deviceIdentifier}}, version {{endpointVersion}}; - {{/if~}} - - {{#user_clusters}} - {{#if enabled}} - {{#unless (isServer side)}} - binding cluster {{asUpperCamelCase name}}; - {{/unless}} - {{/if}} - {{/user_clusters}} - {{#user_clusters}} - {{#if enabled}} - {{#if (isServer side)}} - - server cluster {{asUpperCamelCase name}} { - {{#user_cluster_events}} - {{#if included}} - emits event {{name}}; - {{/if}} - {{/user_cluster_events}} - {{#user_cluster_attributes}} - {{#if included}} - {{~#if (is_str_equal storageOption "NVM")}} - persist {{!align~}} - {{~else if (is_str_equal storageOption "External")}} - callback {{!align~}} - {{~else}} - ram {{!align~}} - {{~/if~}} - attribute {{asLowerCamelCase name}} - {{~#if defaultValue~}} - {{!need space}} default = {{#if (isString type)}}"{{defaultValue}}"{{else}}{{defaultValue}}{{/if}} - {{~/if~}} - ; - {{/if}} - {{/user_cluster_attributes}} - } - {{/if}} - {{/if}} - {{/user_clusters}} -} -{{/user_endpoints}} - - diff --git a/src/app/zap-templates/templates/app/MatterIDL_Client.zapt b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt new file mode 100644 index 00000000000000..50d59f4fc2f38e --- /dev/null +++ b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt @@ -0,0 +1,12 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +{{#zcl_structs}} +{{#if has_more_than_one_cluster}} +{{>idl_structure_definition extraIndent=0}} + +{{/if}} +{{/zcl_structs}} +{{#zcl_clusters~}} +{{>idl_cluster_definition generateClientCluster=1}} +{{/zcl_clusters}} diff --git a/src/app/zap-templates/templates/app/MatterIDL_Server.zapt b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt new file mode 100644 index 00000000000000..7180d2fb78d7eb --- /dev/null +++ b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt @@ -0,0 +1,63 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +{{#zcl_structs}} +{{#if has_more_than_one_cluster}} +{{>idl_structure_definition extraIndent=0}} + +{{/if}} +{{/zcl_structs}} +{{#all_user_clusters~}} +{{#if (is_client side)~}} +{{>idl_cluster_definition generateClientCluster=1}} +{{else~}} +{{>idl_cluster_definition generateClientCluster=0}} +{{/if}} +{{/all_user_clusters}} +{{#user_endpoints}} +endpoint {{endpointId}} { + {{#if deviceIdentifier}} + device type {{chip_friendly_endpoint_type_name}} = {{deviceIdentifier}}, version {{endpointVersion}}; + {{/if~}} + + {{#user_clusters}} + {{#if enabled}} + {{#unless (isServer side)}} + binding cluster {{asUpperCamelCase name}}; + {{/unless}} + {{/if}} + {{/user_clusters}} + {{#user_clusters}} + {{#if enabled}} + {{#if (isServer side)}} + + server cluster {{asUpperCamelCase name}} { + {{#user_cluster_events}} + {{#if included}} + emits event {{name}}; + {{/if}} + {{/user_cluster_events}} + {{#user_cluster_attributes}} + {{#if included}} + {{~#if (is_str_equal storageOption "NVM")}} + persist {{!align~}} + {{~else if (is_str_equal storageOption "External")}} + callback {{!align~}} + {{~else}} + ram {{!align~}} + {{~/if~}} + attribute {{asLowerCamelCase name}} + {{~#if defaultValue~}} + {{!need space}} default = {{#if (isString type)}}"{{defaultValue}}"{{else}}{{defaultValue}}{{/if}} + {{~/if~}} + ; + {{/if}} + {{/user_cluster_attributes}} + } + {{/if}} + {{/if}} + {{/user_clusters}} +} +{{/user_endpoints}} + + diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index e3359d83d369df..69ffd6f2e36488 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -42,166 +42,178 @@ if (current_os == "android" || build_java_matter_controller) { generator = "java-jni" outputs = [ + "jni/AccessControlClient-InvokeSubscribeImpl.cpp", + "jni/AccessControlClient-ReadImpl.cpp", + "jni/AccountLoginClient-InvokeSubscribeImpl.cpp", + "jni/AccountLoginClient-ReadImpl.cpp", + "jni/ActionsClient-InvokeSubscribeImpl.cpp", + "jni/ActionsClient-ReadImpl.cpp", + "jni/ActivatedCarbonFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ActivatedCarbonFilterMonitoringClient-ReadImpl.cpp", + "jni/AdministratorCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/AdministratorCommissioningClient-ReadImpl.cpp", + "jni/AirQualityClient-InvokeSubscribeImpl.cpp", + "jni/AirQualityClient-ReadImpl.cpp", + "jni/ApplicationBasicClient-InvokeSubscribeImpl.cpp", + "jni/ApplicationBasicClient-ReadImpl.cpp", + "jni/ApplicationLauncherClient-InvokeSubscribeImpl.cpp", + "jni/ApplicationLauncherClient-ReadImpl.cpp", + "jni/AudioOutputClient-InvokeSubscribeImpl.cpp", + "jni/AudioOutputClient-ReadImpl.cpp", + "jni/BallastConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/BallastConfigurationClient-ReadImpl.cpp", + "jni/BarrierControlClient-InvokeSubscribeImpl.cpp", + "jni/BarrierControlClient-ReadImpl.cpp", + "jni/BasicInformationClient-InvokeSubscribeImpl.cpp", + "jni/BasicInformationClient-ReadImpl.cpp", + "jni/BinaryInputBasicClient-InvokeSubscribeImpl.cpp", + "jni/BinaryInputBasicClient-ReadImpl.cpp", + "jni/BindingClient-InvokeSubscribeImpl.cpp", + "jni/BindingClient-ReadImpl.cpp", + "jni/BooleanStateClient-InvokeSubscribeImpl.cpp", + "jni/BooleanStateClient-ReadImpl.cpp", + "jni/BridgedDeviceBasicInformationClient-InvokeSubscribeImpl.cpp", + "jni/BridgedDeviceBasicInformationClient-ReadImpl.cpp", + "jni/CeramicFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/CeramicFilterMonitoringClient-ReadImpl.cpp", + "jni/ChannelClient-InvokeSubscribeImpl.cpp", + "jni/ChannelClient-ReadImpl.cpp", "jni/CHIPCallbackTypes.h", "jni/CHIPReadCallbacks.h", - "jni/IdentifyClient-ReadImpl.cpp", - "jni/IdentifyClient-InvokeSubscribeImpl.cpp", - "jni/GroupsClient-ReadImpl.cpp", + "jni/ColorControlClient-InvokeSubscribeImpl.cpp", + "jni/ColorControlClient-ReadImpl.cpp", + "jni/ContentLauncherClient-InvokeSubscribeImpl.cpp", + "jni/ContentLauncherClient-ReadImpl.cpp", + "jni/DescriptorClient-InvokeSubscribeImpl.cpp", + "jni/DescriptorClient-ReadImpl.cpp", + "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", + "jni/DiagnosticLogsClient-ReadImpl.cpp", + "jni/DoorLockClient-InvokeSubscribeImpl.cpp", + "jni/DoorLockClient-ReadImpl.cpp", + "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/ElectricalMeasurementClient-ReadImpl.cpp", + "jni/ElectrostaticFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ElectrostaticFilterMonitoringClient-ReadImpl.cpp", + "jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/FanControlClient-InvokeSubscribeImpl.cpp", + "jni/FanControlClient-ReadImpl.cpp", + "jni/FaultInjectionClient-InvokeSubscribeImpl.cpp", + "jni/FaultInjectionClient-ReadImpl.cpp", + "jni/FixedLabelClient-InvokeSubscribeImpl.cpp", + "jni/FixedLabelClient-ReadImpl.cpp", + "jni/FlowMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/FlowMeasurementClient-ReadImpl.cpp", + "jni/FuelTankMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/FuelTankMonitoringClient-ReadImpl.cpp", + "jni/GeneralCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/GeneralCommissioningClient-ReadImpl.cpp", + "jni/GeneralDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/GeneralDiagnosticsClient-ReadImpl.cpp", + "jni/GroupKeyManagementClient-InvokeSubscribeImpl.cpp", + "jni/GroupKeyManagementClient-ReadImpl.cpp", "jni/GroupsClient-InvokeSubscribeImpl.cpp", - "jni/ScenesClient-ReadImpl.cpp", - "jni/ScenesClient-InvokeSubscribeImpl.cpp", - "jni/OnOffClient-ReadImpl.cpp", + "jni/GroupsClient-ReadImpl.cpp", + "jni/HepaFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/HepaFilterMonitoringClient-ReadImpl.cpp", + "jni/IcdManagementClient-InvokeSubscribeImpl.cpp", + "jni/IcdManagementClient-ReadImpl.cpp", + "jni/IdentifyClient-InvokeSubscribeImpl.cpp", + "jni/IdentifyClient-ReadImpl.cpp", + "jni/IlluminanceMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/IlluminanceMeasurementClient-ReadImpl.cpp", + "jni/InkCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/InkCartridgeMonitoringClient-ReadImpl.cpp", + "jni/IonizingFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", + "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", + "jni/KeypadInputClient-ReadImpl.cpp", + "jni/LevelControlClient-InvokeSubscribeImpl.cpp", + "jni/LevelControlClient-ReadImpl.cpp", + "jni/LocalizationConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/LocalizationConfigurationClient-ReadImpl.cpp", + "jni/LowPowerClient-InvokeSubscribeImpl.cpp", + "jni/LowPowerClient-ReadImpl.cpp", + "jni/MediaInputClient-InvokeSubscribeImpl.cpp", + "jni/MediaInputClient-ReadImpl.cpp", + "jni/MediaPlaybackClient-InvokeSubscribeImpl.cpp", + "jni/MediaPlaybackClient-ReadImpl.cpp", + "jni/ModeSelectClient-InvokeSubscribeImpl.cpp", + "jni/ModeSelectClient-ReadImpl.cpp", + "jni/NetworkCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/NetworkCommissioningClient-ReadImpl.cpp", + "jni/OccupancySensingClient-InvokeSubscribeImpl.cpp", + "jni/OccupancySensingClient-ReadImpl.cpp", "jni/OnOffClient-InvokeSubscribeImpl.cpp", - "jni/OnOffSwitchConfigurationClient-ReadImpl.cpp", + "jni/OnOffClient-ReadImpl.cpp", "jni/OnOffSwitchConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/LevelControlClient-ReadImpl.cpp", - "jni/LevelControlClient-InvokeSubscribeImpl.cpp", - "jni/BinaryInputBasicClient-ReadImpl.cpp", - "jni/BinaryInputBasicClient-InvokeSubscribeImpl.cpp", - "jni/DescriptorClient-ReadImpl.cpp", - "jni/DescriptorClient-InvokeSubscribeImpl.cpp", - "jni/BindingClient-ReadImpl.cpp", - "jni/BindingClient-InvokeSubscribeImpl.cpp", - "jni/AccessControlClient-ReadImpl.cpp", - "jni/AccessControlClient-InvokeSubscribeImpl.cpp", - "jni/ActionsClient-ReadImpl.cpp", - "jni/ActionsClient-InvokeSubscribeImpl.cpp", - "jni/BasicInformationClient-ReadImpl.cpp", - "jni/BasicInformationClient-InvokeSubscribeImpl.cpp", - "jni/OtaSoftwareUpdateProviderClient-ReadImpl.cpp", + "jni/OnOffSwitchConfigurationClient-ReadImpl.cpp", + "jni/OperationalCredentialsClient-InvokeSubscribeImpl.cpp", + "jni/OperationalCredentialsClient-ReadImpl.cpp", "jni/OtaSoftwareUpdateProviderClient-InvokeSubscribeImpl.cpp", - "jni/OtaSoftwareUpdateRequestorClient-ReadImpl.cpp", + "jni/OtaSoftwareUpdateProviderClient-ReadImpl.cpp", "jni/OtaSoftwareUpdateRequestorClient-InvokeSubscribeImpl.cpp", - "jni/LocalizationConfigurationClient-ReadImpl.cpp", - "jni/LocalizationConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/TimeFormatLocalizationClient-ReadImpl.cpp", - "jni/TimeFormatLocalizationClient-InvokeSubscribeImpl.cpp", - "jni/UnitLocalizationClient-ReadImpl.cpp", - "jni/UnitLocalizationClient-InvokeSubscribeImpl.cpp", - "jni/PowerSourceConfigurationClient-ReadImpl.cpp", - "jni/PowerSourceConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/PowerSourceClient-ReadImpl.cpp", + "jni/OtaSoftwareUpdateRequestorClient-ReadImpl.cpp", + "jni/OzoneFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/OzoneFilterMonitoringClient-ReadImpl.cpp", "jni/PowerSourceClient-InvokeSubscribeImpl.cpp", - "jni/GeneralCommissioningClient-ReadImpl.cpp", - "jni/GeneralCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/NetworkCommissioningClient-ReadImpl.cpp", - "jni/NetworkCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/DiagnosticLogsClient-ReadImpl.cpp", - "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", - "jni/GeneralDiagnosticsClient-ReadImpl.cpp", - "jni/GeneralDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/SoftwareDiagnosticsClient-ReadImpl.cpp", + "jni/PowerSourceClient-ReadImpl.cpp", + "jni/PowerSourceConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/PowerSourceConfigurationClient-ReadImpl.cpp", + "jni/PressureMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/PressureMeasurementClient-ReadImpl.cpp", + "jni/ProxyConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/ProxyConfigurationClient-ReadImpl.cpp", + "jni/ProxyDiscoveryClient-InvokeSubscribeImpl.cpp", + "jni/ProxyDiscoveryClient-ReadImpl.cpp", + "jni/ProxyValidClient-InvokeSubscribeImpl.cpp", + "jni/ProxyValidClient-ReadImpl.cpp", + "jni/PulseWidthModulationClient-InvokeSubscribeImpl.cpp", + "jni/PulseWidthModulationClient-ReadImpl.cpp", + "jni/PumpConfigurationAndControlClient-InvokeSubscribeImpl.cpp", + "jni/PumpConfigurationAndControlClient-ReadImpl.cpp", + "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", + "jni/ScenesClient-InvokeSubscribeImpl.cpp", + "jni/ScenesClient-ReadImpl.cpp", "jni/SoftwareDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/ThreadNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/ThreadNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/WiFiNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/WiFiNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/BridgedDeviceBasicInformationClient-ReadImpl.cpp", - "jni/BridgedDeviceBasicInformationClient-InvokeSubscribeImpl.cpp", - "jni/SwitchClient-ReadImpl.cpp", + "jni/SoftwareDiagnosticsClient-ReadImpl.cpp", "jni/SwitchClient-InvokeSubscribeImpl.cpp", - "jni/AdministratorCommissioningClient-ReadImpl.cpp", - "jni/AdministratorCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/OperationalCredentialsClient-ReadImpl.cpp", - "jni/OperationalCredentialsClient-InvokeSubscribeImpl.cpp", - "jni/GroupKeyManagementClient-ReadImpl.cpp", - "jni/GroupKeyManagementClient-InvokeSubscribeImpl.cpp", - "jni/FixedLabelClient-ReadImpl.cpp", - "jni/FixedLabelClient-InvokeSubscribeImpl.cpp", - "jni/UserLabelClient-ReadImpl.cpp", - "jni/UserLabelClient-InvokeSubscribeImpl.cpp", - "jni/BooleanStateClient-ReadImpl.cpp", - "jni/BooleanStateClient-InvokeSubscribeImpl.cpp", - "jni/ModeSelectClient-ReadImpl.cpp", - "jni/ModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/DoorLockClient-ReadImpl.cpp", - "jni/DoorLockClient-InvokeSubscribeImpl.cpp", - "jni/WindowCoveringClient-ReadImpl.cpp", - "jni/WindowCoveringClient-InvokeSubscribeImpl.cpp", - "jni/BarrierControlClient-ReadImpl.cpp", - "jni/BarrierControlClient-InvokeSubscribeImpl.cpp", - "jni/PumpConfigurationAndControlClient-ReadImpl.cpp", - "jni/PumpConfigurationAndControlClient-InvokeSubscribeImpl.cpp", - "jni/ThermostatClient-ReadImpl.cpp", + "jni/SwitchClient-ReadImpl.cpp", + "jni/TargetNavigatorClient-InvokeSubscribeImpl.cpp", + "jni/TargetNavigatorClient-ReadImpl.cpp", + "jni/TemperatureMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/TemperatureMeasurementClient-ReadImpl.cpp", "jni/ThermostatClient-InvokeSubscribeImpl.cpp", - "jni/FanControlClient-ReadImpl.cpp", - "jni/FanControlClient-InvokeSubscribeImpl.cpp", - "jni/ThermostatUserInterfaceConfigurationClient-ReadImpl.cpp", + "jni/ThermostatClient-ReadImpl.cpp", "jni/ThermostatUserInterfaceConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/ColorControlClient-ReadImpl.cpp", - "jni/ColorControlClient-InvokeSubscribeImpl.cpp", - "jni/BallastConfigurationClient-ReadImpl.cpp", - "jni/BallastConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/IlluminanceMeasurementClient-ReadImpl.cpp", - "jni/IlluminanceMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/TemperatureMeasurementClient-ReadImpl.cpp", - "jni/TemperatureMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/PressureMeasurementClient-ReadImpl.cpp", - "jni/PressureMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/FlowMeasurementClient-ReadImpl.cpp", - "jni/FlowMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", - "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/OccupancySensingClient-ReadImpl.cpp", - "jni/OccupancySensingClient-InvokeSubscribeImpl.cpp", - "jni/WakeOnLanClient-ReadImpl.cpp", - "jni/WakeOnLanClient-InvokeSubscribeImpl.cpp", - "jni/ChannelClient-ReadImpl.cpp", - "jni/ChannelClient-InvokeSubscribeImpl.cpp", - "jni/TargetNavigatorClient-ReadImpl.cpp", - "jni/TargetNavigatorClient-InvokeSubscribeImpl.cpp", - "jni/MediaPlaybackClient-ReadImpl.cpp", - "jni/MediaPlaybackClient-InvokeSubscribeImpl.cpp", - "jni/MediaInputClient-ReadImpl.cpp", - "jni/MediaInputClient-InvokeSubscribeImpl.cpp", - "jni/LowPowerClient-ReadImpl.cpp", - "jni/LowPowerClient-InvokeSubscribeImpl.cpp", - "jni/KeypadInputClient-ReadImpl.cpp", - "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", - "jni/ContentLauncherClient-ReadImpl.cpp", - "jni/ContentLauncherClient-InvokeSubscribeImpl.cpp", - "jni/AudioOutputClient-ReadImpl.cpp", - "jni/AudioOutputClient-InvokeSubscribeImpl.cpp", - "jni/ApplicationLauncherClient-ReadImpl.cpp", - "jni/ApplicationLauncherClient-InvokeSubscribeImpl.cpp", - "jni/ApplicationBasicClient-ReadImpl.cpp", - "jni/ApplicationBasicClient-InvokeSubscribeImpl.cpp", - "jni/AccountLoginClient-ReadImpl.cpp", - "jni/AccountLoginClient-InvokeSubscribeImpl.cpp", - "jni/ElectricalMeasurementClient-ReadImpl.cpp", - "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/UnitTestingClient-ReadImpl.cpp", + "jni/ThermostatUserInterfaceConfigurationClient-ReadImpl.cpp", + "jni/ThreadNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/ThreadNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/TimeFormatLocalizationClient-InvokeSubscribeImpl.cpp", + "jni/TimeFormatLocalizationClient-ReadImpl.cpp", + "jni/TimeSynchronizationClient-InvokeSubscribeImpl.cpp", + "jni/TimeSynchronizationClient-ReadImpl.cpp", + "jni/TonerCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/TonerCartridgeMonitoringClient-ReadImpl.cpp", + "jni/UnitLocalizationClient-InvokeSubscribeImpl.cpp", + "jni/UnitLocalizationClient-ReadImpl.cpp", "jni/UnitTestingClient-InvokeSubscribeImpl.cpp", - "jni/AirQualityClient-ReadImpl.cpp", - "jni/AirQualityClient-InvokeSubscribeImpl.cpp", - "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", - "jni/IonizingFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ZeoliteFilterMonitoringClient-ReadImpl.cpp", - "jni/ZeoliteFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/HepaFilterMonitoringClient-ReadImpl.cpp", - "jni/HepaFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ElectrostaticFilterMonitoringClient-ReadImpl.cpp", - "jni/ElectrostaticFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/WaterTankMonitoringClient-ReadImpl.cpp", - "jni/WaterTankMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/OzoneFilterMonitoringClient-ReadImpl.cpp", - "jni/OzoneFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/InkCartridgeMonitoringClient-ReadImpl.cpp", - "jni/InkCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/CeramicFilterMonitoringClient-ReadImpl.cpp", - "jni/CeramicFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ActivatedCarbonFilterMonitoringClient-ReadImpl.cpp", - "jni/ActivatedCarbonFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/FuelTankMonitoringClient-ReadImpl.cpp", - "jni/FuelTankMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/UvFilterMonitoringClient-ReadImpl.cpp", + "jni/UnitTestingClient-ReadImpl.cpp", + "jni/UserLabelClient-InvokeSubscribeImpl.cpp", + "jni/UserLabelClient-ReadImpl.cpp", "jni/UvFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/TonerCartridgeMonitoringClient-ReadImpl.cpp", - "jni/TonerCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/IcdManagementClient-ReadImpl.cpp", - "jni/IcdManagementClient-InvokeSubscribeImpl.cpp", + "jni/UvFilterMonitoringClient-ReadImpl.cpp", + "jni/WakeOnLanClient-InvokeSubscribeImpl.cpp", + "jni/WakeOnLanClient-ReadImpl.cpp", + "jni/WaterTankMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/WaterTankMonitoringClient-ReadImpl.cpp", + "jni/WiFiNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/WiFiNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/WindowCoveringClient-InvokeSubscribeImpl.cpp", + "jni/WindowCoveringClient-ReadImpl.cpp", + "jni/ZeoliteFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ZeoliteFilterMonitoringClient-ReadImpl.cpp", ] deps = [ diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b05b5821804791..13d57667665187 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -525,6 +525,16 @@ client cluster BinaryInputBasic = 15 { readonly attribute int16u clusterRevision = 65533; } +/** Cluster to control pulse width modulation */ +client cluster PulseWidthModulation = 28 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ client cluster Descriptor = 29 { struct DeviceTypeStruct { @@ -2072,6 +2082,152 @@ client cluster EthernetNetworkDiagnostics = 55 { command ResetCounts(): DefaultSuccess = 0; } +/** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */ +client cluster TimeSynchronization = 56 { + enum GranularityEnum : ENUM8 { + kNoTimeGranularity = 0; + kMinutesGranularity = 1; + kSecondsGranularity = 2; + kMillisecondsGranularity = 3; + kMicrosecondsGranularity = 4; + } + + enum StatusCode : ENUM8 { + kTimeNotAccepted = 2; + } + + enum TimeSourceEnum : ENUM8 { + kNone = 0; + kUnknown = 1; + kAdmin = 2; + kNodeTimeCluster = 3; + kNonMatterSNTP = 4; + kNonMatterNTP = 5; + kMatterSNTP = 6; + kMatterNTP = 7; + kMixedNTP = 8; + kNonMatterSNTPNTS = 9; + kNonMatterNTPNTS = 10; + kMatterSNTPNTS = 11; + kMatterNTPNTS = 12; + kMixedNTPNTS = 13; + kCloudSource = 14; + kPtp = 15; + kGnss = 16; + } + + enum TimeZoneDatabaseEnum : ENUM8 { + kFull = 0; + kPartial = 1; + kNone = 2; + } + + bitmap TimeSynchronizationFeature : BITMAP32 { + kTimeZone = 0x1; + kNTPClient = 0x2; + kNTPServer = 0x4; + kTimeSyncClient = 0x8; + } + + struct DSTOffsetStruct { + int32s offset = 0; + epoch_us validStarting = 1; + nullable epoch_us validUntil = 2; + } + + struct FabricScopedTrustedTimeSourceStruct { + node_id nodeID = 0; + endpoint_no endpoint = 1; + } + + struct TimeZoneStruct { + int32s offset = 0; + epoch_us validAt = 1; + optional char_string<64> name = 2; + } + + struct TrustedTimeSourceStruct { + fabric_idx fabricIndex = 0; + node_id nodeID = 1; + endpoint_no endpoint = 2; + } + + info event DSTTableEmpty = 0 { + } + + info event DSTStatus = 1 { + boolean DSTOffsetActive = 0; + } + + info event TimeZoneStatus = 2 { + INT32S offset = 0; + optional CHAR_STRING name = 1; + } + + info event TimeFailure = 3 { + } + + info event MissingTrustedTimeSource = 4 { + } + + readonly attribute nullable epoch_us UTCTime = 0; + readonly attribute GranularityEnum granularity = 1; + readonly attribute optional TimeSourceEnum timeSource = 2; + readonly attribute optional nullable TrustedTimeSourceStruct trustedTimeSource = 3; + readonly attribute optional nullable char_string<128> defaultNTP = 4; + readonly attribute optional TimeZoneStruct timeZone[] = 5; + readonly attribute optional DSTOffsetStruct DSTOffset[] = 6; + readonly attribute optional nullable epoch_us localTime = 7; + readonly attribute optional TimeZoneDatabaseEnum timeZoneDatabase = 8; + readonly attribute optional boolean NTPServerAvailable = 9; + readonly attribute optional int8u timeZoneListMaxSize = 10; + readonly attribute optional int8u DSTOffsetListMaxSize = 11; + readonly attribute optional boolean supportsDNSResolve = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetUTCTimeRequest { + epoch_us UTCTime = 0; + GranularityEnum granularity = 1; + optional TimeSourceEnum timeSource = 2; + } + + request struct SetTrustedTimeSourceRequest { + nullable FabricScopedTrustedTimeSourceStruct trustedTimeSource = 0; + } + + request struct SetTimeZoneRequest { + TimeZoneStruct timeZone[] = 0; + } + + response struct SetTimeZoneResponse = 3 { + boolean DSTOffsetRequired = 0; + } + + request struct SetDSTOffsetRequest { + DSTOffsetStruct DSTOffset[] = 0; + } + + request struct SetDefaultNTPRequest { + nullable CHAR_STRING<128> defaultNTP = 0; + } + + /** This command MAY be issued by Administrator to set the time. */ + command access(invoke: administer) SetUTCTime(SetUTCTimeRequest): DefaultSuccess = 0; + /** This command SHALL set TrustedTimeSource. */ + fabric command access(invoke: administer) SetTrustedTimeSource(SetTrustedTimeSourceRequest): DefaultSuccess = 1; + /** This command SHALL set TimeZone. */ + command access(invoke: manage) SetTimeZone(SetTimeZoneRequest): SetTimeZoneResponse = 2; + /** This command SHALL set DSTOffset. */ + command access(invoke: manage) SetDSTOffset(SetDSTOffsetRequest): DefaultSuccess = 4; + /** This command is used to set DefaultNTP. */ + command access(invoke: administer) SetDefaultNTP(SetDefaultNTPRequest): DefaultSuccess = 5; +} + /** This Cluster serves two purposes towards a Node communicating with a Bridge: indicate that the functionality on the Endpoint where it is placed (and its Parts) is bridged from a non-CHIP technology; and provide a centralized collection of attributes that the Node MAY collect to aid in conveying information regarding the Bridged Device to a user, @@ -2483,6 +2639,36 @@ client cluster UserLabel = 65 { readonly attribute int16u clusterRevision = 65533; } +/** Cluster to control Proxy Configuration */ +client cluster ProxyConfiguration = 66 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Cluster to control Proxy Discovery */ +client cluster ProxyDiscovery = 67 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Cluster to control Proxy Valid */ +client cluster ProxyValid = 68 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** This cluster provides an interface to a boolean state called StateValue. */ client cluster BooleanState = 69 { info event StateChange = 0 { @@ -5900,87 +6086,40 @@ client cluster UnitTesting = 4294048773 { command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21; } -endpoint 1 { - device type rootdevice = 22, version 1; - binding cluster Identify; - binding cluster Groups; - binding cluster Scenes; - binding cluster OnOff; - binding cluster OnOffSwitchConfiguration; - binding cluster LevelControl; - binding cluster BinaryInputBasic; - binding cluster Descriptor; - binding cluster Binding; - binding cluster AccessControl; - binding cluster Actions; - binding cluster BasicInformation; - binding cluster OtaSoftwareUpdateProvider; - binding cluster OtaSoftwareUpdateRequestor; - binding cluster LocalizationConfiguration; - binding cluster TimeFormatLocalization; - binding cluster UnitLocalization; - binding cluster PowerSourceConfiguration; - binding cluster PowerSource; - binding cluster GeneralCommissioning; - binding cluster NetworkCommissioning; - binding cluster DiagnosticLogs; - binding cluster GeneralDiagnostics; - binding cluster SoftwareDiagnostics; - binding cluster ThreadNetworkDiagnostics; - binding cluster WiFiNetworkDiagnostics; - binding cluster EthernetNetworkDiagnostics; - binding cluster BridgedDeviceBasicInformation; - binding cluster Switch; - binding cluster AdministratorCommissioning; - binding cluster OperationalCredentials; - binding cluster GroupKeyManagement; - binding cluster FixedLabel; - binding cluster UserLabel; - binding cluster BooleanState; - binding cluster IcdManagement; - binding cluster ModeSelect; - binding cluster AirQuality; - binding cluster HepaFilterMonitoring; - binding cluster ActivatedCarbonFilterMonitoring; - binding cluster CeramicFilterMonitoring; - binding cluster ElectrostaticFilterMonitoring; - binding cluster UvFilterMonitoring; - binding cluster IonizingFilterMonitoring; - binding cluster ZeoliteFilterMonitoring; - binding cluster OzoneFilterMonitoring; - binding cluster WaterTankMonitoring; - binding cluster FuelTankMonitoring; - binding cluster InkCartridgeMonitoring; - binding cluster TonerCartridgeMonitoring; - binding cluster DoorLock; - binding cluster WindowCovering; - binding cluster BarrierControl; - binding cluster PumpConfigurationAndControl; - binding cluster Thermostat; - binding cluster FanControl; - binding cluster ThermostatUserInterfaceConfiguration; - binding cluster ColorControl; - binding cluster BallastConfiguration; - binding cluster IlluminanceMeasurement; - binding cluster TemperatureMeasurement; - binding cluster PressureMeasurement; - binding cluster FlowMeasurement; - binding cluster RelativeHumidityMeasurement; - binding cluster OccupancySensing; - binding cluster WakeOnLan; - binding cluster Channel; - binding cluster TargetNavigator; - binding cluster MediaPlayback; - binding cluster MediaInput; - binding cluster LowPower; - binding cluster KeypadInput; - binding cluster ContentLauncher; - binding cluster AudioOutput; - binding cluster ApplicationLauncher; - binding cluster ApplicationBasic; - binding cluster AccountLogin; - binding cluster ElectricalMeasurement; - binding cluster UnitTesting; -} +/** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */ +client cluster FaultInjection = 4294048774 { + enum FaultType : ENUM8 { + kUnspecified = 0; + kSystemFault = 1; + kInetFault = 2; + kChipFault = 3; + kCertFault = 4; + } + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct FailAtFaultRequest { + FaultType type = 0; + INT32U id = 1; + INT32U numCallsToSkip = 2; + INT32U numCallsToFail = 3; + BOOLEAN takeMutex = 4; + } + + request struct FailRandomlyAtFaultRequest { + FaultType type = 0; + INT32U id = 1; + INT8U percentage = 2; + } + + /** Configure a fault to be triggered deterministically */ + command access(invoke: manage) FailAtFault(FailAtFaultRequest): DefaultSuccess = 0; + /** Configure a fault to be triggered randomly, with a given probability defined as a percentage */ + command access(invoke: manage) FailRandomlyAtFault(FailRandomlyAtFaultRequest): DefaultSuccess = 1; +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 20574c1135c838..da9947fda4e402 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -1104,6 +1104,105 @@ private static Map readBinaryInputBasicInteractionInfo( return result; } + private static Map readPulseWidthModulationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readPulseWidthModulationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.PulseWidthModulationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterGeneratedCommandListAttributeCallback(), + readPulseWidthModulationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readPulseWidthModulationGeneratedCommandListAttributeInteractionInfo); + Map readPulseWidthModulationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.PulseWidthModulationCluster + .AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterAcceptedCommandListAttributeCallback(), + readPulseWidthModulationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readPulseWidthModulationAcceptedCommandListAttributeInteractionInfo); + Map readPulseWidthModulationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readEventListAttribute( + (ChipClusters.PulseWidthModulationCluster.EventListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterEventListAttributeCallback(), + readPulseWidthModulationEventListCommandParams); + result.put("readEventListAttribute", readPulseWidthModulationEventListAttributeInteractionInfo); + Map readPulseWidthModulationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.PulseWidthModulationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterAttributeListAttributeCallback(), + readPulseWidthModulationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", + readPulseWidthModulationAttributeListAttributeInteractionInfo); + Map readPulseWidthModulationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPulseWidthModulationFeatureMapCommandParams); + result.put( + "readFeatureMapAttribute", readPulseWidthModulationFeatureMapAttributeInteractionInfo); + Map readPulseWidthModulationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPulseWidthModulationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readPulseWidthModulationClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readDescriptorInteractionInfo() { Map result = new LinkedHashMap<>(); Map readDescriptorDeviceTypeListCommandParams = @@ -5598,6 +5697,270 @@ private static Map readEthernetNetworkDiagnosticsIntera return result; } + private static Map readTimeSynchronizationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readTimeSynchronizationUTCTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationUTCTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readUTCTimeAttribute( + (ChipClusters.TimeSynchronizationCluster.UTCTimeAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterUTCTimeAttributeCallback(), + readTimeSynchronizationUTCTimeCommandParams); + result.put("readUTCTimeAttribute", readTimeSynchronizationUTCTimeAttributeInteractionInfo); + Map readTimeSynchronizationGranularityCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationGranularityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readGranularityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationGranularityCommandParams); + result.put( + "readGranularityAttribute", readTimeSynchronizationGranularityAttributeInteractionInfo); + Map readTimeSynchronizationTimeSourceCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeSourceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeSourceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeSourceCommandParams); + result.put( + "readTimeSourceAttribute", readTimeSynchronizationTimeSourceAttributeInteractionInfo); + Map readTimeSynchronizationDefaultNTPCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDefaultNTPAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDefaultNTPAttribute( + (ChipClusters.TimeSynchronizationCluster.DefaultNTPAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterDefaultNTPAttributeCallback(), + readTimeSynchronizationDefaultNTPCommandParams); + result.put( + "readDefaultNTPAttribute", readTimeSynchronizationDefaultNTPAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneAttribute( + (ChipClusters.TimeSynchronizationCluster.TimeZoneAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterTimeZoneAttributeCallback(), + readTimeSynchronizationTimeZoneCommandParams); + result.put("readTimeZoneAttribute", readTimeSynchronizationTimeZoneAttributeInteractionInfo); + Map readTimeSynchronizationDSTOffsetCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDSTOffsetAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDSTOffsetAttribute( + (ChipClusters.TimeSynchronizationCluster.DSTOffsetAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterDSTOffsetAttributeCallback(), + readTimeSynchronizationDSTOffsetCommandParams); + result.put("readDSTOffsetAttribute", readTimeSynchronizationDSTOffsetAttributeInteractionInfo); + Map readTimeSynchronizationLocalTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationLocalTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readLocalTimeAttribute( + (ChipClusters.TimeSynchronizationCluster.LocalTimeAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterLocalTimeAttributeCallback(), + readTimeSynchronizationLocalTimeCommandParams); + result.put("readLocalTimeAttribute", readTimeSynchronizationLocalTimeAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneDatabaseCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneDatabaseAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneDatabaseAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeZoneDatabaseCommandParams); + result.put( + "readTimeZoneDatabaseAttribute", + readTimeSynchronizationTimeZoneDatabaseAttributeInteractionInfo); + Map readTimeSynchronizationNTPServerAvailableCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationNTPServerAvailableAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readNTPServerAvailableAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTimeSynchronizationNTPServerAvailableCommandParams); + result.put( + "readNTPServerAvailableAttribute", + readTimeSynchronizationNTPServerAvailableAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneListMaxSizeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneListMaxSizeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneListMaxSizeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeZoneListMaxSizeCommandParams); + result.put( + "readTimeZoneListMaxSizeAttribute", + readTimeSynchronizationTimeZoneListMaxSizeAttributeInteractionInfo); + Map readTimeSynchronizationDSTOffsetListMaxSizeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDSTOffsetListMaxSizeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDSTOffsetListMaxSizeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationDSTOffsetListMaxSizeCommandParams); + result.put( + "readDSTOffsetListMaxSizeAttribute", + readTimeSynchronizationDSTOffsetListMaxSizeAttributeInteractionInfo); + Map readTimeSynchronizationSupportsDNSResolveCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationSupportsDNSResolveAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readSupportsDNSResolveAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTimeSynchronizationSupportsDNSResolveCommandParams); + result.put( + "readSupportsDNSResolveAttribute", + readTimeSynchronizationSupportsDNSResolveAttributeInteractionInfo); + Map readTimeSynchronizationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.TimeSynchronizationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterGeneratedCommandListAttributeCallback(), + readTimeSynchronizationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readTimeSynchronizationGeneratedCommandListAttributeInteractionInfo); + Map readTimeSynchronizationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.TimeSynchronizationCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterAcceptedCommandListAttributeCallback(), + readTimeSynchronizationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readTimeSynchronizationAcceptedCommandListAttributeInteractionInfo); + Map readTimeSynchronizationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readEventListAttribute( + (ChipClusters.TimeSynchronizationCluster.EventListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterEventListAttributeCallback(), + readTimeSynchronizationEventListCommandParams); + result.put("readEventListAttribute", readTimeSynchronizationEventListAttributeInteractionInfo); + Map readTimeSynchronizationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.TimeSynchronizationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterAttributeListAttributeCallback(), + readTimeSynchronizationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readTimeSynchronizationAttributeListAttributeInteractionInfo); + Map readTimeSynchronizationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTimeSynchronizationFeatureMapCommandParams); + result.put( + "readFeatureMapAttribute", readTimeSynchronizationFeatureMapAttributeInteractionInfo); + Map readTimeSynchronizationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readTimeSynchronizationClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readBridgedDeviceBasicInformationInteractionInfo() { Map result = new LinkedHashMap<>(); Map readBridgedDeviceBasicInformationVendorNameCommandParams = @@ -6714,6 +7077,277 @@ private static Map readUserLabelInteractionInfo() { return result; } + private static Map readProxyConfigurationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyConfigurationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyConfigurationCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterGeneratedCommandListAttributeCallback(), + readProxyConfigurationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyConfigurationGeneratedCommandListAttributeInteractionInfo); + Map readProxyConfigurationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyConfigurationCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterAcceptedCommandListAttributeCallback(), + readProxyConfigurationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyConfigurationAcceptedCommandListAttributeInteractionInfo); + Map readProxyConfigurationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyConfigurationCluster.EventListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterEventListAttributeCallback(), + readProxyConfigurationEventListCommandParams); + result.put("readEventListAttribute", readProxyConfigurationEventListAttributeInteractionInfo); + Map readProxyConfigurationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyConfigurationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterAttributeListAttributeCallback(), + readProxyConfigurationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readProxyConfigurationAttributeListAttributeInteractionInfo); + Map readProxyConfigurationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyConfigurationFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyConfigurationFeatureMapAttributeInteractionInfo); + Map readProxyConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyConfigurationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readProxyConfigurationClusterRevisionAttributeInteractionInfo); + + return result; + } + + private static Map readProxyDiscoveryInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyDiscoveryGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyDiscoveryCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterGeneratedCommandListAttributeCallback(), + readProxyDiscoveryGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyDiscoveryGeneratedCommandListAttributeInteractionInfo); + Map readProxyDiscoveryAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyDiscoveryCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterAcceptedCommandListAttributeCallback(), + readProxyDiscoveryAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyDiscoveryAcceptedCommandListAttributeInteractionInfo); + Map readProxyDiscoveryEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyDiscoveryCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyDiscoveryClusterEventListAttributeCallback(), + readProxyDiscoveryEventListCommandParams); + result.put("readEventListAttribute", readProxyDiscoveryEventListAttributeInteractionInfo); + Map readProxyDiscoveryAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyDiscoveryCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterAttributeListAttributeCallback(), + readProxyDiscoveryAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readProxyDiscoveryAttributeListAttributeInteractionInfo); + Map readProxyDiscoveryFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyDiscoveryFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyDiscoveryFeatureMapAttributeInteractionInfo); + Map readProxyDiscoveryClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyDiscoveryClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readProxyDiscoveryClusterRevisionAttributeInteractionInfo); + + return result; + } + + private static Map readProxyValidInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyValidGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyValidCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyValidClusterGeneratedCommandListAttributeCallback(), + readProxyValidGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyValidGeneratedCommandListAttributeInteractionInfo); + Map readProxyValidAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyValidCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyValidClusterAcceptedCommandListAttributeCallback(), + readProxyValidAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyValidAcceptedCommandListAttributeInteractionInfo); + Map readProxyValidEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyValidCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyValidClusterEventListAttributeCallback(), + readProxyValidEventListCommandParams); + result.put("readEventListAttribute", readProxyValidEventListAttributeInteractionInfo); + Map readProxyValidAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyValidCluster.AttributeListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyValidClusterAttributeListAttributeCallback(), + readProxyValidAttributeListCommandParams); + result.put("readAttributeListAttribute", readProxyValidAttributeListAttributeInteractionInfo); + Map readProxyValidFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyValidFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyValidFeatureMapAttributeInteractionInfo); + Map readProxyValidClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyValidClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readProxyValidClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readBooleanStateInteractionInfo() { Map result = new LinkedHashMap<>(); Map readBooleanStateStateValueCommandParams = @@ -18516,6 +19150,96 @@ private static Map readUnitTestingInteractionInfo() { return result; } + private static Map readFaultInjectionInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readFaultInjectionGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback(), + readFaultInjectionGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readFaultInjectionGeneratedCommandListAttributeInteractionInfo); + Map readFaultInjectionAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback(), + readFaultInjectionAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readFaultInjectionAcceptedCommandListAttributeInteractionInfo); + Map readFaultInjectionEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readEventListAttribute( + (ChipClusters.FaultInjectionCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedFaultInjectionClusterEventListAttributeCallback(), + readFaultInjectionEventListCommandParams); + result.put("readEventListAttribute", readFaultInjectionEventListAttributeInteractionInfo); + Map readFaultInjectionAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterAttributeListAttributeCallback(), + readFaultInjectionAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readFaultInjectionAttributeListAttributeInteractionInfo); + Map readFaultInjectionFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readFaultInjectionFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readFaultInjectionFeatureMapAttributeInteractionInfo); + Map readFaultInjectionClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFaultInjectionClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readFaultInjectionClusterRevisionAttributeInteractionInfo); + + return result; + } + @SuppressWarnings("serial") public Map> getReadAttributeMap() { @@ -18528,6 +19252,7 @@ public Map> getReadAttributeMap() { put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo()); put("levelControl", readLevelControlInteractionInfo()); put("binaryInputBasic", readBinaryInputBasicInteractionInfo()); + put("pulseWidthModulation", readPulseWidthModulationInteractionInfo()); put("descriptor", readDescriptorInteractionInfo()); put("binding", readBindingInteractionInfo()); put("accessControl", readAccessControlInteractionInfo()); @@ -18548,6 +19273,7 @@ public Map> getReadAttributeMap() { put("threadNetworkDiagnostics", readThreadNetworkDiagnosticsInteractionInfo()); put("wiFiNetworkDiagnostics", readWiFiNetworkDiagnosticsInteractionInfo()); put("ethernetNetworkDiagnostics", readEthernetNetworkDiagnosticsInteractionInfo()); + put("timeSynchronization", readTimeSynchronizationInteractionInfo()); put("bridgedDeviceBasicInformation", readBridgedDeviceBasicInformationInteractionInfo()); put("switch", readSwitchInteractionInfo()); put("administratorCommissioning", readAdministratorCommissioningInteractionInfo()); @@ -18555,6 +19281,9 @@ public Map> getReadAttributeMap() { put("groupKeyManagement", readGroupKeyManagementInteractionInfo()); put("fixedLabel", readFixedLabelInteractionInfo()); put("userLabel", readUserLabelInteractionInfo()); + put("proxyConfiguration", readProxyConfigurationInteractionInfo()); + put("proxyDiscovery", readProxyDiscoveryInteractionInfo()); + put("proxyValid", readProxyValidInteractionInfo()); put("booleanState", readBooleanStateInteractionInfo()); put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); @@ -18604,6 +19333,7 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); + put("faultInjection", readFaultInjectionInteractionInfo()); } }; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index c3d7038d4358b6..b58f840370f8a2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -345,6 +345,8 @@ public Map> getWriteAttributeMap() { writeBinaryInputBasicInteractionInfo.put( "writeReliabilityAttribute", writeBinaryInputBasicReliabilityAttributeInteractionInfo); writeAttributeMap.put("binaryInputBasic", writeBinaryInputBasicInteractionInfo); + Map writePulseWidthModulationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("pulseWidthModulation", writePulseWidthModulationInteractionInfo); Map writeDescriptorInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("descriptor", writeDescriptorInteractionInfo); Map writeBindingInteractionInfo = new LinkedHashMap<>(); @@ -553,6 +555,8 @@ public Map> getWriteAttributeMap() { new LinkedHashMap<>(); writeAttributeMap.put( "ethernetNetworkDiagnostics", writeEthernetNetworkDiagnosticsInteractionInfo); + Map writeTimeSynchronizationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("timeSynchronization", writeTimeSynchronizationInteractionInfo); Map writeBridgedDeviceBasicInformationInteractionInfo = new LinkedHashMap<>(); Map writeBridgedDeviceBasicInformationNodeLabelCommandParams = @@ -589,6 +593,12 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("fixedLabel", writeFixedLabelInteractionInfo); Map writeUserLabelInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("userLabel", writeUserLabelInteractionInfo); + Map writeProxyConfigurationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyConfiguration", writeProxyConfigurationInteractionInfo); + Map writeProxyDiscoveryInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyDiscovery", writeProxyDiscoveryInteractionInfo); + Map writeProxyValidInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyValid", writeProxyValidInteractionInfo); Map writeBooleanStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("booleanState", writeBooleanStateInteractionInfo); Map writeIcdManagementInteractionInfo = new LinkedHashMap<>(); @@ -3878,6 +3888,8 @@ public Map> getWriteAttributeMap() { writeUnitTestingInteractionInfo.put( "writeWriteOnlyInt8uAttribute", writeUnitTestingWriteOnlyInt8uAttributeInteractionInfo); writeAttributeMap.put("unitTesting", writeUnitTestingInteractionInfo); + Map writeFaultInjectionInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("faultInjection", writeFaultInjectionInteractionInfo); return writeAttributeMap; } } diff --git a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt index c4ecf0256ace49..a27e442a4ba785 100644 --- a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt +++ b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt @@ -37,7 +37,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR switch (aPath.mClusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} case app::Clusters::{{asUpperCamelCase name}}::Id: { using namespace app::Clusters::{{asUpperCamelCase name}}; switch (aPath.mAttributeId) @@ -61,7 +61,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - {{/all_user_clusters}} + {{/zcl_clusters}} default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/templates/CHIPClustersWrite-JNI.zapt b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt index 2a77e14c42d1bb..e7744ed2fc8e5e 100644 --- a/src/controller/java/templates/CHIPClustersWrite-JNI.zapt +++ b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include #include "CHIPInvokeCallbacks.h" @@ -29,7 +28,7 @@ using namespace chip; using namespace chip::Controller; -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_attributes_server removeKeys='isOptional'}} {{#if_unsupported_attribute_callback type isArray ../id}} {{else}} @@ -77,7 +76,6 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase na {{/if}} {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} #pragma clang diagnostic pop diff --git a/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt b/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt index a9e78ba6590ff8..1a7fb3b853e344 100644 --- a/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt +++ b/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt @@ -37,7 +37,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & switch (aPath.mClusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} case app::Clusters::{{asUpperCamelCase name}}::Id: { using namespace app::Clusters::{{asUpperCamelCase name}}; switch (aPath.mEventId) @@ -82,7 +82,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - {{/all_user_clusters}} + {{/zcl_clusters}} default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt index 29a6769214ee7e..b9e5f54409d65d 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt @@ -14,7 +14,7 @@ namespace chip { -{{#all_user_clusters}} +{{#zcl_clusters}} {{#zcl_commands_source_server}} CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback): Callback::Callback(CallbackFn, this) { @@ -70,5 +70,5 @@ void CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callbac env->CallVoidMethod(javaCallbackRef, javaMethod{{#zcl_command_arguments}}, {{asSymbol label}}{{/zcl_command_arguments}}); } {{/zcl_commands_source_server}} -{{/all_user_clusters}} +{{/zcl_clusters}} } // namespace chip diff --git a/src/controller/java/templates/CHIPInvokeCallbacks.zapt b/src/controller/java/templates/CHIPInvokeCallbacks.zapt index 59adcfe73961f0..1edf8811986e11 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include @@ -8,7 +7,7 @@ namespace chip { -{{#all_user_clusters}} +{{#zcl_clusters}} {{#zcl_commands_source_server}} class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase commandName}}Callback : public Callback::Callback { @@ -24,6 +23,5 @@ private: }; {{/zcl_commands_source_server}} -{{/all_user_clusters}} +{{/zcl_clusters}} } // namespace chip -{{/if_enabled_clusters}} diff --git a/src/controller/java/templates/CHIPReadCallbacks-src.zapt b/src/controller/java/templates/CHIPReadCallbacks-src.zapt index 5a643e5369079d..e45548df890964 100644 --- a/src/controller/java/templates/CHIPReadCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks-src.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include @@ -85,7 +84,7 @@ void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{ch {{/unless}} {{/chip_server_global_responses}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_attributes_server removeKeys='isOptional'}} {{! TODO: Add support for struct-typed attributes }} {{#if_unsupported_attribute_callback type isArray ../id}} @@ -173,6 +172,4 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb {{/if}} {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} -{{/all_user_clusters}} - -{{/if_enabled_clusters}} +{{/zcl_clusters}} diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index d46005ce04ff9b..92621720aba6b4 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -102,7 +102,7 @@ public class ChipClusters { } } - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} public static class {{asUpperCamelCase name}}Cluster extends BaseChipCluster { public static final long CLUSTER_ID = {{code}}L; @@ -245,6 +245,6 @@ public class ChipClusters { {{#not_last}} {{/not_last}} - {{/all_user_clusters}} + {{/zcl_clusters}} } {{/if_enabled_clusters}} diff --git a/src/controller/java/templates/ChipEventStructs-java.zapt b/src/controller/java/templates/ChipEventStructs-java.zapt index e180b3c3a75b70..51a1e91ee299fe 100644 --- a/src/controller/java/templates/ChipEventStructs-java.zapt +++ b/src/controller/java/templates/ChipEventStructs-java.zapt @@ -1,17 +1,14 @@ {{> header}} package chip.devicecontroller; -{{#if_enabled_clusters side='client'}} import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Optional; -{{/if_enabled_clusters}} {{! TODO: Use AutoValue for inner classes. }} public class ChipEventStructs { -{{#if_enabled_clusters side='client'}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_events}} public static class {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Event { {{#zcl_event_fields}} @@ -54,6 +51,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL } {{/zcl_events}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} } \ No newline at end of file diff --git a/src/controller/java/templates/ChipIdLookup-java.zapt b/src/controller/java/templates/ChipIdLookup-java.zapt index aa744a98cd94ac..cd2475af515b1a 100644 --- a/src/controller/java/templates/ChipIdLookup-java.zapt +++ b/src/controller/java/templates/ChipIdLookup-java.zapt @@ -9,11 +9,11 @@ public final class ChipIdLookup { * ID is found, returns an empty string. */ public static String clusterIdToName(long clusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { return "{{asUpperCamelCase name}}"; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } @@ -22,7 +22,7 @@ public final class ChipIdLookup { * If no matching IDs are found, returns an empty string. */ public static String attributeIdToName(long clusterId, long attributeId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { {{#zcl_attributes_server}} if (attributeId == {{code}}L) { @@ -31,7 +31,7 @@ public final class ChipIdLookup { {{/zcl_attributes_server}} return ""; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } @@ -40,7 +40,7 @@ public final class ChipIdLookup { * If no matching IDs are found, returns an empty string. */ public static String eventIdToName(long clusterId, long eventId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { {{#zcl_events}} if (eventId == {{code}}L) { @@ -49,7 +49,7 @@ public final class ChipIdLookup { {{/zcl_events}} return ""; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } } diff --git a/src/controller/java/templates/ChipStructs-java.zapt b/src/controller/java/templates/ChipStructs-java.zapt index 595b47afa42830..8ab62d9308fbbf 100644 --- a/src/controller/java/templates/ChipStructs-java.zapt +++ b/src/controller/java/templates/ChipStructs-java.zapt @@ -1,17 +1,14 @@ {{> header}} package chip.devicecontroller; -{{#if_enabled_clusters side='client'}} import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Optional; -{{/if_enabled_clusters}} {{! TODO: Use AutoValue for inner classes. }} public class ChipStructs { -{{#if_enabled_clusters side='client'}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_structs}} {{#if itemCnt}} public static class {{asUpperCamelCase parent.name}}Cluster{{asUnderlyingType name}} { @@ -52,6 +49,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL {{/if}} {{/zcl_structs}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} } \ No newline at end of file diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 45234bd42a1b39..cb4c9893c55413 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -199,7 +199,7 @@ public class ClusterInfoMapping { callback.onFailure(e); } } - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} {{#all_user_cluster_generated_commands}} {{#if_compare clusterId ../id operator='=='}} {{#if (is_str_equal commandSource 'server')}} @@ -279,7 +279,7 @@ public class ClusterInfoMapping { {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} - {{/all_user_clusters}} + {{/zcl_clusters}} public Map getClusterMap() { Map clusterMap = initializeClusterMap(); @@ -294,24 +294,24 @@ public class ClusterInfoMapping { public Map initializeClusterMap() { Map clusterMap = new HashMap<>(); - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} ClusterInfo {{asLowerCamelCase name}}ClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.{{asUpperCamelCase name}}Cluster(ptr, endpointId), new HashMap<>()); clusterMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInfo); - {{/all_user_clusters}} + {{/zcl_clusters}} return clusterMap; } public void combineCommand(Map destination, Map> source) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} destination.get("{{asLowerCamelCase name}}").combineCommands(source.get("{{asLowerCamelCase name}}")); - {{/all_user_clusters}} + {{/zcl_clusters}} } @SuppressWarnings("unchecked") public Map> getCommandMap() { Map> commandMap = new HashMap<>(); - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} Map {{asLowerCamelCase name}}ClusterInteractionInfoMap = new LinkedHashMap<>(); {{#all_user_cluster_generated_commands}} {{#if_compare clusterId ../id operator='=='}} @@ -367,7 +367,7 @@ public class ClusterInfoMapping { {{/if_compare}} {{/all_user_cluster_generated_commands}} commandMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInteractionInfoMap); - {{/all_user_clusters}} + {{/zcl_clusters}} return commandMap; } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index f8a1f257a0af6b..769ead58483f84 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1621,6 +1621,142 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::PulseWidthModulation::Id: { + using namespace app::Clusters::PulseWidthModulation; + switch (aPath.mAttributeId) + { + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::Descriptor::Id: { using namespace app::Clusters::Descriptor; switch (aPath.mAttributeId) @@ -8643,12 +8779,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::BridgedDeviceBasicInformation::Id: { - using namespace app::Clusters::BridgedDeviceBasicInformation; + case app::Clusters::TimeSynchronization::Id: { + using namespace app::Clusters::TimeSynchronization; switch (aPath.mAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; + case Attributes::UTCTime::Id: { + using TypeInfo = Attributes::UTCTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8656,38 +8792,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + if (cppValue.IsNull()) { - return nullptr; + value = nullptr; } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - static_cast(cppValue), value); - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + else { - return nullptr; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; + case Attributes::Granularity::Id: { + using TypeInfo = Attributes::Granularity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8695,11 +8814,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; + case Attributes::TimeSource::Id: { + using TypeInfo = Attributes::TimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8709,12 +8831,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; + case Attributes::TrustedTimeSource::Id: { + using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8722,11 +8844,54 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_fabricIndex; + std::string value_fabricIndexClassName = "java/lang/Integer"; + std::string value_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_fabricIndexClassName.c_str(), + value_fabricIndexCtorSignature.c_str(), + cppValue.Value().fabricIndex, value_fabricIndex); + jobject value_nodeID; + std::string value_nodeIDClassName = "java/lang/Long"; + std::string value_nodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_nodeIDClassName.c_str(), value_nodeIDCtorSignature.c_str(), cppValue.Value().nodeID, value_nodeID); + jobject value_endpoint; + std::string value_endpointClassName = "java/lang/Integer"; + std::string value_endpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_endpointClassName.c_str(), + value_endpointCtorSignature.c_str(), + cppValue.Value().endpoint, value_endpoint); + + jclass trustedTimeSourceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", + trustedTimeSourceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); + return nullptr; + } + jmethodID trustedTimeSourceStructStructCtor_1 = env->GetMethodID( + trustedTimeSourceStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V"); + if (trustedTimeSourceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); + return nullptr; + } + + value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, value_fabricIndex, + value_nodeID, value_endpoint); + } return value; } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; + case Attributes::DefaultNTP::Id: { + using TypeInfo = Attributes::DefaultNTP::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8734,14 +8899,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } return value; } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; + case Attributes::TimeZone::Id: { + using TypeInfo = Attributes::TimeZone::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8749,11 +8918,62 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + 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; + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_offsetClassName.c_str(), + newElement_0_offsetCtorSignature.c_str(), + entry_0.offset, newElement_0_offset); + jobject newElement_0_validAt; + std::string newElement_0_validAtClassName = "java/lang/Long"; + std::string newElement_0_validAtCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validAtClassName.c_str(), + newElement_0_validAtCtorSignature.c_str(), + entry_0.validAt, newElement_0_validAt); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return nullptr; + } + jmethodID timeZoneStructStructCtor_1 = env->GetMethodID(timeZoneStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; + case Attributes::DSTOffset::Id: { + using TypeInfo = Attributes::DSTOffset::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8761,23 +8981,64 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) { - return nullptr; + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_offsetClassName.c_str(), + newElement_0_offsetCtorSignature.c_str(), + entry_0.offset, newElement_0_offset); + jobject newElement_0_validStarting; + std::string newElement_0_validStartingClassName = "java/lang/Long"; + std::string newElement_0_validStartingCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validStartingClassName.c_str(), + newElement_0_validStartingCtorSignature.c_str(), + entry_0.validStarting, newElement_0_validStarting); + jobject newElement_0_validUntil; + if (entry_0.validUntil.IsNull()) + { + newElement_0_validUntil = nullptr; + } + else + { + std::string newElement_0_validUntilClassName = "java/lang/Long"; + std::string newElement_0_validUntilCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_validUntilClassName.c_str(), newElement_0_validUntilCtorSignature.c_str(), + entry_0.validUntil.Value(), newElement_0_validUntil); + } + + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", + DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return nullptr; + } + jmethodID DSTOffsetStructStructCtor_1 = + env->GetMethodID(DSTOffsetStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + if (DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; + case Attributes::LocalTime::Id: { + using TypeInfo = Attributes::LocalTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8785,23 +9046,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + if (cppValue.IsNull()) { - return nullptr; + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; + case Attributes::TimeZoneDatabase::Id: { + using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8809,11 +9068,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; + case Attributes::NTPServerAvailable::Id: { + using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8827,8 +9089,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; + case Attributes::TimeZoneListMaxSize::Id: { + using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8836,11 +9098,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; + case Attributes::DSTOffsetListMaxSize::Id: { + using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8848,46 +9113,25 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jobject value_finish; - std::string value_finishClassName = "java/lang/Integer"; - std::string value_finishCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(value_finishClassName.c_str(), - value_finishCtorSignature.c_str(), - static_cast(cppValue.finish), value_finish); - jobject value_primaryColor; - if (cppValue.primaryColor.IsNull()) - { - value_primaryColor = nullptr; - } - else - { - std::string value_primaryColorClassName = "java/lang/Integer"; - std::string value_primaryColorCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_primaryColorClassName.c_str(), value_primaryColorCtorSignature.c_str(), - static_cast(cppValue.primaryColor.Value()), value_primaryColor); - } - - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); - return nullptr; - } - jmethodID productAppearanceStructStructCtor_0 = - env->GetMethodID(productAppearanceStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (productAppearanceStructStructCtor_0 == nullptr) + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SupportsDNSResolve::Id: { + using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); return nullptr; } - - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); return value; } case Attributes::GeneratedCommandList::Id: { @@ -9022,12 +9266,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::Switch::Id: { - using namespace app::Clusters::Switch; + case app::Clusters::BridgedDeviceBasicInformation::Id: { + using namespace app::Clusters::BridgedDeviceBasicInformation; switch (aPath.mAttributeId) { - case Attributes::NumberOfPositions::Id: { - using TypeInfo = Attributes::NumberOfPositions::TypeInfo; + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9035,14 +9279,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::CurrentPosition::Id: { - using TypeInfo = Attributes::CurrentPosition::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9052,12 +9293,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::MultiPressMax::Id: { - using TypeInfo = Attributes::MultiPressMax::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9065,14 +9306,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9080,23 +9318,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - 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; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9104,23 +9330,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - 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; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9128,23 +9345,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - 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; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9152,23 +9357,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - 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; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9176,14 +9372,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9191,24 +9384,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } - case app::Clusters::AdministratorCommissioning::Id: { - using namespace app::Clusters::AdministratorCommissioning; - switch (aPath.mAttributeId) - { - case Attributes::WindowStatus::Id: { - using TypeInfo = Attributes::WindowStatus::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9216,14 +9396,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - static_cast(cppValue), value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AdminFabricIndex::Id: { - using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9231,21 +9408,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - if (cppValue.IsNull()) + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - value = nullptr; + return nullptr; } - else + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + return nullptr; } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AdminVendorId::Id: { - using TypeInfo = Attributes::AdminVendorId::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9253,17 +9444,73 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - if (cppValue.IsNull()) + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - value = nullptr; + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_finish; + std::string value_finishClassName = "java/lang/Integer"; + std::string value_finishCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_finishClassName.c_str(), + value_finishCtorSignature.c_str(), + static_cast(cppValue.finish), value_finish); + jobject value_primaryColor; + if (cppValue.primaryColor.IsNull()) + { + value_primaryColor = nullptr; } else { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + std::string value_primaryColorClassName = "java/lang/Integer"; + std::string value_primaryColorCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_primaryColorClassName.c_str(), value_primaryColorCtorSignature.c_str(), + static_cast(cppValue.primaryColor.Value()), value_primaryColor); + } + + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); + return nullptr; + } + jmethodID productAppearanceStructStructCtor_0 = + env->GetMethodID(productAppearanceStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; } + + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); return value; } case Attributes::GeneratedCommandList::Id: { @@ -9398,12 +9645,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::OperationalCredentials::Id: { - using namespace app::Clusters::OperationalCredentials; + case app::Clusters::Switch::Id: { + using namespace app::Clusters::Switch; switch (aPath.mAttributeId) { - case Attributes::NOCs::Id: { - using TypeInfo = Attributes::NOCs::TypeInfo; + case Attributes::NumberOfPositions::Id: { + using TypeInfo = Attributes::NumberOfPositions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::CurrentPosition::Id: { + using TypeInfo = Attributes::CurrentPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MultiPressMax::Id: { + using TypeInfo = Attributes::MultiPressMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9418,53 +9710,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_noc; - jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); - env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), - reinterpret_cast(entry_0.noc.data())); - newElement_0_noc = newElement_0_nocByteArray; - jobject newElement_0_icac; - if (entry_0.icac.IsNull()) - { - newElement_0_icac = nullptr; - } - else - { - jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); - env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), - reinterpret_cast(entry_0.icac.Value().data())); - newElement_0_icac = newElement_0_icacByteArray; - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return nullptr; - } - jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); - if (NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return nullptr; - } + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::Fabrics::Id: { - using TypeInfo = Attributes::Fabrics::TypeInfo; + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9479,22 +9758,366 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_rootPublicKey; - jbyteArray newElement_0_rootPublicKeyByteArray = - env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); - env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), - reinterpret_cast(entry_0.rootPublicKey.data())); - newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; - jobject newElement_0_vendorID; - std::string newElement_0_vendorIDClassName = "java/lang/Integer"; - std::string newElement_0_vendorIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), - static_cast(entry_0.vendorID), newElement_0_vendorID); - jobject newElement_0_fabricID; - std::string newElement_0_fabricIDClassName = "java/lang/Long"; - std::string newElement_0_fabricIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::AdministratorCommissioning::Id: { + using namespace app::Clusters::AdministratorCommissioning; + switch (aPath.mAttributeId) + { + case Attributes::WindowStatus::Id: { + using TypeInfo = Attributes::WindowStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); + return value; + } + case Attributes::AdminFabricIndex::Id: { + using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::AdminVendorId::Id: { + using TypeInfo = Attributes::AdminVendorId::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::OperationalCredentials::Id: { + using namespace app::Clusters::OperationalCredentials; + switch (aPath.mAttributeId) + { + case Attributes::NOCs::Id: { + using TypeInfo = Attributes::NOCs::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + jobject newElement_0_noc; + jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); + env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), + reinterpret_cast(entry_0.noc.data())); + newElement_0_noc = newElement_0_nocByteArray; + jobject newElement_0_icac; + if (entry_0.icac.IsNull()) + { + newElement_0_icac = nullptr; + } + else + { + jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); + env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), + reinterpret_cast(entry_0.icac.Value().data())); + newElement_0_icac = newElement_0_icacByteArray; + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass NOCStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); + return nullptr; + } + jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); + if (NOCStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, + newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + jobject newElement_0_rootPublicKey; + jbyteArray newElement_0_rootPublicKeyByteArray = + env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); + env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), + reinterpret_cast(entry_0.rootPublicKey.data())); + newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; + jobject newElement_0_vendorID; + std::string newElement_0_vendorIDClassName = "java/lang/Integer"; + std::string newElement_0_vendorIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), + static_cast(entry_0.vendorID), newElement_0_vendorID); + jobject newElement_0_fabricID; + std::string newElement_0_fabricIDClassName = "java/lang/Long"; + std::string newElement_0_fabricIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, newElement_0_fabricID); jobject newElement_0_nodeID; @@ -9512,33 +10135,501 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass fabricDescriptorStructStructClass_1; + jclass fabricDescriptorStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + return nullptr; + } + jmethodID fabricDescriptorStructStructCtor_1 = env->GetMethodID( + fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); + if (fabricDescriptorStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, + newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::SupportedFabrics::Id: { + using TypeInfo = Attributes::SupportedFabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::CommissionedFabrics::Id: { + using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::TrustedRootCertificates::Id: { + using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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::CurrentFabricIndex::Id: { + using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::GroupKeyManagement::Id: { + using namespace app::Clusters::GroupKeyManagement; + switch (aPath.mAttributeId) + { + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), + entry_0.groupId, newElement_0_groupId); + jobject newElement_0_groupKeySetID; + std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; + std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), + newElement_0_groupKeySetIDCtorSignature.c_str(), + entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupKeyMapStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", + groupKeyMapStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); return nullptr; } - jmethodID fabricDescriptorStructStructCtor_1 = env->GetMethodID( - fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); - if (fabricDescriptorStructStructCtor_1 == nullptr) + jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID( + groupKeyMapStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (groupKeyMapStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, - newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, + newElement_0_groupKeySetID, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), + entry_0.groupId, newElement_0_groupId); + jobject newElement_0_endpoints; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); + + auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); + while (iter_newElement_0_endpoints_2.Next()) + { + auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); + } + jobject newElement_0_groupName; + if (!entry_0.groupName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); + } + else + { + jobject newElement_0_groupNameInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", + groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return nullptr; + } + jmethodID groupInfoMapStructStructCtor_1 = + env->GetMethodID(groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); + if (groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::SupportedFabrics::Id: { - using TypeInfo = Attributes::SupportedFabrics::TypeInfo; + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9546,14 +10637,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::CommissionedFabrics::Id: { - using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9563,12 +10654,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::TrustedRootCertificates::Id: { - using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::FixedLabel::Id: { + using namespace app::Clusters::FixedLabel; + switch (aPath.mAttributeId) + { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9583,29 +10684,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { 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; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return nullptr; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::CurrentFabricIndex::Id: { - using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -9738,12 +10843,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::GroupKeyManagement::Id: { - using namespace app::Clusters::GroupKeyManagement; + case app::Clusters::UserLabel::Id: { + using namespace app::Clusters::UserLabel; switch (aPath.mAttributeId) { - case Attributes::GroupKeyMap::Id: { - using TypeInfo = Attributes::GroupKeyMap::TypeInfo; + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9758,50 +10863,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), - entry_0.groupId, newElement_0_groupId); - jobject newElement_0_groupKeySetID; - std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; - std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), - newElement_0_groupKeySetIDCtorSignature.c_str(), - entry_0.groupKeySetID, newElement_0_groupKeySetID); - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass groupKeyMapStructStructClass_1; + jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", - groupKeyMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); return nullptr; } - jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID( - groupKeyMapStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (groupKeyMapStructStructCtor_1 == nullptr) + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::GroupTable::Id: { - using TypeInfo = Attributes::GroupTable::TypeInfo; + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9816,71 +10906,88 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), - entry_0.groupId, newElement_0_groupId); - jobject newElement_0_endpoints; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); - - auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); - while (iter_newElement_0_endpoints_2.Next()) - { - auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); - jobject newElement_2; - std::string newElement_2ClassName = "java/lang/Integer"; - std::string newElement_2CtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); - chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); - } - jobject newElement_0_groupName; - if (!entry_0.groupName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); - } - else - { - jobject newElement_0_groupNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), - newElement_0_groupNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - jclass groupInfoMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", - groupInfoMapStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); - return nullptr; - } - jmethodID groupInfoMapStructStructCtor_1 = - env->GetMethodID(groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); - if (groupInfoMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); - return nullptr; - } + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::MaxGroupsPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9888,14 +10995,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, value); return value; } - case Attributes::MaxGroupKeysPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9909,6 +11016,16 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyConfiguration::Id: { + using namespace app::Clusters::ProxyConfiguration; + switch (aPath.mAttributeId) + { case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -10041,53 +11158,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::FixedLabel::Id: { - using namespace app::Clusters::FixedLabel; + case app::Clusters::ProxyDiscovery::Id: { + using namespace app::Clusters::ProxyDiscovery; switch (aPath.mAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - 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; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return nullptr; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return nullptr; - } - - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -10220,53 +11294,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::UserLabel::Id: { - using namespace app::Clusters::UserLabel; + case app::Clusters::ProxyValid::Id: { + using namespace app::Clusters::ProxyValid; switch (aPath.mAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - 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; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return nullptr; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return nullptr; - } - - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -27119,6 +28150,142 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::FaultInjection::Id: { + using namespace app::Clusters::FaultInjection; + switch (aPath.mAttributeId) + { + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index ecbffc60ee818b..9889badb090a46 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -107,6 +107,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::PulseWidthModulation::Id: { + using namespace app::Clusters::PulseWidthModulation; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::Descriptor::Id: { using namespace app::Clusters::Descriptor; switch (aPath.mEventId) @@ -1707,6 +1717,177 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::TimeSynchronization::Id: { + using namespace app::Clusters::TimeSynchronization; + switch (aPath.mEventId) + { + case Events::DSTTableEmpty::Id: { + Events::DSTTableEmpty::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass DSTTableEmptyStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent", + DSTTableEmptyStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent"); + return nullptr; + } + jmethodID DSTTableEmptyStructCtor = env->GetMethodID(DSTTableEmptyStructClass, "", "()V"); + if (DSTTableEmptyStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(DSTTableEmptyStructClass, DSTTableEmptyStructCtor); + + return value; + } + case Events::DSTStatus::Id: { + Events::DSTStatus::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_DSTOffsetActive; + std::string value_DSTOffsetActiveClassName = "java/lang/Boolean"; + std::string value_DSTOffsetActiveCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_DSTOffsetActiveClassName.c_str(), + value_DSTOffsetActiveCtorSignature.c_str(), + cppValue.DSTOffsetActive, value_DSTOffsetActive); + + jclass DSTStatusStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent", DSTStatusStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent"); + return nullptr; + } + jmethodID DSTStatusStructCtor = env->GetMethodID(DSTStatusStructClass, "", "(Ljava/lang/Boolean;)V"); + if (DSTStatusStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(DSTStatusStructClass, DSTStatusStructCtor, value_DSTOffsetActive); + + return value; + } + case Events::TimeZoneStatus::Id: { + Events::TimeZoneStatus::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_offset; + std::string value_offsetClassName = "java/lang/Long"; + std::string value_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_offsetClassName.c_str(), value_offsetCtorSignature.c_str(), cppValue.offset, value_offset); + + jobject value_name; + if (!cppValue.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_name); + } + else + { + jobject value_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.name.Value(), value_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_nameInsideOptional, value_name); + } + + jclass timeZoneStatusStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent", + timeZoneStatusStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent"); + return nullptr; + } + jmethodID timeZoneStatusStructCtor = + env->GetMethodID(timeZoneStatusStructClass, "", "(Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStatusStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(timeZoneStatusStructClass, timeZoneStatusStructCtor, value_offset, value_name); + + return value; + } + case Events::TimeFailure::Id: { + Events::TimeFailure::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass timeFailureStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent", timeFailureStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent"); + return nullptr; + } + jmethodID timeFailureStructCtor = env->GetMethodID(timeFailureStructClass, "", "()V"); + if (timeFailureStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(timeFailureStructClass, timeFailureStructCtor); + + return value; + } + case Events::MissingTrustedTimeSource::Id: { + Events::MissingTrustedTimeSource::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass missingTrustedTimeSourceStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent", + missingTrustedTimeSourceStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent"); + return nullptr; + } + jmethodID missingTrustedTimeSourceStructCtor = env->GetMethodID(missingTrustedTimeSourceStructClass, "", "()V"); + if (missingTrustedTimeSourceStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(missingTrustedTimeSourceStructClass, missingTrustedTimeSourceStructCtor); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::BridgedDeviceBasicInformation::Id: { using namespace app::Clusters::BridgedDeviceBasicInformation; switch (aPath.mEventId) @@ -2149,6 +2330,36 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::ProxyConfiguration::Id: { + using namespace app::Clusters::ProxyConfiguration; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyDiscovery::Id: { + using namespace app::Clusters::ProxyDiscovery; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyValid::Id: { + using namespace app::Clusters::ProxyValid; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::BooleanState::Id: { using namespace app::Clusters::BooleanState; switch (aPath.mEventId) @@ -3816,6 +4027,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::FaultInjection::Id: { + using namespace app::Clusters::FaultInjection; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 0c1c13cfef0297..fed93140fc0ac8 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2174,6 +2174,68 @@ void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, LogContent, UTCTimeStamp, TimeSinceBoot); } +CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = 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"); + } +} + +CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::~CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Boolean;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject DSTOffsetRequired; + std::string DSTOffsetRequiredClassName = "java/lang/Boolean"; + std::string DSTOffsetRequiredCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(DSTOffsetRequiredClassName.c_str(), + DSTOffsetRequiredCtorSignature.c_str(), + dataResponse.DSTOffsetRequired, DSTOffsetRequired); + + env->CallVoidMethod(javaCallbackRef, javaMethod, DSTOffsetRequired); +} CHIPOperationalCredentialsClusterAttestationResponseCallback::CHIPOperationalCredentialsClusterAttestationResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 1c0c13df135b5c..41fdc876e9a115 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -342,6 +342,21 @@ class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback jobject javaCallbackRef; }; +class CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback + : public Callback::Callback +{ +public: + CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback(jobject javaCallback); + + ~CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPOperationalCredentialsClusterAttestationResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index a46f9158eff9fd..484a3887c3523f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -3171,6 +3171,290 @@ void CHIPBinaryInputBasicAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::CHIPPulseWidthModulationGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::~CHIPPulseWidthModulationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::CHIPPulseWidthModulationAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::~CHIPPulseWidthModulationAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationEventListAttributeCallback::CHIPPulseWidthModulationEventListAttributeCallback(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"); + } +} + +CHIPPulseWidthModulationEventListAttributeCallback::~CHIPPulseWidthModulationEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationAttributeListAttributeCallback::CHIPPulseWidthModulationAttributeListAttributeCallback(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"); + } +} + +CHIPPulseWidthModulationAttributeListAttributeCallback::~CHIPPulseWidthModulationAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPDescriptorDeviceTypeListAttributeCallback::CHIPDescriptorDeviceTypeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14287,9 +14571,9 @@ void CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationUTCTimeAttributeCallback::CHIPTimeSynchronizationUTCTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14306,8 +14590,7 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() +CHIPTimeSynchronizationUTCTimeAttributeCallback::~CHIPTimeSynchronizationUTCTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14318,8 +14601,8 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationUTCTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14327,9 +14610,8 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14337,31 +14619,92 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal 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); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationDefaultNTPAttributeCallback::CHIPTimeSynchronizationDefaultNTPAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationDefaultNTPAttributeCallback::~CHIPTimeSynchronizationDefaultNTPAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTimeSynchronizationDefaultNTPAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + 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/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(value.Value(), javaValue)); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationTimeZoneAttributeCallback::CHIPTimeSynchronizationTimeZoneAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14378,8 +14721,7 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() +CHIPTimeSynchronizationTimeZoneAttributeCallback::~CHIPTimeSynchronizationTimeZoneAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14390,8 +14732,10 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationTimeZoneAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14400,8 +14744,8 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14420,10 +14764,48 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offsetClassName.c_str(), newElement_0_offsetCtorSignature.c_str(), entry_0.offset, newElement_0_offset); + jobject newElement_0_validAt; + std::string newElement_0_validAtClassName = "java/lang/Long"; + std::string newElement_0_validAtCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validAtClassName.c_str(), + newElement_0_validAtCtorSignature.c_str(), entry_0.validAt, + newElement_0_validAt); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return; + } + jmethodID timeZoneStructStructCtor_1 = + env->GetMethodID(timeZoneStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return; + } + + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -14431,9 +14813,9 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBasicInformationEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationDSTOffsetAttributeCallback::CHIPTimeSynchronizationDSTOffsetAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14450,7 +14832,7 @@ CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBa } } -CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceBasicInformationEventListAttributeCallback() +CHIPTimeSynchronizationDSTOffsetAttributeCallback::~CHIPTimeSynchronizationDSTOffsetAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14461,8 +14843,10 @@ CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceB env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationDSTOffsetAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14471,8 +14855,8 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14491,10 +14875,49 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offsetClassName.c_str(), newElement_0_offsetCtorSignature.c_str(), entry_0.offset, newElement_0_offset); + jobject newElement_0_validStarting; + std::string newElement_0_validStartingClassName = "java/lang/Long"; + std::string newElement_0_validStartingCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validStartingClassName.c_str(), + newElement_0_validStartingCtorSignature.c_str(), + entry_0.validStarting, newElement_0_validStarting); + jobject newElement_0_validUntil; + if (entry_0.validUntil.IsNull()) + { + newElement_0_validUntil = nullptr; + } + else + { + std::string newElement_0_validUntilClassName = "java/lang/Long"; + std::string newElement_0_validUntilCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validUntilClassName.c_str(), + newElement_0_validUntilCtorSignature.c_str(), + entry_0.validUntil.Value(), newElement_0_validUntil); + } + + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return; + } + jmethodID DSTOffsetStructStructCtor_1 = + env->GetMethodID(DSTOffsetStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + if (DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return; + } + + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -14502,9 +14925,76 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback( +CHIPTimeSynchronizationLocalTimeAttributeCallback::CHIPTimeSynchronizationLocalTimeAttributeCallback(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"); + } +} + +CHIPTimeSynchronizationLocalTimeAttributeCallback::~CHIPTimeSynchronizationLocalTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTimeSynchronizationLocalTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + 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/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::CHIPTimeSynchronizationGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14521,7 +15011,7 @@ CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDevi } } -CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback() +CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::~CHIPTimeSynchronizationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14532,8 +15022,8 @@ CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDev env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14542,8 +15032,8 @@ void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14573,9 +15063,9 @@ void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::CHIPTimeSynchronizationAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14592,7 +15082,7 @@ CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListA } } -CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandListAttributeCallback() +CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::~CHIPTimeSynchronizationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14603,8 +15093,8 @@ CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandList env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14613,8 +15103,8 @@ void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14644,9 +15134,9 @@ void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationEventListAttributeCallback::CHIPTimeSynchronizationEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14663,7 +15153,7 @@ CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAtt } } -CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAttributeCallback() +CHIPTimeSynchronizationEventListAttributeCallback::~CHIPTimeSynchronizationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14674,8 +15164,8 @@ CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14684,8 +15174,8 @@ void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14715,8 +15205,10 @@ void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPTimeSynchronizationAttributeListAttributeCallback::CHIPTimeSynchronizationAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14732,7 +15224,7 @@ CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobje } } -CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() +CHIPTimeSynchronizationAttributeListAttributeCallback::~CHIPTimeSynchronizationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14743,8 +15235,8 @@ CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14753,8 +15245,8 @@ void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14784,8 +15276,10 @@ void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: + CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14801,7 +15295,8 @@ CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallba } } -CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallback() +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14812,8 +15307,8 @@ CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14822,8 +15317,8 @@ void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -14853,9 +15348,9 @@ void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: + CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14872,7 +15367,8 @@ CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministrat } } -CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback() +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14883,8 +15379,8 @@ CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministra env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14892,8 +15388,9 @@ void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + + 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; @@ -14901,28 +15398,31 @@ void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &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 javaValue; - if (value.IsNull()) - { - javaValue = nullptr; - } - else + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - std::string javaValueClassName = "java/lang/Integer"; - std::string javaValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorCommissioningAdminVendorIdAttributeCallback( +CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBasicInformationEventListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14939,7 +15439,7 @@ CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorC } } -CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback() +CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceBasicInformationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14950,8 +15450,8 @@ CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministrator env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14959,8 +15459,9 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + + 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; @@ -14968,28 +15469,31 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &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 javaValue; - if (value.IsNull()) - { - javaValue = nullptr; - } - else + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - std::string javaValueClassName = "java/lang/Integer"; - std::string javaValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15006,8 +15510,7 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15018,8 +15521,8 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15028,8 +15531,8 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15059,9 +15562,9 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15078,8 +15581,7 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() +CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15090,8 +15592,8 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15100,8 +15602,8 @@ void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::Callbac VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15131,9 +15633,9 @@ void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommissioningEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15150,7 +15652,7 @@ CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommi } } -CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorCommissioningEventListAttributeCallback() +CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15161,8 +15663,8 @@ CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorComm env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15171,8 +15673,8 @@ void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15202,10 +15704,8 @@ void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorCommissioningAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15221,7 +15721,7 @@ CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorC } } -CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministratorCommissioningAttributeListAttributeCallback() +CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15232,8 +15732,8 @@ CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministrator env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15242,8 +15742,8 @@ void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15273,10 +15773,8 @@ void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15292,7 +15790,7 @@ CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsA } } -CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCsAttributeCallback() +CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15303,10 +15801,8 @@ CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCs env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list) +void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15315,8 +15811,8 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15335,47 +15831,10 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_noc; - jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); - env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), - reinterpret_cast(entry_0.noc.data())); - newElement_0_noc = newElement_0_nocByteArray; - jobject newElement_0_icac; - if (entry_0.icac.IsNull()) - { - newElement_0_icac = nullptr; - } - else - { - jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); - env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), - reinterpret_cast(entry_0.icac.Value().data())); - newElement_0_icac = newElement_0_icacByteArray; - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return; - } - jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); - if (NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return; - } - - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -15383,9 +15842,9 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15402,7 +15861,7 @@ CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFa } } -CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsFabricsAttributeCallback() +CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15413,10 +15872,8 @@ CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsF env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> & list) +void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15424,9 +15881,8 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15434,79 +15890,28 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( 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); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)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()) + jobject javaValue; + if (value.IsNull()) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_rootPublicKey; - jbyteArray newElement_0_rootPublicKeyByteArray = env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); - env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), - reinterpret_cast(entry_0.rootPublicKey.data())); - newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; - jobject newElement_0_vendorID; - std::string newElement_0_vendorIDClassName = "java/lang/Integer"; - std::string newElement_0_vendorIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), - static_cast(entry_0.vendorID), newElement_0_vendorID); - jobject newElement_0_fabricID; - std::string newElement_0_fabricIDClassName = "java/lang/Long"; - std::string newElement_0_fabricIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), - newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, - newElement_0_fabricID); - jobject newElement_0_nodeID; - std::string newElement_0_nodeIDClassName = "java/lang/Long"; - std::string newElement_0_nodeIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_nodeIDClassName.c_str(), newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass fabricDescriptorStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); - return; - } - jmethodID fabricDescriptorStructStructCtor_1 = - env->GetMethodID(fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); - if (fabricDescriptorStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); - return; - } - - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, newElement_0_nodeID, - newElement_0_label, newElement_0_fabricIndex); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorCommissioningAdminVendorIdAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15523,8 +15928,7 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: } } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15535,8 +15939,8 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15544,9 +15948,8 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15554,31 +15957,28 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac 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); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)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()) + jobject javaValue; + if (value.IsNull()) { - 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); + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperationalCredentialsGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: + CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15595,7 +15995,8 @@ CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperational } } -CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationalCredentialsGeneratedCommandListAttributeCallback() +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15606,7 +16007,7 @@ CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationa env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15616,8 +16017,8 @@ void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15647,9 +16048,9 @@ void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalCredentialsAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: + CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15666,7 +16067,8 @@ CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalC } } -CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperationalCredentialsAcceptedCommandListAttributeCallback() +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15677,7 +16079,7 @@ CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperational env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15687,8 +16089,8 @@ void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15718,9 +16120,9 @@ void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentialsEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommissioningEventListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15737,7 +16139,7 @@ CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentials } } -CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredentialsEventListAttributeCallback() +CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorCommissioningEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15748,7 +16150,7 @@ CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredential env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15758,8 +16160,8 @@ void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15789,9 +16191,9 @@ void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredentialsAttributeListAttributeCallback( +CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorCommissioningAttributeListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15808,7 +16210,7 @@ CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredent } } -CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCredentialsAttributeListAttributeCallback() +CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministratorCommissioningAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15819,7 +16221,7 @@ CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCreden env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15829,8 +16231,8 @@ void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15860,9 +16262,9 @@ void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15879,7 +16281,7 @@ CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupK } } -CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() +CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15890,9 +16292,9 @@ CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroup env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15902,8 +16304,8 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -15922,18 +16324,23 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, - newElement_0_groupId); - jobject newElement_0_groupKeySetID; - std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; - std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), - newElement_0_groupKeySetIDCtorSignature.c_str(), - entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_noc; + jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); + env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), + reinterpret_cast(entry_0.noc.data())); + newElement_0_noc = newElement_0_nocByteArray; + jobject newElement_0_icac; + if (entry_0.icac.IsNull()) + { + newElement_0_icac = nullptr; + } + else + { + jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); + env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), + reinterpret_cast(entry_0.icac.Value().data())); + newElement_0_icac = newElement_0_icacByteArray; + } jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -15941,24 +16348,23 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass groupKeyMapStructStructClass_1; + jclass NOCStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", groupKeyMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); return; } - jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID(groupKeyMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (groupKeyMapStructStructCtor_1 == nullptr) + jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); + if (NOCStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); return; } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, + newElement_0_fabricIndex); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -15966,9 +16372,9 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15985,7 +16391,7 @@ CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTa } } -CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() +CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsFabricsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15996,10 +16402,10 @@ CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupT env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16008,8 +16414,8 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16028,38 +16434,30 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, - newElement_0_groupId); - jobject newElement_0_endpoints; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); - - auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); - while (iter_newElement_0_endpoints_2.Next()) - { - auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); - jobject newElement_2; - std::string newElement_2ClassName = "java/lang/Integer"; - std::string newElement_2CtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); - chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); - } - jobject newElement_0_groupName; - if (!entry_0.groupName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); - } - else - { - jobject newElement_0_groupNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), - newElement_0_groupNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); - } + jobject newElement_0_rootPublicKey; + jbyteArray newElement_0_rootPublicKeyByteArray = env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); + env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), + reinterpret_cast(entry_0.rootPublicKey.data())); + newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; + jobject newElement_0_vendorID; + std::string newElement_0_vendorIDClassName = "java/lang/Integer"; + std::string newElement_0_vendorIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), + static_cast(entry_0.vendorID), newElement_0_vendorID); + jobject newElement_0_fabricID; + std::string newElement_0_fabricIDClassName = "java/lang/Long"; + std::string newElement_0_fabricIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), + newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, + newElement_0_fabricID); + jobject newElement_0_nodeID; + std::string newElement_0_nodeIDClassName = "java/lang/Long"; + std::string newElement_0_nodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_nodeIDClassName.c_str(), newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -16067,25 +16465,27 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass groupInfoMapStructStructClass_1; + jclass fabricDescriptorStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", groupInfoMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); return; } - jmethodID groupInfoMapStructStructCtor_1 = - env->GetMethodID(groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); - if (groupInfoMapStructStructCtor_1 == nullptr) + jmethodID fabricDescriptorStructStructCtor_1 = + env->GetMethodID(fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); + if (fabricDescriptorStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); return; } - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, newElement_0_nodeID, + newElement_0_label, newElement_0_fabricIndex); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -16093,9 +16493,81 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagementGeneratedCommandListAttributeCallback( +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(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"); + } +} + +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::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); +} + +CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperationalCredentialsGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16112,7 +16584,7 @@ CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagem } } -CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManagementGeneratedCommandListAttributeCallback() +CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationalCredentialsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16123,7 +16595,7 @@ CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManage env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16133,8 +16605,1545 @@ void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalCredentialsAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperationalCredentialsAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentialsEventListAttributeCallback(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"); + } +} + +CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredentialsEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredentialsAttributeListAttributeCallback( + 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"); + } +} + +CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCredentialsAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(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"); + } +} + +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::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; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, + newElement_0_groupId); + jobject newElement_0_groupKeySetID; + std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; + std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), + newElement_0_groupKeySetIDCtorSignature.c_str(), + entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupKeyMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", groupKeyMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + return; + } + jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID(groupKeyMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (groupKeyMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + return; + } + + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, + newElement_0_groupKeySetID, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(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"); + } +} + +CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGroupTableAttributeCallback::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; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, + newElement_0_groupId); + jobject newElement_0_endpoints; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); + + auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); + while (iter_newElement_0_endpoints_2.Next()) + { + auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); + } + jobject newElement_0_groupName; + if (!entry_0.groupName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); + } + else + { + jobject newElement_0_groupNameInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return; + } + jmethodID groupInfoMapStructStructCtor_1 = + env->GetMethodID(groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); + if (groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return; + } + + newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagementGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManagementGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManagementAcceptedCommandListAttributeCallback( + 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"); + } +} + +CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagementAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventListAttributeCallback(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"); + } +} + +CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttributeListAttributeCallback(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"); + } +} + +CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(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"); + } +} + +CHIPFixedLabelLabelListAttributeCallback::~CHIPFixedLabelLabelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelLabelListAttributeCallback::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; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", + labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return; + } + + newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedCommandListAttributeCallback(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"); + } +} + +CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelGeneratedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedCommandListAttributeCallback(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"); + } +} + +CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallback(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"); + } +} + +CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttributeCallback(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"); + } +} + +CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelLabelListAttributeCallback::CHIPUserLabelLabelListAttributeCallback(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"); + } +} + +CHIPUserLabelLabelListAttributeCallback::~CHIPUserLabelLabelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelLabelListAttributeCallback::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; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", + labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); + return; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); + return; + } + + newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedCommandListAttributeCallback(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"); + } +} + +CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelGeneratedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandListAttributeCallback(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"); + } +} + +CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback(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"); + } +} + +CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttributeCallback(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"); + } +} + +CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPProxyConfigurationGeneratedCommandListAttributeCallback::CHIPProxyConfigurationGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPProxyConfigurationGeneratedCommandListAttributeCallback::~CHIPProxyConfigurationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPProxyConfigurationGeneratedCommandListAttributeCallback::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; @@ -16164,9 +18173,9 @@ void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManagementAcceptedCommandListAttributeCallback( +CHIPProxyConfigurationAcceptedCommandListAttributeCallback::CHIPProxyConfigurationAcceptedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16183,7 +18192,7 @@ CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManageme } } -CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagementAcceptedCommandListAttributeCallback() +CHIPProxyConfigurationAcceptedCommandListAttributeCallback::~CHIPProxyConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16194,7 +18203,7 @@ CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagem env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyConfigurationAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16204,8 +18213,8 @@ void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16235,9 +18244,9 @@ void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventListAttributeCallback(jobject javaCallback, +CHIPProxyConfigurationEventListAttributeCallback::CHIPProxyConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16254,7 +18263,7 @@ CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventLis } } -CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventListAttributeCallback() +CHIPProxyConfigurationEventListAttributeCallback::~CHIPProxyConfigurationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16265,7 +18274,7 @@ CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventLi env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context, +void CHIPProxyConfigurationEventListAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16275,8 +18284,8 @@ void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16306,9 +18315,9 @@ void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttributeListAttributeCallback(jobject javaCallback, +CHIPProxyConfigurationAttributeListAttributeCallback::CHIPProxyConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16325,7 +18334,7 @@ CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttr } } -CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAttributeListAttributeCallback() +CHIPProxyConfigurationAttributeListAttributeCallback::~CHIPProxyConfigurationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16336,7 +18345,7 @@ CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( +void CHIPProxyConfigurationAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16346,8 +18355,8 @@ void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16377,97 +18386,9 @@ void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(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"); - } -} - -CHIPFixedLabelLabelListAttributeCallback::~CHIPFixedLabelLabelListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPFixedLabelLabelListAttributeCallback::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; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", - labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return; - } - - newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::CHIPProxyDiscoveryGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16484,7 +18405,7 @@ CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedComm } } -CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCommandListAttributeCallback() +CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::~CHIPProxyDiscoveryGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16495,7 +18416,7 @@ CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCom env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16505,8 +18426,8 @@ void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16536,9 +18457,9 @@ void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::CHIPProxyDiscoveryAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16555,7 +18476,7 @@ CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedComman } } -CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedCommandListAttributeCallback() +CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::~CHIPProxyDiscoveryAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16566,7 +18487,7 @@ CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedComma env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16576,8 +18497,8 @@ void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16607,8 +18528,8 @@ void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyDiscoveryEventListAttributeCallback::CHIPProxyDiscoveryEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16624,7 +18545,7 @@ CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallba } } -CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallback() +CHIPProxyDiscoveryEventListAttributeCallback::~CHIPProxyDiscoveryEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16635,8 +18556,8 @@ CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyDiscoveryEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16645,8 +18566,8 @@ void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16676,8 +18597,10 @@ void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyDiscoveryAttributeListAttributeCallback::CHIPProxyDiscoveryAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16693,7 +18616,7 @@ CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttribu } } -CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttributeCallback() +CHIPProxyDiscoveryAttributeListAttributeCallback::~CHIPProxyDiscoveryAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16704,8 +18627,8 @@ CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttrib env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyDiscoveryAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16714,8 +18637,8 @@ void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16745,97 +18668,9 @@ void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelLabelListAttributeCallback::CHIPUserLabelLabelListAttributeCallback(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"); - } -} - -CHIPUserLabelLabelListAttributeCallback::~CHIPUserLabelLabelListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPUserLabelLabelListAttributeCallback::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; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", - labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return; - } - - newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyValidGeneratedCommandListAttributeCallback::CHIPProxyValidGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16852,7 +18687,7 @@ CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedComman } } -CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedCommandListAttributeCallback() +CHIPProxyValidGeneratedCommandListAttributeCallback::~CHIPProxyValidGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16863,7 +18698,7 @@ CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedComma env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPProxyValidGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16873,8 +18708,8 @@ void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16904,9 +18739,9 @@ void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyValidAcceptedCommandListAttributeCallback::CHIPProxyValidAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16923,7 +18758,7 @@ CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandL } } -CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommandListAttributeCallback() +CHIPProxyValidAcceptedCommandListAttributeCallback::~CHIPProxyValidAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16934,7 +18769,7 @@ CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommand env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyValidAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16944,8 +18779,8 @@ void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -16975,8 +18810,8 @@ void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyValidEventListAttributeCallback::CHIPProxyValidEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16992,7 +18827,7 @@ CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback } } -CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallback() +CHIPProxyValidEventListAttributeCallback::~CHIPProxyValidEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17003,8 +18838,8 @@ CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallbac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyValidEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -17013,8 +18848,8 @@ void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -17044,8 +18879,8 @@ void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyValidAttributeListAttributeCallback::CHIPProxyValidAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17061,7 +18896,7 @@ CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttribute } } -CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttributeCallback() +CHIPProxyValidAttributeListAttributeCallback::~CHIPProxyValidAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17072,8 +18907,8 @@ CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttribut env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyValidAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -17082,8 +18917,8 @@ void CHIPUserLabelAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + 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; @@ -39504,3 +41339,285 @@ void CHIPUnitTestingAttributeListAttributeCallback::CallbackFn(void * context, env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } + +CHIPFaultInjectionGeneratedCommandListAttributeCallback::CHIPFaultInjectionGeneratedCommandListAttributeCallback( + 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"); + } +} + +CHIPFaultInjectionGeneratedCommandListAttributeCallback::~CHIPFaultInjectionGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionGeneratedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionAcceptedCommandListAttributeCallback::CHIPFaultInjectionAcceptedCommandListAttributeCallback(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"); + } +} + +CHIPFaultInjectionAcceptedCommandListAttributeCallback::~CHIPFaultInjectionAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionAcceptedCommandListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionEventListAttributeCallback::CHIPFaultInjectionEventListAttributeCallback(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"); + } +} + +CHIPFaultInjectionEventListAttributeCallback::~CHIPFaultInjectionEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionEventListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionAttributeListAttributeCallback::CHIPFaultInjectionAttributeListAttributeCallback(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"); + } +} + +CHIPFaultInjectionAttributeListAttributeCallback::~CHIPFaultInjectionAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionAttributeListAttributeCallback::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; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index e03fffda2bed94..61de68fd55d4a2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -2818,6 +2818,148 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class PulseWidthModulationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 28L; + + public PulseWidthModulationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class DescriptorCluster extends BaseChipCluster { public static final long CLUSTER_ID = 29L; @@ -10171,16 +10313,56 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class BridgedDeviceBasicInformationCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 57L; + public static class TimeSynchronizationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 56L; - public BridgedDeviceBasicInformationCluster(long devicePtr, int endpointId) { + public TimeSynchronizationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); + public interface UTCTimeAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DefaultNTPAttributeCallback { + void onSuccess(@Nullable String value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface TimeZoneAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DSTOffsetAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface LocalTimeAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -10213,161 +10395,125 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readVendorNameAttribute(CharStringAttributeCallback callback) { - readVendorNameAttribute(chipClusterPtr, callback); + public void readUTCTimeAttribute(UTCTimeAttributeCallback callback) { + readUTCTimeAttribute(chipClusterPtr, callback); } - public void subscribeVendorNameAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeUTCTimeAttribute( + UTCTimeAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUTCTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readVendorIDAttribute(IntegerAttributeCallback callback) { - readVendorIDAttribute(chipClusterPtr, callback); + public void readGranularityAttribute(IntegerAttributeCallback callback) { + readGranularityAttribute(chipClusterPtr, callback); } - public void subscribeVendorIDAttribute( + public void subscribeGranularityAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeGranularityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductNameAttribute(CharStringAttributeCallback callback) { - readProductNameAttribute(chipClusterPtr, callback); + public void readTimeSourceAttribute(IntegerAttributeCallback callback) { + readTimeSourceAttribute(chipClusterPtr, callback); } - public void subscribeProductNameAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeSourceAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeSourceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readNodeLabelAttribute(CharStringAttributeCallback callback) { - readNodeLabelAttribute(chipClusterPtr, callback); + public void readDefaultNTPAttribute(DefaultNTPAttributeCallback callback) { + readDefaultNTPAttribute(chipClusterPtr, callback); } - public void writeNodeLabelAttribute(DefaultClusterCallback callback, String value) { - writeNodeLabelAttribute(chipClusterPtr, callback, value, null); + public void subscribeDefaultNTPAttribute( + DefaultNTPAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDefaultNTPAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void writeNodeLabelAttribute( - DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { - writeNodeLabelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + public void readTimeZoneAttribute(TimeZoneAttributeCallback callback) { + readTimeZoneAttribute(chipClusterPtr, callback); } - public void subscribeNodeLabelAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneAttribute( + TimeZoneAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { - readHardwareVersionAttribute(chipClusterPtr, callback); + public void readDSTOffsetAttribute(DSTOffsetAttributeCallback callback) { + readDSTOffsetAttribute(chipClusterPtr, callback); } - public void subscribeHardwareVersionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeDSTOffsetAttribute( + DSTOffsetAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDSTOffsetAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { - readHardwareVersionStringAttribute(chipClusterPtr, callback); + public void readLocalTimeAttribute(LocalTimeAttributeCallback callback) { + readLocalTimeAttribute(chipClusterPtr, callback); } - public void subscribeHardwareVersionStringAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLocalTimeAttribute( + LocalTimeAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLocalTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSoftwareVersionAttribute(LongAttributeCallback callback) { - readSoftwareVersionAttribute(chipClusterPtr, callback); + public void readTimeZoneDatabaseAttribute(IntegerAttributeCallback callback) { + readTimeZoneDatabaseAttribute(chipClusterPtr, callback); } - public void subscribeSoftwareVersionAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneDatabaseAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneDatabaseAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { - readSoftwareVersionStringAttribute(chipClusterPtr, callback); + public void readNTPServerAvailableAttribute(BooleanAttributeCallback callback) { + readNTPServerAvailableAttribute(chipClusterPtr, callback); } - public void subscribeSoftwareVersionStringAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeNTPServerAvailableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNTPServerAvailableAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { - readManufacturingDateAttribute(chipClusterPtr, callback); + public void readTimeZoneListMaxSizeAttribute(IntegerAttributeCallback callback) { + readTimeZoneListMaxSizeAttribute(chipClusterPtr, callback); } - public void subscribeManufacturingDateAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneListMaxSizeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneListMaxSizeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readPartNumberAttribute(CharStringAttributeCallback callback) { - readPartNumberAttribute(chipClusterPtr, callback); + public void readDSTOffsetListMaxSizeAttribute(IntegerAttributeCallback callback) { + readDSTOffsetListMaxSizeAttribute(chipClusterPtr, callback); } - public void subscribePartNumberAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeDSTOffsetListMaxSizeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDSTOffsetListMaxSizeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductURLAttribute(CharStringAttributeCallback callback) { - readProductURLAttribute(chipClusterPtr, callback); + public void readSupportsDNSResolveAttribute(BooleanAttributeCallback callback) { + readSupportsDNSResolveAttribute(chipClusterPtr, callback); } - public void subscribeProductURLAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeSupportsDNSResolveAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSupportsDNSResolveAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductLabelAttribute(CharStringAttributeCallback callback) { - readProductLabelAttribute(chipClusterPtr, callback); + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); } - public void subscribeProductLabelAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSerialNumberAttribute(CharStringAttributeCallback callback) { - readSerialNumberAttribute(chipClusterPtr, callback); - } - - public void subscribeSerialNumberAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readReachableAttribute(BooleanAttributeCallback callback) { - readReachableAttribute(chipClusterPtr, callback); - } - - public void subscribeReachableAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readUniqueIDAttribute(CharStringAttributeCallback callback) { - readUniqueIDAttribute(chipClusterPtr, callback); - } - - public void subscribeUniqueIDAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeUniqueIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); } public void subscribeAcceptedCommandListAttribute( @@ -10411,135 +10557,81 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readUTCTimeAttribute( + long chipClusterPtr, UTCTimeAttributeCallback callback); - private native void subscribeVendorNameAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeUTCTimeAttribute( + long chipClusterPtr, UTCTimeAttributeCallback callback, int minInterval, int maxInterval); - private native void readVendorIDAttribute( + private native void readGranularityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeVendorIDAttribute( + private native void subscribeGranularityAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeProductNameAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readNodeLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void writeNodeLabelAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - String value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeNodeLabelAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readHardwareVersionAttribute( + private native void readTimeSourceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeHardwareVersionAttribute( + private native void subscribeTimeSourceAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readHardwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDefaultNTPAttribute( + long chipClusterPtr, DefaultNTPAttributeCallback callback); - private native void subscribeHardwareVersionStringAttribute( + private native void subscribeDefaultNTPAttribute( long chipClusterPtr, - CharStringAttributeCallback callback, + DefaultNTPAttributeCallback callback, int minInterval, int maxInterval); - private native void readSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback); + private native void readTimeZoneAttribute( + long chipClusterPtr, TimeZoneAttributeCallback callback); - private native void subscribeSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribeTimeZoneAttribute( + long chipClusterPtr, TimeZoneAttributeCallback callback, int minInterval, int maxInterval); - private native void readSoftwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDSTOffsetAttribute( + long chipClusterPtr, DSTOffsetAttributeCallback callback); - private native void subscribeSoftwareVersionStringAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeDSTOffsetAttribute( + long chipClusterPtr, DSTOffsetAttributeCallback callback, int minInterval, int maxInterval); - private native void readManufacturingDateAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readLocalTimeAttribute( + long chipClusterPtr, LocalTimeAttributeCallback callback); - private native void subscribeManufacturingDateAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeLocalTimeAttribute( + long chipClusterPtr, LocalTimeAttributeCallback callback, int minInterval, int maxInterval); - private native void readPartNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readTimeZoneDatabaseAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribePartNumberAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeTimeZoneDatabaseAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductURLAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readNTPServerAvailableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); - private native void subscribeProductURLAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeNTPServerAvailableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readTimeZoneListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeProductLabelAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeTimeZoneListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readSerialNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDSTOffsetListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeSerialNumberAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeDSTOffsetListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readReachableAttribute( + private native void readSupportsDNSResolveAttribute( long chipClusterPtr, BooleanAttributeCallback callback); - private native void subscribeReachableAttribute( + private native void subscribeSupportsDNSResolveAttribute( long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); - private native void readUniqueIDAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeUniqueIDAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -10586,10 +10678,10 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class SwitchCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 59L; + public static class BridgedDeviceBasicInformationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 57L; - public SwitchCluster(long devicePtr, int endpointId) { + public BridgedDeviceBasicInformationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @@ -10628,103 +10720,1550 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { - readNumberOfPositionsAttribute(chipClusterPtr, callback); + public void readVendorNameAttribute(CharStringAttributeCallback callback) { + readVendorNameAttribute(chipClusterPtr, callback); } - public void subscribeNumberOfPositionsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNumberOfPositionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeVendorNameAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionAttribute(IntegerAttributeCallback callback) { - readCurrentPositionAttribute(chipClusterPtr, callback); + public void readVendorIDAttribute(IntegerAttributeCallback callback) { + readVendorIDAttribute(chipClusterPtr, callback); } - public void subscribeCurrentPositionAttribute( + public void subscribeVendorIDAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCurrentPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readMultiPressMaxAttribute(IntegerAttributeCallback callback) { - readMultiPressMaxAttribute(chipClusterPtr, callback); + public void readProductNameAttribute(CharStringAttributeCallback callback) { + readProductNameAttribute(chipClusterPtr, callback); } - public void subscribeMultiPressMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMultiPressMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeProductNameAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); + public void readNodeLabelAttribute(CharStringAttributeCallback callback) { + readNodeLabelAttribute(chipClusterPtr, callback); } - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeNodeLabelAttribute(DefaultClusterCallback callback, String value) { + writeNodeLabelAttribute(chipClusterPtr, callback, value, null); } - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); + public void writeNodeLabelAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeNodeLabelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeNodeLabelAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readEventListAttribute(EventListAttributeCallback callback) { - readEventListAttribute(chipClusterPtr, callback); + public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { + readHardwareVersionAttribute(chipClusterPtr, callback); } - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeHardwareVersionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { - readAttributeListAttribute(chipClusterPtr, callback); + public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { + readHardwareVersionStringAttribute(chipClusterPtr, callback); } - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeHardwareVersionStringAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readFeatureMapAttribute(LongAttributeCallback callback) { - readFeatureMapAttribute(chipClusterPtr, callback); + public void readSoftwareVersionAttribute(LongAttributeCallback callback) { + readSoftwareVersionAttribute(chipClusterPtr, callback); } - public void subscribeFeatureMapAttribute( + public void subscribeSoftwareVersionAttribute( LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { - readClusterRevisionAttribute(chipClusterPtr, callback); + public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { + readSoftwareVersionStringAttribute(chipClusterPtr, callback); } - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeSoftwareVersionStringAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readNumberOfPositionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeNumberOfPositionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { + readManufacturingDateAttribute(chipClusterPtr, callback); + } - private native void readCurrentPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void subscribeManufacturingDateAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void subscribeCurrentPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void readPartNumberAttribute(CharStringAttributeCallback callback) { + readPartNumberAttribute(chipClusterPtr, callback); + } - private native void readMultiPressMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void subscribePartNumberAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void subscribeMultiPressMaxAttribute( + public void readProductURLAttribute(CharStringAttributeCallback callback) { + readProductURLAttribute(chipClusterPtr, callback); + } + + public void subscribeProductURLAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readProductLabelAttribute(CharStringAttributeCallback callback) { + readProductLabelAttribute(chipClusterPtr, callback); + } + + public void subscribeProductLabelAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSerialNumberAttribute(CharStringAttributeCallback callback) { + readSerialNumberAttribute(chipClusterPtr, callback); + } + + public void subscribeSerialNumberAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readReachableAttribute(BooleanAttributeCallback callback) { + readReachableAttribute(chipClusterPtr, callback); + } + + public void subscribeReachableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUniqueIDAttribute(CharStringAttributeCallback callback) { + readUniqueIDAttribute(chipClusterPtr, callback); + } + + public void subscribeUniqueIDAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUniqueIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readVendorNameAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeVendorNameAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readVendorIDAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeVendorIDAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readProductNameAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductNameAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readNodeLabelAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeNodeLabelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeNodeLabelAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readHardwareVersionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeHardwareVersionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readHardwareVersionStringAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeHardwareVersionStringAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readSoftwareVersionAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeSoftwareVersionAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSoftwareVersionStringAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeSoftwareVersionStringAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readManufacturingDateAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeManufacturingDateAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readPartNumberAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribePartNumberAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readProductURLAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductURLAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readProductLabelAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductLabelAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readSerialNumberAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeSerialNumberAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readReachableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeReachableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readUniqueIDAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeUniqueIDAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class SwitchCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 59L; + + public SwitchCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { + readNumberOfPositionsAttribute(chipClusterPtr, callback); + } + + public void subscribeNumberOfPositionsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNumberOfPositionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentPositionAttribute(IntegerAttributeCallback callback) { + readCurrentPositionAttribute(chipClusterPtr, callback); + } + + public void subscribeCurrentPositionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCurrentPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMultiPressMaxAttribute(IntegerAttributeCallback callback) { + readMultiPressMaxAttribute(chipClusterPtr, callback); + } + + public void subscribeMultiPressMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMultiPressMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readNumberOfPositionsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeNumberOfPositionsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readCurrentPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCurrentPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMultiPressMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMultiPressMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class AdministratorCommissioningCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 60L; + + public AdministratorCommissioningCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void openCommissioningWindow( + DefaultClusterCallback callback, + Integer commissioningTimeout, + byte[] PAKEPasscodeVerifier, + Integer discriminator, + Long iterations, + byte[] salt, + int timedInvokeTimeoutMs) { + openCommissioningWindow( + chipClusterPtr, + callback, + commissioningTimeout, + PAKEPasscodeVerifier, + discriminator, + iterations, + salt, + timedInvokeTimeoutMs); + } + + public void openBasicCommissioningWindow( + DefaultClusterCallback callback, Integer commissioningTimeout, int timedInvokeTimeoutMs) { + openBasicCommissioningWindow( + chipClusterPtr, callback, commissioningTimeout, timedInvokeTimeoutMs); + } + + public void revokeCommissioning(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + + revokeCommissioning(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + private native void openCommissioningWindow( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer commissioningTimeout, + byte[] PAKEPasscodeVerifier, + Integer discriminator, + Long iterations, + byte[] salt, + @Nullable Integer timedInvokeTimeoutMs); + + private native void openBasicCommissioningWindow( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer commissioningTimeout, + @Nullable Integer timedInvokeTimeoutMs); + + private native void revokeCommissioning( + long chipClusterPtr, + DefaultClusterCallback Callback, + @Nullable Integer timedInvokeTimeoutMs); + + public interface AdminFabricIndexAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AdminVendorIdAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readWindowStatusAttribute(IntegerAttributeCallback callback) { + readWindowStatusAttribute(chipClusterPtr, callback); + } + + public void subscribeWindowStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWindowStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAdminFabricIndexAttribute(AdminFabricIndexAttributeCallback callback) { + readAdminFabricIndexAttribute(chipClusterPtr, callback); + } + + public void subscribeAdminFabricIndexAttribute( + AdminFabricIndexAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAdminFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAdminVendorIdAttribute(AdminVendorIdAttributeCallback callback) { + readAdminVendorIdAttribute(chipClusterPtr, callback); + } + + public void subscribeAdminVendorIdAttribute( + AdminVendorIdAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAdminVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readWindowStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeWindowStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAdminFabricIndexAttribute( + long chipClusterPtr, AdminFabricIndexAttributeCallback callback); + + private native void subscribeAdminFabricIndexAttribute( + long chipClusterPtr, + AdminFabricIndexAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAdminVendorIdAttribute( + long chipClusterPtr, AdminVendorIdAttributeCallback callback); + + private native void subscribeAdminVendorIdAttribute( + long chipClusterPtr, + AdminVendorIdAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class OperationalCredentialsCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 62L; + + public OperationalCredentialsCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void attestationRequest(AttestationResponseCallback callback, byte[] attestationNonce) { + attestationRequest(chipClusterPtr, callback, attestationNonce, null); + } + + public void attestationRequest( + AttestationResponseCallback callback, byte[] attestationNonce, int timedInvokeTimeoutMs) { + attestationRequest(chipClusterPtr, callback, attestationNonce, timedInvokeTimeoutMs); + } + + public void certificateChainRequest( + CertificateChainResponseCallback callback, Integer certificateType) { + certificateChainRequest(chipClusterPtr, callback, certificateType, null); + } + + public void certificateChainRequest( + CertificateChainResponseCallback callback, + Integer certificateType, + int timedInvokeTimeoutMs) { + certificateChainRequest(chipClusterPtr, callback, certificateType, timedInvokeTimeoutMs); + } + + public void CSRRequest( + CSRResponseCallback callback, byte[] CSRNonce, Optional isForUpdateNOC) { + CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, null); + } + + public void CSRRequest( + CSRResponseCallback callback, + byte[] CSRNonce, + Optional isForUpdateNOC, + int timedInvokeTimeoutMs) { + CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, timedInvokeTimeoutMs); + } + + public void addNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId) { + addNOC( + chipClusterPtr, + callback, + NOCValue, + ICACValue, + IPKValue, + caseAdminSubject, + adminVendorId, + null); + } + + public void addNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId, + int timedInvokeTimeoutMs) { + addNOC( + chipClusterPtr, + callback, + NOCValue, + ICACValue, + IPKValue, + caseAdminSubject, + adminVendorId, + timedInvokeTimeoutMs); + } + + public void updateNOC( + NOCResponseCallback callback, byte[] NOCValue, Optional ICACValue) { + updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, null); + } + + public void updateNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + int timedInvokeTimeoutMs) { + updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, timedInvokeTimeoutMs); + } + + public void updateFabricLabel(NOCResponseCallback callback, String label) { + updateFabricLabel(chipClusterPtr, callback, label, null); + } + + public void updateFabricLabel( + NOCResponseCallback callback, String label, int timedInvokeTimeoutMs) { + updateFabricLabel(chipClusterPtr, callback, label, timedInvokeTimeoutMs); + } + + public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) { + removeFabric(chipClusterPtr, callback, fabricIndex, null); + } + + public void removeFabric( + NOCResponseCallback callback, Integer fabricIndex, int timedInvokeTimeoutMs) { + removeFabric(chipClusterPtr, callback, fabricIndex, timedInvokeTimeoutMs); + } + + public void addTrustedRootCertificate( + DefaultClusterCallback callback, byte[] rootCACertificate) { + addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, null); + } + + public void addTrustedRootCertificate( + DefaultClusterCallback callback, byte[] rootCACertificate, int timedInvokeTimeoutMs) { + addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, timedInvokeTimeoutMs); + } + + private native void attestationRequest( + long chipClusterPtr, + AttestationResponseCallback Callback, + byte[] attestationNonce, + @Nullable Integer timedInvokeTimeoutMs); + + private native void certificateChainRequest( + long chipClusterPtr, + CertificateChainResponseCallback Callback, + Integer certificateType, + @Nullable Integer timedInvokeTimeoutMs); + + private native void CSRRequest( + long chipClusterPtr, + CSRResponseCallback Callback, + byte[] CSRNonce, + Optional isForUpdateNOC, + @Nullable Integer timedInvokeTimeoutMs); + + private native void addNOC( + long chipClusterPtr, + NOCResponseCallback Callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId, + @Nullable Integer timedInvokeTimeoutMs); + + private native void updateNOC( + long chipClusterPtr, + NOCResponseCallback Callback, + byte[] NOCValue, + Optional ICACValue, + @Nullable Integer timedInvokeTimeoutMs); + + private native void updateFabricLabel( + long chipClusterPtr, + NOCResponseCallback Callback, + String label, + @Nullable Integer timedInvokeTimeoutMs); + + private native void removeFabric( + long chipClusterPtr, + NOCResponseCallback Callback, + Integer fabricIndex, + @Nullable Integer timedInvokeTimeoutMs); + + private native void addTrustedRootCertificate( + long chipClusterPtr, + DefaultClusterCallback Callback, + byte[] rootCACertificate, + @Nullable Integer timedInvokeTimeoutMs); + + public interface AttestationResponseCallback { + void onSuccess(byte[] attestationElements, byte[] attestationSignature); + + void onError(Exception error); + } + + public interface CertificateChainResponseCallback { + void onSuccess(byte[] certificate); + + void onError(Exception error); + } + + public interface CSRResponseCallback { + void onSuccess(byte[] NOCSRElements, byte[] attestationSignature); + + void onError(Exception error); + } + + public interface NOCResponseCallback { + void onSuccess(Integer statusCode, Optional fabricIndex, Optional debugText); + + void onError(Exception error); + } + + public interface NOCsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface FabricsAttributeCallback { + void onSuccess( + List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface TrustedRootCertificatesAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readNOCsAttribute(NOCsAttributeCallback callback) { + readNOCsAttribute(chipClusterPtr, callback); + } + + public void subscribeNOCsAttribute( + NOCsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNOCsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFabricsAttribute(FabricsAttributeCallback callback) { + readFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeFabricsAttribute( + FabricsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { + readSupportedFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeSupportedFabricsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSupportedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCommissionedFabricsAttribute(IntegerAttributeCallback callback) { + readCommissionedFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeCommissionedFabricsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCommissionedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readTrustedRootCertificatesAttribute( + TrustedRootCertificatesAttributeCallback callback) { + readTrustedRootCertificatesAttribute(chipClusterPtr, callback); + } + + public void subscribeTrustedRootCertificatesAttribute( + TrustedRootCertificatesAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTrustedRootCertificatesAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { + readCurrentFabricIndexAttribute(chipClusterPtr, callback); + } + + public void subscribeCurrentFabricIndexAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCurrentFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readNOCsAttribute(long chipClusterPtr, NOCsAttributeCallback callback); + + private native void subscribeNOCsAttribute( + long chipClusterPtr, NOCsAttributeCallback callback, int minInterval, int maxInterval); + + private native void readFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback); + + private native void subscribeFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSupportedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSupportedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readCommissionedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCommissionedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readTrustedRootCertificatesAttribute( + long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); + + private native void subscribeTrustedRootCertificatesAttribute( + long chipClusterPtr, + TrustedRootCertificatesAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readCurrentFabricIndexAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCurrentFabricIndexAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class GroupKeyManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 63L; + + public GroupKeyManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void keySetWrite( + DefaultClusterCallback callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet) { + keySetWrite(chipClusterPtr, callback, groupKeySet, null); + } + + public void keySetWrite( + DefaultClusterCallback callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, + int timedInvokeTimeoutMs) { + keySetWrite(chipClusterPtr, callback, groupKeySet, timedInvokeTimeoutMs); + } + + public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { + keySetRead(chipClusterPtr, callback, groupKeySetID, null); + } + + public void keySetRead( + KeySetReadResponseCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { + keySetRead(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); + } + + public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { + keySetRemove(chipClusterPtr, callback, groupKeySetID, null); + } + + public void keySetRemove( + DefaultClusterCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { + keySetRemove(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); + } + + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, ArrayList groupKeySetIDs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, null); + } + + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, + ArrayList groupKeySetIDs, + int timedInvokeTimeoutMs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, timedInvokeTimeoutMs); + } + + private native void keySetWrite( + long chipClusterPtr, + DefaultClusterCallback Callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetRead( + long chipClusterPtr, + KeySetReadResponseCallback Callback, + Integer groupKeySetID, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetRemove( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer groupKeySetID, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetReadAllIndices( + long chipClusterPtr, + KeySetReadAllIndicesResponseCallback Callback, + ArrayList groupKeySetIDs, + @Nullable Integer timedInvokeTimeoutMs); + + public interface KeySetReadResponseCallback { + void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet); + + void onError(Exception error); + } + + public interface KeySetReadAllIndicesResponseCallback { + void onSuccess(ArrayList groupKeySetIDs); + + void onError(Exception error); + } + + public interface GroupKeyMapAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GroupTableAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { + readGroupKeyMapAttribute(chipClusterPtr, callback); + } + + public void writeGroupKeyMapAttribute( + DefaultClusterCallback callback, + ArrayList value) { + writeGroupKeyMapAttribute(chipClusterPtr, callback, value, null); + } + + public void writeGroupKeyMapAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeGroupKeyMapAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeGroupKeyMapAttribute( + GroupKeyMapAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGroupKeyMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGroupTableAttribute(GroupTableAttributeCallback callback) { + readGroupTableAttribute(chipClusterPtr, callback); + } + + public void subscribeGroupTableAttribute( + GroupTableAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGroupTableAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxGroupsPerFabricAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxGroupsPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxGroupKeysPerFabricAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGroupKeyMapAttribute( + long chipClusterPtr, GroupKeyMapAttributeCallback callback); + + private native void writeGroupKeyMapAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeGroupKeyMapAttribute( + long chipClusterPtr, + GroupKeyMapAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGroupTableAttribute( + long chipClusterPtr, GroupTableAttributeCallback callback); + + private native void subscribeGroupTableAttribute( + long chipClusterPtr, + GroupTableAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxGroupKeysPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxGroupKeysPerFabricAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( @@ -10773,77 +12312,18 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class AdministratorCommissioningCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 60L; + public static class FixedLabelCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 64L; - public AdministratorCommissioningCluster(long devicePtr, int endpointId) { + public FixedLabelCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void openCommissioningWindow( - DefaultClusterCallback callback, - Integer commissioningTimeout, - byte[] PAKEPasscodeVerifier, - Integer discriminator, - Long iterations, - byte[] salt, - int timedInvokeTimeoutMs) { - openCommissioningWindow( - chipClusterPtr, - callback, - commissioningTimeout, - PAKEPasscodeVerifier, - discriminator, - iterations, - salt, - timedInvokeTimeoutMs); - } - - public void openBasicCommissioningWindow( - DefaultClusterCallback callback, Integer commissioningTimeout, int timedInvokeTimeoutMs) { - openBasicCommissioningWindow( - chipClusterPtr, callback, commissioningTimeout, timedInvokeTimeoutMs); - } - - public void revokeCommissioning(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - - revokeCommissioning(chipClusterPtr, callback, timedInvokeTimeoutMs); - } - - private native void openCommissioningWindow( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer commissioningTimeout, - byte[] PAKEPasscodeVerifier, - Integer discriminator, - Long iterations, - byte[] salt, - @Nullable Integer timedInvokeTimeoutMs); - - private native void openBasicCommissioningWindow( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer commissioningTimeout, - @Nullable Integer timedInvokeTimeoutMs); - - private native void revokeCommissioning( - long chipClusterPtr, - DefaultClusterCallback Callback, - @Nullable Integer timedInvokeTimeoutMs); - - public interface AdminFabricIndexAttributeCallback { - void onSuccess(@Nullable Integer value); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface AdminVendorIdAttributeCallback { - void onSuccess(@Nullable Integer value); + public interface LabelListAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); @@ -10877,36 +12357,18 @@ default void onSubscriptionEstablished(long subscriptionId) {} public interface AttributeListAttributeCallback { void onSuccess(List valueList); - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public void readWindowStatusAttribute(IntegerAttributeCallback callback) { - readWindowStatusAttribute(chipClusterPtr, callback); - } - - public void subscribeWindowStatusAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeWindowStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAdminFabricIndexAttribute(AdminFabricIndexAttributeCallback callback) { - readAdminFabricIndexAttribute(chipClusterPtr, callback); - } - - public void subscribeAdminFabricIndexAttribute( - AdminFabricIndexAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAdminFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} } - public void readAdminVendorIdAttribute(AdminVendorIdAttributeCallback callback) { - readAdminVendorIdAttribute(chipClusterPtr, callback); + public void readLabelListAttribute(LabelListAttributeCallback callback) { + readLabelListAttribute(chipClusterPtr, callback); } - public void subscribeAdminVendorIdAttribute( - AdminVendorIdAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAdminVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLabelListAttribute( + LabelListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -10963,29 +12425,11 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readWindowStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeWindowStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readAdminFabricIndexAttribute( - long chipClusterPtr, AdminFabricIndexAttributeCallback callback); - - private native void subscribeAdminFabricIndexAttribute( - long chipClusterPtr, - AdminFabricIndexAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readAdminVendorIdAttribute( - long chipClusterPtr, AdminVendorIdAttributeCallback callback); + private native void readLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback); - private native void subscribeAdminVendorIdAttribute( - long chipClusterPtr, - AdminVendorIdAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11033,225 +12477,18 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class OperationalCredentialsCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 62L; - - public OperationalCredentialsCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId); - } - - @Override - public native long initWithDevice(long devicePtr, int endpointId); - - public void attestationRequest(AttestationResponseCallback callback, byte[] attestationNonce) { - attestationRequest(chipClusterPtr, callback, attestationNonce, null); - } - - public void attestationRequest( - AttestationResponseCallback callback, byte[] attestationNonce, int timedInvokeTimeoutMs) { - attestationRequest(chipClusterPtr, callback, attestationNonce, timedInvokeTimeoutMs); - } - - public void certificateChainRequest( - CertificateChainResponseCallback callback, Integer certificateType) { - certificateChainRequest(chipClusterPtr, callback, certificateType, null); - } - - public void certificateChainRequest( - CertificateChainResponseCallback callback, - Integer certificateType, - int timedInvokeTimeoutMs) { - certificateChainRequest(chipClusterPtr, callback, certificateType, timedInvokeTimeoutMs); - } - - public void CSRRequest( - CSRResponseCallback callback, byte[] CSRNonce, Optional isForUpdateNOC) { - CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, null); - } - - public void CSRRequest( - CSRResponseCallback callback, - byte[] CSRNonce, - Optional isForUpdateNOC, - int timedInvokeTimeoutMs) { - CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, timedInvokeTimeoutMs); - } - - public void addNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId) { - addNOC( - chipClusterPtr, - callback, - NOCValue, - ICACValue, - IPKValue, - caseAdminSubject, - adminVendorId, - null); - } - - public void addNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId, - int timedInvokeTimeoutMs) { - addNOC( - chipClusterPtr, - callback, - NOCValue, - ICACValue, - IPKValue, - caseAdminSubject, - adminVendorId, - timedInvokeTimeoutMs); - } - - public void updateNOC( - NOCResponseCallback callback, byte[] NOCValue, Optional ICACValue) { - updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, null); - } - - public void updateNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - int timedInvokeTimeoutMs) { - updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, timedInvokeTimeoutMs); - } - - public void updateFabricLabel(NOCResponseCallback callback, String label) { - updateFabricLabel(chipClusterPtr, callback, label, null); - } - - public void updateFabricLabel( - NOCResponseCallback callback, String label, int timedInvokeTimeoutMs) { - updateFabricLabel(chipClusterPtr, callback, label, timedInvokeTimeoutMs); - } - - public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) { - removeFabric(chipClusterPtr, callback, fabricIndex, null); - } - - public void removeFabric( - NOCResponseCallback callback, Integer fabricIndex, int timedInvokeTimeoutMs) { - removeFabric(chipClusterPtr, callback, fabricIndex, timedInvokeTimeoutMs); - } - - public void addTrustedRootCertificate( - DefaultClusterCallback callback, byte[] rootCACertificate) { - addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, null); - } - - public void addTrustedRootCertificate( - DefaultClusterCallback callback, byte[] rootCACertificate, int timedInvokeTimeoutMs) { - addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, timedInvokeTimeoutMs); - } - - private native void attestationRequest( - long chipClusterPtr, - AttestationResponseCallback Callback, - byte[] attestationNonce, - @Nullable Integer timedInvokeTimeoutMs); - - private native void certificateChainRequest( - long chipClusterPtr, - CertificateChainResponseCallback Callback, - Integer certificateType, - @Nullable Integer timedInvokeTimeoutMs); - - private native void CSRRequest( - long chipClusterPtr, - CSRResponseCallback Callback, - byte[] CSRNonce, - Optional isForUpdateNOC, - @Nullable Integer timedInvokeTimeoutMs); - - private native void addNOC( - long chipClusterPtr, - NOCResponseCallback Callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId, - @Nullable Integer timedInvokeTimeoutMs); - - private native void updateNOC( - long chipClusterPtr, - NOCResponseCallback Callback, - byte[] NOCValue, - Optional ICACValue, - @Nullable Integer timedInvokeTimeoutMs); - - private native void updateFabricLabel( - long chipClusterPtr, - NOCResponseCallback Callback, - String label, - @Nullable Integer timedInvokeTimeoutMs); - - private native void removeFabric( - long chipClusterPtr, - NOCResponseCallback Callback, - Integer fabricIndex, - @Nullable Integer timedInvokeTimeoutMs); - - private native void addTrustedRootCertificate( - long chipClusterPtr, - DefaultClusterCallback Callback, - byte[] rootCACertificate, - @Nullable Integer timedInvokeTimeoutMs); - - public interface AttestationResponseCallback { - void onSuccess(byte[] attestationElements, byte[] attestationSignature); - - void onError(Exception error); - } - - public interface CertificateChainResponseCallback { - void onSuccess(byte[] certificate); - - void onError(Exception error); - } - - public interface CSRResponseCallback { - void onSuccess(byte[] NOCSRElements, byte[] attestationSignature); - - void onError(Exception error); - } - - public interface NOCResponseCallback { - void onSuccess(Integer statusCode, Optional fabricIndex, Optional debugText); - - void onError(Exception error); - } - - public interface NOCsAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface FabricsAttributeCallback { - void onSuccess( - List valueList); - - void onError(Exception ex); + public static class UserLabelCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 65L; - default void onSubscriptionEstablished(long subscriptionId) {} + public UserLabelCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); } - public interface TrustedRootCertificatesAttributeCallback { - void onSuccess(List valueList); + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface LabelListAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); @@ -11290,59 +12527,25 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readNOCsAttribute(NOCsAttributeCallback callback) { - readNOCsAttribute(chipClusterPtr, callback); - } - - public void subscribeNOCsAttribute( - NOCsAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNOCsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readFabricsAttribute(FabricsAttributeCallback callback) { - readFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeFabricsAttribute( - FabricsAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { - readSupportedFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeSupportedFabricsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSupportedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readCommissionedFabricsAttribute(IntegerAttributeCallback callback) { - readCommissionedFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeCommissionedFabricsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCommissionedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readTrustedRootCertificatesAttribute( - TrustedRootCertificatesAttributeCallback callback) { - readTrustedRootCertificatesAttribute(chipClusterPtr, callback); + public void readLabelListAttribute(LabelListAttributeCallback callback) { + readLabelListAttribute(chipClusterPtr, callback); } - public void subscribeTrustedRootCertificatesAttribute( - TrustedRootCertificatesAttributeCallback callback, int minInterval, int maxInterval) { - subscribeTrustedRootCertificatesAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeLabelListAttribute( + DefaultClusterCallback callback, ArrayList value) { + writeLabelListAttribute(chipClusterPtr, callback, value, null); } - public void readCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { - readCurrentFabricIndexAttribute(chipClusterPtr, callback); + public void writeLabelListAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeLabelListAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeCurrentFabricIndexAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCurrentFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLabelListAttribute( + LabelListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -11399,43 +12602,17 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readNOCsAttribute(long chipClusterPtr, NOCsAttributeCallback callback); - - private native void subscribeNOCsAttribute( - long chipClusterPtr, NOCsAttributeCallback callback, int minInterval, int maxInterval); - - private native void readFabricsAttribute( - long chipClusterPtr, FabricsAttributeCallback callback); - - private native void subscribeFabricsAttribute( - long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); - - private native void readSupportedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeSupportedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readCommissionedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeCommissionedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readTrustedRootCertificatesAttribute( - long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); + private native void readLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback); - private native void subscribeTrustedRootCertificatesAttribute( + private native void writeLabelListAttribute( long chipClusterPtr, - TrustedRootCertificatesAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); - private native void subscribeCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribeLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11483,111 +12660,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class GroupKeyManagementCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 63L; + public static class ProxyConfigurationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 66L; - public GroupKeyManagementCluster(long devicePtr, int endpointId) { + public ProxyConfigurationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void keySetWrite( - DefaultClusterCallback callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet) { - keySetWrite(chipClusterPtr, callback, groupKeySet, null); - } - - public void keySetWrite( - DefaultClusterCallback callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, - int timedInvokeTimeoutMs) { - keySetWrite(chipClusterPtr, callback, groupKeySet, timedInvokeTimeoutMs); - } - - public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { - keySetRead(chipClusterPtr, callback, groupKeySetID, null); - } - - public void keySetRead( - KeySetReadResponseCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { - keySetRead(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); - } - - public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { - keySetRemove(chipClusterPtr, callback, groupKeySetID, null); - } - - public void keySetRemove( - DefaultClusterCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { - keySetRemove(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); - } - - public void keySetReadAllIndices( - KeySetReadAllIndicesResponseCallback callback, ArrayList groupKeySetIDs) { - keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, null); - } - - public void keySetReadAllIndices( - KeySetReadAllIndicesResponseCallback callback, - ArrayList groupKeySetIDs, - int timedInvokeTimeoutMs) { - keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, timedInvokeTimeoutMs); - } - - private native void keySetWrite( - long chipClusterPtr, - DefaultClusterCallback Callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetRead( - long chipClusterPtr, - KeySetReadResponseCallback Callback, - Integer groupKeySetID, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetRemove( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer groupKeySetID, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetReadAllIndices( - long chipClusterPtr, - KeySetReadAllIndicesResponseCallback Callback, - ArrayList groupKeySetIDs, - @Nullable Integer timedInvokeTimeoutMs); - - public interface KeySetReadResponseCallback { - void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet); - - void onError(Exception error); - } - - public interface KeySetReadAllIndicesResponseCallback { - void onSuccess(ArrayList groupKeySetIDs); - - void onError(Exception error); - } - - public interface GroupKeyMapAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface GroupTableAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -11612,61 +12694,12 @@ public interface EventListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public interface AttributeListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { - readGroupKeyMapAttribute(chipClusterPtr, callback); - } - - public void writeGroupKeyMapAttribute( - DefaultClusterCallback callback, - ArrayList value) { - writeGroupKeyMapAttribute(chipClusterPtr, callback, value, null); - } - - public void writeGroupKeyMapAttribute( - DefaultClusterCallback callback, - ArrayList value, - int timedWriteTimeoutMs) { - writeGroupKeyMapAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); - } - - public void subscribeGroupKeyMapAttribute( - GroupKeyMapAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGroupKeyMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readGroupTableAttribute(GroupTableAttributeCallback callback) { - readGroupTableAttribute(chipClusterPtr, callback); - } - - public void subscribeGroupTableAttribute( - GroupTableAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGroupTableAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { - readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); - } - - public void subscribeMaxGroupsPerFabricAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMaxGroupsPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { - readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); - } + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); - public void subscribeMaxGroupKeysPerFabricAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -11723,42 +12756,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readGroupKeyMapAttribute( - long chipClusterPtr, GroupKeyMapAttributeCallback callback); - - private native void writeGroupKeyMapAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - ArrayList value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeGroupKeyMapAttribute( - long chipClusterPtr, - GroupKeyMapAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readGroupTableAttribute( - long chipClusterPtr, GroupTableAttributeCallback callback); - - private native void subscribeGroupTableAttribute( - long chipClusterPtr, - GroupTableAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readMaxGroupsPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeMaxGroupsPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readMaxGroupKeysPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeMaxGroupKeysPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11805,24 +12802,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class FixedLabelCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 64L; + public static class ProxyDiscoveryCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 67L; - public FixedLabelCluster(long devicePtr, int endpointId) { + public ProxyDiscoveryCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public interface LabelListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -11855,15 +12844,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readLabelListAttribute(LabelListAttributeCallback callback) { - readLabelListAttribute(chipClusterPtr, callback); - } - - public void subscribeLabelListAttribute( - LabelListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -11918,12 +12898,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback); - - private native void subscribeLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11970,24 +12944,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class UserLabelCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 65L; + public static class ProxyValidCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 68L; - public UserLabelCluster(long devicePtr, int endpointId) { + public ProxyValidCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public interface LabelListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -12020,27 +12986,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readLabelListAttribute(LabelListAttributeCallback callback) { - readLabelListAttribute(chipClusterPtr, callback); - } - - public void writeLabelListAttribute( - DefaultClusterCallback callback, ArrayList value) { - writeLabelListAttribute(chipClusterPtr, callback, value, null); - } - - public void writeLabelListAttribute( - DefaultClusterCallback callback, - ArrayList value, - int timedWriteTimeoutMs) { - writeLabelListAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); - } - - public void subscribeLabelListAttribute( - LabelListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -12095,18 +13040,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback); - - private native void writeLabelListAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - ArrayList value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -33795,4 +34728,146 @@ private native void readClusterRevisionAttribute( private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + + public static class FaultInjectionCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 4294048774L; + + public FaultInjectionCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 9f079111c14841..222ed166cc4333 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -653,6 +653,88 @@ public String toString() { } } + public static class TimeSynchronizationClusterDSTTableEmptyEvent { + + public TimeSynchronizationClusterDSTTableEmptyEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTTableEmptyEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterDSTStatusEvent { + public Boolean DSTOffsetActive; + + public TimeSynchronizationClusterDSTStatusEvent(Boolean DSTOffsetActive) { + this.DSTOffsetActive = DSTOffsetActive; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTStatusEvent {\n"); + output.append("\tDSTOffsetActive: "); + output.append(DSTOffsetActive); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeZoneStatusEvent { + public Long offset; + public Optional name; + + public TimeSynchronizationClusterTimeZoneStatusEvent(Long offset, Optional name) { + this.offset = offset; + this.name = name; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeZoneStatusEvent {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeFailureEvent { + + public TimeSynchronizationClusterTimeFailureEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeFailureEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterMissingTrustedTimeSourceEvent { + + public TimeSynchronizationClusterMissingTrustedTimeSourceEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterMissingTrustedTimeSourceEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedDeviceBasicInformationClusterStartUpEvent { public Long softwareVersion; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 2d67c350f0886c..d6b41b24ba33de 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -46,6 +46,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 15L) { return "BinaryInputBasic"; } + if (clusterId == 28L) { + return "PulseWidthModulation"; + } if (clusterId == 29L) { return "Descriptor"; } @@ -106,6 +109,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 55L) { return "EthernetNetworkDiagnostics"; } + if (clusterId == 56L) { + return "TimeSynchronization"; + } if (clusterId == 57L) { return "BridgedDeviceBasicInformation"; } @@ -127,6 +133,15 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 65L) { return "UserLabel"; } + if (clusterId == 66L) { + return "ProxyConfiguration"; + } + if (clusterId == 67L) { + return "ProxyDiscovery"; + } + if (clusterId == 68L) { + return "ProxyValid"; + } if (clusterId == 69L) { return "BooleanState"; } @@ -262,6 +277,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 4294048773L) { return "UnitTesting"; } + if (clusterId == 4294048774L) { + return "FaultInjection"; + } return ""; } @@ -534,6 +552,27 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 28L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 29L) { if (attributeId == 0L) { return "DeviceTypeList"; @@ -1515,6 +1554,66 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 56L) { + if (attributeId == 0L) { + return "UTCTime"; + } + if (attributeId == 1L) { + return "Granularity"; + } + if (attributeId == 2L) { + return "TimeSource"; + } + if (attributeId == 3L) { + return "TrustedTimeSource"; + } + if (attributeId == 4L) { + return "DefaultNTP"; + } + if (attributeId == 5L) { + return "TimeZone"; + } + if (attributeId == 6L) { + return "DSTOffset"; + } + if (attributeId == 7L) { + return "LocalTime"; + } + if (attributeId == 8L) { + return "TimeZoneDatabase"; + } + if (attributeId == 9L) { + return "NTPServerAvailable"; + } + if (attributeId == 10L) { + return "TimeZoneListMaxSize"; + } + if (attributeId == 11L) { + return "DSTOffsetListMaxSize"; + } + if (attributeId == 12L) { + return "SupportsDNSResolve"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 57L) { if (attributeId == 1L) { return "VendorName"; @@ -1764,6 +1863,69 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 66L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 67L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 68L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 69L) { if (attributeId == 0L) { return "StateValue"; @@ -4386,6 +4548,27 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 4294048774L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } return ""; } @@ -4415,6 +4598,9 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 15L) { return ""; } + if (clusterId == 28L) { + return ""; + } if (clusterId == 29L) { return ""; } @@ -4547,6 +4733,24 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 55L) { return ""; } + if (clusterId == 56L) { + if (eventId == 0L) { + return "DSTTableEmpty"; + } + if (eventId == 1L) { + return "DSTStatus"; + } + if (eventId == 2L) { + return "TimeZoneStatus"; + } + if (eventId == 3L) { + return "TimeFailure"; + } + if (eventId == 4L) { + return "MissingTrustedTimeSource"; + } + return ""; + } if (clusterId == 57L) { if (eventId == 0L) { return "StartUp"; @@ -4601,6 +4805,15 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 65L) { return ""; } + if (clusterId == 66L) { + return ""; + } + if (clusterId == 67L) { + return ""; + } + if (clusterId == 68L) { + return ""; + } if (clusterId == 69L) { if (eventId == 0L) { return "StateChange"; @@ -4811,6 +5024,9 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 4294048774L) { + return ""; + } return ""; } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 238ab930c6f0cb..552977ba3dd20c 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1029,6 +1029,121 @@ public String toString() { } } + public static class TimeSynchronizationClusterDSTOffsetStruct { + public Long offset; + public Long validStarting; + public @Nullable Long validUntil; + + public TimeSynchronizationClusterDSTOffsetStruct( + Long offset, Long validStarting, @Nullable Long validUntil) { + this.offset = offset; + this.validStarting = validStarting; + this.validUntil = validUntil; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTOffsetStruct {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tvalidStarting: "); + output.append(validStarting); + output.append("\n"); + output.append("\tvalidUntil: "); + output.append(validUntil); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { + public Long nodeID; + public Integer endpoint; + + public TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct( + Long nodeID, Integer endpoint) { + this.nodeID = nodeID; + this.endpoint = endpoint; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct {\n"); + output.append("\tnodeID: "); + output.append(nodeID); + output.append("\n"); + output.append("\tendpoint: "); + output.append(endpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeZoneStruct { + public Long offset; + public Long validAt; + public Optional name; + + public TimeSynchronizationClusterTimeZoneStruct( + Long offset, Long validAt, Optional name) { + this.offset = offset; + this.validAt = validAt; + this.name = name; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeZoneStruct {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tvalidAt: "); + output.append(validAt); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTrustedTimeSourceStruct { + public Integer fabricIndex; + public Long nodeID; + public Integer endpoint; + + public TimeSynchronizationClusterTrustedTimeSourceStruct( + Integer fabricIndex, Long nodeID, Integer endpoint) { + this.fabricIndex = fabricIndex; + this.nodeID = nodeID; + this.endpoint = endpoint; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTrustedTimeSourceStruct {\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("\tnodeID: "); + output.append(nodeID); + output.append("\n"); + output.append("\tendpoint: "); + output.append(endpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedDeviceBasicInformationClusterProductAppearanceStruct { public Integer finish; public @Nullable Integer primaryColor; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index bb0c456fba3fe9..a85e4501ab5996 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1366,6 +1366,102 @@ public void onError(Exception ex) { } } + public static class DelegatedPulseWidthModulationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.GeneratedCommandListAttributeCallback, + 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 DelegatedPulseWidthModulationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.AcceptedCommandListAttributeCallback, + 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 DelegatedPulseWidthModulationClusterEventListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.EventListAttributeCallback, + 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 DelegatedPulseWidthModulationClusterAttributeListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.AttributeListAttributeCallback, + 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 DelegatedDescriptorClusterDeviceTypeListAttributeCallback implements ChipClusters.DescriptorCluster.DeviceTypeListAttributeCallback, DelegatedClusterCallback { @@ -5258,10 +5354,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedBridgedDeviceBasicInformationClusterGeneratedCommandListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster - .GeneratedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterUTCTimeAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.UTCTimeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5271,10 +5365,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -5284,10 +5378,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedBridgedDeviceBasicInformationClusterAcceptedCommandListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster - .AcceptedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterDefaultNTPAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.DefaultNTPAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5297,10 +5389,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable String value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -5310,8 +5402,8 @@ public void onError(Exception ex) { } } - public static class DelegatedBridgedDeviceBasicInformationClusterEventListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster.EventListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterTimeZoneAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.TimeZoneAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5321,9 +5413,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5334,8 +5428,8 @@ public void onError(Exception ex) { } } - public static class DelegatedBridgedDeviceBasicInformationClusterAttributeListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster.AttributeListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterDSTOffsetAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.DSTOffsetAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5345,9 +5439,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5358,8 +5454,32 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterGeneratedCommandListAttributeCallback - implements ChipClusters.SwitchCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterLocalTimeAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.LocalTimeAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedTimeSynchronizationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5382,8 +5502,8 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterAcceptedCommandListAttributeCallback - implements ChipClusters.SwitchCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5406,8 +5526,9 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterEventListAttributeCallback - implements ChipClusters.SwitchCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedTimeSynchronizationClusterEventListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.EventListAttributeCallback, + DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5429,8 +5550,8 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterAttributeListAttributeCallback - implements ChipClusters.SwitchCluster.AttributeListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterAttributeListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5453,8 +5574,10 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAdminFabricIndexAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AdminFabricIndexAttributeCallback, + public static + class DelegatedBridgedDeviceBasicInformationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster + .GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5464,10 +5587,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5477,8 +5600,10 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAdminVendorIdAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AdminVendorIdAttributeCallback, + public static + class DelegatedBridgedDeviceBasicInformationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster + .AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5488,10 +5613,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5501,10 +5626,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedAdministratorCommissioningClusterGeneratedCommandListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster - .GeneratedCommandListAttributeCallback, + public static class DelegatedBridgedDeviceBasicInformationClusterEventListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5527,9 +5650,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAcceptedCommandListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster - .AcceptedCommandListAttributeCallback, + public static class DelegatedBridgedDeviceBasicInformationClusterAttributeListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5552,8 +5674,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterEventListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.EventListAttributeCallback, + public static class DelegatedSwitchClusterGeneratedCommandListAttributeCallback + implements ChipClusters.SwitchCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5576,8 +5698,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAttributeListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AttributeListAttributeCallback, + public static class DelegatedSwitchClusterAcceptedCommandListAttributeCallback + implements ChipClusters.SwitchCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5600,9 +5722,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAttestationResponseCallback - implements ChipClusters.OperationalCredentialsCluster.AttestationResponseCallback, - DelegatedClusterCallback { + public static class DelegatedSwitchClusterEventListAttributeCallback + implements ChipClusters.SwitchCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5611,25 +5732,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] AttestationElements, byte[] AttestationSignature) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo AttestationElementsResponseValue = - new CommandResponseInfo("AttestationElements", "byte[]"); - responseValues.put(AttestationElementsResponseValue, AttestationElements); - CommandResponseInfo AttestationSignatureResponseValue = - new CommandResponseInfo("AttestationSignature", "byte[]"); - responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterCertificateChainResponseCallback - implements ChipClusters.OperationalCredentialsCluster.CertificateChainResponseCallback, + public static class DelegatedSwitchClusterAttributeListAttributeCallback + implements ChipClusters.SwitchCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5639,22 +5756,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] Certificate) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo CertificateResponseValue = - new CommandResponseInfo("Certificate", "byte[]"); - responseValues.put(CertificateResponseValue, Certificate); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterCSRResponseCallback - implements ChipClusters.OperationalCredentialsCluster.CSRResponseCallback, + public static class DelegatedAdministratorCommissioningClusterAdminFabricIndexAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AdminFabricIndexAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5664,25 +5780,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] NOCSRElements, byte[] AttestationSignature) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo NOCSRElementsResponseValue = - new CommandResponseInfo("NOCSRElements", "byte[]"); - responseValues.put(NOCSRElementsResponseValue, NOCSRElements); - CommandResponseInfo AttestationSignatureResponseValue = - new CommandResponseInfo("AttestationSignature", "byte[]"); - responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterNOCResponseCallback - implements ChipClusters.OperationalCredentialsCluster.NOCResponseCallback, + public static class DelegatedAdministratorCommissioningClusterAdminVendorIdAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AdminVendorIdAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5692,12 +5804,216 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - Integer StatusCode, Optional FabricIndex, Optional DebugText) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo StatusCodeResponseValue = - new CommandResponseInfo("StatusCode", "Integer"); - responseValues.put(StatusCodeResponseValue, StatusCode); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static + class DelegatedAdministratorCommissioningClusterGeneratedCommandListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster + .GeneratedCommandListAttributeCallback, + 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 DelegatedAdministratorCommissioningClusterAcceptedCommandListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster + .AcceptedCommandListAttributeCallback, + 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 DelegatedAdministratorCommissioningClusterEventListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.EventListAttributeCallback, + 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 DelegatedAdministratorCommissioningClusterAttributeListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AttributeListAttributeCallback, + 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 DelegatedOperationalCredentialsClusterAttestationResponseCallback + implements ChipClusters.OperationalCredentialsCluster.AttestationResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] AttestationElements, byte[] AttestationSignature) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo AttestationElementsResponseValue = + new CommandResponseInfo("AttestationElements", "byte[]"); + responseValues.put(AttestationElementsResponseValue, AttestationElements); + CommandResponseInfo AttestationSignatureResponseValue = + new CommandResponseInfo("AttestationSignature", "byte[]"); + responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterCertificateChainResponseCallback + implements ChipClusters.OperationalCredentialsCluster.CertificateChainResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] Certificate) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo CertificateResponseValue = + new CommandResponseInfo("Certificate", "byte[]"); + responseValues.put(CertificateResponseValue, Certificate); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterCSRResponseCallback + implements ChipClusters.OperationalCredentialsCluster.CSRResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] NOCSRElements, byte[] AttestationSignature) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo NOCSRElementsResponseValue = + new CommandResponseInfo("NOCSRElements", "byte[]"); + responseValues.put(NOCSRElementsResponseValue, NOCSRElements); + CommandResponseInfo AttestationSignatureResponseValue = + new CommandResponseInfo("AttestationSignature", "byte[]"); + responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterNOCResponseCallback + implements ChipClusters.OperationalCredentialsCluster.NOCResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + Integer StatusCode, Optional FabricIndex, Optional DebugText) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo StatusCodeResponseValue = + new CommandResponseInfo("StatusCode", "Integer"); + responseValues.put(StatusCodeResponseValue, StatusCode); CommandResponseInfo FabricIndexResponseValue = new CommandResponseInfo("FabricIndex", "Optional"); responseValues.put(FabricIndexResponseValue, FabricIndex); @@ -5708,13 +6024,312 @@ public void onSuccess( } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterNOCsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback, + 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 DelegatedOperationalCredentialsClusterFabricsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback, + 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 DelegatedOperationalCredentialsClusterTrustedRootCertificatesAttributeCallback + implements ChipClusters.OperationalCredentialsCluster + .TrustedRootCertificatesAttributeCallback, + 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 DelegatedOperationalCredentialsClusterGeneratedCommandListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.GeneratedCommandListAttributeCallback, + 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 DelegatedOperationalCredentialsClusterAcceptedCommandListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.AcceptedCommandListAttributeCallback, + 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 DelegatedOperationalCredentialsClusterEventListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.EventListAttributeCallback, + 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 DelegatedOperationalCredentialsClusterAttributeListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.AttributeListAttributeCallback, + 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 DelegatedGroupKeyManagementClusterKeySetReadResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct GroupKeySet) { + Map responseValues = new LinkedHashMap<>(); + // GroupKeySet: Struct GroupKeySetStruct + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ArrayList GroupKeySetIDs) { + Map responseValues = new LinkedHashMap<>(); + // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + 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 DelegatedGroupKeyManagementClusterGroupTableAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, + 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 DelegatedGroupKeyManagementClusterGeneratedCommandListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GeneratedCommandListAttributeCallback, + 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 DelegatedOperationalCredentialsClusterNOCsAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback, + public static class DelegatedGroupKeyManagementClusterAcceptedCommandListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5724,11 +6339,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5739,8 +6352,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterFabricsAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback, + public static class DelegatedGroupKeyManagementClusterEventListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5750,12 +6363,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5766,9 +6376,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterTrustedRootCertificatesAttributeCallback - implements ChipClusters.OperationalCredentialsCluster - .TrustedRootCertificatesAttributeCallback, + public static class DelegatedGroupKeyManagementClusterAttributeListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5778,10 +6387,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5792,8 +6400,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterGeneratedCommandListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedFixedLabelClusterLabelListAttributeCallback + implements ChipClusters.FixedLabelCluster.LabelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5803,9 +6411,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5816,8 +6425,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAcceptedCommandListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedFixedLabelClusterGeneratedCommandListAttributeCallback + implements ChipClusters.FixedLabelCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5840,8 +6449,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterEventListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.EventListAttributeCallback, + public static class DelegatedFixedLabelClusterAcceptedCommandListAttributeCallback + implements ChipClusters.FixedLabelCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5864,8 +6473,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAttributeListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.AttributeListAttributeCallback, + public static class DelegatedFixedLabelClusterEventListAttributeCallback + implements ChipClusters.FixedLabelCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5888,8 +6497,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterKeySetReadResponseCallback - implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, + public static class DelegatedFixedLabelClusterAttributeListAttributeCallback + implements ChipClusters.FixedLabelCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5899,21 +6508,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct GroupKeySet) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySet: Struct GroupKeySetStruct - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback - implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, + public static class DelegatedUserLabelClusterLabelListAttributeCallback + implements ChipClusters.UserLabelCluster.LabelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5923,21 +6532,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ArrayList GroupKeySetIDs) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + public static class DelegatedUserLabelClusterGeneratedCommandListAttributeCallback + implements ChipClusters.UserLabelCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5947,11 +6557,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5962,8 +6570,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupTableAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, + public static class DelegatedUserLabelClusterAcceptedCommandListAttributeCallback + implements ChipClusters.UserLabelCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5973,11 +6581,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5988,8 +6594,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGeneratedCommandListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedUserLabelClusterEventListAttributeCallback + implements ChipClusters.UserLabelCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6012,8 +6618,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterAcceptedCommandListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedUserLabelClusterAttributeListAttributeCallback + implements ChipClusters.UserLabelCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6036,8 +6642,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterEventListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.EventListAttributeCallback, + public static class DelegatedProxyConfigurationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6060,8 +6666,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterAttributeListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.AttributeListAttributeCallback, + public static class DelegatedProxyConfigurationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6084,8 +6690,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterLabelListAttributeCallback - implements ChipClusters.FixedLabelCluster.LabelListAttributeCallback, + public static class DelegatedProxyConfigurationClusterEventListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6095,10 +6701,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6109,8 +6714,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterGeneratedCommandListAttributeCallback - implements ChipClusters.FixedLabelCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedProxyConfigurationClusterAttributeListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6133,8 +6738,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterAcceptedCommandListAttributeCallback - implements ChipClusters.FixedLabelCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6157,8 +6762,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterEventListAttributeCallback - implements ChipClusters.FixedLabelCluster.EventListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6181,8 +6786,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterAttributeListAttributeCallback - implements ChipClusters.FixedLabelCluster.AttributeListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterEventListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6205,8 +6810,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterLabelListAttributeCallback - implements ChipClusters.UserLabelCluster.LabelListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterAttributeListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6216,10 +6821,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6230,8 +6834,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterGeneratedCommandListAttributeCallback - implements ChipClusters.UserLabelCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedProxyValidClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyValidCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6254,8 +6858,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterAcceptedCommandListAttributeCallback - implements ChipClusters.UserLabelCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedProxyValidClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyValidCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6278,8 +6882,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterEventListAttributeCallback - implements ChipClusters.UserLabelCluster.EventListAttributeCallback, + public static class DelegatedProxyValidClusterEventListAttributeCallback + implements ChipClusters.ProxyValidCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6302,8 +6906,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterAttributeListAttributeCallback - implements ChipClusters.UserLabelCluster.AttributeListAttributeCallback, + public static class DelegatedProxyValidClusterAttributeListAttributeCallback + implements ChipClusters.ProxyValidCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -14527,6 +15131,102 @@ public void onError(Exception ex) { } } + public static class DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback + implements ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback, + 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 DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback + implements ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback, + 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 DelegatedFaultInjectionClusterEventListAttributeCallback + implements ChipClusters.FaultInjectionCluster.EventListAttributeCallback, + 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 DelegatedFaultInjectionClusterAttributeListAttributeCallback + implements ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback, + 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 Map getClusterMap() { Map clusterMap = initializeClusterMap(); Map> commandMap = getCommandMap(); @@ -14574,6 +15274,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.BinaryInputBasicCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("binaryInputBasic", binaryInputBasicClusterInfo); + ClusterInfo pulseWidthModulationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PulseWidthModulationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("pulseWidthModulation", pulseWidthModulationClusterInfo); ClusterInfo descriptorClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), @@ -14674,6 +15379,11 @@ public Map initializeClusterMap() { new ChipClusters.EthernetNetworkDiagnosticsCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInfo); + ClusterInfo timeSynchronizationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TimeSynchronizationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("timeSynchronization", timeSynchronizationClusterInfo); ClusterInfo bridgedDeviceBasicInformationClusterInfo = new ClusterInfo( (ptr, endpointId) -> @@ -14710,6 +15420,21 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.UserLabelCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("userLabel", userLabelClusterInfo); + ClusterInfo proxyConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyConfiguration", proxyConfigurationClusterInfo); + ClusterInfo proxyDiscoveryClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyDiscoveryCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyDiscovery", proxyDiscoveryClusterInfo); + ClusterInfo proxyValidClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyValidCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyValid", proxyValidClusterInfo); ClusterInfo booleanStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.BooleanStateCluster(ptr, endpointId), @@ -14940,6 +15665,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.UnitTestingCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("unitTesting", unitTestingClusterInfo); + ClusterInfo faultInjectionClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.FaultInjectionCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("faultInjection", faultInjectionClusterInfo); return clusterMap; } @@ -14954,6 +15684,7 @@ public void combineCommand( .combineCommands(source.get("onOffSwitchConfiguration")); destination.get("levelControl").combineCommands(source.get("levelControl")); destination.get("binaryInputBasic").combineCommands(source.get("binaryInputBasic")); + destination.get("pulseWidthModulation").combineCommands(source.get("pulseWidthModulation")); destination.get("descriptor").combineCommands(source.get("descriptor")); destination.get("binding").combineCommands(source.get("binding")); destination.get("accessControl").combineCommands(source.get("accessControl")); @@ -14986,6 +15717,7 @@ public void combineCommand( destination .get("ethernetNetworkDiagnostics") .combineCommands(source.get("ethernetNetworkDiagnostics")); + destination.get("timeSynchronization").combineCommands(source.get("timeSynchronization")); destination .get("bridgedDeviceBasicInformation") .combineCommands(source.get("bridgedDeviceBasicInformation")); @@ -14997,6 +15729,9 @@ public void combineCommand( destination.get("groupKeyManagement").combineCommands(source.get("groupKeyManagement")); destination.get("fixedLabel").combineCommands(source.get("fixedLabel")); destination.get("userLabel").combineCommands(source.get("userLabel")); + destination.get("proxyConfiguration").combineCommands(source.get("proxyConfiguration")); + destination.get("proxyDiscovery").combineCommands(source.get("proxyDiscovery")); + destination.get("proxyValid").combineCommands(source.get("proxyValid")); destination.get("booleanState").combineCommands(source.get("booleanState")); destination.get("icdManagement").combineCommands(source.get("icdManagement")); destination.get("modeSelect").combineCommands(source.get("modeSelect")); @@ -15060,6 +15795,7 @@ public void combineCommand( destination.get("accountLogin").combineCommands(source.get("accountLogin")); destination.get("electricalMeasurement").combineCommands(source.get("electricalMeasurement")); destination.get("unitTesting").combineCommands(source.get("unitTesting")); + destination.get("faultInjection").combineCommands(source.get("faultInjection")); } @SuppressWarnings("unchecked") @@ -15771,6 +16507,9 @@ public Map> getCommandMap() { commandMap.put("levelControl", levelControlClusterInteractionInfoMap); Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); + Map pulseWidthModulationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("pulseWidthModulation", pulseWidthModulationClusterInteractionInfoMap); Map descriptorClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("descriptor", descriptorClusterInteractionInfoMap); Map bindingClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -16667,6 +17406,9 @@ public Map> getCommandMap() { "resetCounts", ethernetNetworkDiagnosticsresetCountsInteractionInfo); commandMap.put( "ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInteractionInfoMap); + Map timeSynchronizationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("timeSynchronization", timeSynchronizationClusterInteractionInfoMap); Map bridgedDeviceBasicInformationClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put( @@ -17047,6 +17789,13 @@ public Map> getCommandMap() { commandMap.put("fixedLabel", fixedLabelClusterInteractionInfoMap); Map userLabelClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("userLabel", userLabelClusterInteractionInfoMap); + Map proxyConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("proxyConfiguration", proxyConfigurationClusterInteractionInfoMap); + Map proxyDiscoveryClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("proxyDiscovery", proxyDiscoveryClusterInteractionInfoMap); + Map proxyValidClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("proxyValid", proxyValidClusterInteractionInfoMap); Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); Map icdManagementClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -19621,6 +20370,8 @@ public Map> getCommandMap() { unitTestingClusterInteractionInfoMap.put( "testEmitTestEventRequest", unitTestingtestEmitTestEventRequestInteractionInfo); commandMap.put("unitTesting", unitTestingClusterInteractionInfoMap); + Map faultInjectionClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("faultInjection", faultInjectionClusterInteractionInfoMap); return commandMap; } }