Added functionPrefix as argument to openPort() in order to distinguish from which function comes the exception (e.g. flushBuffer(),doflash(),serialReader()).