fix(serial): assert DTR/RTS on Android USB-CDC open

Empirically, RAK4631/nRF52840 firmware does not respond to WAKE_BYTES
unless DTR is asserted on open. DTR maps to USB SET_CONTROL_LINE_STATE,
which the firmware uses to detect host presence and activate its serial-
side Meshtastic protocol. Bridge-chip boards (CH340, CP210x, FTDI)
tolerate the assertion.
This commit is contained in:
James Rich 2026-04-19 12:23:55 -05:00
parent 646858cc39
commit a6f3a6b4a5

View file

@ -87,6 +87,11 @@ internal class SerialConnectionImpl(
port.open(usbDeviceConnection)
port.setParameters(115200, UsbSerialPort.DATABITS_8, UsbSerialPort.STOPBITS_1, UsbSerialPort.PARITY_NONE)
// Assert DTR/RTS so native USB-CDC firmware (RAK4631 / nRF52840) recognizes the host as
// present and starts its serial-side Meshtastic protocol. Empirically, omitting these
// signals causes the firmware to never respond to WAKE_BYTES, stalling the handshake at
// Stage 1. Bridge-chip boards (CH340, CP210x, FTDI) tolerate the assertion.
port.dtr = true
port.rts = true