Hi there,
Great work with this project - it's exactly what I was looking for!
I could be wrong but I believe I've found a small bug. SerialStreamBuf.h currently contains the following enum:
enum BaudRateEnum {
BAUD_50 = SerialPort::BAUD_50,
...
BAUD_115200 = SerialPort::BAUD_115200,
BAUD_230400 = SerialPort::BAUD_230400,
BAUD_DEFAULT = SerialPort::BAUD_DEFAULT,
BAUD_INVALID
} ;
The problem is that this enum sets BAUD_INVALID to 4098 (because BAUD_DEFAULT==4097). But BAUD_115200 also equals 4098! So, in other words, BAUD_INVALID==BAUD_115200. So if you try setting the baud rate to 115200, the code wrongly decides to set the bad bit after line 78 of SerialStream.cc:
if( SerialStreamBuf::BAUD_INVALID ==
my_buffer->SetBaudRate(baudRate) )
{
setstate(badbit) ;
}
My simple (but probably ugly fix) is to change line 85 of SerialStreamBuf.h from "BAUD_INVALID" to "BAUD_INVALID = 999".
By the way, the line numbers I quoted are for version 0.6.0rc1, not for HEAD from SVN, sorry.
Also, I guess I should really have posted this in "patches", sorry.
Haha, good catch. Thanks, jack-kelly. I will fix this and make sure that BAUD_INVALID is indeed set to an "invalid" value.
This has been fixed in SVN trunk.