}
public static void main(String[] args)
{
Enumeration ports;
CommPortIdentifier portId;
boolean allPorts = true,
lineMonitor = false;
int idx = 0;
win = new BlackBox();
win.setLayout(new FlowLayout());
win.setBackground(Color.gray);
portDisp = new SerialPortDisplay[40];
while (args.length > idx)
{
if (args[idx].equals("-h"))
{
printUsage();
}
else if (args[idx].equals("-f"))
{
friendly = true;
System.out.println("Friendly mode");
}
else if (args[idx].equals("-n"))
{
threaded = false;
System.out.println("No threads");
}
else if (args[idx].equals("-l"))
{
lineMonitor = true;
System.out.println("Line Monitor mode");
}
else if (args[idx].equals("-m"))
{
modemMode = true;
System.out.println("Modem mode");
}
else if (args[idx].equals("-s"))
{
silentReceive = true;
System.out.println("Silent Reciever");
}
else if (args[idx].equals("-d"))
{
idx++;
rcvDelay = new Integer(args[idx]).intValue();
System.out.println("Receive delay = "
+ rcvDelay + " msecs");
}
else if (args[idx].equals("-p"))
{
idx++;
while (args.length > idx)
{
/*
* Get the specific port
*/
try
{
portId =
CommPortIdentifier.getPortIdentifier(args[idx]);
System.out.println("Opening port "
+ portId.getName());
win.addPort(portId);
}
catch (NoSuchPortException e)