Skip to content

setTimeout needs a non-constant reference? #14

@Carlos4621

Description

@Carlos4621

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions