From ca0b4614ae545e30b3f65b5414e7e7f535915c86 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 15 Oct 2012 23:38:17 -0700 Subject: Initial commit --- src/MyClass.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/MyClass.java (limited to 'src/MyClass.java') diff --git a/src/MyClass.java b/src/MyClass.java new file mode 100644 index 0000000..4fac53f --- /dev/null +++ b/src/MyClass.java @@ -0,0 +1,16 @@ +import java.util.Enumeration; + +import gnu.io.CommPortIdentifier; + +public class MyClass { + public static void main(String... args) { + Enumeration ports = CommPortIdentifier.getPortIdentifiers(); + + while (ports.hasMoreElements()) { + CommPortIdentifier port = (CommPortIdentifier) ports.nextElement(); + + System.out.println(port.getName()); + } + } + +} \ No newline at end of file -- cgit v1.2.3