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

[Android] Add controller node ID API #28791

Merged
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
9 changes: 9 additions & 0 deletions src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,15 @@ JNI_METHOD(jlong, getCompressedFabricId)(JNIEnv * env, jobject self, jlong handl
return wrapper->Controller()->GetCompressedFabricId();
}

JNI_METHOD(jlong, getControllerNodeId)(JNIEnv * env, jobject self, jlong handle)
{
chip::DeviceLayer::StackLock lock;

AndroidDeviceControllerWrapper * wrapper = AndroidDeviceControllerWrapper::FromJNIHandle(handle);

return wrapper->Controller()->GetNodeId();
}

JNI_METHOD(void, discoverCommissionableNodes)(JNIEnv * env, jobject self, jlong handle)
{
chip::DeviceLayer::StackLock lock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,11 @@ public long getCompressedFabricId() {
return getCompressedFabricId(deviceControllerPtr);
}

/** Get device Controller's Node ID. */
public long getControllerNodeId() {
return getControllerNodeId(deviceControllerPtr);
}

/**
* Returns the compressed fabric ID based on the given root certificate and node operational
* credentials.
Expand Down Expand Up @@ -1161,6 +1166,8 @@ private native void getConnectedDevicePointer(

private native long getCompressedFabricId(long deviceControllerPtr);

private native long getControllerNodeId(long deviceControllerPtr);

private native void discoverCommissionableNodes(long deviceControllerPtr);

private native DiscoveredDevice getDiscoveredDevice(long deviceControllerPtr, int idx);
Expand Down