Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Add serial connection Flow control for Intel's UartSub devices in Windows #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ int cmdline_process_param(const char *p, char *value,
case 'D':
conf_set_int(conf, CONF_serflow, SER_FLOW_DSRDTR);
break;
case 'U':
conf_set_int(conf, CONF_serflow, SER_FLOW_NONE_DTR_RTS_DIS);
break;

default:
cmdline_error("Unrecognised suboption \"-sercfg %c\"",
Expand Down
4 changes: 2 additions & 2 deletions doc/using.but
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,8 @@ follows:
\cq{o} for odd, \cq{e} for even, \cq{m} for mark and \cq{s} for space.

\b A single upper-case letter specifies the flow control: \cq{N} for
none, \cq{X} for XON/XOFF, \cq{R} for RTS/CTS and \cq{D} for
DSR/DTR.
none, \cq{X} for XON/XOFF, \cq{R} for RTS/CTS, \cq{D} for
DSR/DTR and \cq{U} Disables DTR/RTS (only in Windows version).

For example, \cq{-sercfg 19200,8,n,1,N} denotes a baud rate of
19200, 8 data bits, no parity, 1 stop bit and no flow control.
Expand Down
2 changes: 1 addition & 1 deletion putty.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ enum {
};

enum {
SER_FLOW_NONE, SER_FLOW_XONXOFF, SER_FLOW_RTSCTS, SER_FLOW_DSRDTR
SER_FLOW_NONE, SER_FLOW_XONXOFF, SER_FLOW_RTSCTS, SER_FLOW_DSRDTR, SER_FLOW_NONE_DTR_RTS_DIS
};

/*
Expand Down
1 change: 1 addition & 0 deletions sercfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static void serial_flow_handler(union control *ctrl, void *dlg,
{"XON/XOFF", SER_FLOW_XONXOFF},
{"RTS/CTS", SER_FLOW_RTSCTS},
{"DSR/DTR", SER_FLOW_DSRDTR},
{"Disable DTR/RTS", SER_FLOW_NONE_DTR_RTS_DIS},
};
int mask = ctrl->listbox.context.i;
int i, j;
Expand Down
2 changes: 1 addition & 1 deletion windows/wincfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, int has_help,
* Serial back end is available on Windows.
*/
if (!midsession || (protocol == PROT_SERIAL))
ser_setup_config_box(b, midsession, 0x1F, 0x0F);
ser_setup_config_box(b, midsession, 0x1F, 0x01F);

/*
* $XAUTHORITY is not reliable on Windows, so we provide a
Expand Down
5 changes: 5 additions & 0 deletions windows/winser.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ static const char *serial_configure(Serial serial, HANDLE serport, Conf *conf)
dcb.fOutxDsrFlow = TRUE;
str = "DSR/DTR";
break;
case SER_FLOW_NONE_DTR_RTS_DIS:
str = "Disable DTR/RTS";
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fRtsControl = RTS_CONTROL_DISABLE;
break;
}
msg = dupprintf("Configuring %s flow control", str);
logevent(serial->frontend, msg);
Expand Down