From af2ed1c080cc5a8635a498b9dbcc66d230024969 Mon Sep 17 00:00:00 2001 From: Pavel Vymetálek Date: Wed, 11 Jan 2023 11:48:01 +0100 Subject: Serial port inicialization with flow control "none" for Windows --- sercp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sercp.c') diff --git a/sercp.c b/sercp.c index 9bfb831..a726055 100644 --- a/sercp.c +++ b/sercp.c @@ -693,8 +693,13 @@ int OpenUart() { sDCB.fAbortOnError = TRUE; sDCB.fOutxDsrFlow = FALSE; sDCB.fDtrControl = DTR_CONTROL_DISABLE; - sDCB.fRtsControl = RTS_CONTROL_HANDSHAKE; - sDCB.fOutxCtsFlow = TRUE; + if (is_flow_control_none) { + sDCB.fRtsControl = RTS_CONTROL_DISABLE; + sDCB.fOutxCtsFlow = FALSE; + } else { + sDCB.fRtsControl = RTS_CONTROL_HANDSHAKE; + sDCB.fOutxCtsFlow = TRUE; + } if (SetCommState(serial_fd, &sDCB) == 0) { return (-1); } -- cgit