Skip to content

Commit

Permalink
Flip-flat: Allow handshake without ioctl on virtual serial connection
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jfwells authored Jan 1, 2024
1 parent 5718ec7 commit 583de8a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/auxiliary/flip_flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 583de8a

Please sign in to comment.