From 583de8a6fada1c4780fbc873bb3f0146e854a5d0 Mon Sep 17 00:00:00 2001 From: John Wells Date: Mon, 1 Jan 2024 22:54:56 +0000 Subject: [PATCH] Flip-flat: Allow handshake without ioctl on virtual serial connection Try premptively pinging the flip-flat without dropping the RTS line so that the handshake succeeds in the case of a virtual serial port (pty with no ioctl). --- drivers/auxiliary/flip_flat.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/auxiliary/flip_flat.cpp b/drivers/auxiliary/flip_flat.cpp index eb9a494219..6bd8dd1a3b 100644 --- a/drivers/auxiliary/flip_flat.cpp +++ b/drivers/auxiliary/flip_flat.cpp @@ -145,6 +145,14 @@ bool FlipFlat::Handshake() PortFD = serialConnection->getPortFD(); + /* Try handshake first in case of virtual serial port where ioctl will fail*/ + if (ping()) + { + return true; + } + + LOGF_DEBUG("Initial handshake unsuccessful, dropping RTS", command); + /* Drop RTS */ int i = 0; i |= TIOCM_RTS;