Skip to content

Commit dac25b8

Browse files
sirhceleldruin
authored andcommitted
Revert automatically setting DTR when opening a port
This behavior looked promising in the first place to get some Arduino devices to send data at all (like in #29 and #204). But after shipping this as the new default, several issues were reported from other Arduino devices and other places (see issue #243 and #251). So I'm finally pulling the plug on this and revert setting DTR on open by default. I'm sorry for the back and forth and all the inconvenience this caused!
1 parent 49bf30f commit dac25b8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,11 +859,14 @@ pub fn new<'a>(path: impl Into<std::borrow::Cow<'a, str>>, baud_rate: u32) -> Se
859859
parity: Parity::None,
860860
stop_bits: StopBits::One,
861861
timeout: Duration::from_millis(0),
862-
// By default, set DTR when opening the device. There are USB devices performing "wait for
863-
// DTR" before sending any data and users stumbled over this multiple times (see issues #29
864-
// and #204). We are expecting little to no negative consequences from setting DTR by
865-
// default but less hassle for users.
866-
dtr_on_open: Some(true),
862+
// Leave DTR alone when opening a device. We've started out with setting DTR on open (see
863+
// issues #29 and #204) but despite pleasing some Arduino use cases, this apparently caused
864+
// problems with other boards and when using pseudo terminals (see issues #243 and #251).
865+
//
866+
// To me it looks that the fallout from setting DTR on open by default gets on a
867+
// substantially larger area than the one benefitting from it, I finally decided to revert
868+
// this. Sorry for this back and forth, Christian.
869+
dtr_on_open: None,
867870
}
868871
}
869872

0 commit comments

Comments
 (0)