Skip to content

Commit

Permalink
Add shutdownCommissioning for commissioning step. (#17542)
Browse files Browse the repository at this point in the history
Signed-off-by: sanghyukko <sanghyuk.ko@samsung.com>
Signed-off-by: Charles Kim <chulspro.kim@samsung.com>

Co-authored-by: sanghyukko <sanghyuk.ko@samsung.com>
  • Loading branch information
2 people authored and pan- committed Jun 30, 2023
1 parent e895c65 commit 9690628
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/controller/java/CHIPDeviceController-JNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,17 @@ JNI_METHOD(jboolean, openPairingWindowWithPIN)
return true;
}

JNI_METHOD(void, shutdownCommissioning)
(JNIEnv * env, jobject self, jlong handle)
{
chip::DeviceLayer::StackLock lock;
CHIP_ERROR err = CHIP_NO_ERROR;

AndroidDeviceControllerWrapper * wrapper = AndroidDeviceControllerWrapper::FromJNIHandle(handle);
err = wrapper->Controller()->Shutdown();
VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Error invoking shutdownCommissioning: %s", ErrorStr(err)));
}

JNI_METHOD(jbyteArray, getAttestationChallenge)
(JNIEnv * env, jobject self, jlong handle, jlong devicePtr)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ public PaseVerifierParams computePaseVerifier(
return computePaseVerifier(deviceControllerPtr, devicePtr, setupPincode, iterations, salt);
}

public void shutdownCommissioning() {
shutdownCommissioning(deviceControllerPtr);
}

private native PaseVerifierParams computePaseVerifier(
long deviceControllerPtr, long devicePtr, long setupPincode, long iterations, byte[] salt);

Expand Down Expand Up @@ -452,6 +456,8 @@ private native boolean openPairingWindowWithPIN(

private native void shutdownSubscriptions(long deviceControllerPtr, long devicePtr);

private native void shutdownCommissioning(long deviceControllerPtr);

static {
System.loadLibrary("CHIPController");
}
Expand Down

0 comments on commit 9690628

Please sign in to comment.