public  boolean connect() throws Exception
    {
        port = getPropPort();
        portRate = 9600;
        //Service.WriteLog("Find port: "+port);
        parity = 0;
        rts = true;
		if (this.port.length()<1)
        {

            return false;
        }
        if (status == Device.DEVICE_READY || status == Device.DEVICE_WORKING)
        {

            return true;
        }
		portIdentifier = CommPortIdentifier.getPortIdentifier(this.port);
        if ( portIdentifier.isCurrentlyOwned() )
        {
            status = Device.DEVICE_PORT_BUSY;
        }
        else
        {
            commPort = portIdentifier.open(this.getClass().getName(),2000);
            
            if ( commPort instanceof SerialPort)
            {
            	serialPort = (SerialPort) commPort;
            	serialPort.setSerialPortParams(this.portRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,this.parity);
            	serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
            	serialPort.setDTR(true);
            	serialPort.setRTS(this.rts);
                serialPort.notifyOnDataAvailable(true);
                if (this.timeout>0)
                	serialPort.enableReceiveTimeout(this.timeout);
                //serialPort.notifyOnOutputEmpty(true);
                //serialPort.setOutputBufferSize(this.bufferByte);
                
                portInputStream = serialPort.getInputStream();
                portOutputStream = serialPort.getOutputStream();
                               
                serialPort.addEventListener(this);
               status = Device.DEVICE_READY;
               return true;
            }
            else
            {
            	status = Device.DEVICE_PORT_NOT_FOUND;
            }
        }     
        
        return false;
    }