From 134309468bf540bc32042a2c194729cf315ccd43 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Thu, 24 Aug 2023 06:13:33 +0900 Subject: [PATCH] [Android] Add controller node ID API test code in java-matter-controller (#28823) * Add controller node ID API * Restyled by google-java-format * Add commissioner node id log --------- Co-authored-by: Restyled.io --- .../matter/controller/commands/pairing/PairCodeCommand.kt | 4 +++- .../commands/pairing/PairOnNetworkLongCommand.kt | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeCommand.kt index de3bc1aafc3d84..8d9929991e86e7 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeCommand.kt @@ -20,7 +20,7 @@ package com.matter.controller.commands.pairing import chip.devicecontroller.ChipDeviceController import com.matter.controller.commands.common.CredentialsIssuer -class PairCodeCommand(controller: ChipDeviceController, credsIssue: CredentialsIssuer?) : +class PairCodeCommand(val controller: ChipDeviceController, credsIssue: CredentialsIssuer?) : PairingCommand(controller, "code", credsIssue, PairingModeType.CODE, PairingNetworkType.NONE) { override fun runCommand() { currentCommissioner() @@ -34,5 +34,7 @@ class PairCodeCommand(controller: ChipDeviceController, credsIssue: CredentialsI ) currentCommissioner().setCompletionListener(this) waitCompleteMs(getTimeoutMillis()) + + println("Commissioner Node ID : ${controller.getControllerNodeId()}") } } diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.kt index 1f23d5a1c480c2..6d05e5ff6cc876 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.kt @@ -22,7 +22,10 @@ import com.matter.controller.commands.common.CredentialsIssuer private const val MATTER_PORT = 5540 -class PairOnNetworkLongCommand(controller: ChipDeviceController, credsIssue: CredentialsIssuer?) : +class PairOnNetworkLongCommand( + val controller: ChipDeviceController, + credsIssue: CredentialsIssuer? +) : PairingCommand( controller, "onnetwork-long", @@ -43,5 +46,7 @@ class PairOnNetworkLongCommand(controller: ChipDeviceController, credsIssue: Cre ) currentCommissioner().setCompletionListener(this) waitCompleteMs(getTimeoutMillis()) + + println("Commissioner Node ID : ${controller.getControllerNodeId()}") } }