blob: 27361b718f8ee7c8e8961ea450281ef29e115584 [file] [log] [blame]
/*
*
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS FILE IS GENERATED BY ZAP
#include "CHIPReadCallbacks.h"
#include <app-common/zap-generated/cluster-objects.h>
#include <zap-generated/CHIPClusters.h>
#include <controller/java/AndroidClusterExceptions.h>
#include <controller/java/CHIPDefaultCallbacks.h>
#include <jni.h>
#include <lib/support/CodeUtils.h>
#include <platform/PlatformManager.h>
#define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \
extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME
JNI_METHOD(void, AccountLoginCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::AccountLoginCluster * cppCluster = reinterpret_cast<chip::Controller::AccountLoginCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, AdministratorCommissioningCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::AdministratorCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::AdministratorCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readApplicationNameAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeApplicationName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readProductIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readApplicationIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readCatalogVendorIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readApplicationStatusAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeApplicationStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationBasicCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationLauncherCluster, readApplicationLauncherListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPApplicationLauncherApplicationLauncherListAttributeCallback,
void (*)(CHIPApplicationLauncherApplicationLauncherListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPApplicationLauncherApplicationLauncherListAttributeCallback>(callback),
chip::Platform::Delete<CHIPApplicationLauncherApplicationLauncherListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeApplicationLauncherList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationLauncherCluster, readCatalogVendorIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCatalogVendorId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationLauncherCluster, readApplicationIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeApplicationId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ApplicationLauncherCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ApplicationLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ApplicationLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, AudioOutputCluster, readAudioOutputListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPAudioOutputAudioOutputListAttributeCallback, void (*)(CHIPAudioOutputAudioOutputListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPAudioOutputAudioOutputListAttributeCallback>(callback),
chip::Platform::Delete<CHIPAudioOutputAudioOutputListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::AudioOutputCluster * cppCluster = reinterpret_cast<chip::Controller::AudioOutputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAudioOutputList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, AudioOutputCluster, readCurrentAudioOutputAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::AudioOutputCluster * cppCluster = reinterpret_cast<chip::Controller::AudioOutputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentAudioOutput(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, AudioOutputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::AudioOutputCluster * cppCluster = reinterpret_cast<chip::Controller::AudioOutputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BarrierControlCluster, readBarrierMovingStateAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BarrierControlCluster * cppCluster = reinterpret_cast<chip::Controller::BarrierControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBarrierMovingState(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BarrierControlCluster, readBarrierSafetyStatusAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BarrierControlCluster * cppCluster = reinterpret_cast<chip::Controller::BarrierControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBarrierSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BarrierControlCluster, readBarrierCapabilitiesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BarrierControlCluster * cppCluster = reinterpret_cast<chip::Controller::BarrierControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBarrierCapabilities(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BarrierControlCluster, readBarrierPositionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BarrierControlCluster * cppCluster = reinterpret_cast<chip::Controller::BarrierControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBarrierPosition(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BarrierControlCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BarrierControlCluster * cppCluster = reinterpret_cast<chip::Controller::BarrierControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readInteractionModelVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInteractionModelVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readProductNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readProductIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductID(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readUserLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readLocationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLocation(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readHardwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readHardwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readSoftwareVersionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readSoftwareVersionStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readManufacturingDateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeManufacturingDate(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePartNumber(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readProductURLAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductURL(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readProductLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductLabel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readSerialNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSerialNumber(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readLocalConfigDisabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLocalConfigDisabled(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readReachableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeReachable(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BasicCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BasicCluster * cppCluster = reinterpret_cast<chip::Controller::BasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BinaryInputBasicCluster, readOutOfServiceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BinaryInputBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BinaryInputBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOutOfService(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BinaryInputBasicCluster, readPresentValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BinaryInputBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BinaryInputBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePresentValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BinaryInputBasicCluster, readStatusFlagsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BinaryInputBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BinaryInputBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStatusFlags(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BinaryInputBasicCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BinaryInputBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BinaryInputBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BindingCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BindingCluster * cppCluster = reinterpret_cast<chip::Controller::BindingCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BooleanStateCluster, readStateValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BooleanStateCluster * cppCluster = reinterpret_cast<chip::Controller::BooleanStateCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStateValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BooleanStateCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BooleanStateCluster * cppCluster = reinterpret_cast<chip::Controller::BooleanStateCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedActionsCluster, readActionListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBridgedActionsActionListAttributeCallback, void (*)(CHIPBridgedActionsActionListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPBridgedActionsActionListAttributeCallback>(callback),
chip::Platform::Delete<CHIPBridgedActionsActionListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedActionsCluster * cppCluster = reinterpret_cast<chip::Controller::BridgedActionsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActionList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedActionsCluster, readEndpointListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBridgedActionsEndpointListAttributeCallback, void (*)(CHIPBridgedActionsEndpointListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPBridgedActionsEndpointListAttributeCallback>(callback),
chip::Platform::Delete<CHIPBridgedActionsEndpointListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedActionsCluster * cppCluster = reinterpret_cast<chip::Controller::BridgedActionsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEndpointList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedActionsCluster, readSetupUrlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedActionsCluster * cppCluster = reinterpret_cast<chip::Controller::BridgedActionsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSetupUrl(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedActionsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedActionsCluster * cppCluster = reinterpret_cast<chip::Controller::BridgedActionsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readVendorNameAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readVendorIDAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorID(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readProductNameAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readUserLabelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeUserLabel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readHardwareVersionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeHardwareVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readHardwareVersionStringAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeHardwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readSoftwareVersionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSoftwareVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readSoftwareVersionStringAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSoftwareVersionString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readManufacturingDateAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeManufacturingDate(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readPartNumberAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePartNumber(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readProductURLAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductURL(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readProductLabelAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeProductLabel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readSerialNumberAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSerialNumber(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readReachableAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeReachable(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, BridgedDeviceBasicCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::BridgedDeviceBasicCluster * cppCluster =
reinterpret_cast<chip::Controller::BridgedDeviceBasicCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCurrentHueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCurrentSaturationAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentSaturation(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCurrentXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentX(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCurrentYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentY(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readDriftCompensationAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDriftCompensation(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCompensationTextAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCompensationText(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorTemperatureAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorTemperature(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorControlOptionsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorControlOptions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readNumberOfPrimariesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNumberOfPrimaries(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary1XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary1X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary1YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary1Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary1IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary1Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary2XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary2X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary2YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary2Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary2IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary2Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary3XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary3X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary3YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary3Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary3IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary3Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary4XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary4X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary4YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary4Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary4IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary4Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary5XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary5X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary5YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary5Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary5IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary5Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary6XAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary6X(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary6YAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary6Y(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readPrimary6IntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePrimary6Intensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readWhitePointXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeWhitePointX(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readWhitePointYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeWhitePointY(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointRXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointRX(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointRYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointRY(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointRIntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointRIntensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointGXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointGX(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointGYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointGY(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointGIntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointGIntensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointBXAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointBX(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointBYAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointBY(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorPointBIntensityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorPointBIntensity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readEnhancedCurrentHueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEnhancedCurrentHue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readEnhancedColorModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEnhancedColorMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorLoopActiveAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorLoopActive(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorLoopDirectionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorLoopDirection(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorLoopTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorLoopTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorLoopStartEnhancedHueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorLoopStartEnhancedHue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorLoopStoredEnhancedHueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorLoopStoredEnhancedHue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorCapabilitiesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorCapabilities(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMinAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorTempPhysicalMin(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readColorTempPhysicalMaxAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeColorTempPhysicalMax(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readCoupleColorTempToLevelMinMiredsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCoupleColorTempToLevelMinMireds(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readStartUpColorTemperatureMiredsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartUpColorTemperatureMireds(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ColorControlCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ColorControlCluster * cppCluster = reinterpret_cast<chip::Controller::ColorControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ContentLauncherCluster, readAcceptsHeaderListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPContentLauncherAcceptsHeaderListAttributeCallback,
void (*)(CHIPContentLauncherAcceptsHeaderListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPContentLauncherAcceptsHeaderListAttributeCallback>(callback),
chip::Platform::Delete<CHIPContentLauncherAcceptsHeaderListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ContentLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ContentLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAcceptsHeaderList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ContentLauncherCluster, readSupportedStreamingTypesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPContentLauncherSupportedStreamingTypesAttributeCallback,
void (*)(CHIPContentLauncherSupportedStreamingTypesAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPContentLauncherSupportedStreamingTypesAttributeCallback>(callback),
chip::Platform::Delete<CHIPContentLauncherSupportedStreamingTypesAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ContentLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ContentLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSupportedStreamingTypes(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ContentLauncherCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ContentLauncherCluster * cppCluster =
reinterpret_cast<chip::Controller::ContentLauncherCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DescriptorCluster, readDeviceListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPDescriptorDeviceListAttributeCallback, void (*)(CHIPDescriptorDeviceListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPDescriptorDeviceListAttributeCallback>(callback),
chip::Platform::Delete<CHIPDescriptorDeviceListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DescriptorCluster * cppCluster = reinterpret_cast<chip::Controller::DescriptorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDeviceList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DescriptorCluster, readServerListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPDescriptorServerListAttributeCallback, void (*)(CHIPDescriptorServerListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPDescriptorServerListAttributeCallback>(callback),
chip::Platform::Delete<CHIPDescriptorServerListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DescriptorCluster * cppCluster = reinterpret_cast<chip::Controller::DescriptorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeServerList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DescriptorCluster, readClientListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPDescriptorClientListAttributeCallback, void (*)(CHIPDescriptorClientListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPDescriptorClientListAttributeCallback>(callback),
chip::Platform::Delete<CHIPDescriptorClientListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DescriptorCluster * cppCluster = reinterpret_cast<chip::Controller::DescriptorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClientList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DescriptorCluster, readPartsListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPDescriptorPartsListAttributeCallback, void (*)(CHIPDescriptorPartsListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPDescriptorPartsListAttributeCallback>(callback),
chip::Platform::Delete<CHIPDescriptorPartsListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DescriptorCluster * cppCluster = reinterpret_cast<chip::Controller::DescriptorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePartsList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DescriptorCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DescriptorCluster * cppCluster = reinterpret_cast<chip::Controller::DescriptorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DoorLockCluster, readLockStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DoorLockCluster * cppCluster = reinterpret_cast<chip::Controller::DoorLockCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLockState(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DoorLockCluster, readLockTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DoorLockCluster * cppCluster = reinterpret_cast<chip::Controller::DoorLockCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLockType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DoorLockCluster, readActuatorEnabledAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DoorLockCluster * cppCluster = reinterpret_cast<chip::Controller::DoorLockCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActuatorEnabled(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, DoorLockCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::DoorLockCluster * cppCluster = reinterpret_cast<chip::Controller::DoorLockCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readMeasurementTypeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasurementType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readTotalActivePowerAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32sAttributeCallback, void (*)(CHIPInt32sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTotalActivePower(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsVoltage(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMinAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsVoltageMin(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsVoltageMaxAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsVoltageMax(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsCurrent(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMinAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsCurrentMin(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readRmsCurrentMaxAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRmsCurrentMax(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActivePower(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMinAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActivePowerMin(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readActivePowerMaxAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActivePowerMax(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ElectricalMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ElectricalMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::ElectricalMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPHYRateAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePHYRate(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readFullDuplexAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFullDuplex(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketRxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketRxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readPacketTxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketTxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTxErrCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxErrCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCollisionCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCollisionCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readOverrunCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readCarrierDetectAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCarrierDetect(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readTimeSinceResetAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTimeSinceReset(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, EthernetNetworkDiagnosticsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::EthernetNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::EthernetNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FixedLabelCluster, readLabelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPFixedLabelLabelListAttributeCallback, void (*)(CHIPFixedLabelLabelListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPFixedLabelLabelListAttributeCallback>(callback),
chip::Platform::Delete<CHIPFixedLabelLabelListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FixedLabelCluster * cppCluster = reinterpret_cast<chip::Controller::FixedLabelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLabelList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FixedLabelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FixedLabelCluster * cppCluster = reinterpret_cast<chip::Controller::FixedLabelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FlowMeasurementCluster, readMeasuredValueAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FlowMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::FlowMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FlowMeasurementCluster, readMinMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FlowMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::FlowMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FlowMeasurementCluster, readMaxMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FlowMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::FlowMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FlowMeasurementCluster, readToleranceAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FlowMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::FlowMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, FlowMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::FlowMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::FlowMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralCommissioningCluster, readBreadcrumbAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBreadcrumb(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralCommissioningCluster, readBasicCommissioningInfoListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback,
void (*)(CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback>(callback),
chip::Platform::Delete<CHIPGeneralCommissioningBasicCommissioningInfoListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBasicCommissioningInfoList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralCommissioningCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readNetworkInterfacesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback,
void (*)(CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback>(callback),
chip::Platform::Delete<CHIPGeneralDiagnosticsNetworkInterfacesAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNetworkInterfaces(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readRebootCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRebootCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readUpTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeUpTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readTotalOperationalHoursAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTotalOperationalHours(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readBootReasonsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBootReasons(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GeneralDiagnosticsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GeneralDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::GeneralDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GroupKeyManagementCluster, readGroupsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPGroupKeyManagementGroupsAttributeCallback, void (*)(CHIPGroupKeyManagementGroupsAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPGroupKeyManagementGroupsAttributeCallback>(callback),
chip::Platform::Delete<CHIPGroupKeyManagementGroupsAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GroupKeyManagementCluster * cppCluster =
reinterpret_cast<chip::Controller::GroupKeyManagementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeGroups(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GroupKeyManagementCluster, readGroupKeysAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPGroupKeyManagementGroupKeysAttributeCallback, void (*)(CHIPGroupKeyManagementGroupKeysAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPGroupKeyManagementGroupKeysAttributeCallback>(callback),
chip::Platform::Delete<CHIPGroupKeyManagementGroupKeysAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GroupKeyManagementCluster * cppCluster =
reinterpret_cast<chip::Controller::GroupKeyManagementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeGroupKeys(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GroupKeyManagementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GroupKeyManagementCluster * cppCluster =
reinterpret_cast<chip::Controller::GroupKeyManagementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GroupsCluster, readNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GroupsCluster * cppCluster = reinterpret_cast<chip::Controller::GroupsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, GroupsCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::GroupsCluster * cppCluster = reinterpret_cast<chip::Controller::GroupsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IdentifyCluster, readIdentifyTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IdentifyCluster * cppCluster = reinterpret_cast<chip::Controller::IdentifyCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeIdentifyTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IdentifyCluster, readIdentifyTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IdentifyCluster * cppCluster = reinterpret_cast<chip::Controller::IdentifyCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeIdentifyType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IdentifyCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IdentifyCluster * cppCluster = reinterpret_cast<chip::Controller::IdentifyCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readMinMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readMaxMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readToleranceAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readLightSensorTypeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLightSensorType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, IlluminanceMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::IlluminanceMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::IlluminanceMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, KeypadInputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::KeypadInputCluster * cppCluster = reinterpret_cast<chip::Controller::KeypadInputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readCurrentLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readRemainingTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRemainingTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readMinLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readMaxLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readCurrentFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentFrequency(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readMinFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinFrequency(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readMaxFrequencyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxFrequency(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readOptionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOptions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readOnOffTransitionTimeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readOnLevelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readOnTransitionTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnTransitionTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readOffTransitionTimeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOffTransitionTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readDefaultMoveRateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDefaultMoveRate(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readStartUpCurrentLevelAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartUpCurrentLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LevelControlCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LevelControlCluster * cppCluster = reinterpret_cast<chip::Controller::LevelControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, LowPowerCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::LowPowerCluster * cppCluster = reinterpret_cast<chip::Controller::LowPowerCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaInputCluster, readMediaInputListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPMediaInputMediaInputListAttributeCallback, void (*)(CHIPMediaInputMediaInputListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPMediaInputMediaInputListAttributeCallback>(callback),
chip::Platform::Delete<CHIPMediaInputMediaInputListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaInputCluster * cppCluster = reinterpret_cast<chip::Controller::MediaInputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMediaInputList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaInputCluster, readCurrentMediaInputAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaInputCluster * cppCluster = reinterpret_cast<chip::Controller::MediaInputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentMediaInput(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaInputCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaInputCluster * cppCluster = reinterpret_cast<chip::Controller::MediaInputCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readPlaybackStateAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePlaybackState(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readStartTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readDurationAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDuration(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readPositionUpdatedAtAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePositionUpdatedAt(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readPositionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePosition(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readPlaybackSpeedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePlaybackSpeed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeEndAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSeekRangeEnd(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readSeekRangeStartAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSeekRangeStart(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, MediaPlaybackCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::MediaPlaybackCluster * cppCluster = reinterpret_cast<chip::Controller::MediaPlaybackCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readCurrentModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readSupportedModesAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPModeSelectSupportedModesAttributeCallback, void (*)(CHIPModeSelectSupportedModesAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPModeSelectSupportedModesAttributeCallback>(callback),
chip::Platform::Delete<CHIPModeSelectSupportedModesAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSupportedModes(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readOnModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readStartUpModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartUpMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDescription(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ModeSelectCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ModeSelectCluster * cppCluster = reinterpret_cast<chip::Controller::ModeSelectCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, NetworkCommissioningCluster, readFeatureMapAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::NetworkCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::NetworkCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, NetworkCommissioningCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::NetworkCommissioningCluster * cppCluster =
reinterpret_cast<chip::Controller::NetworkCommissioningCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OtaSoftwareUpdateProviderCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OtaSoftwareUpdateProviderCluster * cppCluster =
reinterpret_cast<chip::Controller::OtaSoftwareUpdateProviderCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readDefaultOtaProviderAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster =
reinterpret_cast<chip::Controller::OtaSoftwareUpdateRequestorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDefaultOtaProvider(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readUpdatePossibleAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster =
reinterpret_cast<chip::Controller::OtaSoftwareUpdateRequestorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeUpdatePossible(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OtaSoftwareUpdateRequestorCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OtaSoftwareUpdateRequestorCluster * cppCluster =
reinterpret_cast<chip::Controller::OtaSoftwareUpdateRequestorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OccupancySensingCluster, readOccupancyAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OccupancySensingCluster * cppCluster =
reinterpret_cast<chip::Controller::OccupancySensingCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOccupancy(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OccupancySensingCluster * cppCluster =
reinterpret_cast<chip::Controller::OccupancySensingCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOccupancySensorType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OccupancySensingCluster, readOccupancySensorTypeBitmapAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OccupancySensingCluster * cppCluster =
reinterpret_cast<chip::Controller::OccupancySensingCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOccupancySensorTypeBitmap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OccupancySensingCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OccupancySensingCluster * cppCluster =
reinterpret_cast<chip::Controller::OccupancySensingCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnOff(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readGlobalSceneControlAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeGlobalSceneControl(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readOnTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOnTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readOffWaitTimeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOffWaitTime(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readStartUpOnOffAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartUpOnOff(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffCluster * cppCluster = reinterpret_cast<chip::Controller::OnOffCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchTypeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffSwitchConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::OnOffSwitchConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSwitchType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffSwitchConfigurationCluster, readSwitchActionsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffSwitchConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::OnOffSwitchConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSwitchActions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OnOffSwitchConfigurationCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OnOffSwitchConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::OnOffSwitchConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readFabricsListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOperationalCredentialsFabricsListAttributeCallback,
void (*)(CHIPOperationalCredentialsFabricsListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPOperationalCredentialsFabricsListAttributeCallback>(callback),
chip::Platform::Delete<CHIPOperationalCredentialsFabricsListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFabricsList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readSupportedFabricsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSupportedFabrics(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readCommissionedFabricsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCommissionedFabrics(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readTrustedRootCertificatesAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback,
void (*)(CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback>(callback),
chip::Platform::Delete<CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTrustedRootCertificates(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readCurrentFabricIndexAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentFabricIndex(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, OperationalCredentialsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::OperationalCredentialsCluster * cppCluster =
reinterpret_cast<chip::Controller::OperationalCredentialsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readOrderAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOrder(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readDescriptionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDescription(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readBatteryVoltageAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBatteryVoltage(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readBatteryPercentRemainingAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBatteryPercentRemaining(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readBatteryTimeRemainingAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBatteryTimeRemaining(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readBatteryChargeLevelAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBatteryChargeLevel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readActiveBatteryFaultsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPPowerSourceActiveBatteryFaultsAttributeCallback,
void (*)(CHIPPowerSourceActiveBatteryFaultsAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPPowerSourceActiveBatteryFaultsAttributeCallback>(callback),
chip::Platform::Delete<CHIPPowerSourceActiveBatteryFaultsAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActiveBatteryFaults(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readBatteryChargeStateAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBatteryChargeState(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PowerSourceCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PowerSourceCluster * cppCluster = reinterpret_cast<chip::Controller::PowerSourceCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PressureMeasurementCluster, readMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PressureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::PressureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PressureMeasurementCluster, readMinMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PressureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::PressureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PressureMeasurementCluster, readMaxMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PressureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::PressureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PressureMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PressureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::PressureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxPressureAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxPressure(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxSpeedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxSpeed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxFlowAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxFlow(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstPressureAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinConstPressure(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstPressureAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxConstPressure(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinCompPressureAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinCompPressure(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxCompPressureAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxCompPressure(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstSpeedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinConstSpeed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstSpeedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxConstSpeed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstFlowAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinConstFlow(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstFlowAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxConstFlow(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMinConstTempAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinConstTemp(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readMaxConstTempAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxConstTemp(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readPumpStatusAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePumpStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveOperationModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEffectiveOperationMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readEffectiveControlModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEffectiveControlMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readCapacityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCapacity(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readSpeedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSpeed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readLifetimeEnergyConsumedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLifetimeEnergyConsumed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readOperationModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOperationMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readControlModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeControlMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readAlarmMaskAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAlarmMask(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readFeatureMapAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, PumpConfigurationAndControlCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::PumpConfigurationAndControlCluster * cppCluster =
reinterpret_cast<chip::Controller::PumpConfigurationAndControlCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::RelativeHumidityMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::RelativeHumidityMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMinMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::RelativeHumidityMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::RelativeHumidityMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, RelativeHumidityMeasurementCluster, readMaxMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::RelativeHumidityMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::RelativeHumidityMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, RelativeHumidityMeasurementCluster, readToleranceAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::RelativeHumidityMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::RelativeHumidityMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, RelativeHumidityMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::RelativeHumidityMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::RelativeHumidityMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readSceneCountAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSceneCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readCurrentSceneAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentScene(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readCurrentGroupAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentGroup(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readSceneValidAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSceneValid(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readNameSupportAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNameSupport(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ScenesCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ScenesCluster * cppCluster = reinterpret_cast<chip::Controller::ScenesCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SoftwareDiagnosticsCluster, readThreadMetricsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback,
void (*)(CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback>(callback),
chip::Platform::Delete<CHIPSoftwareDiagnosticsThreadMetricsAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SoftwareDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::SoftwareDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeThreadMetrics(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapFreeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SoftwareDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::SoftwareDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentHeapFree(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapUsedAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SoftwareDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::SoftwareDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentHeapUsed(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SoftwareDiagnosticsCluster, readCurrentHeapHighWatermarkAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SoftwareDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::SoftwareDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentHeapHighWatermark(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SoftwareDiagnosticsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SoftwareDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::SoftwareDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SwitchCluster, readNumberOfPositionsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SwitchCluster * cppCluster = reinterpret_cast<chip::Controller::SwitchCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNumberOfPositions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SwitchCluster, readCurrentPositionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SwitchCluster * cppCluster = reinterpret_cast<chip::Controller::SwitchCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPosition(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SwitchCluster, readMultiPressMaxAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SwitchCluster * cppCluster = reinterpret_cast<chip::Controller::SwitchCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMultiPressMax(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SwitchCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SwitchCluster * cppCluster = reinterpret_cast<chip::Controller::SwitchCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, SwitchCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::SwitchCluster * cppCluster = reinterpret_cast<chip::Controller::SwitchCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TvChannelCluster, readTvChannelListAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTvChannelTvChannelListAttributeCallback, void (*)(CHIPTvChannelTvChannelListAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPTvChannelTvChannelListAttributeCallback>(callback),
chip::Platform::Delete<CHIPTvChannelTvChannelListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast<chip::Controller::TvChannelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTvChannelList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TvChannelCluster, readTvChannelLineupAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast<chip::Controller::TvChannelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTvChannelLineup(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TvChannelCluster, readCurrentTvChannelAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast<chip::Controller::TvChannelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentTvChannel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TvChannelCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TvChannelCluster * cppCluster = reinterpret_cast<chip::Controller::TvChannelCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TargetNavigatorCluster, readTargetNavigatorListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTargetNavigatorTargetNavigatorListAttributeCallback,
void (*)(CHIPTargetNavigatorTargetNavigatorListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPTargetNavigatorTargetNavigatorListAttributeCallback>(callback),
chip::Platform::Delete<CHIPTargetNavigatorTargetNavigatorListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TargetNavigatorCluster * cppCluster =
reinterpret_cast<chip::Controller::TargetNavigatorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTargetNavigatorList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TargetNavigatorCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TargetNavigatorCluster * cppCluster =
reinterpret_cast<chip::Controller::TargetNavigatorCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TemperatureMeasurementCluster, readMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TemperatureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::TemperatureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TemperatureMeasurementCluster, readMinMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TemperatureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::TemperatureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TemperatureMeasurementCluster, readMaxMeasuredValueAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TemperatureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::TemperatureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxMeasuredValue(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TemperatureMeasurementCluster, readToleranceAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TemperatureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::TemperatureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTolerance(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TemperatureMeasurementCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TemperatureMeasurementCluster * cppCluster =
reinterpret_cast<chip::Controller::TemperatureMeasurementCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8sAttributeCallback, void (*)(CHIPInt8sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32sAttributeCallback, void (*)(CHIPInt32sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64sAttributeCallback, void (*)(CHIPInt64sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readListInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTestClusterListInt8uAttributeCallback, void (*)(CHIPTestClusterListInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPTestClusterListInt8uAttributeCallback>(callback),
chip::Platform::Delete<CHIPTestClusterListInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeListInt8u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readListOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTestClusterListOctetStringAttributeCallback, void (*)(CHIPTestClusterListOctetStringAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPTestClusterListOctetStringAttributeCallback>(callback),
chip::Platform::Delete<CHIPTestClusterListOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeListOctetString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readListStructOctetStringAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTestClusterListStructOctetStringAttributeCallback,
void (*)(CHIPTestClusterListStructOctetStringAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPTestClusterListStructOctetStringAttributeCallback>(callback),
chip::Platform::Delete<CHIPTestClusterListStructOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeListStructOctetString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readLongOctetStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLongOctetString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCharString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readLongCharStringAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLongCharString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readEpochUsAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEpochUs(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readEpochSAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEpochS(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readVendorIdAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeVendorId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readListNullablesAndOptionalsStructAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback,
void (*)(CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback>(callback),
chip::Platform::Delete<CHIPTestClusterListNullablesAndOptionalsStructAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeListNullablesAndOptionalsStruct(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readUnsupportedAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeUnsupported(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableBooleanAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPBooleanAttributeCallback, void (*)(CHIPBooleanAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPBooleanAttributeCallback>(callback), chip::Platform::Delete<CHIPBooleanAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableBoolean(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableBitmap8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableBitmap8(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableBitmap16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableBitmap16(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableBitmap32Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableBitmap32(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableBitmap64Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableBitmap64(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt8uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt8u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt16uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt16u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt32uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt32u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt64uAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt64u(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt8sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8sAttributeCallback, void (*)(CHIPInt8sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt8s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt16sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt16s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt32sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32sAttributeCallback, void (*)(CHIPInt32sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt32s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableInt64sAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64sAttributeCallback, void (*)(CHIPInt64sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableInt64s(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableEnum8Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableEnum8(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableEnum16Attribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableEnum16(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableOctetStringAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableOctetString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readNullableCharStringAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNullableCharString(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, TestClusterCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::TestClusterCluster * cppCluster = reinterpret_cast<chip::Controller::TestClusterCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readLocalTemperatureAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLocalTemperature(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readAbsMinHeatSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAbsMinHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readAbsMaxHeatSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAbsMaxHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readAbsMinCoolSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAbsMinCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readAbsMaxCoolSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAbsMaxCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readOccupiedCoolingSetpointAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOccupiedCoolingSetpoint(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readOccupiedHeatingSetpointAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOccupiedHeatingSetpoint(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readMinHeatSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readMaxHeatSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxHeatSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readMinCoolSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readMaxCoolSetpointLimitAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16sAttributeCallback, void (*)(CHIPInt16sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMaxCoolSetpointLimit(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readMinSetpointDeadBandAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8sAttributeCallback, void (*)(CHIPInt8sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMinSetpointDeadBand(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readControlSequenceOfOperationAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeControlSequenceOfOperation(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readSystemModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSystemMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readStartOfWeekAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStartOfWeek(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readNumberOfWeeklyTransitionsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNumberOfWeeklyTransitions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readNumberOfDailyTransitionsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNumberOfDailyTransitions(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatCluster * cppCluster = reinterpret_cast<chip::Controller::ThermostatCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readTemperatureDisplayModeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatUserInterfaceConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::ThermostatUserInterfaceConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTemperatureDisplayMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readKeypadLockoutAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatUserInterfaceConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::ThermostatUserInterfaceConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeKeypadLockout(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readScheduleProgrammingVisibilityAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatUserInterfaceConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::ThermostatUserInterfaceConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeScheduleProgrammingVisibility(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThermostatUserInterfaceConfigurationCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThermostatUserInterfaceConfigurationCluster * cppCluster =
reinterpret_cast<chip::Controller::ThermostatUserInterfaceConfigurationCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeChannel(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRoutingRoleAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRoutingRole(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNetworkNameAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNetworkName(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPanIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePanId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readExtendedPanIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeExtendedPanId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readMeshLocalPrefixAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMeshLocalPrefix(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOverrunCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readNeighborTableListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback,
void (*)(CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback>(callback),
chip::Platform::Delete<CHIPThreadNetworkDiagnosticsNeighborTableListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeNeighborTableList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouteTableListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback,
void (*)(CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback>(callback),
chip::Platform::Delete<CHIPThreadNetworkDiagnosticsRouteTableListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRouteTableList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePartitionId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readWeightingAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeWeighting(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDataVersionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDataVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readStableDataVersionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeStableDataVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRouterIdAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLeaderRouterId(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDetachedRoleCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDetachedRoleCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChildRoleCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeChildRoleCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRouterRoleCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRouterRoleCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readLeaderRoleCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeLeaderRoleCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readAttachAttemptCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeAttachAttemptCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPartitionIdChangeCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePartitionIdChangeCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readBetterPartitionAttachAttemptCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBetterPartitionAttachAttemptCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readParentChangeCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeParentChangeCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxTotalCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxTotalCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxUnicastCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxUnicastCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBroadcastCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckRequestedCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxAckRequestedCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxAckedCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxAckedCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxNoAckRequestedCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxNoAckRequestedCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxDataCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDataPollCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxDataPollCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxBeaconCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxBeaconRequestCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxBeaconRequestCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxOtherCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxOtherCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxRetryCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxRetryCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxDirectMaxRetryExpiryCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxDirectMaxRetryExpiryCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxIndirectMaxRetryExpiryCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxIndirectMaxRetryExpiryCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrCcaCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxErrCcaCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrAbortCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxErrAbortCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readTxErrBusyChannelCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTxErrBusyChannelCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxTotalCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxTotalCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxUnicastCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxUnicastCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBroadcastCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxBroadcastCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxDataCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDataPollCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxDataPollCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxBeaconCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxBeaconRequestCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxBeaconRequestCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxOtherCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxOtherCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxAddressFilteredCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxAddressFilteredCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDestAddrFilteredCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxDestAddrFilteredCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxDuplicatedCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxDuplicatedCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrNoFrameCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrNoFrameCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrUnknownNeighborCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrUnknownNeighborCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrInvalidSrcAddrCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrInvalidSrcAddrCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrSecCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrSecCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrFcsCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrFcsCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readRxErrOtherCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRxErrOtherCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveTimestampAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActiveTimestamp(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readPendingTimestampAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePendingTimestamp(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readDelayAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeDelay(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readSecurityPolicyAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback,
void (*)(CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback>(callback),
chip::Platform::Delete<CHIPThreadNetworkDiagnosticsSecurityPolicyAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSecurityPolicy(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readChannelMaskAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeChannelMask(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readOperationalDatasetComponentsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback,
void (*)(CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback>(callback),
chip::Platform::Delete<CHIPThreadNetworkDiagnosticsOperationalDatasetComponentsAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOperationalDatasetComponents(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readActiveNetworkFaultsListAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback,
void (*)(CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback *)>
onSuccess(chip::Platform::New<CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback>(callback),
chip::Platform::Delete<CHIPThreadNetworkDiagnosticsActiveNetworkFaultsListAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeActiveNetworkFaultsList(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, ThreadNetworkDiagnosticsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::ThreadNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::ThreadNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WakeOnLanCluster, readWakeOnLanMacAddressAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPCharStringAttributeCallback, void (*)(CHIPCharStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPCharStringAttributeCallback>(callback, false),
chip::Platform::Delete<CHIPCharStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WakeOnLanCluster * cppCluster = reinterpret_cast<chip::Controller::WakeOnLanCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeWakeOnLanMacAddress(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WakeOnLanCluster, readClusterRevisionAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WakeOnLanCluster * cppCluster = reinterpret_cast<chip::Controller::WakeOnLanCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBssidAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPOctetStringAttributeCallback, void (*)(CHIPOctetStringAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPOctetStringAttributeCallback>(callback, true),
chip::Platform::Delete<CHIPOctetStringAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBssid(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readSecurityTypeAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSecurityType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readWiFiVersionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeWiFiVersion(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readChannelNumberAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeChannelNumber(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readRssiAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8sAttributeCallback, void (*)(CHIPInt8sAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8sAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8sAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeRssi(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconLostCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBeaconLostCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readBeaconRxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeBeaconRxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastRxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketMulticastRxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketMulticastTxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketMulticastTxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastRxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketUnicastRxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readPacketUnicastTxCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributePacketUnicastTxCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readCurrentMaxRateAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentMaxRate(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readOverrunCountAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt64uAttributeCallback, void (*)(CHIPInt64uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt64uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt64uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOverrunCount(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WiFiNetworkDiagnosticsCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WiFiNetworkDiagnosticsCluster * cppCluster =
reinterpret_cast<chip::Controller::WiFiNetworkDiagnosticsCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionLift(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionTilt(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readConfigStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeConfigStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercentageAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionLiftPercentage(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercentageAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionTiltPercentage(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readOperationalStatusAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeOperationalStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readTargetPositionLiftPercent100thsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTargetPositionLiftPercent100ths(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readTargetPositionTiltPercent100thsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeTargetPositionTiltPercent100ths(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readEndProductTypeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeEndProductType(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionLiftPercent100thsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionLiftPercent100ths(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readCurrentPositionTiltPercent100thsAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeCurrentPositionTiltPercent100ths(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitLiftAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInstalledOpenLimitLift(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitLiftAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInstalledClosedLimitLift(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readInstalledOpenLimitTiltAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInstalledOpenLimitTilt(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readInstalledClosedLimitTiltAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeInstalledClosedLimitTilt(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readModeAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt8uAttributeCallback, void (*)(CHIPInt8uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt8uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt8uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeMode(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readSafetyStatusAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeSafetyStatus(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readFeatureMapAttribute)(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt32uAttributeCallback, void (*)(CHIPInt32uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt32uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt32uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeFeatureMap(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}
JNI_METHOD(void, WindowCoveringCluster, readClusterRevisionAttribute)
(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback)
{
chip::DeviceLayer::StackLock lock;
std::unique_ptr<CHIPInt16uAttributeCallback, void (*)(CHIPInt16uAttributeCallback *)> onSuccess(
chip::Platform::New<CHIPInt16uAttributeCallback>(callback), chip::Platform::Delete<CHIPInt16uAttributeCallback>);
VerifyOrReturn(onSuccess.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native success callback", CHIP_ERROR_NO_MEMORY));
std::unique_ptr<chip::CHIPDefaultFailureCallback, void (*)(chip::CHIPDefaultFailureCallback *)> onFailure(
chip::Platform::New<chip::CHIPDefaultFailureCallback>(callback), chip::Platform::Delete<chip::CHIPDefaultFailureCallback>);
VerifyOrReturn(onFailure.get() != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY));
CHIP_ERROR err = CHIP_NO_ERROR;
chip::Controller::WindowCoveringCluster * cppCluster = reinterpret_cast<chip::Controller::WindowCoveringCluster *>(clusterPtr);
VerifyOrReturn(cppCluster != nullptr,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(
env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE));
err = cppCluster->ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel());
VerifyOrReturn(
err == CHIP_NO_ERROR,
chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error reading attribute", err));
onSuccess.release();
onFailure.release();
}