go-serial icon indicating copy to clipboard operation
go-serial copied to clipboard

Allow to set initial RTS and DTR state after connect

Open niondir opened this issue 6 years ago • 2 comments

Closes #46

niondir avatar Mar 02 '18 15:03 niondir

We would really like to delete our clone (https://github.com/raceresult/go-serial) and go back to using this repository, but we need this merged.

We use the DTR line on our serial hardware to reset it. If we connect to the hardware it sometimes resets before we are able to set the DTR to false via port.SetDTR(false). That must not happen for our use case. Note that this only is an issue on Windows.

tehsphinx avatar Jul 16 '21 07:07 tehsphinx

@tehsphinx Same for me ;) We use this in production since years in our fork ...

niondir avatar Jul 16 '21 22:07 niondir

Hey! ok.. let's get this merged...

My only concern is that this is a breaking change: if InitialRTS or InitialDTR is not specified it now defaults to false for example:

port, err := serial.Open("COM1", &serial.Mode{Baudrate:115200})  // This now defaults to DTR & RTS off...

I'm going to push another PR, based on this one, that will default both pins to true.

cmaglie avatar Sep 03 '22 15:09 cmaglie

Superseded by #140

cmaglie avatar Sep 04 '22 11:09 cmaglie