Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give ChipDeviceController.java public method to release connected device pointer #21769

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ JNI_METHOD(void, getConnectedDevicePointer)(JNIEnv * env, jobject self, jlong ha
VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Error invoking GetConnectedDevice"));
}

JNI_METHOD(void, releaseConnectedDevicePointer)(JNIEnv * env, jobject self, jlong devicePtr)
JNI_METHOD(void, releaseOperationalDevicePointer)(JNIEnv * env, jobject self, jlong devicePtr)
{
chip::DeviceLayer::StackLock lock;
OperationalDeviceProxy * device = reinterpret_cast<OperationalDeviceProxy *>(devicePtr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ public void getConnectedDevicePointer(long nodeId, GetConnectedDeviceCallback ca
getConnectedDevicePointer(deviceControllerPtr, nodeId, jniCallback.getCallbackHandle());
}

public void releaseConnectedDevicePointer(long devicePtr) {
releaseOperationalDevicePointer(devicePtr);
}

public boolean disconnectDevice(long deviceId) {
return disconnectDevice(deviceControllerPtr, deviceId);
}
Expand Down Expand Up @@ -630,7 +634,7 @@ private native void commissionDevice(
private native void getConnectedDevicePointer(
long deviceControllerPtr, long deviceId, long callbackHandle);

private native void releaseConnectedDevicePointer(long devicePtr);
private native void releaseOperationalDevicePointer(long devicePtr);

private native boolean disconnectDevice(long deviceControllerPtr, long deviceId);

Expand Down