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:
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,
- 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.
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,setSignalsis not permitted before the port is opened.Please discuss one the following enhancements:
openwill not modify signals states, andsetSignalswill return the existing/modified signal states in its Promise, and will support no parameter, so thatsetSignals({})orsetSignals()will return the current states - unmodified.or,
SerialOptionsdictionary 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 toopenandsetSignals.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
closewill leave DTR and RTS in their current state. I'm okay with that.