public short open_serial()
	{
		 // the next line is for Raspberry Pi and gets us into the while loop and was suggested here was suggested http://www.raspberrypi.org/phpBB3/viewtopic.php?f=81&t=32186
        System.setProperty("gnu.io.rxtx.SerialPorts", COM_PORT_NAME);

		Enumeration portEnum = CommPortIdentifier.getPortIdentifiers();
//First, Find an instance of serial port as set in PORT_NAMES.
		while (portEnum.hasMoreElements()) 
		{
			CommPortIdentifier currPortId = (CommPortIdentifier) portEnum.nextElement();
			if (currPortId.getName().equals(COM_PORT_NAME))
			{
				portId = currPortId;
				break;
			}
		}
		if (portId == null) 
		{
			MsgAnalyzerCmnDef.WriteErrorFormatSyslog("Fail to find the COM port: %s", COM_PORT_NAME);
			return MsgAnalyzerCmnDef.ANALYZER_FAILURE_HANDLE_SERIAL;
		}

		try 
		{
// open serial port, and use class name for the appName.
			serialPort = (SerialPort) portId.open(this.getClass().getName(), TIME_OUT);
// set port parameters
			serialPort.setSerialPortParams(COM_PORT_SPEED, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

// open the output streams
			input = new BufferedReader(new InputStreamReader(serialPort.getInputStream()));

// add event listeners
			serialPort.addEventListener(this);
			serialPort.notifyOnDataAvailable(true);
		} 
		catch (Exception e) 
		{
			MsgAnalyzerCmnDef.WriteErrorFormatSyslog("Fail to open the COM port[%s] , due to: %s", COM_PORT_NAME, e.toString());
		}

		return MsgAnalyzerCmnDef.ANALYZER_SUCCESS;	
	}