blob: 8256bf6a38e035e432198ec53b4dfed8c8e3ab07 [file] [log] [blame]
#include <jni.h>
#include <controller/java/zap-generated/CHIPClientCallbacks.h>
#include <lib/core/CHIPError.h>
#include <jni/CHIPCallbackTypes.h>
namespace chip {
/** A success callback that delegates to the Java DefaultClusterCallback.onSuccess(). */
class CHIPDefaultSuccessCallback : public Callback::Callback<DefaultSuccessCallback>
{
public:
CHIPDefaultSuccessCallback(jobject javaCallback);
~CHIPDefaultSuccessCallback();
static void CallbackFn(void * context);
private:
jobject javaCallbackRef;
};
/** A failure callback that delegates to the Java DefaultClusterCallback.onError(). */
class CHIPDefaultFailureCallback : public Callback::Callback<CHIPDefaultFailureCallbackType>
{
public:
CHIPDefaultFailureCallback(jobject javaCallback);
~CHIPDefaultFailureCallback();
static void CallbackFn(void * context, CHIP_ERROR error);
private:
jobject javaCallbackRef;
};
} // namespace chip