I'm trying to change the timeout of my serial object at runtime with setTimeout, but I notice that it requires a non-constant reference to a Timeout object, so lines like
serialPort_m.setTimeout(serial::Timeout::simpleTimeout(100));
don't work. Reviewing the implementation, I find that
void
Serial::SerialImpl::setTimeout (serial::Timeout &timeout)
{
timeout_ = timeout;
}
where timeout_ is a Timeout (not a reference).
My point here is: Does it really need a non-constant reference, or could the implementation be changed to accept a constant reference?