fix(windows): Add option to disable RTS (#1277)

* Add option to disable RTS on Windows
* Add support for XON / XOFF on Windows.  This is probably not feature complete in terms of missing the XonChar, XoffChar, XonLim fields of DCB, but I am not as familiar with this aspect of serial comms.

BREAKING CHANGE:
We previously hard coded to have RTS On for windows at all times.
This commit is contained in:
Joshua Shireman 2017-08-06 14:57:33 -04:00 • committed by Francis Gulotta
parent 92c7dd4bfd
commit 5b8d163861

View file

@ -89,11 +89,28 @@ void EIO_Open(uv_work_t* req) {
dcb.Parity = NOPARITY;
dcb.ByteSize = 8;
dcb.StopBits = ONESTOPBIT;
dcb.fInX = FALSE;
dcb.fOutX = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fOutxCtsFlow = FALSE;
dcb.fRtsControl = RTS_CONTROL_ENABLE;
if (data->xon) {
dcb.fOutX = TRUE;
} else {
dcb.fOutX = FALSE;
}
if (data->xoff) {
dcb.fInX = TRUE;
} else {
dcb.fInX = FALSE;
}
if (data->rtscts) {
dcb.fRtsControl = RTS_CONTROL_ENABLE;
} else {
dcb.fRtsControl = RTS_CONTROL_DISABLE;
}
dcb.fBinary = true;
dcb.BaudRate = data->baudRate;