{ "COM1", "COM2","COM3","COM4", "COM5", "COM6", "COM7", "COM8" };
{ "COM1:", "COM2:","COM3:","COM4:", "COM5:", "COM6:", "COM7:", "COM8:" };
	private void registerScannedPorts(int PortType)	{		String[] CandidateDeviceNames;		if (debug)			System.out.println("scanning device directory "+deviceDirectory+" for ports of type "+PortType);		/* //./name is supposed to work for port numbers > 9 */		if(osName.toLowerCase().indexOf("windows") != -1 )		{			String[] temp = 			/*					{ "//./COM1", "//./COM2", "//./COM3",					"//./COM4", "//./COM5", "//./COM6",					"//./COM7", "//./COM8" };			*/			{ "COM1", "COM2","COM3","COM4",			"COM5", "COM6", "COM7", "COM8" };			CandidateDeviceNames=temp;		}		else if ( osName.equals("Solaris") || osName.equals("SunOS"))		{		/* Solaris uses a few different ways to identify ports.		   They could be /dev/term/a /dev/term0 /dev/cua/a /dev/cuaa		   the /dev/???/a appears to be on more systems.		   The uucp lock files should not cause problems.		*//*			File dev = new File( "/dev/term" );			String deva[] = dev.list();			dev = new File( "/dev/cua" );			String devb[] = dev.list();			String[] temp = new String[ deva.length + devb.length ];			for(int j =0;j<deva.length;j++)				deva[j] = "term/" + deva[j]; 			for(int j =0;j<devb.length;j++)				devb[j] = "cua/" + devb[j];			System.arraycopy( deva, 0, temp, 0, deva.length );			System.arraycopy( devb, 0, temp,					deva.length, devb.length );			if( debug ) {				for( int j = 0; j< temp.length;j++)					System.out.println( temp[j] );			}			CandidateDeviceNames=temp;*/		/*			ok..  Look the the dirctories representing the port			kernel driver interface.			If there are entries there are possibly ports we can			use and need to enumerate.		*/			String term[] = new String[2];			int l = 0;			File dev = null;						dev = new File( "/dev/term" );			if( dev.list().length > 0 );				term[l++] = new String( "term/" );/*			dev = new File( "/dev/cua0" );			if( dev.list().length > 0 );				term[l++] = new String( "cua/" );*/			String[] temp = new String[l];			for(l--;l >= 0;l--)				temp[l] = term[l];			CandidateDeviceNames=temp;		}		else		{			File dev = new File( deviceDirectory );			String[] temp = dev.list();			CandidateDeviceNames=temp;		}		if (CandidateDeviceNames==null)		{			if (debug)				System.out.println("RXTXCommDriver:registerScannedPorts() no Device files to check ");			return;		}		String CandidatePortPrefixes[] = {};		switch (PortType) {			case CommPortIdentifier.PORT_SERIAL:				if (debug)					System.out.println("scanning for serial ports for os "+osName);				if(osName.equals("Linux"))				{					String[] Temp = {					"ttyS" // linux Serial Ports					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("Linux-all-ports"))				{				/* if you want to enumerate all ports ~5000				   possible, then replace the above with this				*/					String[] Temp = {					"comx",      // linux COMMX synchronous serial card					"holter",    // custom card for heart monitoring					"modem",     // linux symbolic link to modem.					"ttyircomm", // linux IrCommdevices (IrDA serial emu)					"ttycosa0c", // linux COSA/SRP synchronous serial card					"ttycosa1c", // linux COSA/SRP synchronous serial card					"ttyC", // linux cyclades cards					"ttyCH",// linux Chase Research AT/PCI-Fast serial card					"ttyD", // linux Digiboard serial card					"ttyE", // linux Stallion serial card					"ttyF", // linux Computone IntelliPort serial card					"ttyH", // linux Chase serial card					"ttyI", // linux virtual modems					"ttyL", // linux SDL RISCom serial card					"ttyM", // linux PAM Software's multimodem boards						// linux ISI serial card					"ttyMX",// linux Moxa Smart IO cards					"ttyP", // linux Hayes ESP serial card					"ttyR", // linux comtrol cards						// linux Specialix RIO serial card					"ttyS", // linux Serial Ports					"ttySI",// linux SmartIO serial card					"ttySR",// linux Specialix RIO serial card 257+					"ttyT", // linux Technology Concepts serial card					"ttyUSB",//linux USB serial converters					"ttyV", // linux Comtrol VS-1000 serial controller					"ttyW", // linux specialix cards					"ttyX"  // linux SpecialX serial card					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("Irix"))				{					String[] Temp = {						"ttyc", // irix raw character devices						"ttyd", // irix basic serial ports						"ttyf", // irix serial ports with hardware flow						"ttym", // irix modems						"ttyq", // irix pseudo ttys						"tty4d",// irix RS422						"tty4f",// irix RS422 with HSKo/HSki						"midi", // irix serial midi						"us"    // irix mapped interface					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("FreeBSD")) //FIXME this is probably wrong				{					String[] Temp = {						"cuaa"  // FreeBSD Serial Ports					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("NetBSD")) // FIXME this is probably wrong				{					String[] Temp = {						"tty0"  // netbsd serial ports					};					CandidatePortPrefixes=Temp;				}				else if ( osName.equals("Solaris")						|| osName.equals("SunOS"))				{					String[] Temp = {						"term/",						"cua/"					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("HP-UX"))				{					String[] Temp = {						"tty0p",// HP-UX serial ports						"tty1p" // HP-UX serial ports					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("UnixWare") ||						osName.equals("OpenUNIX"))				{					String[] Temp = {						"tty00s", // UW7/OU8 serial ports						"tty01s",						"tty02s",						"tty03s" 					};					CandidatePortPrefixes=Temp;				}			else if	(osName.equals("OpenServer"))				{					String[] Temp = {						"tty1A",  // OSR5 serial ports						"tty2A",						"tty3A",						"tty4A",						"tty5A",						"tty6A",						"tty7A",						"tty8A",						"tty9A",						"tty10A",						"tty11A",						"tty12A",						"tty13A",						"tty14A",						"tty15A",						"tty16A",						"ttyu1A", // OSR5 USB-serial ports						"ttyu2A",						"ttyu3A",						"ttyu4A",						"ttyu5A",						"ttyu6A",						"ttyu7A",						"ttyu8A",						"ttyu9A",						"ttyu10A",						"ttyu11A",						"ttyu12A",						"ttyu13A",						"ttyu14A",						"ttyu15A",						"ttyu16A"					};					CandidatePortPrefixes=Temp;				}				else if (osName.equals("Compaq's Digital UNIX") || osName.equals("OSF1"))				{					String[] Temp = {						"tty0"  //  Digital Unix serial ports					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("BeOS"))				{					String[] Temp = {						"serial" // BeOS serial ports					};					CandidatePortPrefixes=Temp;				}				else if(osName.equals("Mac OS X"))				{					String[] Temp = {					// Keyspan USA-28X adapter, USB port 1						"cu.KeyUSA28X191.",					// Keyspan USA-28X adapter, USB port 1						"tty.KeyUSA28X191.",					// Keyspan USA-28X adapter, USB port 2						"cu.KeyUSA28X181.",					// Keyspan USA-28X adapter, USB port 2						"tty.KeyUSA28X181.",					// Keyspan USA-19 adapter						"cu.KeyUSA19181.",					// Keyspan USA-19 adapter						"tty.KeyUSA19181."					};					CandidatePortPrefixes=Temp;				}				else if(osName.toLowerCase().indexOf("windows") != -1 )				{					String[] Temp = {						"COM"    // win32 serial ports					};					CandidatePortPrefixes=Temp;				}				else				{					if (debug)						System.out.println("No valid prefixes for serial ports have been entered for "+osName + " in RXTXCommDriver.java.  This may just be a typo in the method registerScanPorts().");				}				break;			case CommPortIdentifier.PORT_PARALLEL:				if (debug)					System.out.println("scanning for parallel ports for os "+osName);			/** Get the Parallel port prefixes for the running os			* Holger Lehmann			* July 12, 1999			* IBM			*/				if(osName.equals("Linux")			/*				|| osName.equals("NetBSD") FIXME				|| osName.equals("HP-UX")  FIXME				|| osName.equals("Irix")   FIXME				|| osName.equals("BeOS")   FIXME				|| osName.equals("Compaq's Digital UNIX")   FIXME			*/				)				{					String[] temp={						"lp"    // linux printer port					};					CandidatePortPrefixes=temp;				}				else if(osName.equals("FreeBSD"))				{					String[] temp={						"lpt"					};					CandidatePortPrefixes=temp;				}				else  /* printer support is green */				{					String [] temp={};					CandidatePortPrefixes=temp;				}				break;			default:				if (debug)					System.out.println("Unknown PortType "+PortType+" passed to RXTXCommDriver.registerScannedPorts()");		}		registerValidPorts(CandidateDeviceNames, CandidatePortPrefixes, PortType);	}