resetClear all injection, return to passthrough

fn reset(&self) -> Result<()>

Fire-and-forget

EFFECT
StateAfter reset
Box accumulatorZeroed: the running total of injected motion and scroll not yet emitted to the PC.
Box overridesAll released. An override holds one usage down or up.
Library held-stateCleared. A later reapply or reconnect re-asserts nothing. The box counts the reset as a session release, and recovery from it restores nothing.

Sends one RESET frame.

EXAMPLE
use medius::Button;

device.move_rel(40, 0)?;        // 40 right
device.press(Button::LEFT)?;    // hold left down
device.release(Button::LEFT)?;  // release it

device.reset()?;                // drop all of the above, back to passthrough

factory_resetReset, erase the store, reboot

fn factory_reset(&self) -> Result<()>

Fire-and-forget

Does what reset does, then erases what the box keeps across a reboot and restarts it.

ERASED
StoredAfter
Box nameThe MAC-derived default, as on a new box (set_name).
OptionsAll seven at their defaults, imperfect-clone opt-in included.
Learned per-device dataGone for every device the box has seen, patch sets included.

Sends one RESET frame with its NVS flag. The clone re-enumerates on the game PC. The control port stays enumerated through the reboot, so the link stays up. Queries time out until the box replies, so poll one to know it is back.

EXAMPLE
device.factory_reset()?;        // back to a box that has learned nothing

rebootRestart a chip, or boot it to download mode

fn reboot(&self, target: RebootTarget) -> Result<()>

Fire-and-forget

RebootTarget picks the chip, and whether it comes back running firmware or in download mode. Its four variants and bytes are on Types. The wire layout is on the native REBOOT command.

EXAMPLE
use medius::RebootTarget;

device.reboot(RebootTarget::DeviceRun)?;   // restart the device chip

A Download variant leaves the chip in ROM download mode until reflashed or power-cycled. Meanwhile it presents no clone and doesn't reply on the control link. Send one only to flash.

A rebooted device chip sends the ready hello. Once the clone is back, the library re-sends what it holds (session recovery). If the link drops meanwhile, the reader thread's auto-reconnect brings it back, or reconnect forces it.

A box already running Medius takes firmware over the open connection through the update calls. A Download reboot is only for a first install or a chip whose app won't boot.

On AsyncDeviceStill fire-and-forget, no await

AsyncDevice re-exposes reset and reboot unchanged: no reply, so no .await and no block_on. Only queries are async.

EXAMPLE
use medius::{AsyncDevice, RebootTarget};

let device = AsyncDevice::open("/dev/ttyACM0")?;
device.reset()?;                          // sync, no await
device.reboot(RebootTarget::HostRun)?;    // sync, no await