LED
led overrides one of the box's two green status LEDs; LedMode::Auto returns it to the status display. Fire-and-forget: one frame, no reply.
ledOverride or restore a status LED
fn led(&self, target: LedTarget, mode: LedMode, level: u8) -> Result<()>
Fire-and-forget
| Parameter | Type | Description |
|---|---|---|
target | LedTarget | Which chip's LED. |
mode | LedMode | Restore the chip's status display, or override it. |
level | u8 | Brightness 0-255 for Solid and Blink; ignored otherwise. |
An override returns to the status display on Auto, control-PC silence, reset, or inter-chip link loss. Each chip's status patterns are on the native LED command.
EXAMPLE
use medius::{Device, LedTarget, LedMode};
let device = Device::find()?;
device.led(LedTarget::Both, LedMode::Blink, 200)?; // both LEDs blink, bright
device.led(LedTarget::Device, LedMode::Auto, 0)?; // back to the status displayOn AsyncDevice Still fire-and-forget, no await
AsyncDevice re-exposes led unchanged: no reply, so no .await and no block_on. Only queries are async.
EXAMPLE
use medius::{AsyncDevice, LedTarget, LedMode};
let device = AsyncDevice::open("/dev/ttyACM0")?;
device.led(LedTarget::Host, LedMode::Solid, 128)?; // sync, no await