Explicitly enable DTR/RTS to fix RAK serial comms

pull/458/head
Mike Cumings 2022-07-29 14:03:04 -07:00
rodzic 767ddb9a76
commit c1bbf1411a
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -59,7 +59,9 @@ internal class SerialConnectionImpl(
}
port.open(usbDeviceConnection)
port.setParameters(115200, 8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
port.setParameters(115200, UsbSerialPort.DATABITS_8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
port.dtr = true
port.rts = true
debug("Starting serial reader thread")
val io = SerialInputOutputManager(port, object : SerialInputOutputManager.Listener {
@ -70,6 +72,8 @@ internal class SerialConnectionImpl(
override fun onRunError(e: Exception?) {
closed.set(true)
ignoreException {
port.dtr = false
port.rts = false
port.close()
}
closedLatch.countDown()