MCPcopy Index your code
hub / github.com/FrameworkComputer/inputmodule-rs / simple_cmd

Function simple_cmd

inputmodule-control/src/inputmodule.rs:399–411  ·  view source on GitHub ↗
(serialdev: &str, command: Command, args: &[u8])

Source from the content-addressed store, hash-verified

397}
398
399fn simple_cmd(serialdev: &str, command: Command, args: &[u8]) {
400 let port_result = serialport::new(serialdev, 115_200)
401 .timeout(SERIAL_TIMEOUT)
402 .open();
403
404 match port_result {
405 Ok(mut port) => simple_cmd_port(&mut port, command, args),
406 Err(error) => match error.kind {
407 serialport::ErrorKind::Io(std::io::ErrorKind::PermissionDenied) => panic!("Permission denied, couldn't access inputmodule serialport. Ensure that you have permission, for example using a udev rule or sudo."),
408 other_error => panic!("Couldn't open port: {:?}", other_error)
409 }
410 };
411}
412
413fn open_serialport(serialdev: &str) -> Box<dyn SerialPort> {
414 serialport::new(serialdev, 115_200)

Callers 10

serial_commandsFunction · 0.85
bootloader_cmdFunction · 0.85
percentage_cmdFunction · 0.85
pattern_cmdFunction · 0.85
start_game_cmdFunction · 0.85
simple_cmd_multipleFunction · 0.85
display_bw_image_cmdFunction · 0.85
render_matrixFunction · 0.85
show_fontFunction · 0.85
set_color_cmdFunction · 0.85

Calls 1

simple_cmd_portFunction · 0.85

Tested by

no test coverage detected