try
{
if(frontCam!=null)
frontCam.close();
else
frontCam = new RobotCamColorTrack(this.frontCamPort);
portId = CommPortIdentifier.getPortIdentifier( this.robotComPort );
serialPort = (SerialPort)portId.open("SerialCommunicationChannel", 2000);
serialPort.setSerialPortParams(speed, dataBits, stopBit, parity);