if (args.length < 1) {
System.out.println("Usage: java PortTyper portName");
return;
}
try {
CommPortIdentifier com = CommPortIdentifier.getPortIdentifier(args[0]);
CommPort thePort = com.open("PortOpener", 10);
CopyThread input = new CopyThread(System.in, thePort.getOutputStream());
CopyThread output = new CopyThread(thePort.getInputStream(), System.out);
input.start();
output.start();
}
catch (Exception e) {
System.out.println(e);
}