From 1567289c7aaca51401933ab16995ba9aaaa840b0 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 6 Feb 2023 17:21:14 -0800 Subject: [PATCH] [java-matter-controller] Remove pairing ethernet command (#24891) --- .github/workflows/tests.yaml | 4 ++-- examples/java-matter-controller/BUILD.gn | 1 - .../java/src/com/matter/controller/Main.java | 3 --- .../controller/commands/common/Argument.java | 3 ++- .../commands/pairing/PairEthernetCommand.java | 14 -------------- .../commands/pairing/PairingCommand.java | 7 ------- .../commands/pairing/PairingModeType.java | 1 - scripts/tests/java/commissioning_test.py | 2 +- 8 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairEthernetCommand.java diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 16e180a2c06e05..186ab810dfe19d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -511,7 +511,7 @@ jobs: --target linux-x64-java-matter-controller \ build \ " - - name: Run Discover Tests + - name: Run Discover Commissionables Test timeout-minutes: 10 run: | scripts/run_in_build_env.sh \ @@ -523,7 +523,7 @@ jobs: --tool-args "commissionables" \ --factoryreset \ ' - - name: Run Pairing Tests + - name: Run Pairing over Onnetwork Test timeout-minutes: 10 run: | scripts/run_in_build_env.sh \ diff --git a/examples/java-matter-controller/BUILD.gn b/examples/java-matter-controller/BUILD.gn index d4516b43aaa6bd..fed5e722450a26 100644 --- a/examples/java-matter-controller/BUILD.gn +++ b/examples/java-matter-controller/BUILD.gn @@ -46,7 +46,6 @@ java_binary("java-matter-controller") { "java/src/com/matter/controller/commands/pairing/PairCodePaseCommand.java", "java/src/com/matter/controller/commands/pairing/PairCodeThreadCommand.java", "java/src/com/matter/controller/commands/pairing/PairCodeWifiCommand.java", - "java/src/com/matter/controller/commands/pairing/PairEthernetCommand.java", "java/src/com/matter/controller/commands/pairing/PairOnNetworkCommand.java", "java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissionerCommand.java", "java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissioningModeCommand.java", diff --git a/examples/java-matter-controller/java/src/com/matter/controller/Main.java b/examples/java-matter-controller/java/src/com/matter/controller/Main.java index 0e24c6dc1c212d..6b9998a0f7f6b2 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/Main.java +++ b/examples/java-matter-controller/java/src/com/matter/controller/Main.java @@ -60,8 +60,6 @@ private static void registerCommandsPairing( new PairCodeWifiCommand(controller, credentialsIssuer); PairCodeThreadCommand pairCodeThreadCommand = new PairCodeThreadCommand(controller, credentialsIssuer); - PairEthernetCommand pairEthernetCommand = - new PairEthernetCommand(controller, credentialsIssuer); PairOnNetworkCommand pairOnNetworkCommand = new PairOnNetworkCommand(controller, credentialsIssuer); PairOnNetworkShortCommand pairOnNetworkShortCommand = @@ -83,7 +81,6 @@ private static void registerCommandsPairing( clusterCommands.add(pairCodePaseCommand); clusterCommands.add(pairCodeWifiCommand); clusterCommands.add(pairCodeThreadCommand); - clusterCommands.add(pairEthernetCommand); clusterCommands.add(pairOnNetworkCommand); clusterCommands.add(pairOnNetworkShortCommand); clusterCommands.add(pairOnNetworkLongCommand); diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.java b/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.java index c9d911bdc7f347..746ae78f4d3dfe 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.java +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.java @@ -150,8 +150,9 @@ public void setValue(String value) { try { IPAddress ipAddress = (IPAddress) mValue; ipAddress.setAddress(InetAddress.getByName(value)); - } catch (UnknownHostException e) { isValidArgument = true; + } catch (UnknownHostException e) { + isValidArgument = false; } break; } diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairEthernetCommand.java b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairEthernetCommand.java deleted file mode 100644 index b2897760240d2d..00000000000000 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairEthernetCommand.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.matter.controller.commands.pairing; - -import chip.devicecontroller.ChipDeviceController; -import com.matter.controller.commands.common.CredentialsIssuer; - -public final class PairEthernetCommand extends PairingCommand { - public PairEthernetCommand(ChipDeviceController controller, CredentialsIssuer credsIssue) { - super( - controller, "ethernet", PairingModeType.ETHERNET, PairingNetworkType.ETHERNET, credsIssue); - } - - @Override - protected void runCommand() {} -} diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.java b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.java index f26d2cadce3d1a..a1b2d52b33af1e 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.java +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.java @@ -49,7 +49,6 @@ public abstract class PairingCommand extends MatterCommand private final StringBuffer mPassword = new StringBuffer(); private final StringBuffer mOnboardingPayload = new StringBuffer(); private final StringBuffer mDiscoveryFilterInstanceName = new StringBuffer(); - private static Logger logger = Logger.getLogger(PairingCommand.class.getName()); public long getNodeId() { @@ -206,12 +205,6 @@ public PairingCommand( addArgument("device-remote-ip", mRemoteAddr, false); addArgument("device-remote-port", (short) 0, Short.MAX_VALUE, mRemotePort, null, false); break; - case ETHERNET: - addArgument("setup-pin-code", 0, 134217727, mSetupPINCode, null, false); - addArgument("discriminator", (short) 0, (short) 4096, mDiscriminator, null, false); - addArgument("device-remote-ip", mRemoteAddr, false); - addArgument("device-remote-port", (short) 0, Short.MAX_VALUE, mRemotePort, null, false); - break; } switch (filterType) { diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingModeType.java b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingModeType.java index 015bb8005acc25..709be19d356631 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingModeType.java +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingModeType.java @@ -24,6 +24,5 @@ public enum PairingModeType { CODE_PASE_ONLY, BLE, SOFT_AP, - ETHERNET, ON_NETWORK; } diff --git a/scripts/tests/java/commissioning_test.py b/scripts/tests/java/commissioning_test.py index dc9b7bb550817c..ff3439798df952 100755 --- a/scripts/tests/java/commissioning_test.py +++ b/scripts/tests/java/commissioning_test.py @@ -68,8 +68,8 @@ def TestCmdOnnetworkLong(self, nodeid, setuppin, discriminator, timeout): return java_process.wait() def RunTest(self): - logging.info("Testing onnetwork-long pairing") if self.command_name == 'onnetwork-long': + logging.info("Testing pairing over onnetwork-long") code = self.TestCmdOnnetworkLong(self.nodeid, self.setup_payload, self.discriminator, self.timeout) if code != 0: raise Exception(f"Testing onnetwork-long pairing failed with error {code}")