diff --git a/src/serialport_win.cpp b/src/serialport_win.cpp index 3da15c2..08ef264 100644 --- a/src/serialport_win.cpp +++ b/src/serialport_win.cpp @@ -163,6 +163,35 @@ public: NanCallback* disconnectedCallback; }; +void EIO_Set(uv_work_t* req) { + SetBaton* data = static_cast(req->data); + + int bits; + ioctl( data->fd, TIOCMGET, &bits ); + + bits &= ~(TIOCM_RTS | TIOCM_CTS | TIOCM_DTR | TIOCM_DSR); + + if (data->rts) { + bits |= TIOCM_RTS; + } + + if (data->cts) { + bits |= TIOCM_CTS; + } + + if (data->dtr) { + bits |= TIOCM_DTR; + } + + if (data->dsr) { + bits |= TIOCM_DSR; + } + + data->result = ioctl( data->fd, TIOCMSET, &bits ); + +} + + void EIO_WatchPort(uv_work_t* req) { WatchPortBaton* data = static_cast(req->data); data->bytesRead = 0;