go-serial
go-serial copied to clipboard
Allow to set initial RTS and DTR state after connect
Closes #46
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 Same for me ;) We use this in production since years in our fork ...
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
.
Superseded by #140