mirror of
https://github.com/siemens-mobile-hacks/node-serialport-bindings-cpp.git
synced 2026-11-26 02:47:17 +00:00
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:
parent
92c7dd4bfd
commit
5b8d163861
1 changed files with 20 additions and 3 deletions
|
|
@ -89,11 +89,28 @@ void EIO_Open(uv_work_t* req) {
|
||||||
dcb.Parity = NOPARITY;
|
dcb.Parity = NOPARITY;
|
||||||
dcb.ByteSize = 8;
|
dcb.ByteSize = 8;
|
||||||
dcb.StopBits = ONESTOPBIT;
|
dcb.StopBits = ONESTOPBIT;
|
||||||
dcb.fInX = FALSE;
|
|
||||||
dcb.fOutX = FALSE;
|
|
||||||
dcb.fOutxDsrFlow = FALSE;
|
dcb.fOutxDsrFlow = FALSE;
|
||||||
dcb.fOutxCtsFlow = 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.fBinary = true;
|
||||||
dcb.BaudRate = data->baudRate;
|
dcb.BaudRate = data->baudRate;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue