beffroi-tools/crates/canvas-pilot/examples/read_midra.rs

27 lines
879 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//! Explicit, read-only hardware smoke check; never run by automated tests.
fn main() {
let Some(host) = std::env::args().nth(1) else {
eprintln!("Usage: cargo run -p canvas-pilot --example read_midra -- DEVICE_IP");
std::process::exit(2);
};
match canvas_pilot::device::fetch(&host) {
Ok(snapshot) => {
println!("{}", snapshot.identity);
for screen in snapshot.screens {
println!(
"Screen {}: {} × {}, Preview {}, {} layer slots",
screen.id,
screen.resolution[0],
screen.resolution[1],
screen.preview_bank,
screen.layers.len()
);
}
}
Err(error) => {
eprintln!("{error}");
std::process::exit(1);
}
}
}