From d2c4dea65826283dcff38cb737e075f7cb92fafc Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Wed, 10 Dec 2014 21:25:07 -0500 Subject: [PATCH] Bug fix possibly for windows. --- src/serialport_win.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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;