wjwwood/serial — pull request #32 by wjwwood (2013-07-30 21:10:41+00:00)
Title: Setting timeout throws an exception on Windows

My Serial object is part of another class, and as such I don't call the constructor with any argument.

On Linux this works fine, but on Windows an exception is thrown when calling "pimpl_->setTimeout(timeout);" in serial/src/serial.cc at line 68. The exception is thrown from serial/src/impl/win.cc at line 335.

I can temporarily skip the call to setTimeout() by commenting out line 68 in serial.cc.

In my own class constructor I setup the serial object "sr" with:

sr.setPort(port);
sr.setBaudrate(9600);
sr.setBytesize(serial::eightbits);
sr.setParity(serial::parity_none);
sr.setStopbits(serial::stopbits_one);

But if I set a timeout, for example with

serial::Timeout to = serial::Timeout::simpleTimeout(1000);
sr.setTimeout(to);

I still get an exception thrown on Windows, while on Linux it's fine.