diff --git a/src/app/zap-templates/templates/chip/helper.js b/src/app/zap-templates/templates/chip/helper.js index 5cc606fed376b0..b6771871669455 100644 --- a/src/app/zap-templates/templates/chip/helper.js +++ b/src/app/zap-templates/templates/chip/helper.js @@ -152,11 +152,35 @@ function chip_has_clusters(options) * @param {*} options */ function chip_server_global_responses(options) +{ + return asBlocks.call(this, getServerGlobalAttributeResponses(), options); +} + +async function if_in_global_responses(options) +{ + const attribute = this.response.arguments[0]; + const globalResponses = await getServerGlobalAttributeResponses(); + const responseTypeExists = globalResponses.find( + // Some fields of item/attribute here may be undefined. + item => item.isList == attribute.isList && item.isStruct == attribute.isStruct && item.chipType == attribute.chipType + && item.isNullable == attribute.isNullable && item.isOptional == attribute.isOptional) + + if (responseTypeExists) + { + return options.fn(this); + } + else + { + return options.inverse(this); + } +} + +function getServerGlobalAttributeResponses() { const sorter = (a, b) => a.chipCallback.name.localeCompare(b.chipCallback.name, 'en', { numeric : true }); const reducer = (unique, item) => { - const { type, size, isList, chipCallback, chipType } = item.response.arguments[0]; + const { type, size, isList, isOptional, isNullable, chipCallback, chipType } = item.response.arguments[0]; // List-typed elements have a dedicated callback if (isList) { @@ -167,11 +191,11 @@ function chip_server_global_responses(options) return unique; } - return [...unique, { chipCallback, chipType, size } ]; + return [...unique, { chipCallback, chipType, size, isOptional, isNullable } ]; }; const filter = attributes => attributes.reduce(reducer, []).sort(sorter); - return asBlocks.call(this, Clusters.getAttributesByClusterSide('server').then(filter), options); + return Clusters.getAttributesByClusterSide('server').then(filter); } /** @@ -381,3 +405,4 @@ exports.chip_server_cluster_attributes = chip_server_clust exports.chip_server_has_list_attributes = chip_server_has_list_attributes; exports.chip_available_cluster_commands = chip_available_cluster_commands; exports.if_chip_enum = if_chip_enum; +exports.if_in_global_responses = if_in_global_responses; diff --git a/src/controller/java/templates/CHIPCallbackTypes.zapt b/src/controller/java/templates/CHIPCallbackTypes.zapt index 3f4d648f2e102a..5c5dfa29bd40f5 100644 --- a/src/controller/java/templates/CHIPCallbackTypes.zapt +++ b/src/controller/java/templates/CHIPCallbackTypes.zapt @@ -4,11 +4,22 @@ #include typedef void (*CHIPDefaultSuccessCallbackType)(void *, const chip::app::DataModel::NullObjectType &); +typedef void (*CHIPDefaultWriteSuccessCallbackType)(void *); typedef void (*CHIPDefaultFailureCallbackType)(void *, EmberAfStatus); {{#chip_client_clusters}} {{#chip_cluster_responses}} typedef void (*CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}CallbackType)(void *, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &); {{/chip_cluster_responses}} + +{{! TODO: global response types?}} + +{{#chip_server_cluster_attributes}} +{{#if isList}} +typedef void (*CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}AttributeCallbackType)(void *, const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo::DecodableType &); +{{else}} +typedef void (*CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}AttributeCallbackType)(void *, chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo::DecodableArgType); +{{/if}} +{{/chip_server_cluster_attributes}} {{/chip_client_clusters}} {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/CHIPClusters-JNI.zapt b/src/controller/java/templates/CHIPClusters-JNI.zapt index 81bac5365e8a99..aec7ea3a5a8c7c 100644 --- a/src/controller/java/templates/CHIPClusters-JNI.zapt +++ b/src/controller/java/templates/CHIPClusters-JNI.zapt @@ -81,9 +81,14 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, {{asLowerCamelCase name}}) {{! TODO: Lists not supported in attribute writes yet. }} {{#unless isList}} -JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type false}} value) +JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, {{asJniBasicType type true}} value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; + TypeInfo::Type cppValue; + + {{>encode_value target="cppValue" source="value"}} + std::unique_ptr onSuccess(Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -94,15 +99,9 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase na {{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast<{{asCamelCased ../name false}}Cluster *>(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - {{#if (isOctetString type)}} - JniByteArray jniArr(env, value); - err = cppCluster->WriteAttribute{{asUpperCamelCase name}}(onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t*) jniArr.data(), jniArr.size())); - {{else if (isCharString type)}} - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttribute{{asUpperCamelCase name}}(onSuccess->Cancel(), onFailure->Cancel(), chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); - {{else}} - err = cppCluster->WriteAttribute{{asUpperCamelCase name}}(onSuccess->Cancel(), onFailure->Cancel(), static_cast<{{chipType}}>(value)); - {{/if}} + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); onSuccess.release(); diff --git a/src/controller/java/templates/CHIPClustersRead-JNI.zapt b/src/controller/java/templates/CHIPClustersRead-JNI.zapt index 03f897ea97a8a1..7c61a7c7a19cef 100644 --- a/src/controller/java/templates/CHIPClustersRead-JNI.zapt +++ b/src/controller/java/templates/CHIPClustersRead-JNI.zapt @@ -19,13 +19,17 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, read{{asUpperCamelCase name}}Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; -{{#if isList}} - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); -{{else}} - std::unique_ptr onSuccess(chip::Platform::New(callback{{#if (isString type)}}, - {{#if (isOctetString type)}}true{{else}}false{{/if}}{{/if}}), chip::Platform::Delete); -{{/if}} + using TypeInfo = chip::app::Clusters::{{asUpperCamelCase ../name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; + + {{~#*inline "callbackName"}} + {{#if_in_global_responses}} + CHIP{{chipCallback.name}}AttributeCallback + {{else}} + CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallback + {{/if_in_global_responses}} + {{/inline}} + + std::unique_ptr<{{>callbackName}}, void (*)({{>callbackName}} *)> onSuccess(chip::Platform::New<{{>callbackName}}>(callback, false), chip::Platform::Delete<{{>callbackName}}>); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); std::unique_ptr onFailure(chip::Platform::New(callback), chip::Platform::Delete); @@ -35,7 +39,9 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, read{{asUpperCamelCase nam chip::Controller::{{asCamelCased ../name false}}Cluster * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttribute{{asCamelCased name false}}(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn(err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); onSuccess.release(); diff --git a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt index c079b4fa1a8e45..ccac6c109095f0 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt @@ -61,11 +61,11 @@ void CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callbac // Java callback is allowed to be null, exit early if this is the case. VerifyOrReturn(javaCallbackRef != nullptr); - err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if isOptional}}Ljava/util/Optional;{{else if (isOctetString type)}}[B{{else if (isShortString type)}}Ljava/lang/String;{{else}}{{asJniSignature type true}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "({{#chip_cluster_response_arguments}}{{#if isArray}}{{else if isOptional}}Ljava/util/Optional;{{else if (isOctetString type)}}[B{{else if (isCharString type)}}Ljava/lang/String;{{else}}{{asJniSignature type true}}{{/if}}{{/chip_cluster_response_arguments}})V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); {{#chip_cluster_response_arguments}} - {{>decode_value}} + {{>decode_value source=(concat "dataResponse." (asLowerCamelCase name)) target=(asSymbol label)}} {{/chip_cluster_response_arguments}} env->CallVoidMethod(javaCallbackRef, javaMethod{{#chip_cluster_response_arguments}}, {{asSymbol label}}{{/chip_cluster_response_arguments}}); diff --git a/src/controller/java/templates/CHIPReadCallbacks-src.zapt b/src/controller/java/templates/CHIPReadCallbacks-src.zapt index 2f98c332bb62fe..0f6542458d3667 100644 --- a/src/controller/java/templates/CHIPReadCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks-src.zapt @@ -82,7 +82,6 @@ void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{ch {{#chip_client_clusters}} {{#chip_server_cluster_attributes}} -{{#if isList}} {{! NOTE: Some of our helpers rely on broken ZAP APIs that sniff for "isArray" when we are just trying to work with the type of an array element. Fix @@ -92,8 +91,10 @@ void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{ch {{~#*inline "asUnboxedJniSignatureForEntry"}}{{> asUnboxedJniSignature isArray=false}}{{/inline~}} {{~#*inline "asBoxedJavaBasicType"}}{{asJavaBasicTypeForZclType type true}}{{/inline~}} {{~#*inline "asBoxedJavaBasicTypeForEntry"}}{{>asBoxedJavaBasicType isArray=false}}{{/inline~}} -CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(jobject javaCallback) : - chip::Callback::Callback<{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttributeCallback>(CallbackFn, this) +{{#if_in_global_responses}} +{{else}} +CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) { @@ -116,7 +117,9 @@ CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback:: } env->DeleteGlobalRef(javaCallbackRef); } +{{/if_in_global_responses}} +{{#if isList}} void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} list) { chip::DeviceLayer::StackUnlock unlock; @@ -126,7 +129,7 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback(reinterpret_cast(context)); + 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; @@ -311,6 +314,32 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +{{else}} + {{#if_in_global_responses}} + {{else}} + void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback::CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} 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", "({{#if isArray}}{{else if isStruct}}{{else if isOptional}}Ljava/util/Optional;{{else if (isOctetString type)}}[B{{else if (isCharString type)}}Ljava/lang/String;{{else}}{{asJniSignature type true}}{{/if}})V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + {{>decode_value source="value" target="javaValue"}} + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); + } + {{/if_in_global_responses}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/controller/java/templates/CHIPReadCallbacks.zapt b/src/controller/java/templates/CHIPReadCallbacks.zapt index fe4d5d3d0dacfc..56dbebd89dccda 100644 --- a/src/controller/java/templates/CHIPReadCallbacks.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks.zapt @@ -1,8 +1,9 @@ {{> header}} {{#if (chip_has_client_clusters)}} -#include +#include "CHIPCallbackTypes.h" #include +#include {{#chip_server_global_responses}} class CHIP{{chipCallback.name}}AttributeCallback : public chip::Callback::Callback<{{chipCallback.name}}AttributeCallback> { @@ -14,7 +15,7 @@ public: static void maybeDestroy(CHIP{{chipCallback.name}}AttributeCallback * callback) { if (!callback->keepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -24,26 +25,34 @@ private: jobject javaCallbackRef; bool keepAlive; }; - {{/chip_server_global_responses}} {{#chip_client_clusters}} {{#chip_server_cluster_attributes}} -{{#if isList}} -class CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback : public chip::Callback::Callback<{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}ListAttributeCallback> +{{#if_in_global_responses}} +{{else}} +class CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback : public chip::Callback::Callback { public: - CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(jobject javaCallback); + CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback(); - static void CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} list); + static void maybeDestroy(CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback * callback) { + if (!callback->keepAlive) { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true}} {{#if isList}}list{{else}}value{{/if}}); private: jobject javaCallbackRef; + bool keepAlive; }; +{{/if_in_global_responses}} -{{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index 5a616694264da3..0d625aaf5b78df 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -78,13 +78,15 @@ public class ChipClusters { public native long initWithDevice(long devicePtr, int endpointId); {{#chip_cluster_commands}} - public void {{asLowerCamelCase name}}({{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{>command_arguments}}) { + public void {{asLowerCamelCase name}}({{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback + {{#chip_cluster_command_arguments_with_structs_expanded}}{{>java_type_for_argument}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}) { {{asLowerCamelCase name}}(chipClusterPtr, callback{{#chip_cluster_command_arguments_with_structs_expanded}}, {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}); } {{/chip_cluster_commands}} {{#chip_cluster_commands}} - private native void {{asLowerCamelCase name}}(long chipClusterPtr, {{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} callback{{>command_arguments}}); + private native void {{asLowerCamelCase name}}(long chipClusterPtr, {{#if hasSpecificResponse}}{{asUpperCamelCase responseName}}Callback{{else}}DefaultClusterCallback{{/if}} Callback + {{#chip_cluster_command_arguments_with_structs_expanded}}{{>java_type_for_argument}} {{asLowerCamelCase label}}{{/chip_cluster_command_arguments_with_structs_expanded}}); {{/chip_cluster_commands}} {{#chip_cluster_responses}} public interface {{asUpperCamelCase name}}Callback { @@ -184,22 +186,32 @@ public class ChipClusters { return output.toString(); } } -{{/if}} - - public interface {{asUpperCamelCase name}}AttributeCallback { - void onSuccess(List<{{#>list_attribute_callback_type}}{{/list_attribute_callback_type}}> valueList); - void onError(Exception ex); - } + {{/if}} {{/if}} + + {{#if_in_global_responses}} + {{else}} + {{#if isList}} + public interface {{asUpperCamelCase name}}AttributeCallback { + void onSuccess(List<{{#>list_attribute_callback_type}}{{/list_attribute_callback_type}}> valueList); + void onError(Exception ex); + } + {{else}} + public interface {{asUpperCamelCase name}}AttributeCallback { + void onSuccess({{#>list_attribute_callback_type}}{{/list_attribute_callback_type}} value); + void onError(Exception ex); + } + {{/if}} + {{/if_in_global_responses}} {{/chip_server_cluster_attributes}} {{#chip_server_cluster_attributes}} public void read{{asUpperCamelCase name}}Attribute( -{{#if isList}} - {{asUpperCamelCase name}}AttributeCallback callback -{{else}} + {{#if_in_global_responses}} {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback -{{/if}} + {{else}} + {{asUpperCamelCase name}}AttributeCallback callback + {{/if_in_global_responses}} ) { read{{asUpperCamelCase name}}Attribute(chipClusterPtr, callback); } @@ -207,7 +219,7 @@ public class ChipClusters { {{! TODO: Lists not supported in attribute writes yet. }} {{#unless isList}} - public void write{{asUpperCamelCase name}}Attribute(DefaultClusterCallback callback, {{asJavaBasicType type}} value) { + public void write{{asUpperCamelCase name}}Attribute(DefaultClusterCallback callback{{>java_type_for_argument}} value) { write{{asUpperCamelCase name}}Attribute(chipClusterPtr, callback, value); } {{/unless}} @@ -227,17 +239,17 @@ public class ChipClusters { {{#chip_server_cluster_attributes}} private native void read{{asUpperCamelCase name}}Attribute(long chipClusterPtr, -{{#if isList}} - {{asUpperCamelCase name}}AttributeCallback callback -{{else}} - {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback -{{/if}} + {{#if_in_global_responses}} + {{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback callback + {{else}} + {{asUpperCamelCase name}}AttributeCallback callback + {{/if_in_global_responses}} ); {{#if isWritableAttribute}} {{! TODO: Lists not supported in attribute writes yet. }} {{#unless isList}} - private native void write{{asUpperCamelCase name}}Attribute(long chipClusterPtr, DefaultClusterCallback callback, {{asJavaBasicType type}} value); + private native void write{{asUpperCamelCase name}}Attribute(long chipClusterPtr, DefaultClusterCallback callback{{>java_type_for_argument}} value); {{/unless}} {{/if}} {{#if isReportableAttribute}} diff --git a/src/controller/java/templates/ClusterInfo-read-interaction.zapt b/src/controller/java/templates/ClusterInfo-read-interaction.zapt index 564fb91719d7aa..defb1e1ebf3418 100644 --- a/src/controller/java/templates/ClusterInfo-read-interaction.zapt +++ b/src/controller/java/templates/ClusterInfo-read-interaction.zapt @@ -20,11 +20,11 @@ public class ClusterReadMapping { InteractionInfo read{{asUpperCamelCase ../name}}{{asUpperCamelCase name}}AttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.{{asUpperCamelCase ../name}}Cluster) cluster).read{{asUpperCamelCase name}}Attribute( - {{#if isList}} - (ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback) callback - {{else}} - (ChipClusters.{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback) callback - {{/if}} + ({{#if_in_global_responses}} + ChipClusters.{{convertAttributeCallbackTypeToJavaName chipCallback.type}}AttributeCallback + {{else}} + ChipClusters.{{asUpperCamelCase ../name}}Cluster.{{asUpperCamelCase name}}AttributeCallback + {{/if_in_global_responses}}) callback ); }, {{#if isList}} diff --git a/src/controller/java/templates/partials/command_arguments.zapt b/src/controller/java/templates/partials/command_arguments.zapt deleted file mode 100644 index b534c0d285d26b..00000000000000 --- a/src/controller/java/templates/partials/command_arguments.zapt +++ /dev/null @@ -1,13 +0,0 @@ -{{#chip_cluster_command_arguments_with_structs_expanded}} -, -{{#if isOptional}} -Optional< -{{else if isNullable}} -@Nullable -{{/if}} -{{asJavaBoxedType type}} -{{#if isOptional}} -> -{{/if}} -{{asLowerCamelCase label}} -{{/chip_cluster_command_arguments_with_structs_expanded}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 954f08244e895e..2f54f13450b58f 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -1,31 +1,31 @@ -jobject {{asSymbol label}}; +jobject {{target}}; {{#if isOptional}} -if (!dataResponse.{{asLowerCamelCase label}}.HasValue()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, {{asSymbol label}}); +if (!{{source}}.HasValue()) { + chip::JniReferences::GetInstance().CreateOptional(nullptr, {{target}}); } else { {{#if isNullable}} -if (dataResponse.{{asLowerCamelCase label}}.Value().IsNull()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, {{asSymbol label}}); +if ({{source}}.Value().IsNull()) { + chip::JniReferences::GetInstance().CreateOptional(nullptr, {{target}}); } else { {{/if}} {{/if}} -{{~#*inline "item"}}dataResponse.{{asLowerCamelCase name}}{{#if isOptional}}.Value(){{/if}}{{#if isNullable}}.Value(){{/if}}{{/inline}} +{{~#*inline "item"}}{{source}}{{#if isOptional}}.Value(){{/if}}{{#if isNullable}}.Value(){{/if}}{{/inline}} {{#if isArray}} {{asSymbol label}} = nullptr; /* Array - Conversion from this type to Java is not properly implemented yet */ {{! TODO: Use if_is_struct, which works better for nested types. Currently can't because inline partials aren't found in its else block. }} {{else if isStruct}} {{asSymbol label}} = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */ {{else if (isOctetString type)}} -{{asSymbol label}} = chip::ByteArray(env, {{>item}}).jniValue(); +{{target}} = chip::ByteArray(env, {{>item}}).jniValue(); {{else if (isCharString type)}} -{{asSymbol label}} = chip::UtfString(env, {{>item}}).jniValue(); +{{target}} = chip::UtfString(env, {{>item}}).jniValue(); {{else}} -std::string {{asSymbol label}}ClassName = "java/lang/{{asJavaBasicTypeForZclType type true}}"; -std::string {{asSymbol label}}CtorSignature = "({{asJniSignature type false}})V"; -chip::JniReferences::GetInstance().CreateBoxedObject<{{chipType}}>({{asSymbol label}}ClassName.c_str(), {{asSymbol label}}CtorSignature.c_str(), {{>item}}, {{asSymbol label}}); +std::string {{target}}ClassName = "java/lang/{{asJavaBasicTypeForZclType type true}}"; +std::string {{target}}CtorSignature = "({{asJniSignature type false}})V"; +chip::JniReferences::GetInstance().CreateBoxedObject<{{chipType}}>({{target}}ClassName.c_str(), {{target}}CtorSignature.c_str(), {{>item}}, {{target}}); {{/if}} {{#if isOptional}} -chip::JniReferences::GetInstance().CreateOptional({{asSymbol label}}, {{asSymbol label}}); +chip::JniReferences::GetInstance().CreateOptional({{target}}, {{target}}); {{#if isNullable}} } {{/if}} diff --git a/src/controller/java/templates/partials/encode_value.zapt b/src/controller/java/templates/partials/encode_value.zapt index 8cf48d1d44cdf7..8903ac6b6c6f0d 100644 --- a/src/controller/java/templates/partials/encode_value.zapt +++ b/src/controller/java/templates/partials/encode_value.zapt @@ -2,41 +2,41 @@ chip::JniReferences::GetInstance().GetOptionalValue({{source}}, {{source}}); {{/if}} {{#if isNullable}} - {{#if_chip_enum type}} +{{#if_chip_enum type}} + decltype({{target}}) {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})); + } +{{else}} +{{#if isArray}} +{{! TODO: Support array types. }} +{{else if isStruct}} +{{! TODO: Use if_is_struct, which works better for nested types. Currently can't because inline partials aren't found in its else block. }} +{{! TODO: Support struct types. }} +{{else if (isOctetString type)}} + chip::ByteSpan {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = chip::JniByteArray(env, static_cast({{source}})).byteSpan(); + } +{{else if (isCharString type)}} + chip::CharSpan {{source}}Value; + if ({{source}} != nullptr) { + {{source}}Value = chip::JniUtfString(env, static_cast({{source}})).charSpan(); + } +{{else}} + {{#if_is_bitmap type}} decltype({{target}}) {{source}}Value; if ({{source}} != nullptr) { {{source}}Value = static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})); } {{else}} - {{#if isArray}} - {{! TODO: Support array types. }} - {{else if isStruct}} - {{! TODO: Use if_is_struct, which works better for nested types. Currently can't because inline partials aren't found in its else block. }} - {{! TODO: Support struct types. }} - {{else if (isOctetString type)}} - chip::ByteSpan {{source}}Value; + {{chipType}} {{source}}Value; if ({{source}} != nullptr) { - {{source}}Value = chip::JniByteArray(env, static_cast({{source}})).byteSpan(); + {{source}}Value = chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}}); } - {{else if (isCharString type)}} - chip::CharSpan {{source}}Value; - if ({{source}} != nullptr) { - {{source}}Value = chip::JniUtfString(env, static_cast({{source}})).charSpan(); - } - {{else}} - {{#if_is_bitmap type}} - decltype({{target}}) {{source}}Value; - if ({{source}} != nullptr) { - {{source}}Value = static_cast(chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}})); - } - {{else}} - {{chipType}} {{source}}Value; - if ({{source}} != nullptr) { - {{source}}Value = chip::JniReferences::GetInstance().{{asJavaBoxedType type}}ToPrimitive({{source}}); - } - {{/if_is_bitmap}} - {{/if}} - {{/if_chip_enum}} + {{/if_is_bitmap}} +{{/if}} +{{/if_chip_enum}} {{/if}} {{#*inline "value"}} {{! TODO Implement complex types parsing in order to properly set the request parameters }} diff --git a/src/controller/java/templates/partials/java_type_for_argument.zapt b/src/controller/java/templates/partials/java_type_for_argument.zapt new file mode 100644 index 00000000000000..6944bc8df648e6 --- /dev/null +++ b/src/controller/java/templates/partials/java_type_for_argument.zapt @@ -0,0 +1 @@ +, {{#if isOptional}}Optional<{{else if isNullable}}@Nullable {{/if}}{{asJavaBoxedType type}}{{#if isOptional}}>{{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/partials/list_attribute_callback_type.zapt b/src/controller/java/templates/partials/list_attribute_callback_type.zapt index b74884de17986b..587f7b8d436bdd 100644 --- a/src/controller/java/templates/partials/list_attribute_callback_type.zapt +++ b/src/controller/java/templates/partials/list_attribute_callback_type.zapt @@ -2,23 +2,21 @@ {{> @partial-block }}{{asUpperCamelCase name}}Attribute {{else}} {{#if isNullable}} - {{#unless isArray}} - {{#unless isStruct}} @Nullable - {{/unless}} - {{/unless}} {{/if}} {{#if isOptional}} - {{#unless isArray}} - {{#unless isStruct}} Optional< - {{/unless}} - {{/unless}} {{/if}} - {{#if (isOctetString type)}} + {{#if isArray}} + {{! TODO Implement a real type for arrays. }} + Object + {{else if isStruct}} + {{! TODO Implement a real type for structs. }} + Object + {{else if (isOctetString type)}} byte[] {{else if (isCharString type)}} - // Add String field here after ByteSpan is properly emitted in C++ layer + String {{else}} {{! NOTE: asJavaBasicTypeForZclType ends up sniffing for isArray on the context. Since we want the type of our _entry_, force isArray to @@ -27,10 +25,6 @@ {{> asJavaBasicTypeForEntry isArray=false}} {{/if}} {{#if isOptional}} - {{#unless isArray}} - {{#unless isStruct}} > - {{/unless}} - {{/unless}} {{/if}} {{/if}} \ No newline at end of file diff --git a/src/controller/java/templates/templates.json b/src/controller/java/templates/templates.json index 590f9a74447f35..67884e239c724d 100644 --- a/src/controller/java/templates/templates.json +++ b/src/controller/java/templates/templates.json @@ -41,8 +41,8 @@ "path": "partials/command_callback_responses.zapt" }, { - "name": "command_arguments", - "path": "partials/command_arguments.zapt" + "name": "java_type_for_argument", + "path": "partials/java_type_for_argument.zapt" } ], "templates": [ diff --git a/src/controller/java/zap-generated/CHIPCallbackTypes.h b/src/controller/java/zap-generated/CHIPCallbackTypes.h index feeaa68e68cc35..9726fde6694af4 100644 --- a/src/controller/java/zap-generated/CHIPCallbackTypes.h +++ b/src/controller/java/zap-generated/CHIPCallbackTypes.h @@ -20,18 +20,265 @@ #include typedef void (*CHIPDefaultSuccessCallbackType)(void *, const chip::app::DataModel::NullObjectType &); +typedef void (*CHIPDefaultWriteSuccessCallbackType)(void *); typedef void (*CHIPDefaultFailureCallbackType)(void *, EmberAfStatus); typedef void (*CHIPAccountLoginClusterGetSetupPINResponseCallbackType)( void *, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &); + +typedef void (*CHIPAccountLoginClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::AccountLogin::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPAdministratorCommissioningClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPApplicationBasicClusterVendorNameAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterVendorIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::VendorId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterApplicationNameAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterProductIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::ProductId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterApplicationIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::ApplicationId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterCatalogVendorIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::CatalogVendorId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterApplicationStatusAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::ApplicationStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationBasicClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPApplicationLauncherClusterLaunchAppResponseCallbackType)( void *, const chip::app::Clusters::ApplicationLauncher::Commands::LaunchAppResponse::DecodableType &); + +typedef void (*CHIPApplicationLauncherClusterApplicationLauncherListAttributeCallbackType)( + void *, const chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherList::TypeInfo::DecodableType &); +typedef void (*CHIPApplicationLauncherClusterCatalogVendorIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationLauncher::Attributes::CatalogVendorId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationLauncherClusterApplicationIdAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationId::TypeInfo::DecodableArgType); +typedef void (*CHIPApplicationLauncherClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPAudioOutputClusterAudioOutputListAttributeCallbackType)( + void *, const chip::app::Clusters::AudioOutput::Attributes::AudioOutputList::TypeInfo::DecodableType &); +typedef void (*CHIPAudioOutputClusterCurrentAudioOutputAttributeCallbackType)( + void *, chip::app::Clusters::AudioOutput::Attributes::CurrentAudioOutput::TypeInfo::DecodableArgType); +typedef void (*CHIPAudioOutputClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::AudioOutput::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBarrierControlClusterBarrierMovingStateAttributeCallbackType)( + void *, chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::TypeInfo::DecodableArgType); +typedef void (*CHIPBarrierControlClusterBarrierSafetyStatusAttributeCallbackType)( + void *, chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPBarrierControlClusterBarrierCapabilitiesAttributeCallbackType)( + void *, chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::TypeInfo::DecodableArgType); +typedef void (*CHIPBarrierControlClusterBarrierPositionAttributeCallbackType)( + void *, chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::TypeInfo::DecodableArgType); +typedef void (*CHIPBarrierControlClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBasicClusterInteractionModelVersionAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::InteractionModelVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterVendorNameAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::VendorName::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterVendorIDAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::VendorID::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterProductNameAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ProductName::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterProductIDAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ProductID::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterNodeLabelAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterLocationAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::Location::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterHardwareVersionAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::HardwareVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterHardwareVersionStringAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::HardwareVersionString::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterSoftwareVersionAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::SoftwareVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterSoftwareVersionStringAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::SoftwareVersionString::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterManufacturingDateAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ManufacturingDate::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterPartNumberAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::PartNumber::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterProductURLAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ProductURL::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterProductLabelAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ProductLabel::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterSerialNumberAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::SerialNumber::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterLocalConfigDisabledAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterReachableAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::Reachable::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterUniqueIDAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::UniqueID::TypeInfo::DecodableArgType); +typedef void (*CHIPBasicClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Basic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBinaryInputBasicClusterOutOfServiceAttributeCallbackType)( + void *, chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo::DecodableArgType); +typedef void (*CHIPBinaryInputBasicClusterPresentValueAttributeCallbackType)( + void *, chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo::DecodableArgType); +typedef void (*CHIPBinaryInputBasicClusterStatusFlagsAttributeCallbackType)( + void *, chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::TypeInfo::DecodableArgType); +typedef void (*CHIPBinaryInputBasicClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBindingClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Binding::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBooleanStateClusterStateValueAttributeCallbackType)( + void *, chip::app::Clusters::BooleanState::Attributes::StateValue::TypeInfo::DecodableArgType); +typedef void (*CHIPBooleanStateClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BooleanState::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBridgedActionsClusterActionListAttributeCallbackType)( + void *, const chip::app::Clusters::BridgedActions::Attributes::ActionList::TypeInfo::DecodableType &); +typedef void (*CHIPBridgedActionsClusterEndpointListAttributeCallbackType)( + void *, const chip::app::Clusters::BridgedActions::Attributes::EndpointList::TypeInfo::DecodableType &); +typedef void (*CHIPBridgedActionsClusterSetupUrlAttributeCallbackType)( + void *, chip::app::Clusters::BridgedActions::Attributes::SetupUrl::TypeInfo::DecodableArgType); +typedef void (*CHIPBridgedActionsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BridgedActions::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPBridgedDeviceBasicInformationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPColorControlClusterCurrentHueAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CurrentHue::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterCurrentSaturationAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CurrentSaturation::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterRemainingTimeAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::RemainingTime::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterCurrentXAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CurrentX::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterCurrentYAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CurrentY::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterDriftCompensationAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::DriftCompensation::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterCompensationTextAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CompensationText::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorTemperatureAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorTemperature::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorModeAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorMode::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorControlOptionsAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterNumberOfPrimariesAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::NumberOfPrimaries::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary1XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary1X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary1YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary1Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary1IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary1Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary2XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary2X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary2YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary2Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary2IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary2Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary3XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary3X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary3YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary3Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary3IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary3Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary4XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary4X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary4YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary4Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary4IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary4Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary5XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary5X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary5YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary5Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary5IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary5Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary6XAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary6X::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary6YAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary6Y::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterPrimary6IntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::Primary6Intensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterWhitePointXAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterWhitePointYAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointRXAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointRYAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointRIntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointGXAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointGYAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointGIntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointBXAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointBYAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorPointBIntensityAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterEnhancedCurrentHueAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterEnhancedColorModeAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorLoopActiveAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorLoopDirectionAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorLoopTimeAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorLoopStartEnhancedHueAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorLoopStoredEnhancedHueAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorCapabilitiesAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorTempPhysicalMinAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterColorTempPhysicalMaxAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterCoupleColorTempToLevelMinMiredsAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterStartUpColorTemperatureMiredsAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo::DecodableArgType); +typedef void (*CHIPColorControlClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPContentLauncherClusterLaunchContentResponseCallbackType)( void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchContentResponse::DecodableType &); typedef void (*CHIPContentLauncherClusterLaunchURLResponseCallbackType)( void *, const chip::app::Clusters::ContentLauncher::Commands::LaunchURLResponse::DecodableType &); + +typedef void (*CHIPContentLauncherClusterAcceptsHeaderListAttributeCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo::DecodableType &); +typedef void (*CHIPContentLauncherClusterSupportedStreamingTypesAttributeCallbackType)( + void *, const chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingTypes::TypeInfo::DecodableType &); +typedef void (*CHIPContentLauncherClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPDescriptorClusterDeviceListAttributeCallbackType)( + void *, const chip::app::Clusters::Descriptor::Attributes::DeviceList::TypeInfo::DecodableType &); +typedef void (*CHIPDescriptorClusterServerListAttributeCallbackType)( + void *, const chip::app::Clusters::Descriptor::Attributes::ServerList::TypeInfo::DecodableType &); +typedef void (*CHIPDescriptorClusterClientListAttributeCallbackType)( + void *, const chip::app::Clusters::Descriptor::Attributes::ClientList::TypeInfo::DecodableType &); +typedef void (*CHIPDescriptorClusterPartsListAttributeCallbackType)( + void *, const chip::app::Clusters::Descriptor::Attributes::PartsList::TypeInfo::DecodableType &); +typedef void (*CHIPDescriptorClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Descriptor::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPDiagnosticLogsClusterRetrieveLogsResponseCallbackType)( void *, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &); + typedef void (*CHIPDoorLockClusterClearAllPinsResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::ClearAllPinsResponse::DecodableType &); typedef void (*CHIPDoorLockClusterClearAllRfidsResponseCallbackType)( @@ -78,12 +325,118 @@ typedef void (*CHIPDoorLockClusterUnlockDoorResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::UnlockDoorResponse::DecodableType &); typedef void (*CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::UnlockWithTimeoutResponse::DecodableType &); + +typedef void (*CHIPDoorLockClusterLockStateAttributeCallbackType)( + void *, chip::app::Clusters::DoorLock::Attributes::LockState::TypeInfo::DecodableArgType); +typedef void (*CHIPDoorLockClusterLockTypeAttributeCallbackType)( + void *, chip::app::Clusters::DoorLock::Attributes::LockType::TypeInfo::DecodableArgType); +typedef void (*CHIPDoorLockClusterActuatorEnabledAttributeCallbackType)( + void *, chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::TypeInfo::DecodableArgType); +typedef void (*CHIPDoorLockClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::DoorLock::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPElectricalMeasurementClusterMeasurementTypeAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterTotalActivePowerAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsVoltageAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsVoltageMinAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsVoltageMaxAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsCurrentAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsCurrentMinAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterRmsCurrentMaxAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterActivePowerAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterActivePowerMinAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterActivePowerMaxAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo::DecodableArgType); +typedef void (*CHIPElectricalMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPEthernetNetworkDiagnosticsClusterPHYRateAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterFullDuplexAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterPacketRxCountAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterPacketTxCountAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterTxErrCountAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterCollisionCountAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterOverrunCountAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterCarrierDetectAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterTimeSinceResetAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPEthernetNetworkDiagnosticsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPFixedLabelClusterLabelListAttributeCallbackType)( + void *, const chip::app::Clusters::FixedLabel::Attributes::LabelList::TypeInfo::DecodableType &); +typedef void (*CHIPFixedLabelClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPFlowMeasurementClusterMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPFlowMeasurementClusterMinMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPFlowMeasurementClusterMaxMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPFlowMeasurementClusterToleranceAttributeCallbackType)( + void *, chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::TypeInfo::DecodableArgType); +typedef void (*CHIPFlowMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackType)( void *, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType &); typedef void (*CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackType)( void *, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &); typedef void (*CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackType)( void *, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &); + +typedef void (*CHIPGeneralCommissioningClusterBreadcrumbAttributeCallbackType)( + void *, chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo::DecodableArgType); +typedef void (*CHIPGeneralCommissioningClusterBasicCommissioningInfoListAttributeCallbackType)( + void *, const chip::app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfoList::TypeInfo::DecodableType &); +typedef void (*CHIPGeneralCommissioningClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPGeneralDiagnosticsClusterNetworkInterfacesAttributeCallbackType)( + void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::NetworkInterfaces::TypeInfo::DecodableType &); +typedef void (*CHIPGeneralDiagnosticsClusterRebootCountAttributeCallbackType)( + void *, chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::TypeInfo::DecodableArgType); +typedef void (*CHIPGeneralDiagnosticsClusterUpTimeAttributeCallbackType)( + void *, chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::TypeInfo::DecodableArgType); +typedef void (*CHIPGeneralDiagnosticsClusterTotalOperationalHoursAttributeCallbackType)( + void *, chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo::DecodableArgType); +typedef void (*CHIPGeneralDiagnosticsClusterBootReasonsAttributeCallbackType)( + void *, chip::app::Clusters::GeneralDiagnostics::Attributes::BootReasons::TypeInfo::DecodableArgType); +typedef void (*CHIPGeneralDiagnosticsClusterActiveHardwareFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveHardwareFaults::TypeInfo::DecodableType &); +typedef void (*CHIPGeneralDiagnosticsClusterActiveRadioFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveRadioFaults::TypeInfo::DecodableType &); +typedef void (*CHIPGeneralDiagnosticsClusterActiveNetworkFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveNetworkFaults::TypeInfo::DecodableType &); +typedef void (*CHIPGeneralDiagnosticsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPGroupKeyManagementClusterGroupsAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterGroupKeysAttributeCallbackType)( + void *, const chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo::DecodableType &); +typedef void (*CHIPGroupKeyManagementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPGroupsClusterAddGroupResponseCallbackType)( void *, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &); typedef void (*CHIPGroupsClusterGetGroupMembershipResponseCallbackType)( @@ -92,10 +445,79 @@ typedef void (*CHIPGroupsClusterRemoveGroupResponseCallbackType)( void *, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType &); typedef void (*CHIPGroupsClusterViewGroupResponseCallbackType)( void *, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType &); + +typedef void (*CHIPGroupsClusterNameSupportAttributeCallbackType)( + void *, chip::app::Clusters::Groups::Attributes::NameSupport::TypeInfo::DecodableArgType); +typedef void (*CHIPGroupsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Groups::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPIdentifyClusterIdentifyQueryResponseCallbackType)( void *, const chip::app::Clusters::Identify::Commands::IdentifyQueryResponse::DecodableType &); + +typedef void (*CHIPIdentifyClusterIdentifyTimeAttributeCallbackType)( + void *, chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo::DecodableArgType); +typedef void (*CHIPIdentifyClusterIdentifyTypeAttributeCallbackType)( + void *, chip::app::Clusters::Identify::Attributes::IdentifyType::TypeInfo::DecodableArgType); +typedef void (*CHIPIdentifyClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Identify::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPIlluminanceMeasurementClusterMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPIlluminanceMeasurementClusterMinMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPIlluminanceMeasurementClusterMaxMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPIlluminanceMeasurementClusterToleranceAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::TypeInfo::DecodableArgType); +typedef void (*CHIPIlluminanceMeasurementClusterLightSensorTypeAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo::DecodableArgType); +typedef void (*CHIPIlluminanceMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPKeypadInputClusterSendKeyResponseCallbackType)( void *, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &); + +typedef void (*CHIPKeypadInputClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPLevelControlClusterCurrentLevelAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterRemainingTimeAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterMinLevelAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterMaxLevelAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterCurrentFrequencyAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterMinFrequencyAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterMaxFrequencyAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterOptionsAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterOnOffTransitionTimeAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterOnLevelAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterOnTransitionTimeAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterOffTransitionTimeAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterDefaultMoveRateAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterStartUpCurrentLevelAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPLevelControlClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPLowPowerClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::LowPower::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPMediaInputClusterMediaInputListAttributeCallbackType)( + void *, const chip::app::Clusters::MediaInput::Attributes::MediaInputList::TypeInfo::DecodableType &); +typedef void (*CHIPMediaInputClusterCurrentMediaInputAttributeCallbackType)( + void *, chip::app::Clusters::MediaInput::Attributes::CurrentMediaInput::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaInputClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackType)( void *, const chip::app::Clusters::MediaPlayback::Commands::MediaFastForwardResponse::DecodableType &); typedef void (*CHIPMediaPlaybackClusterMediaNextResponseCallbackType)( @@ -118,6 +540,38 @@ typedef void (*CHIPMediaPlaybackClusterMediaStartOverResponseCallbackType)( void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStartOverResponse::DecodableType &); typedef void (*CHIPMediaPlaybackClusterMediaStopResponseCallbackType)( void *, const chip::app::Clusters::MediaPlayback::Commands::MediaStopResponse::DecodableType &); + +typedef void (*CHIPMediaPlaybackClusterPlaybackStateAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterStartTimeAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterDurationAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterPositionUpdatedAtAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::PositionUpdatedAt::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterPositionAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::Position::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterPlaybackSpeedAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterSeekRangeEndAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterSeekRangeStartAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo::DecodableArgType); +typedef void (*CHIPMediaPlaybackClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPModeSelectClusterCurrentModeAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterSupportedModesAttributeCallbackType)( + void *, const chip::app::Clusters::ModeSelect::Attributes::SupportedModes::TypeInfo::DecodableType &); +typedef void (*CHIPModeSelectClusterOnModeAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterStartUpModeAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterDescriptionAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo::DecodableArgType); +typedef void (*CHIPModeSelectClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackType)( void *, const chip::app::Clusters::NetworkCommissioning::Commands::AddThreadNetworkResponse::DecodableType &); typedef void (*CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackType)( @@ -134,10 +588,56 @@ typedef void (*CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbac void *, const chip::app::Clusters::NetworkCommissioning::Commands::UpdateThreadNetworkResponse::DecodableType &); typedef void (*CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackType)( void *, const chip::app::Clusters::NetworkCommissioning::Commands::UpdateWiFiNetworkResponse::DecodableType &); + +typedef void (*CHIPNetworkCommissioningClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPNetworkCommissioningClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPOtaSoftwareUpdateProviderClusterApplyUpdateResponseCallbackType)( void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType &); typedef void (*CHIPOtaSoftwareUpdateProviderClusterQueryImageResponseCallbackType)( void *, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType &); + +typedef void (*CHIPOtaSoftwareUpdateProviderClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterDefaultOtaProviderAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo::DecodableArgType); +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterUpdatePossibleAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo::DecodableArgType); +typedef void (*CHIPOtaSoftwareUpdateRequestorClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPOccupancySensingClusterOccupancyAttributeCallbackType)( + void *, chip::app::Clusters::OccupancySensing::Attributes::Occupancy::TypeInfo::DecodableArgType); +typedef void (*CHIPOccupancySensingClusterOccupancySensorTypeAttributeCallbackType)( + void *, chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::TypeInfo::DecodableArgType); +typedef void (*CHIPOccupancySensingClusterOccupancySensorTypeBitmapAttributeCallbackType)( + void *, chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo::DecodableArgType); +typedef void (*CHIPOccupancySensingClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPOnOffClusterOnOffAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterGlobalSceneControlAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterOnTimeAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterOffWaitTimeAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterStartUpOnOffAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPOnOffSwitchConfigurationClusterSwitchTypeAttributeCallbackType)( + void *, chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffSwitchConfigurationClusterSwitchActionsAttributeCallbackType)( + void *, chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo::DecodableArgType); +typedef void (*CHIPOnOffSwitchConfigurationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPOperationalCredentialsClusterAttestationResponseCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType &); typedef void (*CHIPOperationalCredentialsClusterCertificateChainResponseCallbackType)( @@ -146,6 +646,111 @@ typedef void (*CHIPOperationalCredentialsClusterNOCResponseCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType &); typedef void (*CHIPOperationalCredentialsClusterOpCSRResponseCallbackType)( void *, const chip::app::Clusters::OperationalCredentials::Commands::OpCSRResponse::DecodableType &); + +typedef void (*CHIPOperationalCredentialsClusterFabricsListAttributeCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Attributes::FabricsList::TypeInfo::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterSupportedFabricsAttributeCallbackType)( + void *, chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo::DecodableArgType); +typedef void (*CHIPOperationalCredentialsClusterCommissionedFabricsAttributeCallbackType)( + void *, chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo::DecodableArgType); +typedef void (*CHIPOperationalCredentialsClusterTrustedRootCertificatesAttributeCallbackType)( + void *, const chip::app::Clusters::OperationalCredentials::Attributes::TrustedRootCertificates::TypeInfo::DecodableType &); +typedef void (*CHIPOperationalCredentialsClusterCurrentFabricIndexAttributeCallbackType)( + void *, chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo::DecodableArgType); +typedef void (*CHIPOperationalCredentialsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPPowerSourceClusterStatusAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::Status::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterOrderAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterDescriptionAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryVoltageAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryPercentRemainingAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryTimeRemainingAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterBatteryChargeLevelAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterActiveBatteryFaultsAttributeCallbackType)( + void *, const chip::app::Clusters::PowerSource::Attributes::ActiveBatteryFaults::TypeInfo::DecodableType &); +typedef void (*CHIPPowerSourceClusterBatteryChargeStateAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPPowerSourceClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPPressureMeasurementClusterMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPPressureMeasurementClusterMinMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPPressureMeasurementClusterMaxMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPPressureMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPPumpConfigurationAndControlClusterMaxPressureAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxSpeedAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxFlowAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMinConstPressureAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxConstPressureAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMinCompPressureAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxCompPressureAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMinConstSpeedAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxConstSpeedAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMinConstFlowAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxConstFlowAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMinConstTempAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterMaxConstTempAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterPumpStatusAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterEffectiveOperationModeAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterEffectiveControlModeAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterCapacityAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterSpeedAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterLifetimeEnergyConsumedAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterOperationModeAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterControlModeAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterAlarmMaskAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPPumpConfigurationAndControlClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPRelativeHumidityMeasurementClusterMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPRelativeHumidityMeasurementClusterMinMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPRelativeHumidityMeasurementClusterMaxMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPRelativeHumidityMeasurementClusterToleranceAttributeCallbackType)( + void *, chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo::DecodableArgType); +typedef void (*CHIPRelativeHumidityMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPScenesClusterAddSceneResponseCallbackType)( void *, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType &); typedef void (*CHIPScenesClusterGetSceneMembershipResponseCallbackType)( @@ -158,10 +763,72 @@ typedef void (*CHIPScenesClusterStoreSceneResponseCallbackType)( void *, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &); typedef void (*CHIPScenesClusterViewSceneResponseCallbackType)( void *, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &); + +typedef void (*CHIPScenesClusterSceneCountAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::SceneCount::TypeInfo::DecodableArgType); +typedef void (*CHIPScenesClusterCurrentSceneAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::CurrentScene::TypeInfo::DecodableArgType); +typedef void (*CHIPScenesClusterCurrentGroupAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::CurrentGroup::TypeInfo::DecodableArgType); +typedef void (*CHIPScenesClusterSceneValidAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::SceneValid::TypeInfo::DecodableArgType); +typedef void (*CHIPScenesClusterNameSupportAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::NameSupport::TypeInfo::DecodableArgType); +typedef void (*CHIPScenesClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Scenes::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPSoftwareDiagnosticsClusterThreadMetricsAttributeCallbackType)( + void *, const chip::app::Clusters::SoftwareDiagnostics::Attributes::ThreadMetrics::TypeInfo::DecodableType &); +typedef void (*CHIPSoftwareDiagnosticsClusterCurrentHeapFreeAttributeCallbackType)( + void *, chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo::DecodableArgType); +typedef void (*CHIPSoftwareDiagnosticsClusterCurrentHeapUsedAttributeCallbackType)( + void *, chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo::DecodableArgType); +typedef void (*CHIPSoftwareDiagnosticsClusterCurrentHeapHighWatermarkAttributeCallbackType)( + void *, chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo::DecodableArgType); +typedef void (*CHIPSoftwareDiagnosticsClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPSoftwareDiagnosticsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPSwitchClusterNumberOfPositionsAttributeCallbackType)( + void *, chip::app::Clusters::Switch::Attributes::NumberOfPositions::TypeInfo::DecodableArgType); +typedef void (*CHIPSwitchClusterCurrentPositionAttributeCallbackType)( + void *, chip::app::Clusters::Switch::Attributes::CurrentPosition::TypeInfo::DecodableArgType); +typedef void (*CHIPSwitchClusterMultiPressMaxAttributeCallbackType)( + void *, chip::app::Clusters::Switch::Attributes::MultiPressMax::TypeInfo::DecodableArgType); +typedef void (*CHIPSwitchClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPSwitchClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPTvChannelClusterChangeChannelResponseCallbackType)( void *, const chip::app::Clusters::TvChannel::Commands::ChangeChannelResponse::DecodableType &); + +typedef void (*CHIPTvChannelClusterTvChannelListAttributeCallbackType)( + void *, const chip::app::Clusters::TvChannel::Attributes::TvChannelList::TypeInfo::DecodableType &); +typedef void (*CHIPTvChannelClusterTvChannelLineupAttributeCallbackType)( + void *, chip::app::Clusters::TvChannel::Attributes::TvChannelLineup::TypeInfo::DecodableArgType); +typedef void (*CHIPTvChannelClusterCurrentTvChannelAttributeCallbackType)( + void *, chip::app::Clusters::TvChannel::Attributes::CurrentTvChannel::TypeInfo::DecodableArgType); +typedef void (*CHIPTvChannelClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::TvChannel::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPTargetNavigatorClusterNavigateTargetResponseCallbackType)( void *, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &); + +typedef void (*CHIPTargetNavigatorClusterTargetNavigatorListAttributeCallbackType)( + void *, const chip::app::Clusters::TargetNavigator::Attributes::TargetNavigatorList::TypeInfo::DecodableType &); +typedef void (*CHIPTargetNavigatorClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPTemperatureMeasurementClusterMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPTemperatureMeasurementClusterMinMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPTemperatureMeasurementClusterMaxMeasuredValueAttributeCallbackType)( + void *, chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo::DecodableArgType); +typedef void (*CHIPTemperatureMeasurementClusterToleranceAttributeCallbackType)( + void *, chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::TypeInfo::DecodableArgType); +typedef void (*CHIPTemperatureMeasurementClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo::DecodableArgType); typedef void (*CHIPTestClusterClusterBooleanResponseCallbackType)( void *, const chip::app::Clusters::TestCluster::Commands::BooleanResponse::DecodableType &); typedef void (*CHIPTestClusterClusterTestAddArgumentsResponseCallbackType)( @@ -174,3 +841,353 @@ typedef void (*CHIPTestClusterClusterTestNullableOptionalResponseCallbackType)( void *, const chip::app::Clusters::TestCluster::Commands::TestNullableOptionalResponse::DecodableType &); typedef void (*CHIPTestClusterClusterTestSpecificResponseCallbackType)( void *, const chip::app::Clusters::TestCluster::Commands::TestSpecificResponse::DecodableType &); + +typedef void (*CHIPTestClusterClusterBooleanAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterBitmap8AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterBitmap16AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterBitmap32AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterBitmap64AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt8uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt16uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt32uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt64uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt8sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt16sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt32sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterInt64sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterEnum8AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterEnum16AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterOctetStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterListInt8uAttributeCallbackType)( + void *, const chip::app::Clusters::TestCluster::Attributes::ListInt8u::TypeInfo::DecodableType &); +typedef void (*CHIPTestClusterClusterListOctetStringAttributeCallbackType)( + void *, const chip::app::Clusters::TestCluster::Attributes::ListOctetString::TypeInfo::DecodableType &); +typedef void (*CHIPTestClusterClusterListStructOctetStringAttributeCallbackType)( + void *, const chip::app::Clusters::TestCluster::Attributes::ListStructOctetString::TypeInfo::DecodableType &); +typedef void (*CHIPTestClusterClusterLongOctetStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterCharStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterLongCharStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterEpochUsAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterEpochSAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterVendorIdAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterListNullablesAndOptionalsStructAttributeCallbackType)( + void *, const chip::app::Clusters::TestCluster::Attributes::ListNullablesAndOptionalsStruct::TypeInfo::DecodableType &); +typedef void (*CHIPTestClusterClusterUnsupportedAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableBooleanAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableBitmap8AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableBitmap16AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableBitmap32AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableBitmap64AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt8uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt16uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt32uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt64uAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt8sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt16sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt32sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableInt64sAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableEnum8AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableEnum16AttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableOctetStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterNullableCharStringAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo::DecodableArgType); +typedef void (*CHIPTestClusterClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPThermostatClusterLocalTemperatureAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterAbsMinHeatSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterAbsMaxHeatSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterAbsMinCoolSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterAbsMaxCoolSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupiedCoolingSetpointAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterOccupiedHeatingSetpointAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterMinHeatSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterMaxHeatSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterMinCoolSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterMaxCoolSetpointLimitAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterMinSetpointDeadBandAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterControlSequenceOfOperationAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterSystemModeAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterStartOfWeekAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::StartOfWeek::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterNumberOfWeeklyTransitionsAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterNumberOfDailyTransitionsAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::Thermostat::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPThermostatUserInterfaceConfigurationClusterTemperatureDisplayModeAttributeCallbackType)( + void *, + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatUserInterfaceConfigurationClusterKeypadLockoutAttributeCallbackType)( + void *, chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo::DecodableArgType); +typedef void (*CHIPThermostatUserInterfaceConfigurationClusterScheduleProgrammingVisibilityAttributeCallbackType)( + void *, + chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo:: + DecodableArgType); +typedef void (*CHIPThermostatUserInterfaceConfigurationClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPThreadNetworkDiagnosticsClusterChannelAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRoutingRoleAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterNetworkNameAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterPanIdAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterExtendedPanIdAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterMeshLocalPrefixAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterOverrunCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterNeighborTableListAttributeCallbackType)( + void *, const chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NeighborTableList::TypeInfo::DecodableType &); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRouteTableListAttributeCallbackType)( + void *, const chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouteTableList::TypeInfo::DecodableType &); +typedef void (*CHIPThreadNetworkDiagnosticsClusterPartitionIdAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterWeightingAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterDataVersionAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterStableDataVersionAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterLeaderRouterIdAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterDetachedRoleCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterChildRoleCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRouterRoleCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterLeaderRoleCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterAttachAttemptCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterPartitionIdChangeCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterBetterPartitionAttachAttemptCountAttributeCallbackType)( + void *, + chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterParentChangeCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxTotalCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxUnicastCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxBroadcastCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxAckRequestedCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxAckedCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxNoAckRequestedCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxDataCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxDataPollCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxBeaconCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxBeaconRequestCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxOtherCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxRetryCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxDirectMaxRetryExpiryCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxIndirectMaxRetryExpiryCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxErrCcaCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxErrAbortCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterTxErrBusyChannelCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxTotalCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxUnicastCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxBroadcastCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxDataCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxDataPollCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxBeaconCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxBeaconRequestCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxOtherCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxAddressFilteredCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxDestAddrFilteredCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxDuplicatedCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrNoFrameCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrUnknownNeighborCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrInvalidSrcAddrCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrSecCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrFcsCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterRxErrOtherCountAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterActiveTimestampAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterPendingTimestampAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterDelayAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterSecurityPolicyAttributeCallbackType)( + void *, const chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::TypeInfo::DecodableType &); +typedef void (*CHIPThreadNetworkDiagnosticsClusterChannelMaskAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelMask::TypeInfo::DecodableArgType); +typedef void (*CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponentsAttributeCallbackType)( + void *, + const chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::TypeInfo::DecodableType &); +typedef void (*CHIPThreadNetworkDiagnosticsClusterActiveNetworkFaultsListAttributeCallbackType)( + void *, const chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo::DecodableType &); +typedef void (*CHIPThreadNetworkDiagnosticsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPWakeOnLanClusterWakeOnLanMacAddressAttributeCallbackType)( + void *, chip::app::Clusters::WakeOnLan::Attributes::WakeOnLanMacAddress::TypeInfo::DecodableArgType); +typedef void (*CHIPWakeOnLanClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPWiFiNetworkDiagnosticsClusterBssidAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterSecurityTypeAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::SecurityType::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterWiFiVersionAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::WiFiVersion::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterChannelNumberAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterRssiAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterBeaconLostCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterBeaconRxCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterPacketMulticastRxCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterPacketMulticastTxCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterPacketUnicastRxCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterPacketUnicastTxCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterCurrentMaxRateAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterOverrunCountAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPWiFiNetworkDiagnosticsClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo::DecodableArgType); + +typedef void (*CHIPWindowCoveringClusterTypeAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::Type::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionLiftAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionTiltAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterConfigStatusAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::ConfigStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionLiftPercentageAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionTiltPercentageAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterOperationalStatusAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::OperationalStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterTargetPositionLiftPercent100thsAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterTargetPositionTiltPercent100thsAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterEndProductTypeAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::EndProductType::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionLiftPercent100thsAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterCurrentPositionTiltPercent100thsAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterInstalledOpenLimitLiftAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterInstalledClosedLimitLiftAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterInstalledOpenLimitTiltAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterInstalledClosedLimitTiltAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterModeAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterSafetyStatusAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::SafetyStatus::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterFeatureMapAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::FeatureMap::TypeInfo::DecodableArgType); +typedef void (*CHIPWindowCoveringClusterClusterRevisionAttributeCallbackType)( + void *, chip::app::Clusters::WindowCovering::Attributes::ClusterRevision::TypeInfo::DecodableArgType); diff --git a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp index 1d19ad87a1e309..e39fe408957816 100644 --- a/src/controller/java/zap-generated/CHIPClusters-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClusters-JNI.cpp @@ -1953,6 +1953,11 @@ JNI_METHOD(void, BasicCluster, writeNodeLabelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -1971,9 +1976,9 @@ JNI_METHOD(void, BasicCluster, writeNodeLabelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttributeNodeLabel(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -2040,6 +2045,11 @@ JNI_METHOD(void, BasicCluster, writeLocationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::Location::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -2058,9 +2068,9 @@ JNI_METHOD(void, BasicCluster, writeLocationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttributeLocation(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -2610,9 +2620,14 @@ JNI_METHOD(void, BasicCluster, reportSerialNumberAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, BasicCluster, writeLocalConfigDisabledAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -2631,7 +2646,9 @@ JNI_METHOD(void, BasicCluster, writeLocalConfigDisabledAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeLocalConfigDisabled(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -2811,9 +2828,14 @@ JNI_METHOD(jlong, BinaryInputBasicCluster, initWithDevice)(JNIEnv * env, jobject } JNI_METHOD(void, BinaryInputBasicCluster, writeOutOfServiceAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -2832,7 +2854,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, writeOutOfServiceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOutOfService(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -2897,9 +2921,14 @@ JNI_METHOD(void, BinaryInputBasicCluster, reportOutOfServiceAttribute) } JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -2918,7 +2947,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, writePresentValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributePresentValue(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -5413,9 +5444,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorModeAttribute)(JNIEnv * env, jo } JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -5434,7 +5470,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorControlOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6532,9 +6570,14 @@ JNI_METHOD(void, ColorControlCluster, reportPrimary6IntensityAttribute) } JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6553,7 +6596,9 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6617,9 +6662,14 @@ JNI_METHOD(void, ColorControlCluster, reportWhitePointXAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6638,7 +6688,9 @@ JNI_METHOD(void, ColorControlCluster, writeWhitePointYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6702,9 +6754,14 @@ JNI_METHOD(void, ColorControlCluster, reportWhitePointYAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6723,7 +6780,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6787,9 +6846,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointRXAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6808,7 +6872,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6872,9 +6938,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointRYAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6893,7 +6964,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointRIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -6958,9 +7031,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointRIntensityAttribute) } JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -6979,7 +7057,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -7043,9 +7123,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointGXAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7064,7 +7149,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -7128,9 +7215,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointGYAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7149,7 +7241,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointGIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -7214,9 +7308,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointGIntensityAttribute) } JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7235,7 +7334,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBXAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -7299,9 +7400,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointBXAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7320,7 +7426,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBYAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -7384,9 +7492,14 @@ JNI_METHOD(void, ColorControlCluster, reportColorPointBYAttribute)(JNIEnv * env, } JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -7405,7 +7518,9 @@ JNI_METHOD(void, ColorControlCluster, writeColorPointBIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -8074,9 +8189,14 @@ JNI_METHOD(void, ColorControlCluster, reportCoupleColorTempToLevelMinMiredsAttri } JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -8095,8 +8215,9 @@ JNI_METHOD(void, ColorControlCluster, writeStartUpColorTemperatureMiredsAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -11410,9 +11531,14 @@ JNI_METHOD(void, GeneralCommissioningCluster, setRegulatoryConfig) } JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -11431,7 +11557,9 @@ JNI_METHOD(void, GeneralCommissioningCluster, writeBreadcrumbAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -12372,9 +12500,14 @@ JNI_METHOD(void, IdentifyCluster, triggerEffect) } JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -12393,7 +12526,9 @@ JNI_METHOD(void, IdentifyCluster, writeIdentifyTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -13725,9 +13860,14 @@ JNI_METHOD(void, LevelControlCluster, reportMaxFrequencyAttribute)(JNIEnv * env, } JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13746,7 +13886,9 @@ JNI_METHOD(void, LevelControlCluster, writeOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOptions(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -13810,9 +13952,14 @@ JNI_METHOD(void, LevelControlCluster, reportOptionsAttribute)(JNIEnv * env, jobj } JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13831,7 +13978,9 @@ JNI_METHOD(void, LevelControlCluster, writeOnOffTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOnOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -13896,9 +14045,14 @@ JNI_METHOD(void, LevelControlCluster, reportOnOffTransitionTimeAttribute) } JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -13917,7 +14071,9 @@ JNI_METHOD(void, LevelControlCluster, writeOnLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOnLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -13981,9 +14137,14 @@ JNI_METHOD(void, LevelControlCluster, reportOnLevelAttribute)(JNIEnv * env, jobj } JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14002,7 +14163,9 @@ JNI_METHOD(void, LevelControlCluster, writeOnTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOnTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -14067,9 +14230,14 @@ JNI_METHOD(void, LevelControlCluster, reportOnTransitionTimeAttribute) } JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14088,7 +14256,9 @@ JNI_METHOD(void, LevelControlCluster, writeOffTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -14153,9 +14323,14 @@ JNI_METHOD(void, LevelControlCluster, reportOffTransitionTimeAttribute) } JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14174,7 +14349,9 @@ JNI_METHOD(void, LevelControlCluster, writeDefaultMoveRateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeDefaultMoveRate(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -14239,9 +14416,14 @@ JNI_METHOD(void, LevelControlCluster, reportDefaultMoveRateAttribute) } JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -14260,7 +14442,9 @@ JNI_METHOD(void, LevelControlCluster, writeStartUpCurrentLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeStartUpCurrentLevel(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -15768,9 +15952,14 @@ JNI_METHOD(void, ModeSelectCluster, reportCurrentModeAttribute)(JNIEnv * env, jo } JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -15789,7 +15978,9 @@ JNI_METHOD(void, ModeSelectCluster, writeOnModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOnMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -16747,6 +16938,11 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, writeDefaultOtaProviderAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -16765,9 +16961,9 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, writeDefaultOtaProviderAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniByteArray jniArr(env, value); - err = cppCluster->WriteAttributeDefaultOtaProvider(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) jniArr.data(), jniArr.size())); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -17508,9 +17704,14 @@ JNI_METHOD(void, OnOffCluster, reportGlobalSceneControlAttribute)(JNIEnv * env, onReport.release(); } -JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -17529,7 +17730,9 @@ JNI_METHOD(void, OnOffCluster, writeOnTimeAttribute)(JNIEnv * env, jobject self, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOnTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -17593,9 +17796,14 @@ JNI_METHOD(void, OnOffCluster, reportOnTimeAttribute)(JNIEnv * env, jobject self } JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -17614,7 +17822,9 @@ JNI_METHOD(void, OnOffCluster, writeOffWaitTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOffWaitTime(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -17678,9 +17888,14 @@ JNI_METHOD(void, OnOffCluster, reportOffWaitTimeAttribute)(JNIEnv * env, jobject } JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -17699,7 +17914,9 @@ JNI_METHOD(void, OnOffCluster, writeStartUpOnOffAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeStartUpOnOff(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -17935,9 +18152,14 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, reportSwitchTypeAttribute) } JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -17956,7 +18178,9 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, writeSwitchActionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeSwitchActions(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -20517,9 +20741,14 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, reportLifetimeEnergyConsume } JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20538,7 +20767,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, writeOperationModeAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOperationMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -20603,9 +20834,14 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, reportOperationModeAttribut } JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -20624,7 +20860,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, writeControlModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeControlMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23426,9 +23664,14 @@ JNI_METHOD(void, TestClusterCluster, testUnknownCommand)(JNIEnv * env, jobject s } JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23447,7 +23690,9 @@ JNI_METHOD(void, TestClusterCluster, writeBooleanAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23511,9 +23756,14 @@ JNI_METHOD(void, TestClusterCluster, reportBooleanAttribute)(JNIEnv * env, jobje } JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23532,7 +23782,9 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23596,9 +23848,14 @@ JNI_METHOD(void, TestClusterCluster, reportBitmap8Attribute)(JNIEnv * env, jobje } JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23617,7 +23874,9 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23681,9 +23940,14 @@ JNI_METHOD(void, TestClusterCluster, reportBitmap16Attribute)(JNIEnv * env, jobj } JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23702,7 +23966,9 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap32Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23766,9 +24032,14 @@ JNI_METHOD(void, TestClusterCluster, reportBitmap32Attribute)(JNIEnv * env, jobj } JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23787,7 +24058,9 @@ JNI_METHOD(void, TestClusterCluster, writeBitmap64Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23851,9 +24124,14 @@ JNI_METHOD(void, TestClusterCluster, reportBitmap64Attribute)(JNIEnv * env, jobj } JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23872,7 +24150,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt8uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -23936,9 +24216,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt8uAttribute)(JNIEnv * env, jobject } JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -23957,7 +24242,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt16uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24021,9 +24308,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt16uAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24042,7 +24334,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt32uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24106,9 +24400,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt32uAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24127,7 +24426,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24191,9 +24492,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt64uAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24212,7 +24518,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24276,9 +24584,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt8sAttribute)(JNIEnv * env, jobject } JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24297,7 +24610,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24361,9 +24676,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt16sAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24382,7 +24702,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt32sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24446,9 +24768,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt32sAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24467,7 +24794,9 @@ JNI_METHOD(void, TestClusterCluster, writeInt64sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24531,9 +24860,14 @@ JNI_METHOD(void, TestClusterCluster, reportInt64sAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24552,7 +24886,9 @@ JNI_METHOD(void, TestClusterCluster, writeEnum8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24616,9 +24952,14 @@ JNI_METHOD(void, TestClusterCluster, reportEnum8Attribute)(JNIEnv * env, jobject } JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24637,7 +24978,9 @@ JNI_METHOD(void, TestClusterCluster, writeEnum16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24704,6 +25047,11 @@ JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24722,9 +25070,9 @@ JNI_METHOD(void, TestClusterCluster, writeOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniByteArray jniArr(env, value); - err = cppCluster->WriteAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) jniArr.data(), jniArr.size())); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24791,6 +25139,11 @@ JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24809,9 +25162,9 @@ JNI_METHOD(void, TestClusterCluster, writeLongOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniByteArray jniArr(env, value); - err = cppCluster->WriteAttributeLongOctetString(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) jniArr.data(), jniArr.size())); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24878,6 +25231,11 @@ JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24896,9 +25254,9 @@ JNI_METHOD(void, TestClusterCluster, writeCharStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttributeCharString(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -24965,6 +25323,11 @@ JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -24983,9 +25346,9 @@ JNI_METHOD(void, TestClusterCluster, writeLongCharStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttributeLongCharString(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25049,9 +25412,14 @@ JNI_METHOD(void, TestClusterCluster, reportLongCharStringAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25070,7 +25438,9 @@ JNI_METHOD(void, TestClusterCluster, writeEpochUsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25134,9 +25504,14 @@ JNI_METHOD(void, TestClusterCluster, reportEpochUsAttribute)(JNIEnv * env, jobje } JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().LongToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25155,7 +25530,9 @@ JNI_METHOD(void, TestClusterCluster, writeEpochSAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25219,9 +25596,14 @@ JNI_METHOD(void, TestClusterCluster, reportEpochSAttribute)(JNIEnv * env, jobjec } JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25240,7 +25622,9 @@ JNI_METHOD(void, TestClusterCluster, writeVendorIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25304,9 +25688,14 @@ JNI_METHOD(void, TestClusterCluster, reportVendorIdAttribute)(JNIEnv * env, jobj } JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25325,7 +25714,9 @@ JNI_METHOD(void, TestClusterCluster, writeUnsupportedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeUnsupported(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25389,9 +25780,19 @@ JNI_METHOD(void, TestClusterCluster, reportUnsupportedAttribute)(JNIEnv * env, j } JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jboolean value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + TypeInfo::Type cppValue; + + bool valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().BooleanToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25410,7 +25811,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBooleanAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25474,9 +25877,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBooleanAttribute)(JNIEnv * en } JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25495,7 +25908,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25559,9 +25974,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBitmap8Attribute)(JNIEnv * en } JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25580,7 +26005,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25645,9 +26072,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBitmap16Attribute) } JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25666,7 +26103,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap32Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25731,9 +26170,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBitmap32Attribute) } JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25752,7 +26201,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableBitmap64Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25817,9 +26268,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableBitmap64Attribute) } JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; + TypeInfo::Type cppValue; + + uint8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25838,7 +26299,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt8uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25902,9 +26365,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt8uAttribute)(JNIEnv * env, } JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + TypeInfo::Type cppValue; + + uint16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -25923,7 +26396,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt16uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -25987,9 +26462,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt16uAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + TypeInfo::Type cppValue; + + uint32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26008,7 +26493,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt32uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26072,9 +26559,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt32uAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + TypeInfo::Type cppValue; + + uint64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26093,7 +26590,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt64uAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26157,9 +26656,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt64uAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + TypeInfo::Type cppValue; + + int8_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26178,7 +26687,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt8sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26242,9 +26753,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt8sAttribute)(JNIEnv * env, } JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + TypeInfo::Type cppValue; + + int16_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().IntegerToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26263,7 +26784,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt16sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26327,9 +26850,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt16sAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + TypeInfo::Type cppValue; + + int32_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26348,7 +26881,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt32sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26412,9 +26947,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt32sAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jlong value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + TypeInfo::Type cppValue; + + int64_t valueValue; + if (value != nullptr) + { + valueValue = chip::JniReferences::GetInstance().LongToPrimitive(value); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26433,7 +26978,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableInt64sAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26497,9 +27044,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableInt64sAttribute)(JNIEnv * env } JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + TypeInfo::Type cppValue; + + decltype(cppValue) valueValue; + if (value != nullptr) + { + valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26518,7 +27075,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableEnum8Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26582,9 +27141,19 @@ JNI_METHOD(void, TestClusterCluster, reportNullableEnum8Attribute)(JNIEnv * env, } JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + TypeInfo::Type cppValue; + + decltype(cppValue) valueValue; + if (value != nullptr) + { + valueValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26603,7 +27172,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableEnum16Attribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26670,6 +27241,17 @@ JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jbyteArray value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + TypeInfo::Type cppValue; + + chip::ByteSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniByteArray(env, static_cast(value)).byteSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26688,9 +27270,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniByteArray jniArr(env, value); - err = cppCluster->WriteAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel(), - chip::ByteSpan((const uint8_t *) jniArr.data(), jniArr.size())); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -26758,6 +27340,17 @@ JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jstring value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + TypeInfo::Type cppValue; + + chip::CharSpan valueValue; + if (value != nullptr) + { + valueValue = chip::JniUtfString(env, static_cast(value)).charSpan(); + } + cppValue = value == nullptr ? chip::app::DataModel::Nullable() + : chip::app::DataModel::Nullable(valueValue); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -26776,9 +27369,9 @@ JNI_METHOD(void, TestClusterCluster, writeNullableCharStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - JniUtfString valueStr(env, value); - err = cppCluster->WriteAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel(), - chip::CharSpan(valueStr.c_str(), strlen(valueStr.c_str()))); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27375,9 +27968,14 @@ JNI_METHOD(void, ThermostatCluster, reportAbsMaxCoolSetpointLimitAttribute) } JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27396,7 +27994,9 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedCoolingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOccupiedCoolingSetpoint(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27461,9 +28061,14 @@ JNI_METHOD(void, ThermostatCluster, reportOccupiedCoolingSetpointAttribute) } JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27482,7 +28087,9 @@ JNI_METHOD(void, ThermostatCluster, writeOccupiedHeatingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeOccupiedHeatingSetpoint(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27547,9 +28154,14 @@ JNI_METHOD(void, ThermostatCluster, reportOccupiedHeatingSetpointAttribute) } JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27568,7 +28180,9 @@ JNI_METHOD(void, ThermostatCluster, writeMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMinHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27633,9 +28247,14 @@ JNI_METHOD(void, ThermostatCluster, reportMinHeatSetpointLimitAttribute) } JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27654,7 +28273,9 @@ JNI_METHOD(void, ThermostatCluster, writeMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMaxHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27719,9 +28340,14 @@ JNI_METHOD(void, ThermostatCluster, reportMaxHeatSetpointLimitAttribute) } JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27740,7 +28366,9 @@ JNI_METHOD(void, ThermostatCluster, writeMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMinCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27805,9 +28433,14 @@ JNI_METHOD(void, ThermostatCluster, reportMinCoolSetpointLimitAttribute) } JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27826,7 +28459,9 @@ JNI_METHOD(void, ThermostatCluster, writeMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMaxCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27891,9 +28526,14 @@ JNI_METHOD(void, ThermostatCluster, reportMaxCoolSetpointLimitAttribute) } JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27912,7 +28552,9 @@ JNI_METHOD(void, ThermostatCluster, writeMinSetpointDeadBandAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -27977,9 +28619,14 @@ JNI_METHOD(void, ThermostatCluster, reportMinSetpointDeadBandAttribute) } JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -27998,8 +28645,9 @@ JNI_METHOD(void, ThermostatCluster, writeControlSequenceOfOperationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = - cppCluster->WriteAttributeControlSequenceOfOperation(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -28064,9 +28712,14 @@ JNI_METHOD(void, ThermostatCluster, reportControlSequenceOfOperationAttribute) } JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -28085,7 +28738,9 @@ JNI_METHOD(void, ThermostatCluster, writeSystemModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeSystemMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -28430,9 +29085,14 @@ JNI_METHOD(jlong, ThermostatUserInterfaceConfigurationCluster, initWithDevice) } JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDisplayModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -28452,7 +29112,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeTemperatureDi chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeTemperatureDisplayMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -28519,9 +29181,14 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportTemperatureD } JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockoutAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -28541,7 +29208,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeKeypadLockout chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeKeypadLockout(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -28608,9 +29277,14 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, reportKeypadLockou } JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgrammingVisibilityAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -28630,8 +29304,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, writeScheduleProgr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeScheduleProgrammingVisibility(onSuccess->Cancel(), onFailure->Cancel(), - static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); @@ -34125,9 +34800,14 @@ JNI_METHOD(void, WindowCoveringCluster, reportInstalledClosedLimitTiltAttribute) } JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) -(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jint value) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo; + TypeInfo::Type cppValue; + + cppValue = static_cast(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, @@ -34146,7 +34826,9 @@ JNI_METHOD(void, WindowCoveringCluster, writeModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->WriteAttributeMode(onSuccess->Cancel(), onFailure->Cancel(), static_cast(value)); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); diff --git a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp index ba6a5424d61bdb..22229f0e59d875 100644 --- a/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersRead-JNI.cpp @@ -33,8 +33,9 @@ JNI_METHOD(void, AccountLoginCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AccountLogin::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -51,7 +52,10 @@ JNI_METHOD(void, AccountLoginCluster, readClusterRevisionAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -64,8 +68,9 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -83,7 +88,11 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -95,6 +104,7 @@ JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute JNI_METHOD(void, ApplicationBasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::VendorName::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -115,7 +125,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readVendorNameAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -127,8 +140,9 @@ JNI_METHOD(void, ApplicationBasicCluster, readVendorNameAttribute)(JNIEnv * env, JNI_METHOD(void, ApplicationBasicCluster, readVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::VendorId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -146,7 +160,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readVendorIdAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -159,6 +176,7 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationName::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -179,7 +197,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -191,8 +212,9 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationNameAttribute) JNI_METHOD(void, ApplicationBasicCluster, readProductIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ProductId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -210,7 +232,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readProductIdAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -223,6 +248,7 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationId::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -243,7 +269,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -256,8 +285,9 @@ JNI_METHOD(void, ApplicationBasicCluster, readCatalogVendorIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::CatalogVendorId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -275,7 +305,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readCatalogVendorIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -288,8 +321,9 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ApplicationStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -307,7 +341,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readApplicationStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeApplicationStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -320,8 +357,9 @@ JNI_METHOD(void, ApplicationBasicCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationBasic::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -339,7 +377,10 @@ JNI_METHOD(void, ApplicationBasicCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -352,9 +393,10 @@ JNI_METHOD(void, ApplicationLauncherCluster, readApplicationLauncherListAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationLauncherList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -373,7 +415,11 @@ JNI_METHOD(void, ApplicationLauncherCluster, readApplicationLauncherListAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeApplicationLauncherList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -386,8 +432,9 @@ JNI_METHOD(void, ApplicationLauncherCluster, readCatalogVendorIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationLauncher::Attributes::CatalogVendorId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -405,7 +452,10 @@ JNI_METHOD(void, ApplicationLauncherCluster, readCatalogVendorIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -418,8 +468,9 @@ JNI_METHOD(void, ApplicationLauncherCluster, readApplicationIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationLauncher::Attributes::ApplicationId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -437,7 +488,10 @@ JNI_METHOD(void, ApplicationLauncherCluster, readApplicationIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -450,8 +504,9 @@ JNI_METHOD(void, ApplicationLauncherCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ApplicationLauncher::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -469,7 +524,10 @@ JNI_METHOD(void, ApplicationLauncherCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -481,8 +539,9 @@ JNI_METHOD(void, ApplicationLauncherCluster, readClusterRevisionAttribute) JNI_METHOD(void, AudioOutputCluster, readAudioOutputListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AudioOutput::Attributes::AudioOutputList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -500,7 +559,10 @@ JNI_METHOD(void, AudioOutputCluster, readAudioOutputListAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAudioOutputList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -513,8 +575,9 @@ JNI_METHOD(void, AudioOutputCluster, readCurrentAudioOutputAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AudioOutput::Attributes::CurrentAudioOutput::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -531,7 +594,10 @@ JNI_METHOD(void, AudioOutputCluster, readCurrentAudioOutputAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentAudioOutput(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -543,8 +609,9 @@ JNI_METHOD(void, AudioOutputCluster, readCurrentAudioOutputAttribute) JNI_METHOD(void, AudioOutputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::AudioOutput::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -561,7 +628,10 @@ JNI_METHOD(void, AudioOutputCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -574,8 +644,9 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierMovingStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -592,7 +663,10 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierMovingStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -605,8 +679,9 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierSafetyStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -623,7 +698,10 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierSafetyStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -636,8 +714,9 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierCapabilitiesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -654,7 +733,10 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierCapabilitiesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -667,8 +749,9 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierPositionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -685,7 +768,10 @@ JNI_METHOD(void, BarrierControlCluster, readBarrierPositionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -698,8 +784,9 @@ JNI_METHOD(void, BarrierControlCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -716,7 +803,10 @@ JNI_METHOD(void, BarrierControlCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -728,8 +818,9 @@ JNI_METHOD(void, BarrierControlCluster, readClusterRevisionAttribute) JNI_METHOD(void, BasicCluster, readInteractionModelVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::InteractionModelVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -746,7 +837,10 @@ JNI_METHOD(void, BasicCluster, readInteractionModelVersionAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -758,6 +852,7 @@ JNI_METHOD(void, BasicCluster, readInteractionModelVersionAttribute)(JNIEnv * en JNI_METHOD(void, BasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::VendorName::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -777,7 +872,9 @@ JNI_METHOD(void, BasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject se chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -789,8 +886,9 @@ JNI_METHOD(void, BasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject se JNI_METHOD(void, BasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::VendorID::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -807,7 +905,9 @@ JNI_METHOD(void, BasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -819,6 +919,7 @@ JNI_METHOD(void, BasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self JNI_METHOD(void, BasicCluster, readProductNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductName::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -838,7 +939,10 @@ JNI_METHOD(void, BasicCluster, readProductNameAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -850,8 +954,9 @@ JNI_METHOD(void, BasicCluster, readProductNameAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, BasicCluster, readProductIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductID::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -868,7 +973,9 @@ JNI_METHOD(void, BasicCluster, readProductIDAttribute)(JNIEnv * env, jobject sel chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -880,6 +987,7 @@ JNI_METHOD(void, BasicCluster, readProductIDAttribute)(JNIEnv * env, jobject sel JNI_METHOD(void, BasicCluster, readNodeLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::NodeLabel::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -899,7 +1007,9 @@ JNI_METHOD(void, BasicCluster, readNodeLabelAttribute)(JNIEnv * env, jobject sel chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNodeLabel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -911,6 +1021,7 @@ JNI_METHOD(void, BasicCluster, readNodeLabelAttribute)(JNIEnv * env, jobject sel JNI_METHOD(void, BasicCluster, readLocationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::Location::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -930,7 +1041,9 @@ JNI_METHOD(void, BasicCluster, readLocationAttribute)(JNIEnv * env, jobject self chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -942,8 +1055,9 @@ JNI_METHOD(void, BasicCluster, readLocationAttribute)(JNIEnv * env, jobject self JNI_METHOD(void, BasicCluster, readHardwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::HardwareVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -960,7 +1074,10 @@ JNI_METHOD(void, BasicCluster, readHardwareVersionAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -972,6 +1089,7 @@ JNI_METHOD(void, BasicCluster, readHardwareVersionAttribute)(JNIEnv * env, jobje JNI_METHOD(void, BasicCluster, readHardwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::HardwareVersionString::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -991,7 +1109,10 @@ JNI_METHOD(void, BasicCluster, readHardwareVersionStringAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1003,8 +1124,9 @@ JNI_METHOD(void, BasicCluster, readHardwareVersionStringAttribute)(JNIEnv * env, JNI_METHOD(void, BasicCluster, readSoftwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::SoftwareVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1021,7 +1143,10 @@ JNI_METHOD(void, BasicCluster, readSoftwareVersionAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1033,6 +1158,7 @@ JNI_METHOD(void, BasicCluster, readSoftwareVersionAttribute)(JNIEnv * env, jobje JNI_METHOD(void, BasicCluster, readSoftwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::SoftwareVersionString::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1052,7 +1178,10 @@ JNI_METHOD(void, BasicCluster, readSoftwareVersionStringAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1064,6 +1193,7 @@ JNI_METHOD(void, BasicCluster, readSoftwareVersionStringAttribute)(JNIEnv * env, JNI_METHOD(void, BasicCluster, readManufacturingDateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ManufacturingDate::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1083,7 +1213,10 @@ JNI_METHOD(void, BasicCluster, readManufacturingDateAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeManufacturingDate(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1095,6 +1228,7 @@ JNI_METHOD(void, BasicCluster, readManufacturingDateAttribute)(JNIEnv * env, job JNI_METHOD(void, BasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::PartNumber::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1114,7 +1248,9 @@ JNI_METHOD(void, BasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject se chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePartNumber(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1126,6 +1262,7 @@ JNI_METHOD(void, BasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject se JNI_METHOD(void, BasicCluster, readProductURLAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductURL::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1145,7 +1282,9 @@ JNI_METHOD(void, BasicCluster, readProductURLAttribute)(JNIEnv * env, jobject se chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeProductURL(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1157,6 +1296,7 @@ JNI_METHOD(void, BasicCluster, readProductURLAttribute)(JNIEnv * env, jobject se JNI_METHOD(void, BasicCluster, readProductLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ProductLabel::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1176,7 +1316,10 @@ JNI_METHOD(void, BasicCluster, readProductLabelAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeProductLabel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1188,6 +1331,7 @@ JNI_METHOD(void, BasicCluster, readProductLabelAttribute)(JNIEnv * env, jobject JNI_METHOD(void, BasicCluster, readSerialNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::SerialNumber::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1207,7 +1351,10 @@ JNI_METHOD(void, BasicCluster, readSerialNumberAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSerialNumber(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1219,8 +1366,9 @@ JNI_METHOD(void, BasicCluster, readSerialNumberAttribute)(JNIEnv * env, jobject JNI_METHOD(void, BasicCluster, readLocalConfigDisabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::LocalConfigDisabled::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1237,7 +1385,10 @@ JNI_METHOD(void, BasicCluster, readLocalConfigDisabledAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLocalConfigDisabled(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1249,8 +1400,9 @@ JNI_METHOD(void, BasicCluster, readLocalConfigDisabledAttribute)(JNIEnv * env, j JNI_METHOD(void, BasicCluster, readReachableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::Reachable::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1267,7 +1419,9 @@ JNI_METHOD(void, BasicCluster, readReachableAttribute)(JNIEnv * env, jobject sel chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeReachable(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1279,6 +1433,7 @@ JNI_METHOD(void, BasicCluster, readReachableAttribute)(JNIEnv * env, jobject sel JNI_METHOD(void, BasicCluster, readUniqueIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::UniqueID::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1298,7 +1453,9 @@ JNI_METHOD(void, BasicCluster, readUniqueIDAttribute)(JNIEnv * env, jobject self chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeUniqueID(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1310,8 +1467,9 @@ JNI_METHOD(void, BasicCluster, readUniqueIDAttribute)(JNIEnv * env, jobject self JNI_METHOD(void, BasicCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Basic::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1328,7 +1486,10 @@ JNI_METHOD(void, BasicCluster, readClusterRevisionAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1340,8 +1501,9 @@ JNI_METHOD(void, BasicCluster, readClusterRevisionAttribute)(JNIEnv * env, jobje JNI_METHOD(void, BinaryInputBasicCluster, readOutOfServiceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1359,7 +1521,10 @@ JNI_METHOD(void, BinaryInputBasicCluster, readOutOfServiceAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOutOfService(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1371,8 +1536,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, readOutOfServiceAttribute)(JNIEnv * en JNI_METHOD(void, BinaryInputBasicCluster, readPresentValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1390,7 +1556,10 @@ JNI_METHOD(void, BinaryInputBasicCluster, readPresentValueAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePresentValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1402,8 +1571,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, readPresentValueAttribute)(JNIEnv * en JNI_METHOD(void, BinaryInputBasicCluster, readStatusFlagsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1421,7 +1591,10 @@ JNI_METHOD(void, BinaryInputBasicCluster, readStatusFlagsAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStatusFlags(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1434,8 +1607,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1453,7 +1627,10 @@ JNI_METHOD(void, BinaryInputBasicCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1465,8 +1642,9 @@ JNI_METHOD(void, BinaryInputBasicCluster, readClusterRevisionAttribute) JNI_METHOD(void, BindingCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Binding::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1483,7 +1661,10 @@ JNI_METHOD(void, BindingCluster, readClusterRevisionAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1495,8 +1676,9 @@ JNI_METHOD(void, BindingCluster, readClusterRevisionAttribute)(JNIEnv * env, job JNI_METHOD(void, BooleanStateCluster, readStateValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BooleanState::Attributes::StateValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1513,7 +1695,10 @@ JNI_METHOD(void, BooleanStateCluster, readStateValueAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStateValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1525,8 +1710,9 @@ JNI_METHOD(void, BooleanStateCluster, readStateValueAttribute)(JNIEnv * env, job JNI_METHOD(void, BooleanStateCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BooleanState::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1543,7 +1729,10 @@ JNI_METHOD(void, BooleanStateCluster, readClusterRevisionAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1555,8 +1744,9 @@ JNI_METHOD(void, BooleanStateCluster, readClusterRevisionAttribute)(JNIEnv * env JNI_METHOD(void, BridgedActionsCluster, readActionListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::ActionList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -1574,7 +1764,10 @@ JNI_METHOD(void, BridgedActionsCluster, readActionListAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActionList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1586,8 +1779,9 @@ JNI_METHOD(void, BridgedActionsCluster, readActionListAttribute)(JNIEnv * env, j JNI_METHOD(void, BridgedActionsCluster, readEndpointListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::EndpointList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -1605,7 +1799,10 @@ JNI_METHOD(void, BridgedActionsCluster, readEndpointListAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEndpointList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1617,6 +1814,7 @@ JNI_METHOD(void, BridgedActionsCluster, readEndpointListAttribute)(JNIEnv * env, JNI_METHOD(void, BridgedActionsCluster, readSetupUrlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::SetupUrl::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1636,7 +1834,10 @@ JNI_METHOD(void, BridgedActionsCluster, readSetupUrlAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSetupUrl(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1649,8 +1850,9 @@ JNI_METHOD(void, BridgedActionsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BridgedActions::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1667,7 +1869,10 @@ JNI_METHOD(void, BridgedActionsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1680,8 +1885,9 @@ JNI_METHOD(void, BridgedDeviceBasicInformationCluster, readClusterRevisionAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1699,7 +1905,11 @@ JNI_METHOD(void, BridgedDeviceBasicInformationCluster, readClusterRevisionAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1711,8 +1921,9 @@ JNI_METHOD(void, BridgedDeviceBasicInformationCluster, readClusterRevisionAttrib JNI_METHOD(void, ColorControlCluster, readCurrentHueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentHue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1729,7 +1940,10 @@ JNI_METHOD(void, ColorControlCluster, readCurrentHueAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1742,8 +1956,9 @@ JNI_METHOD(void, ColorControlCluster, readCurrentSaturationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentSaturation::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1760,7 +1975,10 @@ JNI_METHOD(void, ColorControlCluster, readCurrentSaturationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1772,8 +1990,9 @@ JNI_METHOD(void, ColorControlCluster, readCurrentSaturationAttribute) JNI_METHOD(void, ColorControlCluster, readRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::RemainingTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1790,7 +2009,10 @@ JNI_METHOD(void, ColorControlCluster, readRemainingTimeAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1802,8 +2024,9 @@ JNI_METHOD(void, ColorControlCluster, readRemainingTimeAttribute)(JNIEnv * env, JNI_METHOD(void, ColorControlCluster, readCurrentXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentX::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1820,7 +2043,10 @@ JNI_METHOD(void, ColorControlCluster, readCurrentXAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1832,8 +2058,9 @@ JNI_METHOD(void, ColorControlCluster, readCurrentXAttribute)(JNIEnv * env, jobje JNI_METHOD(void, ColorControlCluster, readCurrentYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CurrentY::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1850,7 +2077,10 @@ JNI_METHOD(void, ColorControlCluster, readCurrentYAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1863,8 +2093,9 @@ JNI_METHOD(void, ColorControlCluster, readDriftCompensationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::DriftCompensation::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1881,7 +2112,10 @@ JNI_METHOD(void, ColorControlCluster, readDriftCompensationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1893,6 +2127,7 @@ JNI_METHOD(void, ColorControlCluster, readDriftCompensationAttribute) JNI_METHOD(void, ColorControlCluster, readCompensationTextAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CompensationText::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -1912,7 +2147,10 @@ JNI_METHOD(void, ColorControlCluster, readCompensationTextAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1924,8 +2162,9 @@ JNI_METHOD(void, ColorControlCluster, readCompensationTextAttribute)(JNIEnv * en JNI_METHOD(void, ColorControlCluster, readColorTemperatureAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTemperature::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1942,7 +2181,10 @@ JNI_METHOD(void, ColorControlCluster, readColorTemperatureAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1954,8 +2196,9 @@ JNI_METHOD(void, ColorControlCluster, readColorTemperatureAttribute)(JNIEnv * en JNI_METHOD(void, ColorControlCluster, readColorModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -1972,7 +2215,10 @@ JNI_METHOD(void, ColorControlCluster, readColorModeAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -1985,8 +2231,9 @@ JNI_METHOD(void, ColorControlCluster, readColorControlOptionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorControlOptions::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2003,7 +2250,10 @@ JNI_METHOD(void, ColorControlCluster, readColorControlOptionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2016,8 +2266,9 @@ JNI_METHOD(void, ColorControlCluster, readNumberOfPrimariesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::NumberOfPrimaries::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2034,7 +2285,10 @@ JNI_METHOD(void, ColorControlCluster, readNumberOfPrimariesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2046,8 +2300,9 @@ JNI_METHOD(void, ColorControlCluster, readNumberOfPrimariesAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary1XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2064,7 +2319,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2076,8 +2334,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary1YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2094,7 +2353,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2107,8 +2369,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary1Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2125,7 +2388,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2137,8 +2403,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary1IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary2XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2155,7 +2422,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2167,8 +2437,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary2YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2185,7 +2456,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2198,8 +2472,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary2Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2216,7 +2491,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2228,8 +2506,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary2IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary3XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2246,7 +2525,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2258,8 +2540,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary3YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2276,7 +2559,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2289,8 +2575,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary3Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2307,7 +2594,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2319,8 +2609,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary3IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary4XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2337,7 +2628,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2349,8 +2643,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary4YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2367,7 +2662,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2380,8 +2678,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary4Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2398,7 +2697,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2410,8 +2712,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary4IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary5XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2428,7 +2731,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2440,8 +2746,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary5YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2458,7 +2765,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2471,8 +2781,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary5Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2489,7 +2800,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2501,8 +2815,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary5IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readPrimary6XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6X::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2519,7 +2834,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6XAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2531,8 +2849,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6XAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ColorControlCluster, readPrimary6YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6Y::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2549,7 +2868,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6YAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2562,8 +2884,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6IntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::Primary6Intensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2580,7 +2903,10 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6IntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2592,8 +2918,9 @@ JNI_METHOD(void, ColorControlCluster, readPrimary6IntensityAttribute) JNI_METHOD(void, ColorControlCluster, readWhitePointXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointX::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2610,7 +2937,10 @@ JNI_METHOD(void, ColorControlCluster, readWhitePointXAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2622,8 +2952,9 @@ JNI_METHOD(void, ColorControlCluster, readWhitePointXAttribute)(JNIEnv * env, jo JNI_METHOD(void, ColorControlCluster, readWhitePointYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::WhitePointY::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2640,7 +2971,10 @@ JNI_METHOD(void, ColorControlCluster, readWhitePointYAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2652,8 +2986,9 @@ JNI_METHOD(void, ColorControlCluster, readWhitePointYAttribute)(JNIEnv * env, jo JNI_METHOD(void, ColorControlCluster, readColorPointRXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRX::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2670,7 +3005,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRXAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2682,8 +3020,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRXAttribute)(JNIEnv * env, j JNI_METHOD(void, ColorControlCluster, readColorPointRYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRY::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2700,7 +3039,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRYAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2713,8 +3055,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRIntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointRIntensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2731,7 +3074,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2743,8 +3089,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointRIntensityAttribute) JNI_METHOD(void, ColorControlCluster, readColorPointGXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGX::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2761,7 +3108,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGXAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2773,8 +3123,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGXAttribute)(JNIEnv * env, j JNI_METHOD(void, ColorControlCluster, readColorPointGYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGY::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2791,7 +3142,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGYAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2804,8 +3158,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGIntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointGIntensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2822,7 +3177,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2834,8 +3192,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointGIntensityAttribute) JNI_METHOD(void, ColorControlCluster, readColorPointBXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBX::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2852,7 +3211,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointBXAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2864,8 +3226,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointBXAttribute)(JNIEnv * env, j JNI_METHOD(void, ColorControlCluster, readColorPointBYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBY::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2882,7 +3245,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointBYAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2895,8 +3261,9 @@ JNI_METHOD(void, ColorControlCluster, readColorPointBIntensityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorPointBIntensity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2913,7 +3280,10 @@ JNI_METHOD(void, ColorControlCluster, readColorPointBIntensityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2926,8 +3296,9 @@ JNI_METHOD(void, ColorControlCluster, readEnhancedCurrentHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2944,7 +3315,10 @@ JNI_METHOD(void, ColorControlCluster, readEnhancedCurrentHueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2957,8 +3331,9 @@ JNI_METHOD(void, ColorControlCluster, readEnhancedColorModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::EnhancedColorMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -2975,7 +3350,10 @@ JNI_METHOD(void, ColorControlCluster, readEnhancedColorModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -2987,8 +3365,9 @@ JNI_METHOD(void, ColorControlCluster, readEnhancedColorModeAttribute) JNI_METHOD(void, ColorControlCluster, readColorLoopActiveAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopActive::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3005,7 +3384,10 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopActiveAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3018,8 +3400,9 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopDirectionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopDirection::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3036,7 +3419,10 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopDirectionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3048,8 +3434,9 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopDirectionAttribute) JNI_METHOD(void, ColorControlCluster, readColorLoopTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3066,7 +3453,10 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopTimeAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3079,8 +3469,9 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopStartEnhancedHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3097,7 +3488,11 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopStartEnhancedHueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorLoopStartEnhancedHue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3110,8 +3505,9 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopStoredEnhancedHueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3128,7 +3524,11 @@ JNI_METHOD(void, ColorControlCluster, readColorLoopStoredEnhancedHueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorLoopStoredEnhancedHue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3141,8 +3541,9 @@ JNI_METHOD(void, ColorControlCluster, readColorCapabilitiesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorCapabilities::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3159,7 +3560,10 @@ JNI_METHOD(void, ColorControlCluster, readColorCapabilitiesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3172,8 +3576,9 @@ JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMin::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3190,7 +3595,10 @@ JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3203,8 +3611,9 @@ JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ColorTempPhysicalMax::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3221,7 +3630,10 @@ JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3234,8 +3646,9 @@ JNI_METHOD(void, ColorControlCluster, readCoupleColorTempToLevelMinMiredsAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3252,7 +3665,11 @@ JNI_METHOD(void, ColorControlCluster, readCoupleColorTempToLevelMinMiredsAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3265,8 +3682,9 @@ JNI_METHOD(void, ColorControlCluster, readStartUpColorTemperatureMiredsAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3283,7 +3701,11 @@ JNI_METHOD(void, ColorControlCluster, readStartUpColorTemperatureMiredsAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3295,8 +3717,9 @@ JNI_METHOD(void, ColorControlCluster, readStartUpColorTemperatureMiredsAttribute JNI_METHOD(void, ColorControlCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ColorControl::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3313,7 +3736,10 @@ JNI_METHOD(void, ColorControlCluster, readClusterRevisionAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3326,9 +3752,10 @@ JNI_METHOD(void, ContentLauncherCluster, readAcceptsHeaderListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::AcceptsHeaderList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3347,7 +3774,10 @@ JNI_METHOD(void, ContentLauncherCluster, readAcceptsHeaderListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAcceptsHeaderList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3360,9 +3790,10 @@ JNI_METHOD(void, ContentLauncherCluster, readSupportedStreamingTypesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::SupportedStreamingTypes::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3381,7 +3812,11 @@ JNI_METHOD(void, ContentLauncherCluster, readSupportedStreamingTypesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSupportedStreamingTypes(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3394,8 +3829,9 @@ JNI_METHOD(void, ContentLauncherCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ContentLauncher::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3413,7 +3849,10 @@ JNI_METHOD(void, ContentLauncherCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3425,8 +3864,9 @@ JNI_METHOD(void, ContentLauncherCluster, readClusterRevisionAttribute) JNI_METHOD(void, DescriptorCluster, readDeviceListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::DeviceList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3444,7 +3884,10 @@ JNI_METHOD(void, DescriptorCluster, readDeviceListAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDeviceList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3456,8 +3899,9 @@ JNI_METHOD(void, DescriptorCluster, readDeviceListAttribute)(JNIEnv * env, jobje JNI_METHOD(void, DescriptorCluster, readServerListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ServerList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3475,7 +3919,10 @@ JNI_METHOD(void, DescriptorCluster, readServerListAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeServerList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3487,8 +3934,9 @@ JNI_METHOD(void, DescriptorCluster, readServerListAttribute)(JNIEnv * env, jobje JNI_METHOD(void, DescriptorCluster, readClientListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ClientList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3506,7 +3954,10 @@ JNI_METHOD(void, DescriptorCluster, readClientListAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClientList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3518,8 +3969,9 @@ JNI_METHOD(void, DescriptorCluster, readClientListAttribute)(JNIEnv * env, jobje JNI_METHOD(void, DescriptorCluster, readPartsListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::PartsList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -3537,7 +3989,10 @@ JNI_METHOD(void, DescriptorCluster, readPartsListAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePartsList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3549,8 +4004,9 @@ JNI_METHOD(void, DescriptorCluster, readPartsListAttribute)(JNIEnv * env, jobjec JNI_METHOD(void, DescriptorCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Descriptor::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3567,7 +4023,10 @@ JNI_METHOD(void, DescriptorCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3579,8 +4038,9 @@ JNI_METHOD(void, DescriptorCluster, readClusterRevisionAttribute)(JNIEnv * env, JNI_METHOD(void, DoorLockCluster, readLockStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockState::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3597,7 +4057,10 @@ JNI_METHOD(void, DoorLockCluster, readLockStateAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3609,8 +4072,9 @@ JNI_METHOD(void, DoorLockCluster, readLockStateAttribute)(JNIEnv * env, jobject JNI_METHOD(void, DoorLockCluster, readLockTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::LockType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3627,7 +4091,10 @@ JNI_METHOD(void, DoorLockCluster, readLockTypeAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3639,8 +4106,9 @@ JNI_METHOD(void, DoorLockCluster, readLockTypeAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, DoorLockCluster, readActuatorEnabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ActuatorEnabled::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3657,7 +4125,10 @@ JNI_METHOD(void, DoorLockCluster, readActuatorEnabledAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3669,8 +4140,9 @@ JNI_METHOD(void, DoorLockCluster, readActuatorEnabledAttribute)(JNIEnv * env, jo JNI_METHOD(void, DoorLockCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::DoorLock::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3687,7 +4159,10 @@ JNI_METHOD(void, DoorLockCluster, readClusterRevisionAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3700,8 +4175,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readMeasurementTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3719,7 +4195,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readMeasurementTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasurementType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3732,8 +4211,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readTotalActivePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3751,7 +4231,11 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readTotalActivePowerAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTotalActivePower(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3764,8 +4248,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3783,7 +4268,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsVoltage(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3796,8 +4284,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3815,7 +4304,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsVoltageMin(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3828,8 +4320,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3847,7 +4340,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsVoltageMax(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3860,8 +4356,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3879,7 +4376,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsCurrent(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3892,8 +4392,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3911,7 +4412,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsCurrentMin(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3924,8 +4428,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3943,7 +4448,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRmsCurrentMax(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3956,8 +4464,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -3975,7 +4484,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActivePower(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -3988,8 +4500,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMinAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4007,7 +4520,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMinAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActivePowerMin(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4020,8 +4536,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMaxAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4039,7 +4556,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMaxAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActivePowerMax(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4052,8 +4572,9 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4071,7 +4592,10 @@ JNI_METHOD(void, ElectricalMeasurementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4084,8 +4608,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPHYRateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PHYRate::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4103,7 +4628,10 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPHYRateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePHYRate(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4116,8 +4644,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readFullDuplexAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4135,7 +4664,10 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readFullDuplexAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFullDuplex(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4148,8 +4680,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketRxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4167,7 +4700,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketRxCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketRxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4180,8 +4717,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketTxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4199,7 +4737,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketTxCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketTxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4212,8 +4754,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTxErrCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4231,7 +4774,10 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTxErrCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxErrCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4244,8 +4790,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCollisionCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4263,7 +4810,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCollisionCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCollisionCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4276,8 +4827,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readOverrunCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4295,7 +4847,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readOverrunCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4308,8 +4864,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCarrierDetectAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4327,7 +4884,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCarrierDetectAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCarrierDetect(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4340,8 +4901,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTimeSinceResetAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4359,7 +4921,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTimeSinceResetAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTimeSinceReset(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4372,8 +4938,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4391,7 +4958,10 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4404,8 +4974,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readClusterRevisionAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4423,7 +4994,11 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readClusterRevisionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4435,8 +5010,9 @@ JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readClusterRevisionAttribute JNI_METHOD(void, FixedLabelCluster, readLabelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FixedLabel::Attributes::LabelList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -4454,7 +5030,10 @@ JNI_METHOD(void, FixedLabelCluster, readLabelListAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLabelList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4466,8 +5045,9 @@ JNI_METHOD(void, FixedLabelCluster, readLabelListAttribute)(JNIEnv * env, jobjec JNI_METHOD(void, FixedLabelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FixedLabel::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4484,7 +5064,10 @@ JNI_METHOD(void, FixedLabelCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4496,8 +5079,9 @@ JNI_METHOD(void, FixedLabelCluster, readClusterRevisionAttribute)(JNIEnv * env, JNI_METHOD(void, FlowMeasurementCluster, readMeasuredValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4515,7 +5099,10 @@ JNI_METHOD(void, FlowMeasurementCluster, readMeasuredValueAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4528,8 +5115,9 @@ JNI_METHOD(void, FlowMeasurementCluster, readMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4547,7 +5135,10 @@ JNI_METHOD(void, FlowMeasurementCluster, readMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4560,8 +5151,9 @@ JNI_METHOD(void, FlowMeasurementCluster, readMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4579,7 +5171,10 @@ JNI_METHOD(void, FlowMeasurementCluster, readMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4591,8 +5186,9 @@ JNI_METHOD(void, FlowMeasurementCluster, readMaxMeasuredValueAttribute) JNI_METHOD(void, FlowMeasurementCluster, readToleranceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::Tolerance::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4610,7 +5206,10 @@ JNI_METHOD(void, FlowMeasurementCluster, readToleranceAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4623,8 +5222,9 @@ JNI_METHOD(void, FlowMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::FlowMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4642,7 +5242,10 @@ JNI_METHOD(void, FlowMeasurementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4655,8 +5258,9 @@ JNI_METHOD(void, GeneralCommissioningCluster, readBreadcrumbAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4674,7 +5278,10 @@ JNI_METHOD(void, GeneralCommissioningCluster, readBreadcrumbAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4687,9 +5294,10 @@ JNI_METHOD(void, GeneralCommissioningCluster, readBasicCommissioningInfoListAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::BasicCommissioningInfoList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -4708,7 +5316,11 @@ JNI_METHOD(void, GeneralCommissioningCluster, readBasicCommissioningInfoListAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBasicCommissioningInfoList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4721,8 +5333,9 @@ JNI_METHOD(void, GeneralCommissioningCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4740,7 +5353,10 @@ JNI_METHOD(void, GeneralCommissioningCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4753,9 +5369,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readNetworkInterfacesAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::NetworkInterfaces::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -4774,7 +5391,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readNetworkInterfacesAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNetworkInterfaces(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4787,8 +5407,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readRebootCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::RebootCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4806,7 +5427,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readRebootCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRebootCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4818,8 +5442,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readRebootCountAttribute) JNI_METHOD(void, GeneralDiagnosticsCluster, readUpTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::UpTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4837,7 +5462,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readUpTimeAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeUpTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4850,8 +5478,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readTotalOperationalHoursAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4869,7 +5498,11 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readTotalOperationalHoursAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTotalOperationalHours(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4882,8 +5515,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readBootReasonsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::BootReasons::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -4901,7 +5535,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readBootReasonsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBootReasons(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4914,9 +5551,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveHardwareFaultsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveHardwareFaults::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -4935,7 +5573,11 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveHardwareFaultsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveHardwareFaults(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4948,9 +5590,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveRadioFaultsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveRadioFaults::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -4969,7 +5612,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveRadioFaultsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveRadioFaults(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -4982,9 +5628,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveNetworkFaultsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ActiveNetworkFaults::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -5003,7 +5650,11 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readActiveNetworkFaultsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveNetworkFaults(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5016,8 +5667,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5035,7 +5687,10 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5047,8 +5702,9 @@ JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute) JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::Groups::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -5067,7 +5723,10 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeGroups(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5079,8 +5738,9 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, j JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::GroupKeys::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -5099,7 +5759,10 @@ JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeGroupKeys(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5112,8 +5775,9 @@ JNI_METHOD(void, GroupKeyManagementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5131,7 +5795,10 @@ JNI_METHOD(void, GroupKeyManagementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5143,8 +5810,9 @@ JNI_METHOD(void, GroupKeyManagementCluster, readClusterRevisionAttribute) JNI_METHOD(void, GroupsCluster, readNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Groups::Attributes::NameSupport::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5161,7 +5829,10 @@ JNI_METHOD(void, GroupsCluster, readNameSupportAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5173,8 +5844,9 @@ JNI_METHOD(void, GroupsCluster, readNameSupportAttribute)(JNIEnv * env, jobject JNI_METHOD(void, GroupsCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Groups::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5191,7 +5863,10 @@ JNI_METHOD(void, GroupsCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5203,8 +5878,9 @@ JNI_METHOD(void, GroupsCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj JNI_METHOD(void, IdentifyCluster, readIdentifyTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5221,7 +5897,10 @@ JNI_METHOD(void, IdentifyCluster, readIdentifyTimeAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5233,8 +5912,9 @@ JNI_METHOD(void, IdentifyCluster, readIdentifyTimeAttribute)(JNIEnv * env, jobje JNI_METHOD(void, IdentifyCluster, readIdentifyTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::IdentifyType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5251,7 +5931,10 @@ JNI_METHOD(void, IdentifyCluster, readIdentifyTypeAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeIdentifyType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5263,8 +5946,9 @@ JNI_METHOD(void, IdentifyCluster, readIdentifyTypeAttribute)(JNIEnv * env, jobje JNI_METHOD(void, IdentifyCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Identify::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5281,7 +5965,10 @@ JNI_METHOD(void, IdentifyCluster, readClusterRevisionAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5294,8 +5981,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5313,7 +6003,10 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5326,8 +6019,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5345,7 +6041,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5358,8 +6058,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5377,7 +6080,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5390,8 +6097,9 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5409,7 +6117,10 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5422,8 +6133,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readLightSensorTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5441,7 +6155,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readLightSensorTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLightSensorType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5454,8 +6172,9 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5473,7 +6192,11 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5485,8 +6208,9 @@ JNI_METHOD(void, IlluminanceMeasurementCluster, readClusterRevisionAttribute) JNI_METHOD(void, KeypadInputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::KeypadInput::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5503,7 +6227,10 @@ JNI_METHOD(void, KeypadInputCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5515,8 +6242,9 @@ JNI_METHOD(void, KeypadInputCluster, readClusterRevisionAttribute)(JNIEnv * env, JNI_METHOD(void, LevelControlCluster, readCurrentLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5533,7 +6261,10 @@ JNI_METHOD(void, LevelControlCluster, readCurrentLevelAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5545,8 +6276,9 @@ JNI_METHOD(void, LevelControlCluster, readCurrentLevelAttribute)(JNIEnv * env, j JNI_METHOD(void, LevelControlCluster, readRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::RemainingTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5563,7 +6295,10 @@ JNI_METHOD(void, LevelControlCluster, readRemainingTimeAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5575,8 +6310,9 @@ JNI_METHOD(void, LevelControlCluster, readRemainingTimeAttribute)(JNIEnv * env, JNI_METHOD(void, LevelControlCluster, readMinLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5593,7 +6329,10 @@ JNI_METHOD(void, LevelControlCluster, readMinLevelAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5605,8 +6344,9 @@ JNI_METHOD(void, LevelControlCluster, readMinLevelAttribute)(JNIEnv * env, jobje JNI_METHOD(void, LevelControlCluster, readMaxLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5623,7 +6363,10 @@ JNI_METHOD(void, LevelControlCluster, readMaxLevelAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5635,8 +6378,9 @@ JNI_METHOD(void, LevelControlCluster, readMaxLevelAttribute)(JNIEnv * env, jobje JNI_METHOD(void, LevelControlCluster, readCurrentFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::CurrentFrequency::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5653,7 +6397,10 @@ JNI_METHOD(void, LevelControlCluster, readCurrentFrequencyAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentFrequency(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5665,8 +6412,9 @@ JNI_METHOD(void, LevelControlCluster, readCurrentFrequencyAttribute)(JNIEnv * en JNI_METHOD(void, LevelControlCluster, readMinFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MinFrequency::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5683,7 +6431,10 @@ JNI_METHOD(void, LevelControlCluster, readMinFrequencyAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinFrequency(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5695,8 +6446,9 @@ JNI_METHOD(void, LevelControlCluster, readMinFrequencyAttribute)(JNIEnv * env, j JNI_METHOD(void, LevelControlCluster, readMaxFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::MaxFrequency::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5713,7 +6465,10 @@ JNI_METHOD(void, LevelControlCluster, readMaxFrequencyAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxFrequency(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5725,8 +6480,9 @@ JNI_METHOD(void, LevelControlCluster, readMaxFrequencyAttribute)(JNIEnv * env, j JNI_METHOD(void, LevelControlCluster, readOptionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::Options::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5743,7 +6499,10 @@ JNI_METHOD(void, LevelControlCluster, readOptionsAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOptions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5756,8 +6515,9 @@ JNI_METHOD(void, LevelControlCluster, readOnOffTransitionTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnOffTransitionTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5774,7 +6534,10 @@ JNI_METHOD(void, LevelControlCluster, readOnOffTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5786,8 +6549,9 @@ JNI_METHOD(void, LevelControlCluster, readOnOffTransitionTimeAttribute) JNI_METHOD(void, LevelControlCluster, readOnLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5804,7 +6568,10 @@ JNI_METHOD(void, LevelControlCluster, readOnLevelAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5816,8 +6583,9 @@ JNI_METHOD(void, LevelControlCluster, readOnLevelAttribute)(JNIEnv * env, jobjec JNI_METHOD(void, LevelControlCluster, readOnTransitionTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OnTransitionTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5834,7 +6602,10 @@ JNI_METHOD(void, LevelControlCluster, readOnTransitionTimeAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnTransitionTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5847,8 +6618,9 @@ JNI_METHOD(void, LevelControlCluster, readOffTransitionTimeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::OffTransitionTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5865,7 +6637,10 @@ JNI_METHOD(void, LevelControlCluster, readOffTransitionTimeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5877,8 +6652,9 @@ JNI_METHOD(void, LevelControlCluster, readOffTransitionTimeAttribute) JNI_METHOD(void, LevelControlCluster, readDefaultMoveRateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::DefaultMoveRate::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5895,7 +6671,10 @@ JNI_METHOD(void, LevelControlCluster, readDefaultMoveRateAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDefaultMoveRate(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5908,8 +6687,9 @@ JNI_METHOD(void, LevelControlCluster, readStartUpCurrentLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5926,7 +6706,10 @@ JNI_METHOD(void, LevelControlCluster, readStartUpCurrentLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartUpCurrentLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5938,8 +6721,9 @@ JNI_METHOD(void, LevelControlCluster, readStartUpCurrentLevelAttribute) JNI_METHOD(void, LevelControlCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LevelControl::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5956,7 +6740,10 @@ JNI_METHOD(void, LevelControlCluster, readClusterRevisionAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5968,8 +6755,9 @@ JNI_METHOD(void, LevelControlCluster, readClusterRevisionAttribute)(JNIEnv * env JNI_METHOD(void, LowPowerCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::LowPower::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -5986,7 +6774,10 @@ JNI_METHOD(void, LowPowerCluster, readClusterRevisionAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -5998,8 +6789,9 @@ JNI_METHOD(void, LowPowerCluster, readClusterRevisionAttribute)(JNIEnv * env, jo JNI_METHOD(void, MediaInputCluster, readMediaInputListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::MediaInputList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -6017,7 +6809,10 @@ JNI_METHOD(void, MediaInputCluster, readMediaInputListAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMediaInputList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6029,8 +6824,9 @@ JNI_METHOD(void, MediaInputCluster, readMediaInputListAttribute)(JNIEnv * env, j JNI_METHOD(void, MediaInputCluster, readCurrentMediaInputAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::CurrentMediaInput::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6047,7 +6843,10 @@ JNI_METHOD(void, MediaInputCluster, readCurrentMediaInputAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentMediaInput(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6059,8 +6858,9 @@ JNI_METHOD(void, MediaInputCluster, readCurrentMediaInputAttribute)(JNIEnv * env JNI_METHOD(void, MediaInputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaInput::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6077,7 +6877,10 @@ JNI_METHOD(void, MediaInputCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6089,8 +6892,9 @@ JNI_METHOD(void, MediaInputCluster, readClusterRevisionAttribute)(JNIEnv * env, JNI_METHOD(void, MediaPlaybackCluster, readPlaybackStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackState::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6107,7 +6911,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readPlaybackStateAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePlaybackState(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6119,8 +6926,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readPlaybackStateAttribute)(JNIEnv * env, JNI_METHOD(void, MediaPlaybackCluster, readStartTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::StartTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6137,7 +6945,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readStartTimeAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6149,8 +6960,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readStartTimeAttribute)(JNIEnv * env, job JNI_METHOD(void, MediaPlaybackCluster, readDurationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::Duration::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6167,7 +6979,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readDurationAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDuration(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6180,8 +6995,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readPositionUpdatedAtAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PositionUpdatedAt::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6198,7 +7014,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readPositionUpdatedAtAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePositionUpdatedAt(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6210,8 +7029,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readPositionUpdatedAtAttribute) JNI_METHOD(void, MediaPlaybackCluster, readPositionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::Position::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6228,7 +7048,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readPositionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePosition(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6240,8 +7063,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readPositionAttribute)(JNIEnv * env, jobj JNI_METHOD(void, MediaPlaybackCluster, readPlaybackSpeedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6258,7 +7082,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readPlaybackSpeedAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePlaybackSpeed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6270,8 +7097,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readPlaybackSpeedAttribute)(JNIEnv * env, JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeEndAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6288,7 +7116,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeEndAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSeekRangeEnd(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6300,8 +7131,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeEndAttribute)(JNIEnv * env, JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeStartAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::SeekRangeStart::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6318,7 +7150,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeStartAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSeekRangeStart(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6330,8 +7165,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeStartAttribute)(JNIEnv * env JNI_METHOD(void, MediaPlaybackCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::MediaPlayback::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6348,7 +7184,10 @@ JNI_METHOD(void, MediaPlaybackCluster, readClusterRevisionAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6360,8 +7199,9 @@ JNI_METHOD(void, MediaPlaybackCluster, readClusterRevisionAttribute)(JNIEnv * en JNI_METHOD(void, ModeSelectCluster, readCurrentModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::CurrentMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6378,7 +7218,10 @@ JNI_METHOD(void, ModeSelectCluster, readCurrentModeAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6390,8 +7233,9 @@ JNI_METHOD(void, ModeSelectCluster, readCurrentModeAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ModeSelectCluster, readSupportedModesAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::SupportedModes::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -6409,7 +7253,10 @@ JNI_METHOD(void, ModeSelectCluster, readSupportedModesAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSupportedModes(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6421,8 +7268,9 @@ JNI_METHOD(void, ModeSelectCluster, readSupportedModesAttribute)(JNIEnv * env, j JNI_METHOD(void, ModeSelectCluster, readOnModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::OnMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6439,7 +7287,10 @@ JNI_METHOD(void, ModeSelectCluster, readOnModeAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6451,8 +7302,9 @@ JNI_METHOD(void, ModeSelectCluster, readOnModeAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, ModeSelectCluster, readStartUpModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::StartUpMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6469,7 +7321,10 @@ JNI_METHOD(void, ModeSelectCluster, readStartUpModeAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartUpMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6481,6 +7336,7 @@ JNI_METHOD(void, ModeSelectCluster, readStartUpModeAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ModeSelectCluster, readDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::Description::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -6500,7 +7356,10 @@ JNI_METHOD(void, ModeSelectCluster, readDescriptionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDescription(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6512,8 +7371,9 @@ JNI_METHOD(void, ModeSelectCluster, readDescriptionAttribute)(JNIEnv * env, jobj JNI_METHOD(void, ModeSelectCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ModeSelect::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6530,7 +7390,10 @@ JNI_METHOD(void, ModeSelectCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6543,8 +7406,9 @@ JNI_METHOD(void, NetworkCommissioningCluster, readFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6562,7 +7426,10 @@ JNI_METHOD(void, NetworkCommissioningCluster, readFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6575,8 +7442,9 @@ JNI_METHOD(void, NetworkCommissioningCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6594,7 +7462,10 @@ JNI_METHOD(void, NetworkCommissioningCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6607,8 +7478,9 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6626,7 +7498,11 @@ JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6639,8 +7515,9 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProviderAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::DefaultOtaProvider::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -6659,7 +7536,11 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProviderAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDefaultOtaProvider(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6672,8 +7553,9 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdatePossibleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6691,7 +7573,11 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdatePossibleAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeUpdatePossible(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6704,8 +7590,9 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readClusterRevisionAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6723,7 +7610,11 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readClusterRevisionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6735,8 +7626,9 @@ JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readClusterRevisionAttribute JNI_METHOD(void, OccupancySensingCluster, readOccupancyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::Occupancy::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6754,7 +7646,10 @@ JNI_METHOD(void, OccupancySensingCluster, readOccupancyAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOccupancy(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6767,8 +7662,9 @@ JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6786,7 +7682,10 @@ JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOccupancySensorType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6799,8 +7698,9 @@ JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeBitmapAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6818,7 +7718,11 @@ JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeBitmapAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOccupancySensorTypeBitmap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6831,8 +7735,9 @@ JNI_METHOD(void, OccupancySensingCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OccupancySensing::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6850,7 +7755,10 @@ JNI_METHOD(void, OccupancySensingCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6862,8 +7770,9 @@ JNI_METHOD(void, OccupancySensingCluster, readClusterRevisionAttribute) JNI_METHOD(void, OnOffCluster, readOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnOff::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6880,7 +7789,9 @@ JNI_METHOD(void, OnOffCluster, readOnOffAttribute)(JNIEnv * env, jobject self, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6892,8 +7803,9 @@ JNI_METHOD(void, OnOffCluster, readOnOffAttribute)(JNIEnv * env, jobject self, j JNI_METHOD(void, OnOffCluster, readGlobalSceneControlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::GlobalSceneControl::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6910,7 +7822,10 @@ JNI_METHOD(void, OnOffCluster, readGlobalSceneControlAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeGlobalSceneControl(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6922,8 +7837,9 @@ JNI_METHOD(void, OnOffCluster, readGlobalSceneControlAttribute)(JNIEnv * env, jo JNI_METHOD(void, OnOffCluster, readOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OnTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6940,7 +7856,9 @@ JNI_METHOD(void, OnOffCluster, readOnTimeAttribute)(JNIEnv * env, jobject self, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOnTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6952,8 +7870,9 @@ JNI_METHOD(void, OnOffCluster, readOnTimeAttribute)(JNIEnv * env, jobject self, JNI_METHOD(void, OnOffCluster, readOffWaitTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::OffWaitTime::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -6970,7 +7889,10 @@ JNI_METHOD(void, OnOffCluster, readOffWaitTimeAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOffWaitTime(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -6982,8 +7904,9 @@ JNI_METHOD(void, OnOffCluster, readOffWaitTimeAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, OnOffCluster, readStartUpOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::StartUpOnOff::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7000,7 +7923,10 @@ JNI_METHOD(void, OnOffCluster, readStartUpOnOffAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartUpOnOff(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7012,8 +7938,9 @@ JNI_METHOD(void, OnOffCluster, readStartUpOnOffAttribute)(JNIEnv * env, jobject JNI_METHOD(void, OnOffCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7030,7 +7957,9 @@ JNI_METHOD(void, OnOffCluster, readFeatureMapAttribute)(JNIEnv * env, jobject se chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7042,8 +7971,9 @@ JNI_METHOD(void, OnOffCluster, readFeatureMapAttribute)(JNIEnv * env, jobject se JNI_METHOD(void, OnOffCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOff::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7060,7 +7990,10 @@ JNI_METHOD(void, OnOffCluster, readClusterRevisionAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7073,8 +8006,9 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7092,7 +8026,10 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSwitchType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7105,8 +8042,9 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchActionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7124,7 +8062,11 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchActionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSwitchActions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7137,8 +8079,9 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7156,7 +8099,11 @@ JNI_METHOD(void, OnOffSwitchConfigurationCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7169,9 +8116,10 @@ JNI_METHOD(void, OperationalCredentialsCluster, readFabricsListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::FabricsList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -7190,7 +8138,10 @@ JNI_METHOD(void, OperationalCredentialsCluster, readFabricsListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFabricsList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7203,8 +8154,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, readSupportedFabricsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7222,7 +8174,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readSupportedFabricsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSupportedFabrics(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7235,8 +8191,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, readCommissionedFabricsAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7254,7 +8211,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readCommissionedFabricsAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCommissionedFabrics(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7267,9 +8228,10 @@ JNI_METHOD(void, OperationalCredentialsCluster, readTrustedRootCertificatesAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::TrustedRootCertificates::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -7288,7 +8250,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readTrustedRootCertificatesAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTrustedRootCertificates(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7301,8 +8267,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readCurrentFabricIndexAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7320,7 +8289,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readCurrentFabricIndexAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentFabricIndex(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7333,8 +8306,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::OperationalCredentials::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7352,7 +8326,11 @@ JNI_METHOD(void, OperationalCredentialsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7364,8 +8342,9 @@ JNI_METHOD(void, OperationalCredentialsCluster, readClusterRevisionAttribute) JNI_METHOD(void, PowerSourceCluster, readStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Status::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7382,7 +8361,10 @@ JNI_METHOD(void, PowerSourceCluster, readStatusAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7394,8 +8376,9 @@ JNI_METHOD(void, PowerSourceCluster, readStatusAttribute)(JNIEnv * env, jobject JNI_METHOD(void, PowerSourceCluster, readOrderAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Order::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7412,7 +8395,10 @@ JNI_METHOD(void, PowerSourceCluster, readOrderAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOrder(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7424,6 +8410,7 @@ JNI_METHOD(void, PowerSourceCluster, readOrderAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, PowerSourceCluster, readDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::Description::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -7443,7 +8430,10 @@ JNI_METHOD(void, PowerSourceCluster, readDescriptionAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDescription(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7455,8 +8445,9 @@ JNI_METHOD(void, PowerSourceCluster, readDescriptionAttribute)(JNIEnv * env, job JNI_METHOD(void, PowerSourceCluster, readBatteryVoltageAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryVoltage::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7473,7 +8464,10 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryVoltageAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBatteryVoltage(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7486,8 +8480,9 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryPercentRemainingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryPercentRemaining::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7504,7 +8499,10 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryPercentRemainingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBatteryPercentRemaining(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7517,8 +8515,9 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryTimeRemainingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryTimeRemaining::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7535,7 +8534,10 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryTimeRemainingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBatteryTimeRemaining(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7548,8 +8550,9 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryChargeLevelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeLevel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7566,7 +8569,10 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryChargeLevelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBatteryChargeLevel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7579,9 +8585,10 @@ JNI_METHOD(void, PowerSourceCluster, readActiveBatteryFaultsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::ActiveBatteryFaults::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -7599,7 +8606,10 @@ JNI_METHOD(void, PowerSourceCluster, readActiveBatteryFaultsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveBatteryFaults(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7612,8 +8622,9 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryChargeStateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::BatteryChargeState::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7630,7 +8641,10 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryChargeStateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBatteryChargeState(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7642,8 +8656,9 @@ JNI_METHOD(void, PowerSourceCluster, readBatteryChargeStateAttribute) JNI_METHOD(void, PowerSourceCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7660,7 +8675,10 @@ JNI_METHOD(void, PowerSourceCluster, readFeatureMapAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7672,8 +8690,9 @@ JNI_METHOD(void, PowerSourceCluster, readFeatureMapAttribute)(JNIEnv * env, jobj JNI_METHOD(void, PowerSourceCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PowerSource::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7690,7 +8709,10 @@ JNI_METHOD(void, PowerSourceCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7703,8 +8725,9 @@ JNI_METHOD(void, PressureMeasurementCluster, readMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7722,7 +8745,10 @@ JNI_METHOD(void, PressureMeasurementCluster, readMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7735,8 +8761,9 @@ JNI_METHOD(void, PressureMeasurementCluster, readMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7754,7 +8781,10 @@ JNI_METHOD(void, PressureMeasurementCluster, readMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7767,8 +8797,9 @@ JNI_METHOD(void, PressureMeasurementCluster, readMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7786,7 +8817,10 @@ JNI_METHOD(void, PressureMeasurementCluster, readMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7799,8 +8833,9 @@ JNI_METHOD(void, PressureMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PressureMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7818,7 +8853,10 @@ JNI_METHOD(void, PressureMeasurementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7831,8 +8869,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxPressureAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7850,7 +8889,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxPressureAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxPressure(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7863,8 +8906,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7882,7 +8926,10 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxSpeed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7895,8 +8942,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxFlowAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7914,7 +8962,10 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxFlowAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxFlow(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7927,8 +8978,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstPressureAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7946,7 +8998,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstPressureAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinConstPressure(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7959,8 +9015,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstPressureAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -7978,7 +9035,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstPressureAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxConstPressure(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -7991,8 +9052,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinCompPressureAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8010,7 +9072,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinCompPressureAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinCompPressure(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8023,8 +9089,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxCompPressureAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8042,7 +9109,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxCompPressureAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxCompPressure(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8055,8 +9126,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8074,7 +9146,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinConstSpeed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8087,8 +9163,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8106,7 +9183,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxConstSpeed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8119,8 +9200,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstFlowAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8138,7 +9220,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstFlowAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinConstFlow(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8151,8 +9237,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstFlowAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8170,7 +9257,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstFlowAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxConstFlow(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8183,8 +9274,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstTempAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8202,7 +9294,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstTempAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinConstTemp(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8215,8 +9311,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstTempAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8234,7 +9331,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstTempAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxConstTemp(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8247,8 +9348,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readPumpStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::PumpStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8266,7 +9368,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readPumpStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePumpStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8279,8 +9385,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveOperationModeA (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveOperationMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8298,7 +9405,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveOperationModeA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEffectiveOperationMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8311,8 +9422,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveControlModeAtt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::EffectiveControlMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8330,7 +9442,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveControlModeAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEffectiveControlMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8343,8 +9459,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readCapacityAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8362,7 +9479,10 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readCapacityAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCapacity(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8375,8 +9495,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readSpeedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::Speed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8394,7 +9515,10 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readSpeedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSpeed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8407,8 +9531,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readLifetimeEnergyConsumedA (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8426,7 +9551,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readLifetimeEnergyConsumedA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLifetimeEnergyConsumed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8439,8 +9568,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readOperationModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::OperationMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8458,7 +9588,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readOperationModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOperationMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8471,8 +9605,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readControlModeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ControlMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8490,7 +9625,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readControlModeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeControlMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8503,8 +9642,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readAlarmMaskAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::AlarmMask::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8522,7 +9662,10 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readAlarmMaskAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAlarmMask(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8535,8 +9678,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8554,7 +9698,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8567,8 +9715,9 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readClusterRevisionAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8586,7 +9735,11 @@ JNI_METHOD(void, PumpConfigurationAndControlCluster, readClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8599,8 +9752,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8618,7 +9772,11 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8631,8 +9789,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMinMeasuredValueAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8650,7 +9809,11 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMinMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8663,8 +9826,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMaxMeasuredValueAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8682,7 +9846,11 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMaxMeasuredValueAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8695,8 +9863,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8714,7 +9883,10 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8727,8 +9899,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readClusterRevisionAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8746,7 +9919,11 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readClusterRevisionAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8758,8 +9935,9 @@ JNI_METHOD(void, RelativeHumidityMeasurementCluster, readClusterRevisionAttribut JNI_METHOD(void, ScenesCluster, readSceneCountAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8776,7 +9954,10 @@ JNI_METHOD(void, ScenesCluster, readSceneCountAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8788,8 +9969,9 @@ JNI_METHOD(void, ScenesCluster, readSceneCountAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, ScenesCluster, readCurrentSceneAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentScene::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8806,7 +9988,10 @@ JNI_METHOD(void, ScenesCluster, readCurrentSceneAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8818,8 +10003,9 @@ JNI_METHOD(void, ScenesCluster, readCurrentSceneAttribute)(JNIEnv * env, jobject JNI_METHOD(void, ScenesCluster, readCurrentGroupAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::CurrentGroup::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8836,7 +10022,10 @@ JNI_METHOD(void, ScenesCluster, readCurrentGroupAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8848,8 +10037,9 @@ JNI_METHOD(void, ScenesCluster, readCurrentGroupAttribute)(JNIEnv * env, jobject JNI_METHOD(void, ScenesCluster, readSceneValidAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::SceneValid::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8866,7 +10056,10 @@ JNI_METHOD(void, ScenesCluster, readSceneValidAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8878,8 +10071,9 @@ JNI_METHOD(void, ScenesCluster, readSceneValidAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, ScenesCluster, readNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::NameSupport::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8896,7 +10090,10 @@ JNI_METHOD(void, ScenesCluster, readNameSupportAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8908,8 +10105,9 @@ JNI_METHOD(void, ScenesCluster, readNameSupportAttribute)(JNIEnv * env, jobject JNI_METHOD(void, ScenesCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Scenes::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8926,7 +10124,10 @@ JNI_METHOD(void, ScenesCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8939,9 +10140,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readThreadMetricsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::ThreadMetrics::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -8960,7 +10162,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readThreadMetricsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeThreadMetrics(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -8973,8 +10178,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapFreeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -8992,7 +10198,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapFreeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentHeapFree(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9005,8 +10214,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapUsedAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9024,7 +10234,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapUsedAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentHeapUsed(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9037,8 +10250,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapHighWatermarkAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9056,7 +10270,11 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapHighWatermarkAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentHeapHighWatermark(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9069,8 +10287,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9088,7 +10307,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9101,8 +10323,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9120,7 +10343,10 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9132,8 +10358,9 @@ JNI_METHOD(void, SoftwareDiagnosticsCluster, readClusterRevisionAttribute) JNI_METHOD(void, SwitchCluster, readNumberOfPositionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Switch::Attributes::NumberOfPositions::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9150,7 +10377,10 @@ JNI_METHOD(void, SwitchCluster, readNumberOfPositionsAttribute)(JNIEnv * env, jo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNumberOfPositions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9162,8 +10392,9 @@ JNI_METHOD(void, SwitchCluster, readNumberOfPositionsAttribute)(JNIEnv * env, jo JNI_METHOD(void, SwitchCluster, readCurrentPositionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Switch::Attributes::CurrentPosition::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9180,7 +10411,10 @@ JNI_METHOD(void, SwitchCluster, readCurrentPositionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPosition(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9192,8 +10426,9 @@ JNI_METHOD(void, SwitchCluster, readCurrentPositionAttribute)(JNIEnv * env, jobj JNI_METHOD(void, SwitchCluster, readMultiPressMaxAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Switch::Attributes::MultiPressMax::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9210,7 +10445,10 @@ JNI_METHOD(void, SwitchCluster, readMultiPressMaxAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMultiPressMax(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9222,8 +10460,9 @@ JNI_METHOD(void, SwitchCluster, readMultiPressMaxAttribute)(JNIEnv * env, jobjec JNI_METHOD(void, SwitchCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Switch::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9240,7 +10479,10 @@ JNI_METHOD(void, SwitchCluster, readFeatureMapAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9252,8 +10494,9 @@ JNI_METHOD(void, SwitchCluster, readFeatureMapAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, SwitchCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Switch::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9270,7 +10513,10 @@ JNI_METHOD(void, SwitchCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9282,8 +10528,9 @@ JNI_METHOD(void, SwitchCluster, readClusterRevisionAttribute)(JNIEnv * env, jobj JNI_METHOD(void, TvChannelCluster, readTvChannelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TvChannel::Attributes::TvChannelList::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -9301,7 +10548,10 @@ JNI_METHOD(void, TvChannelCluster, readTvChannelListAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTvChannelList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9313,8 +10563,9 @@ JNI_METHOD(void, TvChannelCluster, readTvChannelListAttribute)(JNIEnv * env, job JNI_METHOD(void, TvChannelCluster, readTvChannelLineupAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TvChannel::Attributes::TvChannelLineup::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -9332,7 +10583,10 @@ JNI_METHOD(void, TvChannelCluster, readTvChannelLineupAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTvChannelLineup(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9344,8 +10598,9 @@ JNI_METHOD(void, TvChannelCluster, readTvChannelLineupAttribute)(JNIEnv * env, j JNI_METHOD(void, TvChannelCluster, readCurrentTvChannelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TvChannel::Attributes::CurrentTvChannel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -9363,7 +10618,10 @@ JNI_METHOD(void, TvChannelCluster, readCurrentTvChannelAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentTvChannel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9375,8 +10633,9 @@ JNI_METHOD(void, TvChannelCluster, readCurrentTvChannelAttribute)(JNIEnv * env, JNI_METHOD(void, TvChannelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TvChannel::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9393,7 +10652,10 @@ JNI_METHOD(void, TvChannelCluster, readClusterRevisionAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9406,9 +10668,10 @@ JNI_METHOD(void, TargetNavigatorCluster, readTargetNavigatorListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::TargetNavigatorList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -9427,7 +10690,10 @@ JNI_METHOD(void, TargetNavigatorCluster, readTargetNavigatorListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTargetNavigatorList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9440,8 +10706,9 @@ JNI_METHOD(void, TargetNavigatorCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TargetNavigator::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9459,7 +10726,10 @@ JNI_METHOD(void, TargetNavigatorCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9472,8 +10742,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9491,7 +10762,10 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9504,8 +10778,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMinMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9523,7 +10798,11 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMinMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9536,8 +10815,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMaxMeasuredValueAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9555,7 +10835,11 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readMaxMeasuredValueAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9568,8 +10852,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readToleranceAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::Tolerance::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9587,7 +10872,10 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readToleranceAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9600,8 +10888,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9619,7 +10908,11 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9631,8 +10924,9 @@ JNI_METHOD(void, TemperatureMeasurementCluster, readClusterRevisionAttribute) JNI_METHOD(void, TestClusterCluster, readBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Boolean::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9649,7 +10943,10 @@ JNI_METHOD(void, TestClusterCluster, readBooleanAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9661,8 +10958,9 @@ JNI_METHOD(void, TestClusterCluster, readBooleanAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap8::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9679,7 +10977,10 @@ JNI_METHOD(void, TestClusterCluster, readBitmap8Attribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9691,8 +10992,9 @@ JNI_METHOD(void, TestClusterCluster, readBitmap8Attribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap16::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9709,7 +11011,10 @@ JNI_METHOD(void, TestClusterCluster, readBitmap16Attribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9721,8 +11026,9 @@ JNI_METHOD(void, TestClusterCluster, readBitmap16Attribute)(JNIEnv * env, jobjec JNI_METHOD(void, TestClusterCluster, readBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap32::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9739,7 +11045,10 @@ JNI_METHOD(void, TestClusterCluster, readBitmap32Attribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9751,8 +11060,9 @@ JNI_METHOD(void, TestClusterCluster, readBitmap32Attribute)(JNIEnv * env, jobjec JNI_METHOD(void, TestClusterCluster, readBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Bitmap64::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9769,7 +11079,10 @@ JNI_METHOD(void, TestClusterCluster, readBitmap64Attribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9781,8 +11094,9 @@ JNI_METHOD(void, TestClusterCluster, readBitmap64Attribute)(JNIEnv * env, jobjec JNI_METHOD(void, TestClusterCluster, readInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8u::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9799,7 +11113,10 @@ JNI_METHOD(void, TestClusterCluster, readInt8uAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9811,8 +11128,9 @@ JNI_METHOD(void, TestClusterCluster, readInt8uAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, TestClusterCluster, readInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16u::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9829,7 +11147,10 @@ JNI_METHOD(void, TestClusterCluster, readInt16uAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9841,8 +11162,9 @@ JNI_METHOD(void, TestClusterCluster, readInt16uAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32u::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9859,7 +11181,10 @@ JNI_METHOD(void, TestClusterCluster, readInt32uAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9871,8 +11196,9 @@ JNI_METHOD(void, TestClusterCluster, readInt32uAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64u::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9889,7 +11215,10 @@ JNI_METHOD(void, TestClusterCluster, readInt64uAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9901,8 +11230,9 @@ JNI_METHOD(void, TestClusterCluster, readInt64uAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int8s::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9919,7 +11249,10 @@ JNI_METHOD(void, TestClusterCluster, readInt8sAttribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9931,8 +11264,9 @@ JNI_METHOD(void, TestClusterCluster, readInt8sAttribute)(JNIEnv * env, jobject s JNI_METHOD(void, TestClusterCluster, readInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int16s::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9949,7 +11283,10 @@ JNI_METHOD(void, TestClusterCluster, readInt16sAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9961,8 +11298,9 @@ JNI_METHOD(void, TestClusterCluster, readInt16sAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int32s::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -9979,7 +11317,10 @@ JNI_METHOD(void, TestClusterCluster, readInt32sAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -9991,8 +11332,9 @@ JNI_METHOD(void, TestClusterCluster, readInt32sAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Int64s::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10009,7 +11351,10 @@ JNI_METHOD(void, TestClusterCluster, readInt64sAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10021,8 +11366,9 @@ JNI_METHOD(void, TestClusterCluster, readInt64sAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum8::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10039,7 +11385,10 @@ JNI_METHOD(void, TestClusterCluster, readEnum8Attribute)(JNIEnv * env, jobject s chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10051,8 +11400,9 @@ JNI_METHOD(void, TestClusterCluster, readEnum8Attribute)(JNIEnv * env, jobject s JNI_METHOD(void, TestClusterCluster, readEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Enum16::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10069,7 +11419,10 @@ JNI_METHOD(void, TestClusterCluster, readEnum16Attribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10081,8 +11434,9 @@ JNI_METHOD(void, TestClusterCluster, readEnum16Attribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::OctetString::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10100,7 +11454,10 @@ JNI_METHOD(void, TestClusterCluster, readOctetStringAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10112,8 +11469,9 @@ JNI_METHOD(void, TestClusterCluster, readOctetStringAttribute)(JNIEnv * env, job JNI_METHOD(void, TestClusterCluster, readListInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ListInt8u::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10131,7 +11489,10 @@ JNI_METHOD(void, TestClusterCluster, readListInt8uAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeListInt8u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10143,8 +11504,9 @@ JNI_METHOD(void, TestClusterCluster, readListInt8uAttribute)(JNIEnv * env, jobje JNI_METHOD(void, TestClusterCluster, readListOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ListOctetString::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10162,7 +11524,10 @@ JNI_METHOD(void, TestClusterCluster, readListOctetStringAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeListOctetString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10175,9 +11540,10 @@ JNI_METHOD(void, TestClusterCluster, readListStructOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ListStructOctetString::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10195,7 +11561,10 @@ JNI_METHOD(void, TestClusterCluster, readListStructOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeListStructOctetString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10207,8 +11576,9 @@ JNI_METHOD(void, TestClusterCluster, readListStructOctetStringAttribute) JNI_METHOD(void, TestClusterCluster, readLongOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongOctetString::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10226,7 +11596,10 @@ JNI_METHOD(void, TestClusterCluster, readLongOctetStringAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLongOctetString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10238,6 +11611,7 @@ JNI_METHOD(void, TestClusterCluster, readLongOctetStringAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::CharString::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -10257,7 +11631,10 @@ JNI_METHOD(void, TestClusterCluster, readCharStringAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCharString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10269,6 +11646,7 @@ JNI_METHOD(void, TestClusterCluster, readCharStringAttribute)(JNIEnv * env, jobj JNI_METHOD(void, TestClusterCluster, readLongCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::LongCharString::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -10288,7 +11666,10 @@ JNI_METHOD(void, TestClusterCluster, readLongCharStringAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLongCharString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10300,8 +11681,9 @@ JNI_METHOD(void, TestClusterCluster, readLongCharStringAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readEpochUsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochUs::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10318,7 +11700,10 @@ JNI_METHOD(void, TestClusterCluster, readEpochUsAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10330,8 +11715,9 @@ JNI_METHOD(void, TestClusterCluster, readEpochUsAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readEpochSAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::EpochS::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10348,7 +11734,10 @@ JNI_METHOD(void, TestClusterCluster, readEpochSAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10360,8 +11749,10 @@ JNI_METHOD(void, TestClusterCluster, readEpochSAttribute)(JNIEnv * env, jobject JNI_METHOD(void, TestClusterCluster, readVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::VendorId::TypeInfo; + std::unique_ptr onSuccess( + chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10378,7 +11769,10 @@ JNI_METHOD(void, TestClusterCluster, readVendorIdAttribute)(JNIEnv * env, jobjec chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10391,9 +11785,10 @@ JNI_METHOD(void, TestClusterCluster, readListNullablesAndOptionalsStructAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ListNullablesAndOptionalsStruct::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -10411,7 +11806,11 @@ JNI_METHOD(void, TestClusterCluster, readListNullablesAndOptionalsStructAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeListNullablesAndOptionalsStruct(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10423,8 +11822,9 @@ JNI_METHOD(void, TestClusterCluster, readListNullablesAndOptionalsStructAttribut JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::Unsupported::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10441,7 +11841,10 @@ JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, job chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeUnsupported(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10453,8 +11856,10 @@ JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, job JNI_METHOD(void, TestClusterCluster, readNullableBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBoolean::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10471,7 +11876,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBooleanAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10483,8 +11891,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBooleanAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap8::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10501,7 +11911,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap8Attribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10513,8 +11926,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap8Attribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap16::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10531,7 +11946,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap16Attribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10543,8 +11961,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap16Attribute)(JNIEnv * env JNI_METHOD(void, TestClusterCluster, readNullableBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap32::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10561,7 +11981,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap32Attribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10573,8 +11996,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap32Attribute)(JNIEnv * env JNI_METHOD(void, TestClusterCluster, readNullableBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableBitmap64::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10591,7 +12016,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap64Attribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10603,8 +12031,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableBitmap64Attribute)(JNIEnv * env JNI_METHOD(void, TestClusterCluster, readNullableInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8u::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10621,7 +12051,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt8uAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10633,8 +12066,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt8uAttribute)(JNIEnv * env, j JNI_METHOD(void, TestClusterCluster, readNullableInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16u::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10651,7 +12086,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt16uAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10663,8 +12101,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt16uAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32u::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10681,7 +12121,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt32uAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10693,8 +12136,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt32uAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64u::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10711,7 +12156,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt64uAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10723,8 +12171,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt64uAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt8s::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10741,7 +12191,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt8sAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10753,8 +12206,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt8sAttribute)(JNIEnv * env, j JNI_METHOD(void, TestClusterCluster, readNullableInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt16s::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10771,7 +12226,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt16sAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10783,8 +12241,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt16sAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt32s::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10801,7 +12261,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt32sAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10813,8 +12276,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt32sAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableInt64s::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10831,7 +12296,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt64sAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10843,8 +12311,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableInt64sAttribute)(JNIEnv * env, JNI_METHOD(void, TestClusterCluster, readNullableEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum8::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10861,7 +12331,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableEnum8Attribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10873,8 +12346,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableEnum8Attribute)(JNIEnv * env, j JNI_METHOD(void, TestClusterCluster, readNullableEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableEnum16::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10891,7 +12366,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableEnum16Attribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10904,9 +12382,11 @@ JNI_METHOD(void, TestClusterCluster, readNullableOctetStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback, true), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableOctetString::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10923,7 +12403,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableOctetStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10936,9 +12419,11 @@ JNI_METHOD(void, TestClusterCluster, readNullableCharStringAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; - std::unique_ptr onSuccess( - chip::Platform::New(callback, false), - chip::Platform::Delete); + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::NullableCharString::TypeInfo; + std::unique_ptr + onSuccess(chip::Platform::New(callback, false), + chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10955,7 +12440,10 @@ JNI_METHOD(void, TestClusterCluster, readNullableCharStringAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10967,8 +12455,9 @@ JNI_METHOD(void, TestClusterCluster, readNullableCharStringAttribute) JNI_METHOD(void, TestClusterCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::TestCluster::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -10985,7 +12474,10 @@ JNI_METHOD(void, TestClusterCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -10997,8 +12489,9 @@ JNI_METHOD(void, TestClusterCluster, readClusterRevisionAttribute)(JNIEnv * env, JNI_METHOD(void, ThermostatCluster, readLocalTemperatureAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::LocalTemperature::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11015,7 +12508,10 @@ JNI_METHOD(void, ThermostatCluster, readLocalTemperatureAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLocalTemperature(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11028,8 +12524,9 @@ JNI_METHOD(void, ThermostatCluster, readAbsMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11046,7 +12543,10 @@ JNI_METHOD(void, ThermostatCluster, readAbsMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAbsMinHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11059,8 +12559,9 @@ JNI_METHOD(void, ThermostatCluster, readAbsMaxHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11077,7 +12578,10 @@ JNI_METHOD(void, ThermostatCluster, readAbsMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAbsMaxHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11090,8 +12594,9 @@ JNI_METHOD(void, ThermostatCluster, readAbsMinCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11108,7 +12613,10 @@ JNI_METHOD(void, ThermostatCluster, readAbsMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAbsMinCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11121,8 +12629,9 @@ JNI_METHOD(void, ThermostatCluster, readAbsMaxCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11139,7 +12648,10 @@ JNI_METHOD(void, ThermostatCluster, readAbsMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAbsMaxCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11152,8 +12664,9 @@ JNI_METHOD(void, ThermostatCluster, readOccupiedCoolingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11170,7 +12683,10 @@ JNI_METHOD(void, ThermostatCluster, readOccupiedCoolingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOccupiedCoolingSetpoint(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11183,8 +12699,9 @@ JNI_METHOD(void, ThermostatCluster, readOccupiedHeatingSetpointAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11201,7 +12718,10 @@ JNI_METHOD(void, ThermostatCluster, readOccupiedHeatingSetpointAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOccupiedHeatingSetpoint(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11214,8 +12734,9 @@ JNI_METHOD(void, ThermostatCluster, readMinHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11232,7 +12753,10 @@ JNI_METHOD(void, ThermostatCluster, readMinHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11245,8 +12769,9 @@ JNI_METHOD(void, ThermostatCluster, readMaxHeatSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11263,7 +12788,10 @@ JNI_METHOD(void, ThermostatCluster, readMaxHeatSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11276,8 +12804,9 @@ JNI_METHOD(void, ThermostatCluster, readMinCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11294,7 +12823,10 @@ JNI_METHOD(void, ThermostatCluster, readMinCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11307,8 +12839,9 @@ JNI_METHOD(void, ThermostatCluster, readMaxCoolSetpointLimitAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11325,7 +12858,10 @@ JNI_METHOD(void, ThermostatCluster, readMaxCoolSetpointLimitAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMaxCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11338,8 +12874,9 @@ JNI_METHOD(void, ThermostatCluster, readMinSetpointDeadBandAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11356,7 +12893,10 @@ JNI_METHOD(void, ThermostatCluster, readMinSetpointDeadBandAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11369,8 +12909,9 @@ JNI_METHOD(void, ThermostatCluster, readControlSequenceOfOperationAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ControlSequenceOfOperation::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11387,7 +12928,10 @@ JNI_METHOD(void, ThermostatCluster, readControlSequenceOfOperationAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeControlSequenceOfOperation(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11399,8 +12943,9 @@ JNI_METHOD(void, ThermostatCluster, readControlSequenceOfOperationAttribute) JNI_METHOD(void, ThermostatCluster, readSystemModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::SystemMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11417,7 +12962,10 @@ JNI_METHOD(void, ThermostatCluster, readSystemModeAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSystemMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11429,8 +12977,9 @@ JNI_METHOD(void, ThermostatCluster, readSystemModeAttribute)(JNIEnv * env, jobje JNI_METHOD(void, ThermostatCluster, readStartOfWeekAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::StartOfWeek::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11447,7 +12996,10 @@ JNI_METHOD(void, ThermostatCluster, readStartOfWeekAttribute)(JNIEnv * env, jobj chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStartOfWeek(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11460,8 +13012,9 @@ JNI_METHOD(void, ThermostatCluster, readNumberOfWeeklyTransitionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11478,7 +13031,10 @@ JNI_METHOD(void, ThermostatCluster, readNumberOfWeeklyTransitionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNumberOfWeeklyTransitions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11491,8 +13047,9 @@ JNI_METHOD(void, ThermostatCluster, readNumberOfDailyTransitionsAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11509,7 +13066,10 @@ JNI_METHOD(void, ThermostatCluster, readNumberOfDailyTransitionsAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNumberOfDailyTransitions(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11521,8 +13081,9 @@ JNI_METHOD(void, ThermostatCluster, readNumberOfDailyTransitionsAttribute) JNI_METHOD(void, ThermostatCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11539,7 +13100,10 @@ JNI_METHOD(void, ThermostatCluster, readFeatureMapAttribute)(JNIEnv * env, jobje chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11551,8 +13115,9 @@ JNI_METHOD(void, ThermostatCluster, readFeatureMapAttribute)(JNIEnv * env, jobje JNI_METHOD(void, ThermostatCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::Thermostat::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11569,7 +13134,10 @@ JNI_METHOD(void, ThermostatCluster, readClusterRevisionAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11582,8 +13150,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readTemperatureDis (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11601,7 +13170,11 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readTemperatureDis chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTemperatureDisplayMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback:: + FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11614,8 +13187,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readKeypadLockoutA (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11633,7 +13207,11 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readKeypadLockoutA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeKeypadLockout(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11646,8 +13224,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readScheduleProgra (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11665,7 +13244,11 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readScheduleProgra chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeScheduleProgrammingVisibility(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback:: + Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11678,8 +13261,9 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readClusterRevisio (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11697,7 +13281,10 @@ JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readClusterRevisio chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback< + CHIPThermostatUserInterfaceConfigurationClusterClusterRevisionAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11710,8 +13297,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11729,7 +13317,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeChannel(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11742,8 +13333,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRoutingRoleAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RoutingRole::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11761,7 +13353,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRoutingRoleAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRoutingRole(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11774,8 +13369,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNetworkNameAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -11794,7 +13390,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNetworkNameAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNetworkName(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11807,8 +13406,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPanIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11826,7 +13426,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPanIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePanId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11839,8 +13442,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readExtendedPanIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11858,7 +13462,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readExtendedPanIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeExtendedPanId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11871,8 +13479,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readMeshLocalPrefixAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -11891,7 +13500,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readMeshLocalPrefixAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMeshLocalPrefix(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11904,8 +13517,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOverrunCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -11923,7 +13537,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOverrunCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11936,9 +13553,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNeighborTableListAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::NeighborTableList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -11957,7 +13575,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNeighborTableListAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeNeighborTableList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -11970,9 +13592,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouteTableListAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouteTableList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -11991,7 +13614,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouteTableListAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRouteTableList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12004,8 +13631,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12023,7 +13651,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePartitionId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12036,8 +13667,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readWeightingAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12055,7 +13687,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readWeightingAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeWeighting(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12068,8 +13703,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDataVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12087,7 +13723,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDataVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDataVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12100,8 +13739,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readStableDataVersionAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12119,7 +13759,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readStableDataVersionAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeStableDataVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12132,8 +13776,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRouterIdAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12151,7 +13796,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRouterIdAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLeaderRouterId(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12164,8 +13813,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDetachedRoleCountAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12183,7 +13833,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDetachedRoleCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDetachedRoleCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12196,8 +13850,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChildRoleCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12215,7 +13870,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChildRoleCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeChildRoleCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12228,8 +13887,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouterRoleCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12247,7 +13907,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouterRoleCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRouterRoleCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12260,8 +13924,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRoleCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12279,7 +13944,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRoleCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeLeaderRoleCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12292,8 +13961,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readAttachAttemptCountAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12311,7 +13981,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readAttachAttemptCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeAttachAttemptCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12324,8 +13998,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdChangeCountAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12343,7 +14018,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdChangeCountAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePartitionIdChangeCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12356,8 +14035,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readBetterPartitionAttachAttem (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12375,7 +14055,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readBetterPartitionAttachAttem chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBetterPartitionAttachAttemptCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback:: + FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12388,8 +14072,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readParentChangeCountAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12407,7 +14092,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readParentChangeCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeParentChangeCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12420,8 +14109,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxTotalCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12439,7 +14129,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxTotalCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxTotalCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12452,8 +14145,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxUnicastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12471,7 +14165,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxUnicastCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxUnicastCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12484,8 +14182,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBroadcastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12503,7 +14202,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBroadcastCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12516,8 +14219,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckRequestedCountAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12535,7 +14239,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckRequestedCountAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxAckRequestedCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12548,8 +14256,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckedCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12567,7 +14276,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckedCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxAckedCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12580,8 +14292,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxNoAckRequestedCountAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12599,7 +14312,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxNoAckRequestedCountAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxNoAckRequestedCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12612,8 +14329,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12631,7 +14349,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxDataCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12644,8 +14365,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataPollCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12663,7 +14385,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataPollCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxDataPollCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12676,8 +14402,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12695,7 +14422,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxBeaconCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12708,8 +14439,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconRequestCountAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12727,7 +14459,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconRequestCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxBeaconRequestCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12740,8 +14476,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxOtherCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12759,7 +14496,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxOtherCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxOtherCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12772,8 +14512,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxRetryCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12791,7 +14532,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxRetryCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxRetryCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12804,8 +14548,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDirectMaxRetryExpiryCoun (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12823,7 +14568,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDirectMaxRetryExpiryCoun chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxDirectMaxRetryExpiryCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback< + CHIPThreadNetworkDiagnosticsClusterTxDirectMaxRetryExpiryCountAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12836,8 +14584,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxIndirectMaxRetryExpiryCo (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12855,7 +14604,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxIndirectMaxRetryExpiryCo chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxIndirectMaxRetryExpiryCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback< + CHIPThreadNetworkDiagnosticsClusterTxIndirectMaxRetryExpiryCountAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12868,8 +14620,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrCcaCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12887,7 +14640,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrCcaCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxErrCcaCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12900,8 +14657,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrAbortCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12919,7 +14677,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrAbortCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxErrAbortCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12932,8 +14694,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrBusyChannelCountAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12951,7 +14714,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrBusyChannelCountAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTxErrBusyChannelCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12964,8 +14731,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxTotalCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -12983,7 +14751,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxTotalCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxTotalCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -12996,8 +14767,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxUnicastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13015,7 +14787,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxUnicastCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxUnicastCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13028,8 +14804,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBroadcastCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13047,7 +14824,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBroadcastCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13060,8 +14841,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13079,7 +14861,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxDataCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13092,8 +14877,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataPollCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13111,7 +14897,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataPollCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxDataPollCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13124,8 +14914,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13143,7 +14934,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxBeaconCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13156,8 +14951,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconRequestCountAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13175,7 +14971,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconRequestCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxBeaconRequestCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13188,8 +14988,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxOtherCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13207,7 +15008,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxOtherCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxOtherCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13220,8 +15024,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxAddressFilteredCountAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13239,7 +15044,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxAddressFilteredCountAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxAddressFilteredCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13252,8 +15061,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDestAddrFilteredCountAtt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13271,7 +15081,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDestAddrFilteredCountAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxDestAddrFilteredCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13284,8 +15098,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDuplicatedCountAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13303,7 +15118,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDuplicatedCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxDuplicatedCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13316,8 +15135,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrNoFrameCountAttribute (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13335,7 +15155,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrNoFrameCountAttribute chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrNoFrameCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13348,8 +15172,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrUnknownNeighborCountA (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13367,7 +15192,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrUnknownNeighborCountA chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrUnknownNeighborCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13380,8 +15209,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrInvalidSrcAddrCountAt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13399,7 +15229,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrInvalidSrcAddrCountAt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrInvalidSrcAddrCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13412,8 +15246,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrSecCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13431,7 +15266,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrSecCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrSecCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13444,8 +15283,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrFcsCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13463,7 +15303,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrFcsCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrFcsCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13476,8 +15320,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrOtherCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13495,7 +15340,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrOtherCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRxErrOtherCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13508,8 +15357,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveTimestampAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13527,7 +15377,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveTimestampAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveTimestamp(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13540,8 +15394,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPendingTimestampAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13559,7 +15414,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPendingTimestampAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePendingTimestamp(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13572,8 +15431,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDelayAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13591,7 +15451,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDelayAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeDelay(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13604,9 +15467,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readSecurityPolicyAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::SecurityPolicy::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -13625,7 +15489,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readSecurityPolicyAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSecurityPolicy(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13638,8 +15506,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelMaskAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ChannelMask::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -13658,7 +15527,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelMaskAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeChannelMask(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13671,9 +15543,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOperationalDatasetComponen (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::OperationalDatasetComponents::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -13692,7 +15565,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOperationalDatasetComponen chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOperationalDatasetComponents(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback< + CHIPThreadNetworkDiagnosticsClusterOperationalDatasetComponentsAttributeCallbackType>::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13705,9 +15581,10 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveNetworkFaultsListAtt (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ActiveNetworkFaultsList::TypeInfo; std::unique_ptr - onSuccess(chip::Platform::New(callback), + onSuccess(chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -13726,7 +15603,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveNetworkFaultsListAtt chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeActiveNetworkFaultsList(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13739,8 +15620,9 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13758,7 +15640,11 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13770,6 +15656,7 @@ JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readClusterRevisionAttribute) JNI_METHOD(void, WakeOnLanCluster, readWakeOnLanMacAddressAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WakeOnLan::Attributes::WakeOnLanMacAddress::TypeInfo; std::unique_ptr onSuccess( chip::Platform::New(callback, false), chip::Platform::Delete); @@ -13789,7 +15676,10 @@ JNI_METHOD(void, WakeOnLanCluster, readWakeOnLanMacAddressAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeWakeOnLanMacAddress(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13801,8 +15691,9 @@ JNI_METHOD(void, WakeOnLanCluster, readWakeOnLanMacAddressAttribute)(JNIEnv * en JNI_METHOD(void, WakeOnLanCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WakeOnLan::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13819,7 +15710,10 @@ JNI_METHOD(void, WakeOnLanCluster, readClusterRevisionAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13831,8 +15725,9 @@ JNI_METHOD(void, WakeOnLanCluster, readClusterRevisionAttribute)(JNIEnv * env, j JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBssidAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback, true), + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( @@ -13851,7 +15746,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBssidAttribute)(JNIEnv * env chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBssid(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13864,8 +15762,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readSecurityTypeAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::SecurityType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13883,7 +15782,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readSecurityTypeAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSecurityType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13896,8 +15798,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readWiFiVersionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::WiFiVersion::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13915,7 +15818,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readWiFiVersionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeWiFiVersion(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13928,8 +15834,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readChannelNumberAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13947,7 +15854,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readChannelNumberAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeChannelNumber(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13959,8 +15869,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readChannelNumberAttribute) JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readRssiAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -13978,7 +15889,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readRssiAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeRssi(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -13991,8 +15905,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconLostCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14010,7 +15925,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconLostCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBeaconLostCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14023,8 +15942,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconRxCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14042,7 +15962,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconRxCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeBeaconRxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14055,8 +15978,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastRxCountAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14074,7 +15998,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastRxCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketMulticastRxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14087,8 +16015,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastTxCountAttrib (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14106,7 +16035,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastTxCountAttrib chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketMulticastTxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14119,8 +16052,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastRxCountAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14138,7 +16072,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastRxCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketUnicastRxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14151,8 +16089,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastTxCountAttribut (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14170,7 +16109,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastTxCountAttribut chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributePacketUnicastTxCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14183,8 +16126,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readCurrentMaxRateAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14202,7 +16146,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readCurrentMaxRateAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentMaxRate(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14215,8 +16162,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readOverrunCountAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14234,7 +16182,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readOverrunCountAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14247,8 +16198,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readFeatureMapAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14266,7 +16218,10 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readFeatureMapAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14279,8 +16234,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14298,7 +16254,11 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14310,8 +16270,9 @@ JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readClusterRevisionAttribute) JNI_METHOD(void, WindowCoveringCluster, readTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Type::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14328,7 +16289,10 @@ JNI_METHOD(void, WindowCoveringCluster, readTypeAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14341,8 +16305,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLift::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14359,7 +16324,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionLift(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14372,8 +16340,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14390,7 +16359,10 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionTilt(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14402,8 +16374,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltAttribute) JNI_METHOD(void, WindowCoveringCluster, readConfigStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::ConfigStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14420,7 +16393,10 @@ JNI_METHOD(void, WindowCoveringCluster, readConfigStatusAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeConfigStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14433,8 +16409,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercentageAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14451,7 +16428,11 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercentageAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionLiftPercentage(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14464,8 +16445,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercentageAttribu (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14482,7 +16464,11 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercentageAttribu chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionTiltPercentage(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14495,8 +16481,9 @@ JNI_METHOD(void, WindowCoveringCluster, readOperationalStatusAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::OperationalStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14513,7 +16500,10 @@ JNI_METHOD(void, WindowCoveringCluster, readOperationalStatusAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeOperationalStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14526,8 +16516,9 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionLiftPercent100thsAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14544,7 +16535,11 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionLiftPercent100thsAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTargetPositionLiftPercent100ths(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14557,8 +16552,9 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionTiltPercent100thsAttri (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14575,7 +16571,11 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionTiltPercent100thsAttri chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeTargetPositionTiltPercent100ths(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14587,8 +16587,9 @@ JNI_METHOD(void, WindowCoveringCluster, readTargetPositionTiltPercent100thsAttri JNI_METHOD(void, WindowCoveringCluster, readEndProductTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::EndProductType::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14605,7 +16606,10 @@ JNI_METHOD(void, WindowCoveringCluster, readEndProductTypeAttribute)(JNIEnv * en chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeEndProductType(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14618,8 +16622,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercent100thsAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14636,7 +16641,11 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercent100thsAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionLiftPercent100ths(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14649,8 +16658,9 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercent100thsAttr (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14667,7 +16677,11 @@ JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercent100thsAttr chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeCurrentPositionTiltPercent100ths(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14680,8 +16694,9 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14698,7 +16713,10 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitLiftAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInstalledOpenLimitLift(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14711,8 +16729,9 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitLiftAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14729,7 +16748,11 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitLiftAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInstalledClosedLimitLift(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14742,8 +16765,9 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14760,7 +16784,10 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitTiltAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInstalledOpenLimitTilt(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14773,8 +16800,9 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitTiltAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14791,7 +16819,11 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitTiltAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeInstalledClosedLimitTilt(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14803,8 +16835,9 @@ JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitTiltAttribute) JNI_METHOD(void, WindowCoveringCluster, readModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::Mode::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14821,7 +16854,10 @@ JNI_METHOD(void, WindowCoveringCluster, readModeAttribute)(JNIEnv * env, jobject chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeMode(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14833,8 +16869,9 @@ JNI_METHOD(void, WindowCoveringCluster, readModeAttribute)(JNIEnv * env, jobject JNI_METHOD(void, WindowCoveringCluster, readSafetyStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::SafetyStatus::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14851,7 +16888,10 @@ JNI_METHOD(void, WindowCoveringCluster, readSafetyStatusAttribute)(JNIEnv * env, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeSafetyStatus(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14863,8 +16903,9 @@ JNI_METHOD(void, WindowCoveringCluster, readSafetyStatusAttribute)(JNIEnv * env, JNI_METHOD(void, WindowCoveringCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::FeatureMap::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14881,7 +16922,10 @@ JNI_METHOD(void, WindowCoveringCluster, readFeatureMapAttribute)(JNIEnv * env, j chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = + chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); @@ -14894,8 +16938,9 @@ JNI_METHOD(void, WindowCoveringCluster, readClusterRevisionAttribute) (JNIEnv * env, jobject self, jlong clusterPtr, jobject callback) { chip::DeviceLayer::StackLock lock; + using TypeInfo = chip::app::Clusters::WindowCovering::Attributes::ClusterRevision::TypeInfo; std::unique_ptr onSuccess( - chip::Platform::New(callback), chip::Platform::Delete); + chip::Platform::New(callback, false), chip::Platform::Delete); VerifyOrReturn(onSuccess.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY)); @@ -14912,7 +16957,10 @@ JNI_METHOD(void, WindowCoveringCluster, readClusterRevisionAttribute) chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); - err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + auto successFn = chip::Callback::Callback::FromCancelable( + onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + err = cppCluster->ReadAttribute(onSuccess->mContext, successFn->mCall, failureFn->mCall); VerifyOrReturn( err == CHIP_NO_ERROR, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err)); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 26d3578e867e71..5d63c7f38b3c39 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -575,8 +575,9 @@ void CHIPOctetStringAttributeCallback::CallbackFn(void * context, const chip::By } CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CHIPApplicationLauncherApplicationLauncherListAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -613,8 +614,8 @@ void CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -663,8 +664,10 @@ void CHIPApplicationLauncherApplicationLauncherListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAudioOutputAudioOutputListAttributeCallback::CHIPAudioOutputAudioOutputListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPAudioOutputAudioOutputListAttributeCallback::CHIPAudioOutputAudioOutputListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -702,8 +705,8 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -796,8 +799,8 @@ void CHIPAudioOutputAudioOutputListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedActionsActionListAttributeCallback::CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPBridgedActionsActionListAttributeCallback::CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -835,8 +838,8 @@ void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -975,8 +978,10 @@ void CHIPBridgedActionsActionListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedActionsEndpointListAttributeCallback::CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPBridgedActionsEndpointListAttributeCallback::CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1015,8 +1020,8 @@ void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1108,8 +1113,10 @@ void CHIPBridgedActionsEndpointListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPContentLauncherAcceptsHeaderListAttributeCallback::CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPContentLauncherAcceptsHeaderListAttributeCallback::CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1146,8 +1153,8 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1194,8 +1201,9 @@ void CHIPContentLauncherAcceptsHeaderListAttributeCallback::CallbackFn( } CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CHIPContentLauncherSupportedStreamingTypesAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1233,8 +1241,8 @@ void CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1283,8 +1291,8 @@ void CHIPContentLauncherSupportedStreamingTypesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPDescriptorDeviceListAttributeCallback::CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1322,8 +1330,8 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1402,8 +1410,8 @@ void CHIPDescriptorDeviceListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDescriptorServerListAttributeCallback::CHIPDescriptorServerListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPDescriptorServerListAttributeCallback::CHIPDescriptorServerListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1440,8 +1448,8 @@ void CHIPDescriptorServerListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1489,8 +1497,8 @@ void CHIPDescriptorServerListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDescriptorClientListAttributeCallback::CHIPDescriptorClientListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPDescriptorClientListAttributeCallback::CHIPDescriptorClientListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1527,8 +1535,8 @@ void CHIPDescriptorClientListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1576,8 +1584,8 @@ void CHIPDescriptorClientListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPDescriptorPartsListAttributeCallback::CHIPDescriptorPartsListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPDescriptorPartsListAttributeCallback::CHIPDescriptorPartsListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1614,8 +1622,8 @@ void CHIPDescriptorPartsListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1663,8 +1671,8 @@ void CHIPDescriptorPartsListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1702,8 +1710,8 @@ void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1777,8 +1785,9 @@ void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( } CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback:: - CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1818,8 +1827,8 @@ void CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback::Callba VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -1888,8 +1897,9 @@ void CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback::Callba } CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -1928,8 +1938,8 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2075,8 +2085,9 @@ void CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback::CallbackFn( } CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback::CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2113,8 +2124,8 @@ void CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2164,8 +2175,9 @@ void CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback::CallbackFn( } CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback::CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2202,8 +2214,8 @@ void CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback::CallbackFn(void * VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2253,8 +2265,9 @@ void CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback::CallbackFn(void * } CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback::CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2291,8 +2304,8 @@ void CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2341,8 +2354,8 @@ void CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPGroupKeyManagementGroupsAttributeCallback::CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2380,8 +2393,8 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2476,8 +2489,10 @@ void CHIPGroupKeyManagementGroupsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPGroupKeyManagementGroupKeysAttributeCallback::CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2515,8 +2530,8 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2642,8 +2657,252 @@ void CHIPGroupKeyManagementGroupKeysAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPMediaInputMediaInputListAttributeCallback::CHIPMediaInputMediaInputListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::CHIPIlluminanceMeasurementMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::~CHIPIlluminanceMeasurementMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIlluminanceMeasurementMeasuredValueAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::~CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback( + 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"); + } +} + +CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::~CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback( + 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"); + } +} + +CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::~CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPMediaInputMediaInputListAttributeCallback::CHIPMediaInputMediaInputListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2681,8 +2940,8 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2787,8 +3046,8 @@ void CHIPMediaInputMediaInputListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPModeSelectSupportedModesAttributeCallback::CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPModeSelectSupportedModesAttributeCallback::CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2826,8 +3085,8 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -2920,9 +3179,10 @@ void CHIPModeSelectSupportedModesAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentialsFabricsListAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPOperationalCredentialsFabricsListAttributeCallback::CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -2961,8 +3221,8 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3100,8 +3360,9 @@ void CHIPOperationalCredentialsFabricsListAttributeCallback::CallbackFn( } CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3139,8 +3400,8 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3186,8 +3447,70 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback( + 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"); + } +} + +CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::~CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback::CallbackFn(void * context, chip::FabricIndex 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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), + javaValueCtorSignature.c_str(), value, javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3224,8 +3547,8 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3274,8 +3597,10 @@ void CHIPPowerSourceActiveBatteryFaultsAttributeCallback::CallbackFn(void * cont env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3314,8 +3639,8 @@ void CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3440,8 +3765,8 @@ void CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTvChannelTvChannelListAttributeCallback::CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPTvChannelTvChannelListAttributeCallback::CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3479,8 +3804,8 @@ void CHIPTvChannelTvChannelListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3600,8 +3925,9 @@ void CHIPTvChannelTvChannelListAttributeCallback::CallbackFn( } CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CHIPTargetNavigatorTargetNavigatorListAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3640,8 +3966,8 @@ void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3719,8 +4045,8 @@ void CHIPTargetNavigatorTargetNavigatorListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTestClusterListInt8uAttributeCallback::CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPTestClusterListInt8uAttributeCallback::CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3757,8 +4083,8 @@ void CHIPTestClusterListInt8uAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3806,8 +4132,10 @@ void CHIPTestClusterListInt8uAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTestClusterListOctetStringAttributeCallback::CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPTestClusterListOctetStringAttributeCallback::CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3844,8 +4172,8 @@ void CHIPTestClusterListOctetStringAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -3891,8 +4219,10 @@ void CHIPTestClusterListOctetStringAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTestClusterListStructOctetStringAttributeCallback::CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPTestClusterListStructOctetStringAttributeCallback::CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -3930,8 +4260,8 @@ void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -4010,9 +4340,8 @@ void CHIPTestClusterListStructOctetStringAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) +CHIPTestClusterVendorIdAttributeCallback::CHIPTestClusterVendorIdAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4028,7 +4357,7 @@ CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CHIPTestCluster } } -CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback() +CHIPTestClusterVendorIdAttributeCallback::~CHIPTestClusterVendorIdAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4039,10 +4368,7 @@ CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::~CHIPTestCluste env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list) +void CHIPTestClusterVendorIdAttributeCallback::CallbackFn(void * context, chip::VendorId value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -4050,42 +4376,105 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context)); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; VerifyOrReturn(javaCallbackRef != nullptr, ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - jclass arrayListClass; - err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); - chip::JniClass arrayListJniClass(arrayListClass); - jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); - jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); - VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, - ChipLogError(Zcl, "Error finding Java ArrayList methods")); - jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); - VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + 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")); - jclass attributeClass; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipClusters$TestClusterCluster$ListNullablesAndOptionalsStructAttribute", attributeClass); - VerifyOrReturn( - err == CHIP_NO_ERROR, - ChipLogError( - Zcl, - "Could not find class chip/devicecontroller/ChipClusters$TestClusterCluster$ListNullablesAndOptionalsStructAttribute")); - chip::JniClass attributeJniClass(attributeClass); - jmethodID attributeCtor = env->GetMethodID( - attributeClass, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)V"); + jobject javaValue; + + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value, javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback( + 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"); + } +} + +CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jclass arrayListClass; + err = chip::JniReferences::GetInstance().GetClassRef(env, "java/util/ArrayList", arrayListClass); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error using Java ArrayList")); + chip::JniClass arrayListJniClass(arrayListClass); + jmethodID arrayListCtor = env->GetMethodID(arrayListClass, "", "()V"); + jmethodID arrayListAddMethod = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + VerifyOrReturn(arrayListCtor != nullptr && arrayListAddMethod != nullptr, + ChipLogError(Zcl, "Error finding Java ArrayList methods")); + jobject arrayListObj = env->NewObject(arrayListClass, arrayListCtor); + VerifyOrReturn(arrayListObj != nullptr, ChipLogError(Zcl, "Error creating Java ArrayList")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jclass attributeClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipClusters$TestClusterCluster$ListNullablesAndOptionalsStructAttribute", attributeClass); + VerifyOrReturn( + err == CHIP_NO_ERROR, + ChipLogError( + Zcl, + "Could not find class chip/devicecontroller/ChipClusters$TestClusterCluster$ListNullablesAndOptionalsStructAttribute")); + chip::JniClass attributeJniClass(attributeClass); + jmethodID attributeCtor = env->GetMethodID( + attributeClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;)V"); VerifyOrReturn(attributeCtor != nullptr, ChipLogError(Zcl, "Could not find ListNullablesAndOptionalsStructAttribute constructor")); @@ -4239,9 +4628,1033 @@ void CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPTestClusterNullableBooleanAttributeCallback::CHIPTestClusterNullableBooleanAttributeCallback(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"); + } +} + +CHIPTestClusterNullableBooleanAttributeCallback::~CHIPTestClusterNullableBooleanAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableBooleanAttributeCallback::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/Boolean;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + std::string javaValueClassName = "java/lang/Boolean"; + std::string javaValueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableBitmap8AttributeCallback::CHIPTestClusterNullableBitmap8AttributeCallback(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"); + } +} + +CHIPTestClusterNullableBitmap8AttributeCallback::~CHIPTestClusterNullableBitmap8AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableBitmap8AttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableBitmap16AttributeCallback::CHIPTestClusterNullableBitmap16AttributeCallback(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"); + } +} + +CHIPTestClusterNullableBitmap16AttributeCallback::~CHIPTestClusterNullableBitmap16AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableBitmap16AttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableBitmap32AttributeCallback::CHIPTestClusterNullableBitmap32AttributeCallback(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"); + } +} + +CHIPTestClusterNullableBitmap32AttributeCallback::~CHIPTestClusterNullableBitmap32AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableBitmap32AttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableBitmap64AttributeCallback::CHIPTestClusterNullableBitmap64AttributeCallback(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"); + } +} + +CHIPTestClusterNullableBitmap64AttributeCallback::~CHIPTestClusterNullableBitmap64AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableBitmap64AttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableInt8uAttributeCallback::CHIPTestClusterNullableInt8uAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt8uAttributeCallback::~CHIPTestClusterNullableInt8uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt8uAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableInt16uAttributeCallback::CHIPTestClusterNullableInt16uAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt16uAttributeCallback::~CHIPTestClusterNullableInt16uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt16uAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableInt32uAttributeCallback::CHIPTestClusterNullableInt32uAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt32uAttributeCallback::~CHIPTestClusterNullableInt32uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt32uAttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableInt64uAttributeCallback::CHIPTestClusterNullableInt64uAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt64uAttributeCallback::~CHIPTestClusterNullableInt64uAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt64uAttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableInt8sAttributeCallback::CHIPTestClusterNullableInt8sAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt8sAttributeCallback::~CHIPTestClusterNullableInt8sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt8sAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableInt16sAttributeCallback::CHIPTestClusterNullableInt16sAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt16sAttributeCallback::~CHIPTestClusterNullableInt16sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt16sAttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableInt32sAttributeCallback::CHIPTestClusterNullableInt32sAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt32sAttributeCallback::~CHIPTestClusterNullableInt32sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt32sAttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableInt64sAttributeCallback::CHIPTestClusterNullableInt64sAttributeCallback(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"); + } +} + +CHIPTestClusterNullableInt64sAttributeCallback::~CHIPTestClusterNullableInt64sAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableInt64sAttributeCallback::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; + + 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); +} + +CHIPTestClusterNullableEnum8AttributeCallback::CHIPTestClusterNullableEnum8AttributeCallback(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"); + } +} + +CHIPTestClusterNullableEnum8AttributeCallback::~CHIPTestClusterNullableEnum8AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableEnum8AttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableEnum16AttributeCallback::CHIPTestClusterNullableEnum16AttributeCallback(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"); + } +} + +CHIPTestClusterNullableEnum16AttributeCallback::~CHIPTestClusterNullableEnum16AttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableEnum16AttributeCallback::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/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + 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->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableOctetStringAttributeCallback::CHIPTestClusterNullableOctetStringAttributeCallback(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"); + } +} + +CHIPTestClusterNullableOctetStringAttributeCallback::~CHIPTestClusterNullableOctetStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableOctetStringAttributeCallback::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", "([B)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + + javaValue = chip::ByteArray(env, value.Value()).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTestClusterNullableCharStringAttributeCallback::CHIPTestClusterNullableCharStringAttributeCallback(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"); + } +} + +CHIPTestClusterNullableCharStringAttributeCallback::~CHIPTestClusterNullableCharStringAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTestClusterNullableCharStringAttributeCallback::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; + + javaValue = chip::UtfString(env, value.Value()).jniValue(); + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4280,8 +5693,8 @@ void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -4550,8 +5963,9 @@ void CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback::CallbackFn( } CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4590,8 +6004,8 @@ void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -4798,8 +6212,9 @@ void CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback::CallbackFn( } CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback( - jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4838,8 +6253,8 @@ void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -4922,8 +6337,10 @@ void CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback::CallbackFn( } CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: - CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, + this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -4963,8 +6380,8 @@ void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; @@ -5211,8 +6628,9 @@ void CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback:: } CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback:: - CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback) : - chip::Callback::Callback(CallbackFn, this) + CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -5250,8 +6668,8 @@ void CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback::Callb VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context)); + 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; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 7867815cee0fe5..32cf00fb2cda1f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -16,9 +16,10 @@ */ // THIS FILE IS GENERATED BY ZAP -#include +#include "CHIPCallbackTypes.h" #include +#include class CHIPBooleanAttributeCallback : public chip::Callback::Callback { @@ -32,7 +33,7 @@ class CHIPBooleanAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -42,7 +43,6 @@ class CHIPBooleanAttributeCallback : public chip::Callback::Callback { public: @@ -55,7 +55,7 @@ class CHIPCharStringAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -65,7 +65,6 @@ class CHIPCharStringAttributeCallback : public chip::Callback::Callback { public: @@ -78,7 +77,7 @@ class CHIPInt8sAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -88,7 +87,6 @@ class CHIPInt8sAttributeCallback : public chip::Callback::Callback { public: @@ -101,7 +99,7 @@ class CHIPInt8uAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -111,7 +109,6 @@ class CHIPInt8uAttributeCallback : public chip::Callback::Callback { public: @@ -124,7 +121,7 @@ class CHIPInt16sAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -134,7 +131,6 @@ class CHIPInt16sAttributeCallback : public chip::Callback::Callback { public: @@ -147,7 +143,7 @@ class CHIPInt16uAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -157,7 +153,6 @@ class CHIPInt16uAttributeCallback : public chip::Callback::Callback { public: @@ -170,7 +165,7 @@ class CHIPInt32sAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -180,7 +175,6 @@ class CHIPInt32sAttributeCallback : public chip::Callback::Callback { public: @@ -193,7 +187,7 @@ class CHIPInt32uAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -203,7 +197,6 @@ class CHIPInt32uAttributeCallback : public chip::Callback::Callback { public: @@ -216,7 +209,7 @@ class CHIPInt64sAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -226,7 +219,6 @@ class CHIPInt64sAttributeCallback : public chip::Callback::Callback { public: @@ -239,7 +231,7 @@ class CHIPInt64uAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -249,7 +241,6 @@ class CHIPInt64uAttributeCallback : public chip::Callback::Callback { public: @@ -262,7 +253,7 @@ class CHIPOctetStringAttributeCallback : public chip::Callback::CallbackkeepAlive) { callback->Cancel(); - delete callback; + chip::Platform::Delete(callback); } } @@ -274,27 +265,46 @@ class CHIPOctetStringAttributeCallback : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPApplicationLauncherApplicationLauncherListAttributeCallback(jobject javaCallback); + CHIPApplicationLauncherApplicationLauncherListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPApplicationLauncherApplicationLauncherListAttributeCallback(); + static void maybeDestroy(CHIPApplicationLauncherApplicationLauncherListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPAudioOutputAudioOutputListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPAudioOutputAudioOutputListAttributeCallback(jobject javaCallback); + CHIPAudioOutputAudioOutputListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPAudioOutputAudioOutputListAttributeCallback(); + static void maybeDestroy(CHIPAudioOutputAudioOutputListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -302,15 +312,26 @@ class CHIPAudioOutputAudioOutputListAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPBridgedActionsActionListAttributeCallback : public chip::Callback::Callback +class CHIPBridgedActionsActionListAttributeCallback + : public chip::Callback::Callback { public: - CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback); + CHIPBridgedActionsActionListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPBridgedActionsActionListAttributeCallback(); + static void maybeDestroy(CHIPBridgedActionsActionListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -318,16 +339,26 @@ class CHIPBridgedActionsActionListAttributeCallback : public chip::Callback::Cal private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPBridgedActionsEndpointListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback); + CHIPBridgedActionsEndpointListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPBridgedActionsEndpointListAttributeCallback(); + static void maybeDestroy(CHIPBridgedActionsEndpointListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -335,115 +366,200 @@ class CHIPBridgedActionsEndpointListAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPContentLauncherAcceptsHeaderListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback); + CHIPContentLauncherAcceptsHeaderListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPContentLauncherAcceptsHeaderListAttributeCallback(); + static void maybeDestroy(CHIPContentLauncherAcceptsHeaderListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPContentLauncherSupportedStreamingTypesAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPContentLauncherSupportedStreamingTypesAttributeCallback(jobject javaCallback); + CHIPContentLauncherSupportedStreamingTypesAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPContentLauncherSupportedStreamingTypesAttributeCallback(); + static void maybeDestroy(CHIPContentLauncherSupportedStreamingTypesAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPDescriptorDeviceListAttributeCallback : public chip::Callback::Callback +class CHIPDescriptorDeviceListAttributeCallback + : public chip::Callback::Callback { public: - CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback); + CHIPDescriptorDeviceListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPDescriptorDeviceListAttributeCallback(); + static void maybeDestroy(CHIPDescriptorDeviceListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPDescriptorServerListAttributeCallback : public chip::Callback::Callback +class CHIPDescriptorServerListAttributeCallback + : public chip::Callback::Callback { public: - CHIPDescriptorServerListAttributeCallback(jobject javaCallback); + CHIPDescriptorServerListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPDescriptorServerListAttributeCallback(); + static void maybeDestroy(CHIPDescriptorServerListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPDescriptorClientListAttributeCallback : public chip::Callback::Callback +class CHIPDescriptorClientListAttributeCallback + : public chip::Callback::Callback { public: - CHIPDescriptorClientListAttributeCallback(jobject javaCallback); + CHIPDescriptorClientListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPDescriptorClientListAttributeCallback(); + static void maybeDestroy(CHIPDescriptorClientListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPDescriptorPartsListAttributeCallback : public chip::Callback::Callback +class CHIPDescriptorPartsListAttributeCallback + : public chip::Callback::Callback { public: - CHIPDescriptorPartsListAttributeCallback(jobject javaCallback); + CHIPDescriptorPartsListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPDescriptorPartsListAttributeCallback(); + static void maybeDestroy(CHIPDescriptorPartsListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPFixedLabelLabelListAttributeCallback : public chip::Callback::Callback +class CHIPFixedLabelLabelListAttributeCallback + : public chip::Callback::Callback { public: - CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback); + CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPFixedLabelLabelListAttributeCallback(); + static void maybeDestroy(CHIPFixedLabelLabelListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(jobject javaCallback); + CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback(); + static void maybeDestroy(CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< @@ -451,73 +567,124 @@ class CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(jobject javaCallback); + CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback(); + static void maybeDestroy(CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::GeneralDiagnostics::Structs::NetworkInterfaceType::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback(jobject javaCallback); + CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback(); + static void maybeDestroy(CHIPGeneralDiagnosticsActiveHardwareFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback(jobject javaCallback); + CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback(); + static void maybeDestroy(CHIPGeneralDiagnosticsActiveRadioFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback(jobject javaCallback); + CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback(); + static void maybeDestroy(CHIPGeneralDiagnosticsActiveNetworkFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPGroupKeyManagementGroupsAttributeCallback : public chip::Callback::Callback +class CHIPGroupKeyManagementGroupsAttributeCallback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback); + CHIPGroupKeyManagementGroupsAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGroupKeyManagementGroupsAttributeCallback(); + static void maybeDestroy(CHIPGroupKeyManagementGroupsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -525,16 +692,26 @@ class CHIPGroupKeyManagementGroupsAttributeCallback : public chip::Callback::Cal private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPGroupKeyManagementGroupKeysAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback); + CHIPGroupKeyManagementGroupKeysAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPGroupKeyManagementGroupKeysAttributeCallback(); + static void maybeDestroy(CHIPGroupKeyManagementGroupKeysAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -542,166 +719,400 @@ class CHIPGroupKeyManagementGroupKeysAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPMediaInputMediaInputListAttributeCallback : public chip::Callback::Callback +class CHIPIlluminanceMeasurementMeasuredValueAttributeCallback + : public chip::Callback::Callback { public: - CHIPMediaInputMediaInputListAttributeCallback(jobject javaCallback); - - ~CHIPMediaInputMediaInputListAttributeCallback(); - - static void CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & list); - -private: - jobject javaCallbackRef; -}; + CHIPIlluminanceMeasurementMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); -class CHIPModeSelectSupportedModesAttributeCallback : public chip::Callback::Callback -{ -public: - CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback); + ~CHIPIlluminanceMeasurementMeasuredValueAttributeCallback(); - ~CHIPModeSelectSupportedModesAttributeCallback(); + static void maybeDestroy(CHIPIlluminanceMeasurementMeasuredValueAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } - static void CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list); + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPOperationalCredentialsFabricsListAttributeCallback - : public chip::Callback::Callback +class CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback + : public chip::Callback::Callback { public: - CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback); + CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPOperationalCredentialsFabricsListAttributeCallback(); + ~CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback(); - static void CallbackFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list); + static void maybeDestroy(CHIPIlluminanceMeasurementMinMeasuredValueAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback - : public chip::Callback::Callback +class CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback + : public chip::Callback::Callback { public: - CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback); + CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(); + ~CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback(); - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void maybeDestroy(CHIPIlluminanceMeasurementMaxMeasuredValueAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPPowerSourceActiveBatteryFaultsAttributeCallback - : public chip::Callback::Callback +class CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback + : public chip::Callback::Callback { public: - CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback); + CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPPowerSourceActiveBatteryFaultsAttributeCallback(); + ~CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback(); - static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + static void maybeDestroy(CHIPIlluminanceMeasurementLightSensorTypeAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback - : public chip::Callback::Callback +class CHIPMediaInputMediaInputListAttributeCallback + : public chip::Callback::Callback { public: - CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback); + CHIPMediaInputMediaInputListAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(); + ~CHIPMediaInputMediaInputListAttributeCallback(); + + static void maybeDestroy(CHIPMediaInputMediaInputListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list); + const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPTvChannelTvChannelListAttributeCallback : public chip::Callback::Callback +class CHIPModeSelectSupportedModesAttributeCallback + : public chip::Callback::Callback { public: - CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback); + CHIPModeSelectSupportedModesAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPTvChannelTvChannelListAttributeCallback(); + ~CHIPModeSelectSupportedModesAttributeCallback(); + + static void maybeDestroy(CHIPModeSelectSupportedModesAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } static void CallbackFn( void * context, - const chip::app::DataModel::DecodableList & list); + const chip::app::DataModel::DecodableList & + list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPTargetNavigatorTargetNavigatorListAttributeCallback - : public chip::Callback::Callback +class CHIPOperationalCredentialsFabricsListAttributeCallback + : public chip::Callback::Callback { public: - CHIPTargetNavigatorTargetNavigatorListAttributeCallback(jobject javaCallback); + CHIPOperationalCredentialsFabricsListAttributeCallback(jobject javaCallback, bool keepAlive = false); - ~CHIPTargetNavigatorTargetNavigatorListAttributeCallback(); + ~CHIPOperationalCredentialsFabricsListAttributeCallback(); + + static void maybeDestroy(CHIPOperationalCredentialsFabricsListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< - chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list); + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptor::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; }; -class CHIPTestClusterListInt8uAttributeCallback : public chip::Callback::Callback +class CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(); + + static void maybeDestroy(CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback(); + + static void maybeDestroy(CHIPOperationalCredentialsCurrentFabricIndexAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, chip::FabricIndex value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPPowerSourceActiveBatteryFaultsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPPowerSourceActiveBatteryFaultsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPPowerSourceActiveBatteryFaultsAttributeCallback(); + + static void maybeDestroy(CHIPPowerSourceActiveBatteryFaultsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback(); + + static void maybeDestroy(CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTvChannelTvChannelListAttributeCallback + : public chip::Callback::Callback { public: - CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback); + CHIPTvChannelTvChannelListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTvChannelTvChannelListAttributeCallback(); + + static void maybeDestroy(CHIPTvChannelTvChannelListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTargetNavigatorTargetNavigatorListAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTargetNavigatorTargetNavigatorListAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTargetNavigatorTargetNavigatorListAttributeCallback(); + + static void maybeDestroy(CHIPTargetNavigatorTargetNavigatorListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, + const chip::app::DataModel::DecodableList< + chip::app::Clusters::TargetNavigator::Structs::NavigateTargetTargetInfo::DecodableType> & list); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterListInt8uAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterListInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPTestClusterListInt8uAttributeCallback(); + static void maybeDestroy(CHIPTestClusterListInt8uAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPTestClusterListOctetStringAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback); + CHIPTestClusterListOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPTestClusterListOctetStringAttributeCallback(); + static void maybeDestroy(CHIPTestClusterListOctetStringAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPTestClusterListStructOctetStringAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback); + CHIPTestClusterListStructOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPTestClusterListStructOctetStringAttributeCallback(); + static void maybeDestroy(CHIPTestClusterListStructOctetStringAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn( void * context, const chip::app::DataModel::DecodableList & @@ -709,80 +1120,562 @@ class CHIPTestClusterListStructOctetStringAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterVendorIdAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterVendorIdAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterVendorIdAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterVendorIdAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, chip::VendorId value); + +private: + jobject javaCallbackRef; + bool keepAlive; }; class CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(jobject javaCallback); + CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback(); + static void maybeDestroy(CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::TestCluster::Structs::NullablesAndOptionalsStruct::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableBooleanAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableBooleanAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableBooleanAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableBooleanAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableBitmap8AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableBitmap8AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableBitmap8AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableBitmap8AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableBitmap16AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableBitmap16AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableBitmap16AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableBitmap16AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableBitmap32AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableBitmap32AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableBitmap32AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableBitmap32AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableBitmap64AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableBitmap64AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableBitmap64AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableBitmap64AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt8uAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt8uAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt8uAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt8uAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt16uAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt16uAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt16uAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt16uAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt32uAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt32uAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt32uAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt32uAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt64uAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt64uAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt64uAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt64uAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt8sAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt8sAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt8sAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt8sAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt16sAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt16sAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt16sAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt16sAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt32sAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt32sAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt32sAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt32sAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableInt64sAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableInt64sAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableInt64sAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableInt64sAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableEnum8AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableEnum8AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableEnum8AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableEnum8AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableEnum16AttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableEnum16AttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableEnum16AttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableEnum16AttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableOctetStringAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableOctetStringAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableOctetStringAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableOctetStringAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; +}; + +class CHIPTestClusterNullableCharStringAttributeCallback + : public chip::Callback::Callback +{ +public: + CHIPTestClusterNullableCharStringAttributeCallback(jobject javaCallback, bool keepAlive = false); + + ~CHIPTestClusterNullableCharStringAttributeCallback(); + + static void maybeDestroy(CHIPTestClusterNullableCharStringAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + + static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + +private: + jobject javaCallbackRef; + bool keepAlive; }; class CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(jobject javaCallback); + CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback(); + static void maybeDestroy(CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::NeighborTable::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(jobject javaCallback); + CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback(); + static void maybeDestroy(CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::RouteTable::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(jobject javaCallback); + CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback(); + static void maybeDestroy(CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< chip::app::Clusters::ThreadNetworkDiagnostics::Structs::SecurityPolicy::DecodableType> & list); private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback); + CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback(); + static void maybeDestroy(CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList< @@ -790,20 +1683,31 @@ class CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback private: jobject javaCallbackRef; + bool keepAlive; }; class CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback - : public chip::Callback::Callback + : public chip::Callback::Callback { public: - CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback); + CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(jobject javaCallback, bool keepAlive = false); ~CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback(); + static void maybeDestroy(CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback * callback) + { + if (!callback->keepAlive) + { + callback->Cancel(); + chip::Platform::Delete(callback); + } + } + static void CallbackFn(void * context, const chip::app::DataModel::DecodableList & list); private: jobject javaCallbackRef; + bool keepAlive; }; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index cd95d5fb9b7f2a..7d2c0a8e49a8a9 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -108,11 +108,11 @@ public void login( } private native void getSetupPIN( - long chipClusterPtr, GetSetupPINResponseCallback callback, String tempAccountIdentifier); + long chipClusterPtr, GetSetupPINResponseCallback Callback, String tempAccountIdentifier); private native void login( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, String tempAccountIdentifier, String setupPIN); @@ -186,11 +186,11 @@ public void revokeCommissioning(DefaultClusterCallback callback) { } private native void openBasicCommissioningWindow( - long chipClusterPtr, DefaultClusterCallback callback, Integer commissioningTimeout); + long chipClusterPtr, DefaultClusterCallback Callback, Integer commissioningTimeout); private native void openCommissioningWindow( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer commissioningTimeout, byte[] PAKEVerifier, Integer discriminator, @@ -198,7 +198,7 @@ private native void openCommissioningWindow( byte[] salt, Integer passcodeID); - private native void revokeCommissioning(long chipClusterPtr, DefaultClusterCallback callback); + private native void revokeCommissioning(long chipClusterPtr, DefaultClusterCallback Callback); public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); @@ -240,7 +240,7 @@ public void changeStatus(DefaultClusterCallback callback, Integer status) { } private native void changeStatus( - long chipClusterPtr, DefaultClusterCallback callback, Integer status); + long chipClusterPtr, DefaultClusterCallback Callback, Integer status); public void readVendorNameAttribute(CharStringAttributeCallback callback) { readVendorNameAttribute(chipClusterPtr, callback); @@ -441,7 +441,7 @@ public void launchApp( private native void launchApp( long chipClusterPtr, - LaunchAppResponseCallback callback, + LaunchAppResponseCallback Callback, String data, Integer catalogVendorId, String applicationId); @@ -453,7 +453,7 @@ public interface LaunchAppResponseCallback { } public interface ApplicationLauncherListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -554,10 +554,10 @@ public void selectOutput(DefaultClusterCallback callback, Integer index) { } private native void renameOutput( - long chipClusterPtr, DefaultClusterCallback callback, Integer index, String name); + long chipClusterPtr, DefaultClusterCallback Callback, Integer index, String name); private native void selectOutput( - long chipClusterPtr, DefaultClusterCallback callback, Integer index); + long chipClusterPtr, DefaultClusterCallback Callback, Integer index); public static class AudioOutputListAttribute { public Integer index; @@ -668,9 +668,9 @@ public void barrierControlStop(DefaultClusterCallback callback) { } private native void barrierControlGoToPercent( - long chipClusterPtr, DefaultClusterCallback callback, Integer percentOpen); + long chipClusterPtr, DefaultClusterCallback Callback, Integer percentOpen); - private native void barrierControlStop(long chipClusterPtr, DefaultClusterCallback callback); + private native void barrierControlStop(long chipClusterPtr, DefaultClusterCallback Callback); public void readBarrierMovingStateAttribute(IntegerAttributeCallback callback) { readBarrierMovingStateAttribute(chipClusterPtr, callback); @@ -799,7 +799,7 @@ public void mfgSpecificPing(DefaultClusterCallback callback) { mfgSpecificPing(chipClusterPtr, callback); } - private native void mfgSpecificPing(long chipClusterPtr, DefaultClusterCallback callback); + private native void mfgSpecificPing(long chipClusterPtr, DefaultClusterCallback Callback); public void readInteractionModelVersionAttribute(IntegerAttributeCallback callback) { readInteractionModelVersionAttribute(chipClusterPtr, callback); @@ -1021,7 +1021,7 @@ public void readLocalConfigDisabledAttribute(BooleanAttributeCallback callback) readLocalConfigDisabledAttribute(chipClusterPtr, callback); } - public void writeLocalConfigDisabledAttribute(DefaultClusterCallback callback, boolean value) { + public void writeLocalConfigDisabledAttribute(DefaultClusterCallback callback, Boolean value) { writeLocalConfigDisabledAttribute(chipClusterPtr, callback, value); } @@ -1218,7 +1218,7 @@ private native void readLocalConfigDisabledAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void writeLocalConfigDisabledAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeLocalConfigDisabledAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -1264,7 +1264,7 @@ public void readOutOfServiceAttribute(BooleanAttributeCallback callback) { readOutOfServiceAttribute(chipClusterPtr, callback); } - public void writeOutOfServiceAttribute(DefaultClusterCallback callback, boolean value) { + public void writeOutOfServiceAttribute(DefaultClusterCallback callback, Boolean value) { writeOutOfServiceAttribute(chipClusterPtr, callback, value); } @@ -1281,7 +1281,7 @@ public void readPresentValueAttribute(BooleanAttributeCallback callback) { readPresentValueAttribute(chipClusterPtr, callback); } - public void writePresentValueAttribute(DefaultClusterCallback callback, boolean value) { + public void writePresentValueAttribute(DefaultClusterCallback callback, Boolean value) { writePresentValueAttribute(chipClusterPtr, callback, value); } @@ -1324,7 +1324,7 @@ private native void readOutOfServiceAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void writeOutOfServiceAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeOutOfServiceAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -1336,7 +1336,7 @@ private native void readPresentValueAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void writePresentValueAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribePresentValueAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -1395,7 +1395,7 @@ public void unbind( private native void bind( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Long nodeId, Integer groupId, Integer endpointId, @@ -1403,7 +1403,7 @@ private native void bind( private native void unbind( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Long nodeId, Integer groupId, Integer endpointId, @@ -1566,78 +1566,78 @@ public void stopAction( private native void disableAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void disableActionWithDuration( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID, Long duration); private native void enableAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void enableActionWithDuration( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID, Long duration); private native void instantAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void instantActionWithTransition( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID, Integer transitionTime); private native void pauseAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void pauseActionWithDuration( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID, Long duration); private native void resumeAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void startAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); private native void startActionWithDuration( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID, Long duration); private native void stopAction( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer actionID, Optional invokeID); @@ -2096,7 +2096,7 @@ public void stopMoveStep( private native void colorLoopSet( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer updateFlags, Integer action, Integer direction, @@ -2107,7 +2107,7 @@ private native void colorLoopSet( private native void enhancedMoveHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer moveMode, Integer rate, Integer optionsMask, @@ -2115,7 +2115,7 @@ private native void enhancedMoveHue( private native void enhancedMoveToHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer enhancedHue, Integer direction, Integer transitionTime, @@ -2124,7 +2124,7 @@ private native void enhancedMoveToHue( private native void enhancedMoveToHueAndSaturation( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer enhancedHue, Integer saturation, Integer transitionTime, @@ -2133,7 +2133,7 @@ private native void enhancedMoveToHueAndSaturation( private native void enhancedStepHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime, @@ -2142,7 +2142,7 @@ private native void enhancedStepHue( private native void moveColor( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer rateX, Integer rateY, Integer optionsMask, @@ -2150,7 +2150,7 @@ private native void moveColor( private native void moveColorTemperature( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer moveMode, Integer rate, Integer colorTemperatureMinimum, @@ -2160,7 +2160,7 @@ private native void moveColorTemperature( private native void moveHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer moveMode, Integer rate, Integer optionsMask, @@ -2168,7 +2168,7 @@ private native void moveHue( private native void moveSaturation( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer moveMode, Integer rate, Integer optionsMask, @@ -2176,7 +2176,7 @@ private native void moveSaturation( private native void moveToColor( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer colorX, Integer colorY, Integer transitionTime, @@ -2185,7 +2185,7 @@ private native void moveToColor( private native void moveToColorTemperature( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer colorTemperature, Integer transitionTime, Integer optionsMask, @@ -2193,7 +2193,7 @@ private native void moveToColorTemperature( private native void moveToHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer hue, Integer direction, Integer transitionTime, @@ -2202,7 +2202,7 @@ private native void moveToHue( private native void moveToHueAndSaturation( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer hue, Integer saturation, Integer transitionTime, @@ -2211,7 +2211,7 @@ private native void moveToHueAndSaturation( private native void moveToSaturation( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer saturation, Integer transitionTime, Integer optionsMask, @@ -2219,7 +2219,7 @@ private native void moveToSaturation( private native void stepColor( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepX, Integer stepY, Integer transitionTime, @@ -2228,7 +2228,7 @@ private native void stepColor( private native void stepColorTemperature( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime, @@ -2239,7 +2239,7 @@ private native void stepColorTemperature( private native void stepHue( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime, @@ -2248,7 +2248,7 @@ private native void stepHue( private native void stepSaturation( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime, @@ -2257,7 +2257,7 @@ private native void stepSaturation( private native void stopMoveStep( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer optionsMask, Integer optionsOverride); @@ -2382,7 +2382,7 @@ public void readColorControlOptionsAttribute(IntegerAttributeCallback callback) readColorControlOptionsAttribute(chipClusterPtr, callback); } - public void writeColorControlOptionsAttribute(DefaultClusterCallback callback, int value) { + public void writeColorControlOptionsAttribute(DefaultClusterCallback callback, Integer value) { writeColorControlOptionsAttribute(chipClusterPtr, callback, value); } @@ -2646,7 +2646,7 @@ public void readWhitePointXAttribute(IntegerAttributeCallback callback) { readWhitePointXAttribute(chipClusterPtr, callback); } - public void writeWhitePointXAttribute(DefaultClusterCallback callback, int value) { + public void writeWhitePointXAttribute(DefaultClusterCallback callback, Integer value) { writeWhitePointXAttribute(chipClusterPtr, callback, value); } @@ -2663,7 +2663,7 @@ public void readWhitePointYAttribute(IntegerAttributeCallback callback) { readWhitePointYAttribute(chipClusterPtr, callback); } - public void writeWhitePointYAttribute(DefaultClusterCallback callback, int value) { + public void writeWhitePointYAttribute(DefaultClusterCallback callback, Integer value) { writeWhitePointYAttribute(chipClusterPtr, callback, value); } @@ -2680,7 +2680,7 @@ public void readColorPointRXAttribute(IntegerAttributeCallback callback) { readColorPointRXAttribute(chipClusterPtr, callback); } - public void writeColorPointRXAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointRXAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointRXAttribute(chipClusterPtr, callback, value); } @@ -2697,7 +2697,7 @@ public void readColorPointRYAttribute(IntegerAttributeCallback callback) { readColorPointRYAttribute(chipClusterPtr, callback); } - public void writeColorPointRYAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointRYAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointRYAttribute(chipClusterPtr, callback, value); } @@ -2714,7 +2714,7 @@ public void readColorPointRIntensityAttribute(IntegerAttributeCallback callback) readColorPointRIntensityAttribute(chipClusterPtr, callback); } - public void writeColorPointRIntensityAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointRIntensityAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointRIntensityAttribute(chipClusterPtr, callback, value); } @@ -2731,7 +2731,7 @@ public void readColorPointGXAttribute(IntegerAttributeCallback callback) { readColorPointGXAttribute(chipClusterPtr, callback); } - public void writeColorPointGXAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointGXAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointGXAttribute(chipClusterPtr, callback, value); } @@ -2748,7 +2748,7 @@ public void readColorPointGYAttribute(IntegerAttributeCallback callback) { readColorPointGYAttribute(chipClusterPtr, callback); } - public void writeColorPointGYAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointGYAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointGYAttribute(chipClusterPtr, callback, value); } @@ -2765,7 +2765,7 @@ public void readColorPointGIntensityAttribute(IntegerAttributeCallback callback) readColorPointGIntensityAttribute(chipClusterPtr, callback); } - public void writeColorPointGIntensityAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointGIntensityAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointGIntensityAttribute(chipClusterPtr, callback, value); } @@ -2782,7 +2782,7 @@ public void readColorPointBXAttribute(IntegerAttributeCallback callback) { readColorPointBXAttribute(chipClusterPtr, callback); } - public void writeColorPointBXAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointBXAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointBXAttribute(chipClusterPtr, callback, value); } @@ -2799,7 +2799,7 @@ public void readColorPointBYAttribute(IntegerAttributeCallback callback) { readColorPointBYAttribute(chipClusterPtr, callback); } - public void writeColorPointBYAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointBYAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointBYAttribute(chipClusterPtr, callback, value); } @@ -2816,7 +2816,7 @@ public void readColorPointBIntensityAttribute(IntegerAttributeCallback callback) readColorPointBIntensityAttribute(chipClusterPtr, callback); } - public void writeColorPointBIntensityAttribute(DefaultClusterCallback callback, int value) { + public void writeColorPointBIntensityAttribute(DefaultClusterCallback callback, Integer value) { writeColorPointBIntensityAttribute(chipClusterPtr, callback, value); } @@ -2980,7 +2980,7 @@ public void readStartUpColorTemperatureMiredsAttribute(IntegerAttributeCallback } public void writeStartUpColorTemperatureMiredsAttribute( - DefaultClusterCallback callback, int value) { + DefaultClusterCallback callback, Integer value) { writeStartUpColorTemperatureMiredsAttribute(chipClusterPtr, callback, value); } @@ -3092,7 +3092,7 @@ private native void readColorControlOptionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorControlOptionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorControlOptionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3275,7 +3275,7 @@ private native void readWhitePointXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeWhitePointXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeWhitePointXAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3287,7 +3287,7 @@ private native void readWhitePointYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeWhitePointYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeWhitePointYAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3299,7 +3299,7 @@ private native void readColorPointRXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointRXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRXAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3311,7 +3311,7 @@ private native void readColorPointRYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointRYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRYAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3323,7 +3323,7 @@ private native void readColorPointRIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointRIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointRIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3335,7 +3335,7 @@ private native void readColorPointGXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointGXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGXAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3347,7 +3347,7 @@ private native void readColorPointGYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointGYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGYAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3359,7 +3359,7 @@ private native void readColorPointGIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointGIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointGIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3371,7 +3371,7 @@ private native void readColorPointBXAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointBXAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBXAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3383,7 +3383,7 @@ private native void readColorPointBYAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointBYAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBYAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3395,7 +3395,7 @@ private native void readColorPointBIntensityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeColorPointBIntensityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeColorPointBIntensityAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3506,7 +3506,7 @@ private native void readStartUpColorTemperatureMiredsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeStartUpColorTemperatureMiredsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpColorTemperatureMiredsAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -3547,11 +3547,11 @@ public void launchURL( } private native void launchContent( - long chipClusterPtr, LaunchContentResponseCallback callback, Boolean autoPlay, String data); + long chipClusterPtr, LaunchContentResponseCallback Callback, Boolean autoPlay, String data); private native void launchURL( long chipClusterPtr, - LaunchURLResponseCallback callback, + LaunchURLResponseCallback Callback, String contentURL, String displayString); @@ -3568,13 +3568,13 @@ public interface LaunchURLResponseCallback { } public interface AcceptsHeaderListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface SupportedStreamingTypesAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -3660,19 +3660,19 @@ public interface DeviceListAttributeCallback { } public interface ServerListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface ClientListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface PartsListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -3751,7 +3751,7 @@ public void retrieveLogsRequest( private native void retrieveLogsRequest( long chipClusterPtr, - RetrieveLogsResponseCallback callback, + RetrieveLogsResponseCallback Callback, Integer intent, Integer requestedProtocol, byte[] transferFileDesignator); @@ -3919,64 +3919,64 @@ public void unlockWithTimeout( unlockWithTimeout(chipClusterPtr, callback, timeoutInSeconds, pin); } - private native void clearAllPins(long chipClusterPtr, ClearAllPinsResponseCallback callback); + private native void clearAllPins(long chipClusterPtr, ClearAllPinsResponseCallback Callback); - private native void clearAllRfids(long chipClusterPtr, ClearAllRfidsResponseCallback callback); + private native void clearAllRfids(long chipClusterPtr, ClearAllRfidsResponseCallback Callback); private native void clearHolidaySchedule( - long chipClusterPtr, ClearHolidayScheduleResponseCallback callback, Integer scheduleId); + long chipClusterPtr, ClearHolidayScheduleResponseCallback Callback, Integer scheduleId); private native void clearPin( - long chipClusterPtr, ClearPinResponseCallback callback, Integer userId); + long chipClusterPtr, ClearPinResponseCallback Callback, Integer userId); private native void clearRfid( - long chipClusterPtr, ClearRfidResponseCallback callback, Integer userId); + long chipClusterPtr, ClearRfidResponseCallback Callback, Integer userId); private native void clearWeekdaySchedule( long chipClusterPtr, - ClearWeekdayScheduleResponseCallback callback, + ClearWeekdayScheduleResponseCallback Callback, Integer scheduleId, Integer userId); private native void clearYeardaySchedule( long chipClusterPtr, - ClearYeardayScheduleResponseCallback callback, + ClearYeardayScheduleResponseCallback Callback, Integer scheduleId, Integer userId); private native void getHolidaySchedule( - long chipClusterPtr, GetHolidayScheduleResponseCallback callback, Integer scheduleId); + long chipClusterPtr, GetHolidayScheduleResponseCallback Callback, Integer scheduleId); private native void getLogRecord( - long chipClusterPtr, GetLogRecordResponseCallback callback, Integer logIndex); + long chipClusterPtr, GetLogRecordResponseCallback Callback, Integer logIndex); private native void getPin( - long chipClusterPtr, GetPinResponseCallback callback, Integer userId); + long chipClusterPtr, GetPinResponseCallback Callback, Integer userId); private native void getRfid( - long chipClusterPtr, GetRfidResponseCallback callback, Integer userId); + long chipClusterPtr, GetRfidResponseCallback Callback, Integer userId); private native void getUserType( - long chipClusterPtr, GetUserTypeResponseCallback callback, Integer userId); + long chipClusterPtr, GetUserTypeResponseCallback Callback, Integer userId); private native void getWeekdaySchedule( long chipClusterPtr, - GetWeekdayScheduleResponseCallback callback, + GetWeekdayScheduleResponseCallback Callback, Integer scheduleId, Integer userId); private native void getYeardaySchedule( long chipClusterPtr, - GetYeardayScheduleResponseCallback callback, + GetYeardayScheduleResponseCallback Callback, Integer scheduleId, Integer userId); private native void lockDoor( - long chipClusterPtr, LockDoorResponseCallback callback, byte[] pin); + long chipClusterPtr, LockDoorResponseCallback Callback, byte[] pin); private native void setHolidaySchedule( long chipClusterPtr, - SetHolidayScheduleResponseCallback callback, + SetHolidayScheduleResponseCallback Callback, Integer scheduleId, Long localStartTime, Long localEndTime, @@ -3984,7 +3984,7 @@ private native void setHolidaySchedule( private native void setPin( long chipClusterPtr, - SetPinResponseCallback callback, + SetPinResponseCallback Callback, Integer userId, Integer userStatus, Integer userType, @@ -3992,7 +3992,7 @@ private native void setPin( private native void setRfid( long chipClusterPtr, - SetRfidResponseCallback callback, + SetRfidResponseCallback Callback, Integer userId, Integer userStatus, Integer userType, @@ -4000,13 +4000,13 @@ private native void setRfid( private native void setUserType( long chipClusterPtr, - SetUserTypeResponseCallback callback, + SetUserTypeResponseCallback Callback, Integer userId, Integer userType); private native void setWeekdaySchedule( long chipClusterPtr, - SetWeekdayScheduleResponseCallback callback, + SetWeekdayScheduleResponseCallback Callback, Integer scheduleId, Integer userId, Integer daysMask, @@ -4017,18 +4017,18 @@ private native void setWeekdaySchedule( private native void setYeardaySchedule( long chipClusterPtr, - SetYeardayScheduleResponseCallback callback, + SetYeardayScheduleResponseCallback Callback, Integer scheduleId, Integer userId, Long localStartTime, Long localEndTime); private native void unlockDoor( - long chipClusterPtr, UnlockDoorResponseCallback callback, byte[] pin); + long chipClusterPtr, UnlockDoorResponseCallback Callback, byte[] pin); private native void unlockWithTimeout( long chipClusterPtr, - UnlockWithTimeoutResponseCallback callback, + UnlockWithTimeoutResponseCallback Callback, Integer timeoutInSeconds, byte[] pin); @@ -4577,7 +4577,7 @@ public void resetCounts(DefaultClusterCallback callback) { resetCounts(chipClusterPtr, callback); } - private native void resetCounts(long chipClusterPtr, DefaultClusterCallback callback); + private native void resetCounts(long chipClusterPtr, DefaultClusterCallback Callback); public void readPHYRateAttribute(IntegerAttributeCallback callback) { readPHYRateAttribute(chipClusterPtr, callback); @@ -5037,17 +5037,17 @@ public void setRegulatoryConfig( private native void armFailSafe( long chipClusterPtr, - ArmFailSafeResponseCallback callback, + ArmFailSafeResponseCallback Callback, Integer expiryLengthSeconds, Long breadcrumb, Long timeoutMs); private native void commissioningComplete( - long chipClusterPtr, CommissioningCompleteResponseCallback callback); + long chipClusterPtr, CommissioningCompleteResponseCallback Callback); private native void setRegulatoryConfig( long chipClusterPtr, - SetRegulatoryConfigResponseCallback callback, + SetRegulatoryConfigResponseCallback Callback, Integer location, String countryCode, Long breadcrumb, @@ -5099,7 +5099,7 @@ public void readBreadcrumbAttribute(LongAttributeCallback callback) { readBreadcrumbAttribute(chipClusterPtr, callback); } - public void writeBreadcrumbAttribute(DefaultClusterCallback callback, long value) { + public void writeBreadcrumbAttribute(DefaultClusterCallback callback, Long value) { writeBreadcrumbAttribute(chipClusterPtr, callback, value); } @@ -5134,7 +5134,7 @@ private native void readBreadcrumbAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void writeBreadcrumbAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBreadcrumbAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5228,19 +5228,19 @@ public interface NetworkInterfacesAttributeCallback { } public interface ActiveHardwareFaultsAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface ActiveRadioFaultsAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface ActiveNetworkFaultsAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -5557,21 +5557,21 @@ public void viewGroup(ViewGroupResponseCallback callback, Integer groupId) { } private native void addGroup( - long chipClusterPtr, AddGroupResponseCallback callback, Integer groupId, String groupName); + long chipClusterPtr, AddGroupResponseCallback Callback, Integer groupId, String groupName); private native void addGroupIfIdentifying( - long chipClusterPtr, DefaultClusterCallback callback, Integer groupId, String groupName); + long chipClusterPtr, DefaultClusterCallback Callback, Integer groupId, String groupName); private native void getGroupMembership( - long chipClusterPtr, GetGroupMembershipResponseCallback callback, Integer groupList); + long chipClusterPtr, GetGroupMembershipResponseCallback Callback, Integer groupList); - private native void removeAllGroups(long chipClusterPtr, DefaultClusterCallback callback); + private native void removeAllGroups(long chipClusterPtr, DefaultClusterCallback Callback); private native void removeGroup( - long chipClusterPtr, RemoveGroupResponseCallback callback, Integer groupId); + long chipClusterPtr, RemoveGroupResponseCallback Callback, Integer groupId); private native void viewGroup( - long chipClusterPtr, ViewGroupResponseCallback callback, Integer groupId); + long chipClusterPtr, ViewGroupResponseCallback Callback, Integer groupId); public interface AddGroupResponseCallback { void onSuccess(Integer status, Integer groupId); @@ -5671,13 +5671,13 @@ public void triggerEffect( } private native void identify( - long chipClusterPtr, DefaultClusterCallback callback, Integer identifyTime); + long chipClusterPtr, DefaultClusterCallback Callback, Integer identifyTime); - private native void identifyQuery(long chipClusterPtr, IdentifyQueryResponseCallback callback); + private native void identifyQuery(long chipClusterPtr, IdentifyQueryResponseCallback Callback); private native void triggerEffect( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer effectIdentifier, Integer effectVariant); @@ -5691,7 +5691,7 @@ public void readIdentifyTimeAttribute(IntegerAttributeCallback callback) { readIdentifyTimeAttribute(chipClusterPtr, callback); } - public void writeIdentifyTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeIdentifyTimeAttribute(DefaultClusterCallback callback, Integer value) { writeIdentifyTimeAttribute(chipClusterPtr, callback, value); } @@ -5734,7 +5734,7 @@ private native void readIdentifyTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeIdentifyTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeIdentifyTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5773,7 +5773,31 @@ public static long clusterId() { @Override public native long initWithDevice(long devicePtr, int endpointId); - public void readMeasuredValueAttribute(IntegerAttributeCallback callback) { + public interface MeasuredValueAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface MinMeasuredValueAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface MaxMeasuredValueAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface LightSensorTypeAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public void readMeasuredValueAttribute(MeasuredValueAttributeCallback callback) { readMeasuredValueAttribute(chipClusterPtr, callback); } @@ -5786,7 +5810,7 @@ public void reportMeasuredValueAttribute(IntegerAttributeCallback callback) { reportMeasuredValueAttribute(chipClusterPtr, callback); } - public void readMinMeasuredValueAttribute(IntegerAttributeCallback callback) { + public void readMinMeasuredValueAttribute(MinMeasuredValueAttributeCallback callback) { readMinMeasuredValueAttribute(chipClusterPtr, callback); } @@ -5799,7 +5823,7 @@ public void reportMinMeasuredValueAttribute(IntegerAttributeCallback callback) { reportMinMeasuredValueAttribute(chipClusterPtr, callback); } - public void readMaxMeasuredValueAttribute(IntegerAttributeCallback callback) { + public void readMaxMeasuredValueAttribute(MaxMeasuredValueAttributeCallback callback) { readMaxMeasuredValueAttribute(chipClusterPtr, callback); } @@ -5825,7 +5849,7 @@ public void reportToleranceAttribute(IntegerAttributeCallback callback) { reportToleranceAttribute(chipClusterPtr, callback); } - public void readLightSensorTypeAttribute(IntegerAttributeCallback callback) { + public void readLightSensorTypeAttribute(LightSensorTypeAttributeCallback callback) { readLightSensorTypeAttribute(chipClusterPtr, callback); } @@ -5852,7 +5876,7 @@ public void reportClusterRevisionAttribute(IntegerAttributeCallback callback) { } private native void readMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, MeasuredValueAttributeCallback callback); private native void subscribeMeasuredValueAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5861,7 +5885,7 @@ private native void reportMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readMinMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, MinMeasuredValueAttributeCallback callback); private native void subscribeMinMeasuredValueAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5870,7 +5894,7 @@ private native void reportMinMeasuredValueAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readMaxMeasuredValueAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, MaxMeasuredValueAttributeCallback callback); private native void subscribeMaxMeasuredValueAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5888,7 +5912,7 @@ private native void reportToleranceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readLightSensorTypeAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, LightSensorTypeAttributeCallback callback); private native void subscribeLightSensorTypeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -5923,7 +5947,7 @@ public void sendKey(SendKeyResponseCallback callback, Integer keyCode) { } private native void sendKey( - long chipClusterPtr, SendKeyResponseCallback callback, Integer keyCode); + long chipClusterPtr, SendKeyResponseCallback Callback, Integer keyCode); public interface SendKeyResponseCallback { void onSuccess(Integer status); @@ -6022,7 +6046,7 @@ public void stopWithOnOff(DefaultClusterCallback callback) { private native void move( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer moveMode, Integer rate, Integer optionMask, @@ -6030,7 +6054,7 @@ private native void move( private native void moveToLevel( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer level, Integer transitionTime, Integer optionMask, @@ -6038,16 +6062,16 @@ private native void moveToLevel( private native void moveToLevelWithOnOff( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer level, Integer transitionTime); private native void moveWithOnOff( - long chipClusterPtr, DefaultClusterCallback callback, Integer moveMode, Integer rate); + long chipClusterPtr, DefaultClusterCallback Callback, Integer moveMode, Integer rate); private native void step( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime, @@ -6056,18 +6080,18 @@ private native void step( private native void stepWithOnOff( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer stepMode, Integer stepSize, Integer transitionTime); private native void stop( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer optionMask, Integer optionOverride); - private native void stopWithOnOff(long chipClusterPtr, DefaultClusterCallback callback); + private native void stopWithOnOff(long chipClusterPtr, DefaultClusterCallback Callback); public void readCurrentLevelAttribute(IntegerAttributeCallback callback) { readCurrentLevelAttribute(chipClusterPtr, callback); @@ -6164,7 +6188,7 @@ public void readOptionsAttribute(IntegerAttributeCallback callback) { readOptionsAttribute(chipClusterPtr, callback); } - public void writeOptionsAttribute(DefaultClusterCallback callback, int value) { + public void writeOptionsAttribute(DefaultClusterCallback callback, Integer value) { writeOptionsAttribute(chipClusterPtr, callback, value); } @@ -6181,7 +6205,7 @@ public void readOnOffTransitionTimeAttribute(IntegerAttributeCallback callback) readOnOffTransitionTimeAttribute(chipClusterPtr, callback); } - public void writeOnOffTransitionTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeOnOffTransitionTimeAttribute(DefaultClusterCallback callback, Integer value) { writeOnOffTransitionTimeAttribute(chipClusterPtr, callback, value); } @@ -6198,7 +6222,7 @@ public void readOnLevelAttribute(IntegerAttributeCallback callback) { readOnLevelAttribute(chipClusterPtr, callback); } - public void writeOnLevelAttribute(DefaultClusterCallback callback, int value) { + public void writeOnLevelAttribute(DefaultClusterCallback callback, Integer value) { writeOnLevelAttribute(chipClusterPtr, callback, value); } @@ -6215,7 +6239,7 @@ public void readOnTransitionTimeAttribute(IntegerAttributeCallback callback) { readOnTransitionTimeAttribute(chipClusterPtr, callback); } - public void writeOnTransitionTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeOnTransitionTimeAttribute(DefaultClusterCallback callback, Integer value) { writeOnTransitionTimeAttribute(chipClusterPtr, callback, value); } @@ -6232,7 +6256,7 @@ public void readOffTransitionTimeAttribute(IntegerAttributeCallback callback) { readOffTransitionTimeAttribute(chipClusterPtr, callback); } - public void writeOffTransitionTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeOffTransitionTimeAttribute(DefaultClusterCallback callback, Integer value) { writeOffTransitionTimeAttribute(chipClusterPtr, callback, value); } @@ -6249,7 +6273,7 @@ public void readDefaultMoveRateAttribute(IntegerAttributeCallback callback) { readDefaultMoveRateAttribute(chipClusterPtr, callback); } - public void writeDefaultMoveRateAttribute(DefaultClusterCallback callback, int value) { + public void writeDefaultMoveRateAttribute(DefaultClusterCallback callback, Integer value) { writeDefaultMoveRateAttribute(chipClusterPtr, callback, value); } @@ -6266,7 +6290,7 @@ public void readStartUpCurrentLevelAttribute(IntegerAttributeCallback callback) readStartUpCurrentLevelAttribute(chipClusterPtr, callback); } - public void writeStartUpCurrentLevelAttribute(DefaultClusterCallback callback, int value) { + public void writeStartUpCurrentLevelAttribute(DefaultClusterCallback callback, Integer value) { writeStartUpCurrentLevelAttribute(chipClusterPtr, callback, value); } @@ -6359,7 +6383,7 @@ private native void readOptionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOptionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOptionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6371,7 +6395,7 @@ private native void readOnOffTransitionTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOnOffTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnOffTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6383,7 +6407,7 @@ private native void readOnLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOnLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnLevelAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6395,7 +6419,7 @@ private native void readOnTransitionTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOnTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6407,7 +6431,7 @@ private native void readOffTransitionTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOffTransitionTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOffTransitionTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6419,7 +6443,7 @@ private native void readDefaultMoveRateAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeDefaultMoveRateAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeDefaultMoveRateAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6431,7 +6455,7 @@ private native void readStartUpCurrentLevelAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeStartUpCurrentLevelAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpCurrentLevelAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -6465,7 +6489,7 @@ public void sleep(DefaultClusterCallback callback) { sleep(chipClusterPtr, callback); } - private native void sleep(long chipClusterPtr, DefaultClusterCallback callback); + private native void sleep(long chipClusterPtr, DefaultClusterCallback Callback); public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { readClusterRevisionAttribute(chipClusterPtr, callback); @@ -6518,15 +6542,15 @@ public void showInputStatus(DefaultClusterCallback callback) { showInputStatus(chipClusterPtr, callback); } - private native void hideInputStatus(long chipClusterPtr, DefaultClusterCallback callback); + private native void hideInputStatus(long chipClusterPtr, DefaultClusterCallback Callback); private native void renameInput( - long chipClusterPtr, DefaultClusterCallback callback, Integer index, String name); + long chipClusterPtr, DefaultClusterCallback Callback, Integer index, String name); private native void selectInput( - long chipClusterPtr, DefaultClusterCallback callback, Integer index); + long chipClusterPtr, DefaultClusterCallback Callback, Integer index); - private native void showInputStatus(long chipClusterPtr, DefaultClusterCallback callback); + private native void showInputStatus(long chipClusterPtr, DefaultClusterCallback Callback); public static class MediaInputListAttribute { public Integer index; @@ -6682,35 +6706,35 @@ public void mediaStop(MediaStopResponseCallback callback) { } private native void mediaFastForward( - long chipClusterPtr, MediaFastForwardResponseCallback callback); + long chipClusterPtr, MediaFastForwardResponseCallback Callback); - private native void mediaNext(long chipClusterPtr, MediaNextResponseCallback callback); + private native void mediaNext(long chipClusterPtr, MediaNextResponseCallback Callback); - private native void mediaPause(long chipClusterPtr, MediaPauseResponseCallback callback); + private native void mediaPause(long chipClusterPtr, MediaPauseResponseCallback Callback); - private native void mediaPlay(long chipClusterPtr, MediaPlayResponseCallback callback); + private native void mediaPlay(long chipClusterPtr, MediaPlayResponseCallback Callback); - private native void mediaPrevious(long chipClusterPtr, MediaPreviousResponseCallback callback); + private native void mediaPrevious(long chipClusterPtr, MediaPreviousResponseCallback Callback); - private native void mediaRewind(long chipClusterPtr, MediaRewindResponseCallback callback); + private native void mediaRewind(long chipClusterPtr, MediaRewindResponseCallback Callback); private native void mediaSeek( - long chipClusterPtr, MediaSeekResponseCallback callback, Long position); + long chipClusterPtr, MediaSeekResponseCallback Callback, Long position); private native void mediaSkipBackward( long chipClusterPtr, - MediaSkipBackwardResponseCallback callback, + MediaSkipBackwardResponseCallback Callback, Long deltaPositionMilliseconds); private native void mediaSkipForward( long chipClusterPtr, - MediaSkipForwardResponseCallback callback, + MediaSkipForwardResponseCallback Callback, Long deltaPositionMilliseconds); private native void mediaStartOver( - long chipClusterPtr, MediaStartOverResponseCallback callback); + long chipClusterPtr, MediaStartOverResponseCallback Callback); - private native void mediaStop(long chipClusterPtr, MediaStopResponseCallback callback); + private native void mediaStop(long chipClusterPtr, MediaStopResponseCallback Callback); public interface MediaFastForwardResponseCallback { void onSuccess(Integer mediaPlaybackStatus); @@ -6991,7 +7015,7 @@ public void changeToMode(DefaultClusterCallback callback, Integer newMode) { } private native void changeToMode( - long chipClusterPtr, DefaultClusterCallback callback, Integer newMode); + long chipClusterPtr, DefaultClusterCallback Callback, Integer newMode); public static class SupportedModesAttribute { public String label; @@ -7050,7 +7074,7 @@ public void readOnModeAttribute(IntegerAttributeCallback callback) { readOnModeAttribute(chipClusterPtr, callback); } - public void writeOnModeAttribute(DefaultClusterCallback callback, int value) { + public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { writeOnModeAttribute(chipClusterPtr, callback, value); } @@ -7117,7 +7141,7 @@ private native void readSupportedModesAttribute( private native void readOnModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOnModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -7224,14 +7248,14 @@ public void updateWiFiNetwork( private native void addThreadNetwork( long chipClusterPtr, - AddThreadNetworkResponseCallback callback, + AddThreadNetworkResponseCallback Callback, byte[] operationalDataset, Long breadcrumb, Long timeoutMs); private native void addWiFiNetwork( long chipClusterPtr, - AddWiFiNetworkResponseCallback callback, + AddWiFiNetworkResponseCallback Callback, byte[] ssid, byte[] credentials, Long breadcrumb, @@ -7239,42 +7263,42 @@ private native void addWiFiNetwork( private native void disableNetwork( long chipClusterPtr, - DisableNetworkResponseCallback callback, + DisableNetworkResponseCallback Callback, byte[] networkID, Long breadcrumb, Long timeoutMs); private native void enableNetwork( long chipClusterPtr, - EnableNetworkResponseCallback callback, + EnableNetworkResponseCallback Callback, byte[] networkID, Long breadcrumb, Long timeoutMs); private native void removeNetwork( long chipClusterPtr, - RemoveNetworkResponseCallback callback, + RemoveNetworkResponseCallback Callback, byte[] networkID, Long breadcrumb, Long timeoutMs); private native void scanNetworks( long chipClusterPtr, - ScanNetworksResponseCallback callback, + ScanNetworksResponseCallback Callback, byte[] ssid, Long breadcrumb, Long timeoutMs); private native void updateThreadNetwork( long chipClusterPtr, - UpdateThreadNetworkResponseCallback callback, + UpdateThreadNetworkResponseCallback Callback, byte[] operationalDataset, Long breadcrumb, Long timeoutMs); private native void updateWiFiNetwork( long chipClusterPtr, - UpdateWiFiNetworkResponseCallback callback, + UpdateWiFiNetworkResponseCallback Callback, byte[] ssid, byte[] credentials, Long breadcrumb, @@ -7425,19 +7449,19 @@ public void queryImage( private native void applyUpdateRequest( long chipClusterPtr, - ApplyUpdateResponseCallback callback, + ApplyUpdateResponseCallback Callback, byte[] updateToken, Long newVersion); private native void notifyUpdateApplied( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, byte[] updateToken, Long softwareVersion); private native void queryImage( long chipClusterPtr, - QueryImageResponseCallback callback, + QueryImageResponseCallback Callback, Integer vendorId, Integer productId, Long softwareVersion, @@ -7519,7 +7543,7 @@ public void announceOtaProvider( private native void announceOtaProvider( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Long providerLocation, Integer vendorId, Integer announcementReason, @@ -7742,27 +7766,27 @@ public void toggle(DefaultClusterCallback callback) { toggle(chipClusterPtr, callback); } - private native void off(long chipClusterPtr, DefaultClusterCallback callback); + private native void off(long chipClusterPtr, DefaultClusterCallback Callback); private native void offWithEffect( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer effectId, Integer effectVariant); - private native void on(long chipClusterPtr, DefaultClusterCallback callback); + private native void on(long chipClusterPtr, DefaultClusterCallback Callback); private native void onWithRecallGlobalScene( - long chipClusterPtr, DefaultClusterCallback callback); + long chipClusterPtr, DefaultClusterCallback Callback); private native void onWithTimedOff( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer onOffControl, Integer onTime, Integer offWaitTime); - private native void toggle(long chipClusterPtr, DefaultClusterCallback callback); + private native void toggle(long chipClusterPtr, DefaultClusterCallback Callback); public void readOnOffAttribute(BooleanAttributeCallback callback) { readOnOffAttribute(chipClusterPtr, callback); @@ -7794,7 +7818,7 @@ public void readOnTimeAttribute(IntegerAttributeCallback callback) { readOnTimeAttribute(chipClusterPtr, callback); } - public void writeOnTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeOnTimeAttribute(DefaultClusterCallback callback, Integer value) { writeOnTimeAttribute(chipClusterPtr, callback, value); } @@ -7811,7 +7835,7 @@ public void readOffWaitTimeAttribute(IntegerAttributeCallback callback) { readOffWaitTimeAttribute(chipClusterPtr, callback); } - public void writeOffWaitTimeAttribute(DefaultClusterCallback callback, int value) { + public void writeOffWaitTimeAttribute(DefaultClusterCallback callback, Integer value) { writeOffWaitTimeAttribute(chipClusterPtr, callback, value); } @@ -7828,7 +7852,7 @@ public void readStartUpOnOffAttribute(IntegerAttributeCallback callback) { readStartUpOnOffAttribute(chipClusterPtr, callback); } - public void writeStartUpOnOffAttribute(DefaultClusterCallback callback, int value) { + public void writeStartUpOnOffAttribute(DefaultClusterCallback callback, Integer value) { writeStartUpOnOffAttribute(chipClusterPtr, callback, value); } @@ -7887,7 +7911,7 @@ private native void reportGlobalSceneControlAttribute( private native void readOnTimeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOnTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOnTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -7899,7 +7923,7 @@ private native void readOffWaitTimeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOffWaitTimeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOffWaitTimeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -7911,7 +7935,7 @@ private native void readStartUpOnOffAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeStartUpOnOffAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeStartUpOnOffAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -7967,7 +7991,7 @@ public void readSwitchActionsAttribute(IntegerAttributeCallback callback) { readSwitchActionsAttribute(chipClusterPtr, callback); } - public void writeSwitchActionsAttribute(DefaultClusterCallback callback, int value) { + public void writeSwitchActionsAttribute(DefaultClusterCallback callback, Integer value) { writeSwitchActionsAttribute(chipClusterPtr, callback, value); } @@ -8006,7 +8030,7 @@ private native void readSwitchActionsAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeSwitchActionsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeSwitchActionsAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -8083,7 +8107,7 @@ public void updateNOC( private native void addNOC( long chipClusterPtr, - NOCResponseCallback callback, + NOCResponseCallback Callback, byte[] NOCValue, Optional ICACValue, byte[] IPKValue, @@ -8091,29 +8115,29 @@ private native void addNOC( Integer adminVendorId); private native void addTrustedRootCertificate( - long chipClusterPtr, DefaultClusterCallback callback, byte[] rootCertificate); + long chipClusterPtr, DefaultClusterCallback Callback, byte[] rootCertificate); private native void attestationRequest( - long chipClusterPtr, AttestationResponseCallback callback, byte[] attestationNonce); + long chipClusterPtr, AttestationResponseCallback Callback, byte[] attestationNonce); private native void certificateChainRequest( - long chipClusterPtr, CertificateChainResponseCallback callback, Integer certificateType); + long chipClusterPtr, CertificateChainResponseCallback Callback, Integer certificateType); private native void opCSRRequest( - long chipClusterPtr, OpCSRResponseCallback callback, byte[] CSRNonce); + long chipClusterPtr, OpCSRResponseCallback Callback, byte[] CSRNonce); private native void removeFabric( - long chipClusterPtr, NOCResponseCallback callback, Integer fabricIndex); + long chipClusterPtr, NOCResponseCallback Callback, Integer fabricIndex); private native void removeTrustedRootCertificate( - long chipClusterPtr, DefaultClusterCallback callback, byte[] trustedRootIdentifier); + long chipClusterPtr, DefaultClusterCallback Callback, byte[] trustedRootIdentifier); private native void updateFabricLabel( - long chipClusterPtr, NOCResponseCallback callback, String label); + long chipClusterPtr, NOCResponseCallback Callback, String label); private native void updateNOC( long chipClusterPtr, - NOCResponseCallback callback, + NOCResponseCallback Callback, byte[] NOCValue, Optional ICACValue); @@ -8202,7 +8226,13 @@ public interface FabricsListAttributeCallback { } public interface TrustedRootCertificatesAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); + + void onError(Exception ex); + } + + public interface CurrentFabricIndexAttributeCallback { + void onSuccess(Integer value); void onError(Exception ex); } @@ -8242,7 +8272,7 @@ public void readTrustedRootCertificatesAttribute( readTrustedRootCertificatesAttribute(chipClusterPtr, callback); } - public void readCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { + public void readCurrentFabricIndexAttribute(CurrentFabricIndexAttributeCallback callback) { readCurrentFabricIndexAttribute(chipClusterPtr, callback); } @@ -8293,7 +8323,7 @@ private native void readTrustedRootCertificatesAttribute( long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); private native void readCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, CurrentFabricIndexAttributeCallback callback); private native void subscribeCurrentFabricIndexAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -8324,7 +8354,7 @@ public static long clusterId() { public native long initWithDevice(long devicePtr, int endpointId); public interface ActiveBatteryFaultsAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -8919,7 +8949,7 @@ public void readOperationModeAttribute(IntegerAttributeCallback callback) { readOperationModeAttribute(chipClusterPtr, callback); } - public void writeOperationModeAttribute(DefaultClusterCallback callback, int value) { + public void writeOperationModeAttribute(DefaultClusterCallback callback, Integer value) { writeOperationModeAttribute(chipClusterPtr, callback, value); } @@ -8936,7 +8966,7 @@ public void readControlModeAttribute(IntegerAttributeCallback callback) { readControlModeAttribute(chipClusterPtr, callback); } - public void writeControlModeAttribute(DefaultClusterCallback callback, int value) { + public void writeControlModeAttribute(DefaultClusterCallback callback, Integer value) { writeControlModeAttribute(chipClusterPtr, callback, value); } @@ -9162,7 +9192,7 @@ private native void readOperationModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOperationModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOperationModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -9174,7 +9204,7 @@ private native void readControlModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeControlModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeControlModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -9394,7 +9424,7 @@ public void viewScene(ViewSceneResponseCallback callback, Integer groupId, Integ private native void addScene( long chipClusterPtr, - AddSceneResponseCallback callback, + AddSceneResponseCallback Callback, Integer groupId, Integer sceneId, Integer transitionTime, @@ -9404,29 +9434,29 @@ private native void addScene( Integer value); private native void getSceneMembership( - long chipClusterPtr, GetSceneMembershipResponseCallback callback, Integer groupId); + long chipClusterPtr, GetSceneMembershipResponseCallback Callback, Integer groupId); private native void recallScene( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer groupId, Integer sceneId, Integer transitionTime); private native void removeAllScenes( - long chipClusterPtr, RemoveAllScenesResponseCallback callback, Integer groupId); + long chipClusterPtr, RemoveAllScenesResponseCallback Callback, Integer groupId); private native void removeScene( long chipClusterPtr, - RemoveSceneResponseCallback callback, + RemoveSceneResponseCallback Callback, Integer groupId, Integer sceneId); private native void storeScene( - long chipClusterPtr, StoreSceneResponseCallback callback, Integer groupId, Integer sceneId); + long chipClusterPtr, StoreSceneResponseCallback Callback, Integer groupId, Integer sceneId); private native void viewScene( - long chipClusterPtr, ViewSceneResponseCallback callback, Integer groupId, Integer sceneId); + long chipClusterPtr, ViewSceneResponseCallback Callback, Integer groupId, Integer sceneId); public interface AddSceneResponseCallback { void onSuccess(Integer status, Integer groupId, Integer sceneId); @@ -9620,7 +9650,7 @@ public void resetWatermarks(DefaultClusterCallback callback) { resetWatermarks(chipClusterPtr, callback); } - private native void resetWatermarks(long chipClusterPtr, DefaultClusterCallback callback); + private native void resetWatermarks(long chipClusterPtr, DefaultClusterCallback Callback); public static class ThreadMetricsAttribute { public Long id; @@ -9924,16 +9954,16 @@ public void skipChannel(DefaultClusterCallback callback, Integer count) { } private native void changeChannel( - long chipClusterPtr, ChangeChannelResponseCallback callback, String match); + long chipClusterPtr, ChangeChannelResponseCallback Callback, String match); private native void changeChannelByNumber( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer majorNumber, Integer minorNumber); private native void skipChannel( - long chipClusterPtr, DefaultClusterCallback callback, Integer count); + long chipClusterPtr, DefaultClusterCallback Callback, Integer count); public interface ChangeChannelResponseCallback { void onSuccess( // ChannelMatch: /* TYPE WARNING: array array defaults to */ uint8_t * @@ -10088,7 +10118,7 @@ public void navigateTarget( } private native void navigateTarget( - long chipClusterPtr, NavigateTargetResponseCallback callback, Integer target, String data); + long chipClusterPtr, NavigateTargetResponseCallback Callback, Integer target, String data); public interface NavigateTargetResponseCallback { void onSuccess(Integer status, String data); @@ -10352,23 +10382,23 @@ public void testUnknownCommand(DefaultClusterCallback callback) { testUnknownCommand(chipClusterPtr, callback); } - private native void test(long chipClusterPtr, DefaultClusterCallback callback); + private native void test(long chipClusterPtr, DefaultClusterCallback Callback); private native void testAddArguments( - long chipClusterPtr, TestAddArgumentsResponseCallback callback, Integer arg1, Integer arg2); + long chipClusterPtr, TestAddArgumentsResponseCallback Callback, Integer arg1, Integer arg2); private native void testEnumsRequest( - long chipClusterPtr, TestEnumsResponseCallback callback, Integer arg1, Integer arg2); + long chipClusterPtr, TestEnumsResponseCallback Callback, Integer arg1, Integer arg2); private native void testListInt8UArgumentRequest( - long chipClusterPtr, BooleanResponseCallback callback, Integer arg1); + long chipClusterPtr, BooleanResponseCallback Callback, Integer arg1); private native void testListInt8UReverseRequest( - long chipClusterPtr, TestListInt8UReverseResponseCallback callback, Integer arg1); + long chipClusterPtr, TestListInt8UReverseResponseCallback Callback, Integer arg1); private native void testListStructArgumentRequest( long chipClusterPtr, - BooleanResponseCallback callback, + BooleanResponseCallback Callback, Integer a, Boolean b, Integer c, @@ -10376,16 +10406,16 @@ private native void testListStructArgumentRequest( String e, Integer f); - private native void testNotHandled(long chipClusterPtr, DefaultClusterCallback callback); + private native void testNotHandled(long chipClusterPtr, DefaultClusterCallback Callback); private native void testNullableOptionalRequest( - long chipClusterPtr, TestNullableOptionalResponseCallback callback, Optional arg1); + long chipClusterPtr, TestNullableOptionalResponseCallback Callback, Optional arg1); - private native void testSpecific(long chipClusterPtr, TestSpecificResponseCallback callback); + private native void testSpecific(long chipClusterPtr, TestSpecificResponseCallback Callback); private native void testStructArgumentRequest( long chipClusterPtr, - BooleanResponseCallback callback, + BooleanResponseCallback Callback, Integer a, Boolean b, Integer c, @@ -10393,7 +10423,7 @@ private native void testStructArgumentRequest( String e, Integer f); - private native void testUnknownCommand(long chipClusterPtr, DefaultClusterCallback callback); + private native void testUnknownCommand(long chipClusterPtr, DefaultClusterCallback Callback); public interface BooleanResponseCallback { void onSuccess(Boolean value); @@ -10438,13 +10468,13 @@ public interface TestSpecificResponseCallback { } public interface ListInt8uAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } public interface ListOctetStringAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -10479,6 +10509,12 @@ public interface ListStructOctetStringAttributeCallback { void onError(Exception ex); } + public interface VendorIdAttributeCallback { + void onSuccess(Integer value); + + void onError(Exception ex); + } + public static class ListNullablesAndOptionalsStructAttribute { @Nullable public Integer nullableInt; public Optional optionalInt; @@ -10516,11 +10552,113 @@ public interface ListNullablesAndOptionalsStructAttributeCallback { void onError(Exception ex); } + public interface NullableBooleanAttributeCallback { + void onSuccess(@Nullable Boolean value); + + void onError(Exception ex); + } + + public interface NullableBitmap8AttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableBitmap16AttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableBitmap32AttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableBitmap64AttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableInt8uAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableInt16uAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableInt32uAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableInt64uAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableInt8sAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableInt16sAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableInt32sAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableInt64sAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + } + + public interface NullableEnum8AttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableEnum16AttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + } + + public interface NullableOctetStringAttributeCallback { + void onSuccess(@Nullable byte[] value); + + void onError(Exception ex); + } + + public interface NullableCharStringAttributeCallback { + void onSuccess(@Nullable String value); + + void onError(Exception ex); + } + public void readBooleanAttribute(BooleanAttributeCallback callback) { readBooleanAttribute(chipClusterPtr, callback); } - public void writeBooleanAttribute(DefaultClusterCallback callback, boolean value) { + public void writeBooleanAttribute(DefaultClusterCallback callback, Boolean value) { writeBooleanAttribute(chipClusterPtr, callback, value); } @@ -10537,7 +10675,7 @@ public void readBitmap8Attribute(IntegerAttributeCallback callback) { readBitmap8Attribute(chipClusterPtr, callback); } - public void writeBitmap8Attribute(DefaultClusterCallback callback, int value) { + public void writeBitmap8Attribute(DefaultClusterCallback callback, Integer value) { writeBitmap8Attribute(chipClusterPtr, callback, value); } @@ -10554,7 +10692,7 @@ public void readBitmap16Attribute(IntegerAttributeCallback callback) { readBitmap16Attribute(chipClusterPtr, callback); } - public void writeBitmap16Attribute(DefaultClusterCallback callback, int value) { + public void writeBitmap16Attribute(DefaultClusterCallback callback, Integer value) { writeBitmap16Attribute(chipClusterPtr, callback, value); } @@ -10571,7 +10709,7 @@ public void readBitmap32Attribute(LongAttributeCallback callback) { readBitmap32Attribute(chipClusterPtr, callback); } - public void writeBitmap32Attribute(DefaultClusterCallback callback, long value) { + public void writeBitmap32Attribute(DefaultClusterCallback callback, Long value) { writeBitmap32Attribute(chipClusterPtr, callback, value); } @@ -10588,7 +10726,7 @@ public void readBitmap64Attribute(LongAttributeCallback callback) { readBitmap64Attribute(chipClusterPtr, callback); } - public void writeBitmap64Attribute(DefaultClusterCallback callback, long value) { + public void writeBitmap64Attribute(DefaultClusterCallback callback, Long value) { writeBitmap64Attribute(chipClusterPtr, callback, value); } @@ -10605,7 +10743,7 @@ public void readInt8uAttribute(IntegerAttributeCallback callback) { readInt8uAttribute(chipClusterPtr, callback); } - public void writeInt8uAttribute(DefaultClusterCallback callback, int value) { + public void writeInt8uAttribute(DefaultClusterCallback callback, Integer value) { writeInt8uAttribute(chipClusterPtr, callback, value); } @@ -10622,7 +10760,7 @@ public void readInt16uAttribute(IntegerAttributeCallback callback) { readInt16uAttribute(chipClusterPtr, callback); } - public void writeInt16uAttribute(DefaultClusterCallback callback, int value) { + public void writeInt16uAttribute(DefaultClusterCallback callback, Integer value) { writeInt16uAttribute(chipClusterPtr, callback, value); } @@ -10639,7 +10777,7 @@ public void readInt32uAttribute(LongAttributeCallback callback) { readInt32uAttribute(chipClusterPtr, callback); } - public void writeInt32uAttribute(DefaultClusterCallback callback, long value) { + public void writeInt32uAttribute(DefaultClusterCallback callback, Long value) { writeInt32uAttribute(chipClusterPtr, callback, value); } @@ -10656,7 +10794,7 @@ public void readInt64uAttribute(LongAttributeCallback callback) { readInt64uAttribute(chipClusterPtr, callback); } - public void writeInt64uAttribute(DefaultClusterCallback callback, long value) { + public void writeInt64uAttribute(DefaultClusterCallback callback, Long value) { writeInt64uAttribute(chipClusterPtr, callback, value); } @@ -10673,7 +10811,7 @@ public void readInt8sAttribute(IntegerAttributeCallback callback) { readInt8sAttribute(chipClusterPtr, callback); } - public void writeInt8sAttribute(DefaultClusterCallback callback, int value) { + public void writeInt8sAttribute(DefaultClusterCallback callback, Integer value) { writeInt8sAttribute(chipClusterPtr, callback, value); } @@ -10690,7 +10828,7 @@ public void readInt16sAttribute(IntegerAttributeCallback callback) { readInt16sAttribute(chipClusterPtr, callback); } - public void writeInt16sAttribute(DefaultClusterCallback callback, int value) { + public void writeInt16sAttribute(DefaultClusterCallback callback, Integer value) { writeInt16sAttribute(chipClusterPtr, callback, value); } @@ -10707,7 +10845,7 @@ public void readInt32sAttribute(LongAttributeCallback callback) { readInt32sAttribute(chipClusterPtr, callback); } - public void writeInt32sAttribute(DefaultClusterCallback callback, long value) { + public void writeInt32sAttribute(DefaultClusterCallback callback, Long value) { writeInt32sAttribute(chipClusterPtr, callback, value); } @@ -10724,7 +10862,7 @@ public void readInt64sAttribute(LongAttributeCallback callback) { readInt64sAttribute(chipClusterPtr, callback); } - public void writeInt64sAttribute(DefaultClusterCallback callback, long value) { + public void writeInt64sAttribute(DefaultClusterCallback callback, Long value) { writeInt64sAttribute(chipClusterPtr, callback, value); } @@ -10741,7 +10879,7 @@ public void readEnum8Attribute(IntegerAttributeCallback callback) { readEnum8Attribute(chipClusterPtr, callback); } - public void writeEnum8Attribute(DefaultClusterCallback callback, int value) { + public void writeEnum8Attribute(DefaultClusterCallback callback, Integer value) { writeEnum8Attribute(chipClusterPtr, callback, value); } @@ -10758,7 +10896,7 @@ public void readEnum16Attribute(IntegerAttributeCallback callback) { readEnum16Attribute(chipClusterPtr, callback); } - public void writeEnum16Attribute(DefaultClusterCallback callback, int value) { + public void writeEnum16Attribute(DefaultClusterCallback callback, Integer value) { writeEnum16Attribute(chipClusterPtr, callback, value); } @@ -10856,7 +10994,7 @@ public void readEpochUsAttribute(LongAttributeCallback callback) { readEpochUsAttribute(chipClusterPtr, callback); } - public void writeEpochUsAttribute(DefaultClusterCallback callback, long value) { + public void writeEpochUsAttribute(DefaultClusterCallback callback, Long value) { writeEpochUsAttribute(chipClusterPtr, callback, value); } @@ -10873,7 +11011,7 @@ public void readEpochSAttribute(LongAttributeCallback callback) { readEpochSAttribute(chipClusterPtr, callback); } - public void writeEpochSAttribute(DefaultClusterCallback callback, long value) { + public void writeEpochSAttribute(DefaultClusterCallback callback, Long value) { writeEpochSAttribute(chipClusterPtr, callback, value); } @@ -10886,11 +11024,11 @@ public void reportEpochSAttribute(LongAttributeCallback callback) { reportEpochSAttribute(chipClusterPtr, callback); } - public void readVendorIdAttribute(IntegerAttributeCallback callback) { + public void readVendorIdAttribute(VendorIdAttributeCallback callback) { readVendorIdAttribute(chipClusterPtr, callback); } - public void writeVendorIdAttribute(DefaultClusterCallback callback, int value) { + public void writeVendorIdAttribute(DefaultClusterCallback callback, Integer value) { writeVendorIdAttribute(chipClusterPtr, callback, value); } @@ -10912,7 +11050,7 @@ public void readUnsupportedAttribute(BooleanAttributeCallback callback) { readUnsupportedAttribute(chipClusterPtr, callback); } - public void writeUnsupportedAttribute(DefaultClusterCallback callback, boolean value) { + public void writeUnsupportedAttribute(DefaultClusterCallback callback, Boolean value) { writeUnsupportedAttribute(chipClusterPtr, callback, value); } @@ -10925,11 +11063,12 @@ public void reportUnsupportedAttribute(BooleanAttributeCallback callback) { reportUnsupportedAttribute(chipClusterPtr, callback); } - public void readNullableBooleanAttribute(BooleanAttributeCallback callback) { + public void readNullableBooleanAttribute(NullableBooleanAttributeCallback callback) { readNullableBooleanAttribute(chipClusterPtr, callback); } - public void writeNullableBooleanAttribute(DefaultClusterCallback callback, boolean value) { + public void writeNullableBooleanAttribute( + DefaultClusterCallback callback, @Nullable Boolean value) { writeNullableBooleanAttribute(chipClusterPtr, callback, value); } @@ -10942,11 +11081,12 @@ public void reportNullableBooleanAttribute(BooleanAttributeCallback callback) { reportNullableBooleanAttribute(chipClusterPtr, callback); } - public void readNullableBitmap8Attribute(IntegerAttributeCallback callback) { + public void readNullableBitmap8Attribute(NullableBitmap8AttributeCallback callback) { readNullableBitmap8Attribute(chipClusterPtr, callback); } - public void writeNullableBitmap8Attribute(DefaultClusterCallback callback, int value) { + public void writeNullableBitmap8Attribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableBitmap8Attribute(chipClusterPtr, callback, value); } @@ -10959,11 +11099,12 @@ public void reportNullableBitmap8Attribute(IntegerAttributeCallback callback) { reportNullableBitmap8Attribute(chipClusterPtr, callback); } - public void readNullableBitmap16Attribute(IntegerAttributeCallback callback) { + public void readNullableBitmap16Attribute(NullableBitmap16AttributeCallback callback) { readNullableBitmap16Attribute(chipClusterPtr, callback); } - public void writeNullableBitmap16Attribute(DefaultClusterCallback callback, int value) { + public void writeNullableBitmap16Attribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableBitmap16Attribute(chipClusterPtr, callback, value); } @@ -10976,11 +11117,12 @@ public void reportNullableBitmap16Attribute(IntegerAttributeCallback callback) { reportNullableBitmap16Attribute(chipClusterPtr, callback); } - public void readNullableBitmap32Attribute(LongAttributeCallback callback) { + public void readNullableBitmap32Attribute(NullableBitmap32AttributeCallback callback) { readNullableBitmap32Attribute(chipClusterPtr, callback); } - public void writeNullableBitmap32Attribute(DefaultClusterCallback callback, long value) { + public void writeNullableBitmap32Attribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableBitmap32Attribute(chipClusterPtr, callback, value); } @@ -10993,11 +11135,12 @@ public void reportNullableBitmap32Attribute(LongAttributeCallback callback) { reportNullableBitmap32Attribute(chipClusterPtr, callback); } - public void readNullableBitmap64Attribute(LongAttributeCallback callback) { + public void readNullableBitmap64Attribute(NullableBitmap64AttributeCallback callback) { readNullableBitmap64Attribute(chipClusterPtr, callback); } - public void writeNullableBitmap64Attribute(DefaultClusterCallback callback, long value) { + public void writeNullableBitmap64Attribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableBitmap64Attribute(chipClusterPtr, callback, value); } @@ -11010,11 +11153,12 @@ public void reportNullableBitmap64Attribute(LongAttributeCallback callback) { reportNullableBitmap64Attribute(chipClusterPtr, callback); } - public void readNullableInt8uAttribute(IntegerAttributeCallback callback) { + public void readNullableInt8uAttribute(NullableInt8uAttributeCallback callback) { readNullableInt8uAttribute(chipClusterPtr, callback); } - public void writeNullableInt8uAttribute(DefaultClusterCallback callback, int value) { + public void writeNullableInt8uAttribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableInt8uAttribute(chipClusterPtr, callback, value); } @@ -11027,11 +11171,12 @@ public void reportNullableInt8uAttribute(IntegerAttributeCallback callback) { reportNullableInt8uAttribute(chipClusterPtr, callback); } - public void readNullableInt16uAttribute(IntegerAttributeCallback callback) { + public void readNullableInt16uAttribute(NullableInt16uAttributeCallback callback) { readNullableInt16uAttribute(chipClusterPtr, callback); } - public void writeNullableInt16uAttribute(DefaultClusterCallback callback, int value) { + public void writeNullableInt16uAttribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableInt16uAttribute(chipClusterPtr, callback, value); } @@ -11044,11 +11189,12 @@ public void reportNullableInt16uAttribute(IntegerAttributeCallback callback) { reportNullableInt16uAttribute(chipClusterPtr, callback); } - public void readNullableInt32uAttribute(LongAttributeCallback callback) { + public void readNullableInt32uAttribute(NullableInt32uAttributeCallback callback) { readNullableInt32uAttribute(chipClusterPtr, callback); } - public void writeNullableInt32uAttribute(DefaultClusterCallback callback, long value) { + public void writeNullableInt32uAttribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableInt32uAttribute(chipClusterPtr, callback, value); } @@ -11061,11 +11207,12 @@ public void reportNullableInt32uAttribute(LongAttributeCallback callback) { reportNullableInt32uAttribute(chipClusterPtr, callback); } - public void readNullableInt64uAttribute(LongAttributeCallback callback) { + public void readNullableInt64uAttribute(NullableInt64uAttributeCallback callback) { readNullableInt64uAttribute(chipClusterPtr, callback); } - public void writeNullableInt64uAttribute(DefaultClusterCallback callback, long value) { + public void writeNullableInt64uAttribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableInt64uAttribute(chipClusterPtr, callback, value); } @@ -11078,11 +11225,12 @@ public void reportNullableInt64uAttribute(LongAttributeCallback callback) { reportNullableInt64uAttribute(chipClusterPtr, callback); } - public void readNullableInt8sAttribute(IntegerAttributeCallback callback) { + public void readNullableInt8sAttribute(NullableInt8sAttributeCallback callback) { readNullableInt8sAttribute(chipClusterPtr, callback); } - public void writeNullableInt8sAttribute(DefaultClusterCallback callback, int value) { + public void writeNullableInt8sAttribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableInt8sAttribute(chipClusterPtr, callback, value); } @@ -11095,11 +11243,12 @@ public void reportNullableInt8sAttribute(IntegerAttributeCallback callback) { reportNullableInt8sAttribute(chipClusterPtr, callback); } - public void readNullableInt16sAttribute(IntegerAttributeCallback callback) { + public void readNullableInt16sAttribute(NullableInt16sAttributeCallback callback) { readNullableInt16sAttribute(chipClusterPtr, callback); } - public void writeNullableInt16sAttribute(DefaultClusterCallback callback, int value) { + public void writeNullableInt16sAttribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableInt16sAttribute(chipClusterPtr, callback, value); } @@ -11112,11 +11261,12 @@ public void reportNullableInt16sAttribute(IntegerAttributeCallback callback) { reportNullableInt16sAttribute(chipClusterPtr, callback); } - public void readNullableInt32sAttribute(LongAttributeCallback callback) { + public void readNullableInt32sAttribute(NullableInt32sAttributeCallback callback) { readNullableInt32sAttribute(chipClusterPtr, callback); } - public void writeNullableInt32sAttribute(DefaultClusterCallback callback, long value) { + public void writeNullableInt32sAttribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableInt32sAttribute(chipClusterPtr, callback, value); } @@ -11129,11 +11279,12 @@ public void reportNullableInt32sAttribute(LongAttributeCallback callback) { reportNullableInt32sAttribute(chipClusterPtr, callback); } - public void readNullableInt64sAttribute(LongAttributeCallback callback) { + public void readNullableInt64sAttribute(NullableInt64sAttributeCallback callback) { readNullableInt64sAttribute(chipClusterPtr, callback); } - public void writeNullableInt64sAttribute(DefaultClusterCallback callback, long value) { + public void writeNullableInt64sAttribute( + DefaultClusterCallback callback, @Nullable Long value) { writeNullableInt64sAttribute(chipClusterPtr, callback, value); } @@ -11146,11 +11297,12 @@ public void reportNullableInt64sAttribute(LongAttributeCallback callback) { reportNullableInt64sAttribute(chipClusterPtr, callback); } - public void readNullableEnum8Attribute(IntegerAttributeCallback callback) { + public void readNullableEnum8Attribute(NullableEnum8AttributeCallback callback) { readNullableEnum8Attribute(chipClusterPtr, callback); } - public void writeNullableEnum8Attribute(DefaultClusterCallback callback, int value) { + public void writeNullableEnum8Attribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableEnum8Attribute(chipClusterPtr, callback, value); } @@ -11163,11 +11315,12 @@ public void reportNullableEnum8Attribute(IntegerAttributeCallback callback) { reportNullableEnum8Attribute(chipClusterPtr, callback); } - public void readNullableEnum16Attribute(IntegerAttributeCallback callback) { + public void readNullableEnum16Attribute(NullableEnum16AttributeCallback callback) { readNullableEnum16Attribute(chipClusterPtr, callback); } - public void writeNullableEnum16Attribute(DefaultClusterCallback callback, int value) { + public void writeNullableEnum16Attribute( + DefaultClusterCallback callback, @Nullable Integer value) { writeNullableEnum16Attribute(chipClusterPtr, callback, value); } @@ -11180,11 +11333,12 @@ public void reportNullableEnum16Attribute(IntegerAttributeCallback callback) { reportNullableEnum16Attribute(chipClusterPtr, callback); } - public void readNullableOctetStringAttribute(OctetStringAttributeCallback callback) { + public void readNullableOctetStringAttribute(NullableOctetStringAttributeCallback callback) { readNullableOctetStringAttribute(chipClusterPtr, callback); } - public void writeNullableOctetStringAttribute(DefaultClusterCallback callback, byte[] value) { + public void writeNullableOctetStringAttribute( + DefaultClusterCallback callback, @Nullable byte[] value) { writeNullableOctetStringAttribute(chipClusterPtr, callback, value); } @@ -11197,11 +11351,12 @@ public void reportNullableOctetStringAttribute(OctetStringAttributeCallback call reportNullableOctetStringAttribute(chipClusterPtr, callback); } - public void readNullableCharStringAttribute(CharStringAttributeCallback callback) { + public void readNullableCharStringAttribute(NullableCharStringAttributeCallback callback) { readNullableCharStringAttribute(chipClusterPtr, callback); } - public void writeNullableCharStringAttribute(DefaultClusterCallback callback, String value) { + public void writeNullableCharStringAttribute( + DefaultClusterCallback callback, @Nullable String value) { writeNullableCharStringAttribute(chipClusterPtr, callback, value); } @@ -11231,7 +11386,7 @@ private native void readBooleanAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void writeBooleanAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeBooleanAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11243,7 +11398,7 @@ private native void readBitmap8Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeBitmap8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeBitmap8Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11255,7 +11410,7 @@ private native void readBitmap16Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeBitmap16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeBitmap16Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11266,7 +11421,7 @@ private native void reportBitmap16Attribute( private native void readBitmap32Attribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeBitmap32Attribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBitmap32Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11277,7 +11432,7 @@ private native void reportBitmap32Attribute( private native void readBitmap64Attribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeBitmap64Attribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeBitmap64Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11288,7 +11443,7 @@ private native void reportBitmap64Attribute( private native void readInt8uAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11299,7 +11454,7 @@ private native void reportInt8uAttribute( private native void readInt16uAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11310,7 +11465,7 @@ private native void reportInt16uAttribute( private native void readInt32uAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeInt32uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt32uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11320,7 +11475,7 @@ private native void subscribeInt32uAttribute( private native void readInt64uAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeInt64uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt64uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11330,7 +11485,7 @@ private native void subscribeInt64uAttribute( private native void readInt8sAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11341,7 +11496,7 @@ private native void reportInt8sAttribute( private native void readInt16sAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11352,7 +11507,7 @@ private native void reportInt16sAttribute( private native void readInt32sAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeInt32sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt32sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11362,7 +11517,7 @@ private native void subscribeInt32sAttribute( private native void readInt64sAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeInt64sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeInt64sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11372,7 +11527,7 @@ private native void subscribeInt64sAttribute( private native void readEnum8Attribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeEnum8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeEnum8Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11383,7 +11538,7 @@ private native void reportEnum8Attribute( private native void readEnum16Attribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeEnum16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeEnum16Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11451,7 +11606,7 @@ private native void reportLongCharStringAttribute( private native void readEpochUsAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeEpochUsAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeEpochUsAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11461,7 +11616,7 @@ private native void subscribeEpochUsAttribute( private native void readEpochSAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void writeEpochSAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, Long value); private native void subscribeEpochSAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11469,10 +11624,10 @@ private native void subscribeEpochSAttribute( private native void reportEpochSAttribute(long chipClusterPtr, LongAttributeCallback callback); private native void readVendorIdAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, VendorIdAttributeCallback callback); private native void writeVendorIdAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeVendorIdAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11487,7 +11642,7 @@ private native void readUnsupportedAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void writeUnsupportedAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, Boolean value); private native void subscribeUnsupportedAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11496,10 +11651,10 @@ private native void reportUnsupportedAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void readNullableBooleanAttribute( - long chipClusterPtr, BooleanAttributeCallback callback); + long chipClusterPtr, NullableBooleanAttributeCallback callback); private native void writeNullableBooleanAttribute( - long chipClusterPtr, DefaultClusterCallback callback, boolean value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Boolean value); private native void subscribeNullableBooleanAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11508,10 +11663,10 @@ private native void reportNullableBooleanAttribute( long chipClusterPtr, BooleanAttributeCallback callback); private native void readNullableBitmap8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableBitmap8AttributeCallback callback); private native void writeNullableBitmap8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableBitmap8Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11520,10 +11675,10 @@ private native void reportNullableBitmap8Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableBitmap16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableBitmap16AttributeCallback callback); private native void writeNullableBitmap16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableBitmap16Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11532,10 +11687,10 @@ private native void reportNullableBitmap16Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableBitmap32Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableBitmap32AttributeCallback callback); private native void writeNullableBitmap32Attribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableBitmap32Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11544,10 +11699,10 @@ private native void reportNullableBitmap32Attribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableBitmap64Attribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableBitmap64AttributeCallback callback); private native void writeNullableBitmap64Attribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableBitmap64Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11556,10 +11711,10 @@ private native void reportNullableBitmap64Attribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableInt8uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableInt8uAttributeCallback callback); private native void writeNullableInt8uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt8uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11568,10 +11723,10 @@ private native void reportNullableInt8uAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableInt16uAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableInt16uAttributeCallback callback); private native void writeNullableInt16uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt16uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11580,10 +11735,10 @@ private native void reportNullableInt16uAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableInt32uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableInt32uAttributeCallback callback); private native void writeNullableInt32uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt32uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11592,10 +11747,10 @@ private native void reportNullableInt32uAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableInt64uAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableInt64uAttributeCallback callback); private native void writeNullableInt64uAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt64uAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11604,10 +11759,10 @@ private native void reportNullableInt64uAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableInt8sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableInt8sAttributeCallback callback); private native void writeNullableInt8sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt8sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11616,10 +11771,10 @@ private native void reportNullableInt8sAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableInt16sAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableInt16sAttributeCallback callback); private native void writeNullableInt16sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableInt16sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11628,10 +11783,10 @@ private native void reportNullableInt16sAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableInt32sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableInt32sAttributeCallback callback); private native void writeNullableInt32sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt32sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11640,10 +11795,10 @@ private native void reportNullableInt32sAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableInt64sAttribute( - long chipClusterPtr, LongAttributeCallback callback); + long chipClusterPtr, NullableInt64sAttributeCallback callback); private native void writeNullableInt64sAttribute( - long chipClusterPtr, DefaultClusterCallback callback, long value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Long value); private native void subscribeNullableInt64sAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11652,10 +11807,10 @@ private native void reportNullableInt64sAttribute( long chipClusterPtr, LongAttributeCallback callback); private native void readNullableEnum8Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableEnum8AttributeCallback callback); private native void writeNullableEnum8Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableEnum8Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11664,10 +11819,10 @@ private native void reportNullableEnum8Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableEnum16Attribute( - long chipClusterPtr, IntegerAttributeCallback callback); + long chipClusterPtr, NullableEnum16AttributeCallback callback); private native void writeNullableEnum16Attribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable Integer value); private native void subscribeNullableEnum16Attribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11676,10 +11831,10 @@ private native void reportNullableEnum16Attribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void readNullableOctetStringAttribute( - long chipClusterPtr, OctetStringAttributeCallback callback); + long chipClusterPtr, NullableOctetStringAttributeCallback callback); private native void writeNullableOctetStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, byte[] value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable byte[] value); private native void subscribeNullableOctetStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11688,10 +11843,10 @@ private native void reportNullableOctetStringAttribute( long chipClusterPtr, OctetStringAttributeCallback callback); private native void readNullableCharStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + long chipClusterPtr, NullableCharStringAttributeCallback callback); private native void writeNullableCharStringAttribute( - long chipClusterPtr, DefaultClusterCallback callback, String value); + long chipClusterPtr, DefaultClusterCallback callback, @Nullable String value); private native void subscribeNullableCharStringAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -11753,26 +11908,26 @@ public void setpointRaiseLower(DefaultClusterCallback callback, Integer mode, In setpointRaiseLower(chipClusterPtr, callback, mode, amount); } - private native void clearWeeklySchedule(long chipClusterPtr, DefaultClusterCallback callback); + private native void clearWeeklySchedule(long chipClusterPtr, DefaultClusterCallback Callback); - private native void getRelayStatusLog(long chipClusterPtr, DefaultClusterCallback callback); + private native void getRelayStatusLog(long chipClusterPtr, DefaultClusterCallback Callback); private native void getWeeklySchedule( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer daysToReturn, Integer modeToReturn); private native void setWeeklySchedule( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer numberOfTransitionsForSequence, Integer dayOfWeekForSequence, Integer modeForSequence, Integer payload); private native void setpointRaiseLower( - long chipClusterPtr, DefaultClusterCallback callback, Integer mode, Integer amount); + long chipClusterPtr, DefaultClusterCallback Callback, Integer mode, Integer amount); public void readLocalTemperatureAttribute(IntegerAttributeCallback callback) { readLocalTemperatureAttribute(chipClusterPtr, callback); @@ -11843,7 +11998,8 @@ public void readOccupiedCoolingSetpointAttribute(IntegerAttributeCallback callba readOccupiedCoolingSetpointAttribute(chipClusterPtr, callback); } - public void writeOccupiedCoolingSetpointAttribute(DefaultClusterCallback callback, int value) { + public void writeOccupiedCoolingSetpointAttribute( + DefaultClusterCallback callback, Integer value) { writeOccupiedCoolingSetpointAttribute(chipClusterPtr, callback, value); } @@ -11860,7 +12016,8 @@ public void readOccupiedHeatingSetpointAttribute(IntegerAttributeCallback callba readOccupiedHeatingSetpointAttribute(chipClusterPtr, callback); } - public void writeOccupiedHeatingSetpointAttribute(DefaultClusterCallback callback, int value) { + public void writeOccupiedHeatingSetpointAttribute( + DefaultClusterCallback callback, Integer value) { writeOccupiedHeatingSetpointAttribute(chipClusterPtr, callback, value); } @@ -11877,7 +12034,7 @@ public void readMinHeatSetpointLimitAttribute(IntegerAttributeCallback callback) readMinHeatSetpointLimitAttribute(chipClusterPtr, callback); } - public void writeMinHeatSetpointLimitAttribute(DefaultClusterCallback callback, int value) { + public void writeMinHeatSetpointLimitAttribute(DefaultClusterCallback callback, Integer value) { writeMinHeatSetpointLimitAttribute(chipClusterPtr, callback, value); } @@ -11894,7 +12051,7 @@ public void readMaxHeatSetpointLimitAttribute(IntegerAttributeCallback callback) readMaxHeatSetpointLimitAttribute(chipClusterPtr, callback); } - public void writeMaxHeatSetpointLimitAttribute(DefaultClusterCallback callback, int value) { + public void writeMaxHeatSetpointLimitAttribute(DefaultClusterCallback callback, Integer value) { writeMaxHeatSetpointLimitAttribute(chipClusterPtr, callback, value); } @@ -11911,7 +12068,7 @@ public void readMinCoolSetpointLimitAttribute(IntegerAttributeCallback callback) readMinCoolSetpointLimitAttribute(chipClusterPtr, callback); } - public void writeMinCoolSetpointLimitAttribute(DefaultClusterCallback callback, int value) { + public void writeMinCoolSetpointLimitAttribute(DefaultClusterCallback callback, Integer value) { writeMinCoolSetpointLimitAttribute(chipClusterPtr, callback, value); } @@ -11928,7 +12085,7 @@ public void readMaxCoolSetpointLimitAttribute(IntegerAttributeCallback callback) readMaxCoolSetpointLimitAttribute(chipClusterPtr, callback); } - public void writeMaxCoolSetpointLimitAttribute(DefaultClusterCallback callback, int value) { + public void writeMaxCoolSetpointLimitAttribute(DefaultClusterCallback callback, Integer value) { writeMaxCoolSetpointLimitAttribute(chipClusterPtr, callback, value); } @@ -11945,7 +12102,7 @@ public void readMinSetpointDeadBandAttribute(IntegerAttributeCallback callback) readMinSetpointDeadBandAttribute(chipClusterPtr, callback); } - public void writeMinSetpointDeadBandAttribute(DefaultClusterCallback callback, int value) { + public void writeMinSetpointDeadBandAttribute(DefaultClusterCallback callback, Integer value) { writeMinSetpointDeadBandAttribute(chipClusterPtr, callback, value); } @@ -11963,7 +12120,7 @@ public void readControlSequenceOfOperationAttribute(IntegerAttributeCallback cal } public void writeControlSequenceOfOperationAttribute( - DefaultClusterCallback callback, int value) { + DefaultClusterCallback callback, Integer value) { writeControlSequenceOfOperationAttribute(chipClusterPtr, callback, value); } @@ -11981,7 +12138,7 @@ public void readSystemModeAttribute(IntegerAttributeCallback callback) { readSystemModeAttribute(chipClusterPtr, callback); } - public void writeSystemModeAttribute(DefaultClusterCallback callback, int value) { + public void writeSystemModeAttribute(DefaultClusterCallback callback, Integer value) { writeSystemModeAttribute(chipClusterPtr, callback, value); } @@ -12110,7 +12267,7 @@ private native void readOccupiedCoolingSetpointAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOccupiedCoolingSetpointAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOccupiedCoolingSetpointAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12122,7 +12279,7 @@ private native void readOccupiedHeatingSetpointAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeOccupiedHeatingSetpointAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeOccupiedHeatingSetpointAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12134,7 +12291,7 @@ private native void readMinHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeMinHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinHeatSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12146,7 +12303,7 @@ private native void readMaxHeatSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeMaxHeatSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMaxHeatSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12158,7 +12315,7 @@ private native void readMinCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeMinCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinCoolSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12170,7 +12327,7 @@ private native void readMaxCoolSetpointLimitAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeMaxCoolSetpointLimitAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMaxCoolSetpointLimitAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12182,7 +12339,7 @@ private native void readMinSetpointDeadBandAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeMinSetpointDeadBandAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeMinSetpointDeadBandAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12194,7 +12351,7 @@ private native void readControlSequenceOfOperationAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeControlSequenceOfOperationAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeControlSequenceOfOperationAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12206,7 +12363,7 @@ private native void readSystemModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeSystemModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeSystemModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12276,7 +12433,8 @@ public void readTemperatureDisplayModeAttribute(IntegerAttributeCallback callbac readTemperatureDisplayModeAttribute(chipClusterPtr, callback); } - public void writeTemperatureDisplayModeAttribute(DefaultClusterCallback callback, int value) { + public void writeTemperatureDisplayModeAttribute( + DefaultClusterCallback callback, Integer value) { writeTemperatureDisplayModeAttribute(chipClusterPtr, callback, value); } @@ -12293,7 +12451,7 @@ public void readKeypadLockoutAttribute(IntegerAttributeCallback callback) { readKeypadLockoutAttribute(chipClusterPtr, callback); } - public void writeKeypadLockoutAttribute(DefaultClusterCallback callback, int value) { + public void writeKeypadLockoutAttribute(DefaultClusterCallback callback, Integer value) { writeKeypadLockoutAttribute(chipClusterPtr, callback, value); } @@ -12311,7 +12469,7 @@ public void readScheduleProgrammingVisibilityAttribute(IntegerAttributeCallback } public void writeScheduleProgrammingVisibilityAttribute( - DefaultClusterCallback callback, int value) { + DefaultClusterCallback callback, Integer value) { writeScheduleProgrammingVisibilityAttribute(chipClusterPtr, callback, value); } @@ -12342,7 +12500,7 @@ private native void readTemperatureDisplayModeAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeTemperatureDisplayModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeTemperatureDisplayModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12354,7 +12512,7 @@ private native void readKeypadLockoutAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeKeypadLockoutAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeKeypadLockoutAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12366,7 +12524,7 @@ private native void readScheduleProgrammingVisibilityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); private native void writeScheduleProgrammingVisibilityAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeScheduleProgrammingVisibilityAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); @@ -12400,7 +12558,7 @@ public void resetCounts(DefaultClusterCallback callback) { resetCounts(chipClusterPtr, callback); } - private native void resetCounts(long chipClusterPtr, DefaultClusterCallback callback); + private native void resetCounts(long chipClusterPtr, DefaultClusterCallback Callback); public static class NeighborTableListAttribute { public Long extAddress; @@ -12739,7 +12897,7 @@ public interface OperationalDatasetComponentsAttributeCallback { } public interface ActiveNetworkFaultsListAttributeCallback { - void onSuccess(List valueList); + void onSuccess(List valueList); void onError(Exception ex); } @@ -14156,7 +14314,7 @@ public void resetCounts(DefaultClusterCallback callback) { resetCounts(chipClusterPtr, callback); } - private native void resetCounts(long chipClusterPtr, DefaultClusterCallback callback); + private native void resetCounts(long chipClusterPtr, DefaultClusterCallback Callback); public void readBssidAttribute(OctetStringAttributeCallback callback) { readBssidAttribute(chipClusterPtr, callback); @@ -14518,29 +14676,29 @@ public void upOrOpen(DefaultClusterCallback callback) { upOrOpen(chipClusterPtr, callback); } - private native void downOrClose(long chipClusterPtr, DefaultClusterCallback callback); + private native void downOrClose(long chipClusterPtr, DefaultClusterCallback Callback); private native void goToLiftPercentage( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer liftPercentageValue, Integer liftPercent100thsValue); private native void goToLiftValue( - long chipClusterPtr, DefaultClusterCallback callback, Integer liftValue); + long chipClusterPtr, DefaultClusterCallback Callback, Integer liftValue); private native void goToTiltPercentage( long chipClusterPtr, - DefaultClusterCallback callback, + DefaultClusterCallback Callback, Integer tiltPercentageValue, Integer tiltPercent100thsValue); private native void goToTiltValue( - long chipClusterPtr, DefaultClusterCallback callback, Integer tiltValue); + long chipClusterPtr, DefaultClusterCallback Callback, Integer tiltValue); - private native void stopMotion(long chipClusterPtr, DefaultClusterCallback callback); + private native void stopMotion(long chipClusterPtr, DefaultClusterCallback Callback); - private native void upOrOpen(long chipClusterPtr, DefaultClusterCallback callback); + private native void upOrOpen(long chipClusterPtr, DefaultClusterCallback Callback); public void readTypeAttribute(IntegerAttributeCallback callback) { readTypeAttribute(chipClusterPtr, callback); @@ -14762,7 +14920,7 @@ public void readModeAttribute(IntegerAttributeCallback callback) { readModeAttribute(chipClusterPtr, callback); } - public void writeModeAttribute(DefaultClusterCallback callback, int value) { + public void writeModeAttribute(DefaultClusterCallback callback, Integer value) { writeModeAttribute(chipClusterPtr, callback, value); } @@ -14959,7 +15117,7 @@ private native void reportInstalledClosedLimitTiltAttribute( private native void readModeAttribute(long chipClusterPtr, IntegerAttributeCallback callback); private native void writeModeAttribute( - long chipClusterPtr, DefaultClusterCallback callback, int value); + long chipClusterPtr, DefaultClusterCallback callback, Integer value); private native void subscribeModeAttribute( long chipClusterPtr, DefaultClusterCallback callback, int minInterval, int maxInterval); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 2818372dd6fb28..dda5872457343f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -235,7 +235,7 @@ 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"); @@ -398,7 +398,7 @@ 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"); @@ -424,7 +424,7 @@ 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"); @@ -477,7 +477,7 @@ 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"); @@ -502,7 +502,7 @@ 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"); @@ -527,7 +527,7 @@ 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"); @@ -1380,7 +1380,7 @@ 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"); @@ -1406,7 +1406,7 @@ 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"); @@ -1432,7 +1432,7 @@ 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"); @@ -2428,7 +2428,7 @@ 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"); @@ -2454,7 +2454,7 @@ 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"); @@ -2957,7 +2957,7 @@ 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"); @@ -2983,7 +2983,7 @@ 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"); @@ -3185,7 +3185,7 @@ 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"); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java index 9f8db536d2d96c..b03c060a474e2a 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterReadMapping.java @@ -2248,7 +2248,9 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMeasuredValueAttribute( + (ChipClusters.IlluminanceMeasurementCluster.MeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMeasuredValueCommandParams); @@ -2261,7 +2263,9 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMinMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMinMeasuredValueAttribute( + (ChipClusters.IlluminanceMeasurementCluster.MinMeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMinMeasuredValueCommandParams); @@ -2274,7 +2278,9 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readMaxMeasuredValueAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readMaxMeasuredValueAttribute( + (ChipClusters.IlluminanceMeasurementCluster.MaxMeasuredValueAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementMaxMeasuredValueCommandParams); @@ -2299,7 +2305,9 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.IlluminanceMeasurementCluster) cluster) - .readLightSensorTypeAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readLightSensorTypeAttribute( + (ChipClusters.IlluminanceMeasurementCluster.LightSensorTypeAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readIlluminanceMeasurementLightSensorTypeCommandParams); @@ -3095,7 +3103,9 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.OperationalCredentialsCluster) cluster) .readCurrentFabricIndexAttribute( - (ChipClusters.IntegerAttributeCallback) callback); + (ChipClusters.OperationalCredentialsCluster + .CurrentFabricIndexAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readOperationalCredentialsCurrentFabricIndexCommandParams); @@ -4364,7 +4374,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readVendorIdAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readVendorIdAttribute( + (ChipClusters.TestClusterCluster.VendorIdAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterVendorIdCommandParams); @@ -4405,7 +4416,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableBooleanAttribute((ChipClusters.BooleanAttributeCallback) callback); + .readNullableBooleanAttribute( + (ChipClusters.TestClusterCluster.NullableBooleanAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), readTestClusterNullableBooleanCommandParams); @@ -4417,7 +4429,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap8Attribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableBitmap8Attribute( + (ChipClusters.TestClusterCluster.NullableBitmap8AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableBitmap8CommandParams); @@ -4429,7 +4442,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap16Attribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableBitmap16Attribute( + (ChipClusters.TestClusterCluster.NullableBitmap16AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableBitmap16CommandParams); @@ -4441,7 +4455,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap32Attribute((ChipClusters.LongAttributeCallback) callback); + .readNullableBitmap32Attribute( + (ChipClusters.TestClusterCluster.NullableBitmap32AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableBitmap32CommandParams); @@ -4453,7 +4468,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableBitmap64Attribute((ChipClusters.LongAttributeCallback) callback); + .readNullableBitmap64Attribute( + (ChipClusters.TestClusterCluster.NullableBitmap64AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableBitmap64CommandParams); @@ -4465,7 +4481,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt8uAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableInt8uAttribute( + (ChipClusters.TestClusterCluster.NullableInt8uAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableInt8uCommandParams); @@ -4477,7 +4494,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt16uAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableInt16uAttribute( + (ChipClusters.TestClusterCluster.NullableInt16uAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableInt16uCommandParams); @@ -4489,7 +4507,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt32uAttribute((ChipClusters.LongAttributeCallback) callback); + .readNullableInt32uAttribute( + (ChipClusters.TestClusterCluster.NullableInt32uAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableInt32uCommandParams); @@ -4501,7 +4520,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt64uAttribute((ChipClusters.LongAttributeCallback) callback); + .readNullableInt64uAttribute( + (ChipClusters.TestClusterCluster.NullableInt64uAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableInt64uCommandParams); @@ -4513,7 +4533,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt8sAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableInt8sAttribute( + (ChipClusters.TestClusterCluster.NullableInt8sAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableInt8sCommandParams); @@ -4525,7 +4546,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt16sAttribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableInt16sAttribute( + (ChipClusters.TestClusterCluster.NullableInt16sAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableInt16sCommandParams); @@ -4537,7 +4559,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt32sAttribute((ChipClusters.LongAttributeCallback) callback); + .readNullableInt32sAttribute( + (ChipClusters.TestClusterCluster.NullableInt32sAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableInt32sCommandParams); @@ -4549,7 +4572,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableInt64sAttribute((ChipClusters.LongAttributeCallback) callback); + .readNullableInt64sAttribute( + (ChipClusters.TestClusterCluster.NullableInt64sAttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), readTestClusterNullableInt64sCommandParams); @@ -4561,7 +4585,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableEnum8Attribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableEnum8Attribute( + (ChipClusters.TestClusterCluster.NullableEnum8AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableEnum8CommandParams); @@ -4573,7 +4598,8 @@ public Map> getReadAttributeMap() { new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) - .readNullableEnum16Attribute((ChipClusters.IntegerAttributeCallback) callback); + .readNullableEnum16Attribute( + (ChipClusters.TestClusterCluster.NullableEnum16AttributeCallback) callback); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), readTestClusterNullableEnum16CommandParams); @@ -4586,7 +4612,8 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readNullableOctetStringAttribute( - (ChipClusters.OctetStringAttributeCallback) callback); + (ChipClusters.TestClusterCluster.NullableOctetStringAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedOctetStringAttributeCallback(), readTestClusterNullableOctetStringCommandParams); @@ -4600,7 +4627,8 @@ public Map> getReadAttributeMap() { (cluster, callback, commandArguments) -> { ((ChipClusters.TestClusterCluster) cluster) .readNullableCharStringAttribute( - (ChipClusters.CharStringAttributeCallback) callback); + (ChipClusters.TestClusterCluster.NullableCharStringAttributeCallback) + callback); }, () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), readTestClusterNullableCharStringCommandParams);