Crates.io | pirate-midi-rs |
lib.rs | pirate-midi-rs |
version | 1.2.0 |
source | src |
created_at | 2022-08-11 03:02:40.530476 |
updated_at | 2023-02-17 17:37:05.90198 |
description | send serial commands to pirate midi bridge devices |
homepage | https://github.com/beckler/pirate-midi-rs |
repository | https://github.com/beckler/pirate-midi-rs |
max_upload_size | |
id | 643078 |
size | 64,163 |
Rust library for sending serial commands to Pirate MIDI Bridge devices
Make sure your bridge device is connected via USB before running a command.
// create our test device
let device = PirateMIDIDevice::new();
// get device details
let response = device.send(Command::Check).unwrap(); // use a `match` instead of `.unwrap()`
// enter the bootloader
// the device will detach and then reattach in bootloader mode, and the serial port will no longer be available.
// will return `ok`, but any subsequent commands will throw an error
match PirateMIDIDevice::new().send(Command::Control(ControlArgs::EnterBootloader)) {
Ok(_) => Ok(()),
Err(err) => panic!("unable to enter bootloader: {}", err),
}