@SuppressWarnings("unchecked")
	public void open() throws Exception {
		System.out.println("Starting....");
		portList = CommPortIdentifier.getPortIdentifiers();
		System.out.println("found portList = " + portList.toString());
		Win32Driver w32Driver = new Win32Driver();
		w32Driver.initialize();

		try {
			while (portList.hasMoreElements()) {
				portId = portList.nextElement();
				System.out.println("found portId = " + portId.getName());
				if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
					if (portId.getName().equals(mPortName)) {
						System.out.println("Found Serial Port " + mPortName);

						System.out.println("Opening Serial......");

						try {
							serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
							portOpen = true;
						} catch (PortInUseException e) {
							System.out.println("!!!!!!!!! PortInUseException ");
						}
						try {
							outputStream = serialPort.getOutputStream();
						} catch (IOException e) {
						}

						try {
							System.out.println("Getting input stream....");
							inputStream = serialPort.getInputStream();
							System.out.println("serialPort.getName() " + serialPort.getName());

							// in = new BufferedInputStream(inputStream, 1024);
						} catch (IOException e) {
							serialPort.close();
							System.out.println("Error opening i/o streams");
						}
						try {
							serialPort.addEventListener(this);
						} catch (TooManyListenersException e) {
							System.out.println("!!!!!!!!! TooManyListenersException ");
						}
						serialPort.notifyOnDataAvailable(true);

						try {
							serialPort.setSerialPortParams(mBaudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
						} catch (UnsupportedCommOperationException e) {
							System.out.println("!!!!!!!!! UnsupportedCommOperationException ");
						}

						System.out.println("Parameters set");
						readThread = new Thread(this);
						readThread.start();
					}
				}
			}

		} catch (NullPointerException e) {
			System.out.println("ERROR: Device not found");
			System.exit(1);
		}
	}