Skip to content

Specify default DTR and RTS output states #177

@codembed

Description

@codembed

What is the default state for these pins after a call to open ?

On Windows, it seems that DTR and RTS assert on open. In some cases, automatically asserting these is not desirable.

In my experience, some serial port drivers leave these pins in the state set by a previous OS handle. Perhaps other drivers or APIs always set a default state (which is not always asserted)?

If possible, it would be nice to have consistency over all platforms.

My preference would be for DTR and RTS to be unmodified by open. However, this can be problematic as there is currently no function to get the existing state of these outputs. In addition, setSignals is not permitted before the port is opened.

Please discuss one the following enhancements:

  1. open will not modify signals states, and
    setSignals will return the existing/modified signal states in its Promise, and will support no parameter, so that setSignals({}) or setSignals() will return the current states - unmodified.

or,

  1. Add optional signals parameters to the SerialOptions dictionary to allow these signals to be set synchronously when the port is opened. In some cases, this would prevent glitches in the signals between calls to open and setSignals.

I prefer 1, but I suppose this is considered a 'breaking' change. Having a way to retrieve the current output states would be good!

If neither implementation is practical, it would be good to at least have the default states specified in the standard.

It seems that close will leave DTR and RTS in their current state. I'm okay with that.

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