pub struct TouchlessResetWatcher { /* private fields */ }Expand description
Watcher for the 1200-baud touchless reset.
Track CDC SET_LINE_CODING (baud rate) and
SET_CONTROL_LINE_STATE (DTR / RTS) events. When the host opens
the port at 1200 baud and then drops DTR, return
RescueAction::TriggerDfu so the caller can put the
device into serial DFU mode.
The watcher self-suppresses after firing — once
TouchlessResetWatcher::fired is true, subsequent events return
None until TouchlessResetWatcher::reset is called. In normal
operation the BSP’s enter_dfu_serial() diverges so the
suppression is moot; it exists for defensive symmetry and
testability.
Implementations§
Source§impl TouchlessResetWatcher
impl TouchlessResetWatcher
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Construct with the conventional power-on assumption: baud 115200, DTR low (host has not yet opened the port).
Sourcepub fn on_line_coding(&mut self, baud: u32) -> RescueAction
pub fn on_line_coding(&mut self, baud: u32) -> RescueAction
Notify of a CDC SET_LINE_CODING request.
Sourcepub fn on_control_line_state(&mut self, dtr: bool, _rts: bool) -> RescueAction
pub fn on_control_line_state(&mut self, dtr: bool, _rts: bool) -> RescueAction
Notify of a CDC SET_CONTROL_LINE_STATE request. Only dtr
is consulted; rts is accepted for API completeness but
ignored, since the Arduino-ecosystem 1200-baud convention is
DTR-driven.