Is there a way to close/clear these streams or SerialDevice without blocking? bufferedRead.close() // blocks until device is up again Also closing the streams, or closing the SerialDevice blocks. But this clear method on the input/output stream blocks if the device is down. If the unit is becomes unavailable, I have to clear the stream before being able to send new commands, once the device is up again. OutputStream = serialPort.getOutputStream() tSerialPortParams(baudrate, databits, stopbits, parity) īufferedReader = new BufferedReader(new InputStreamReader(serialPort.getInputStream())) SerialPort = (SerialPort) portIdentifier.open(name, PortIdentifier = CommPortIdentifier.getPortIdentifier(device) Opening a connection with the serial device: import gnu.io.CommPortIdentifier I communicate with a unit to control a satellite antenna via a serial connection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |