Application is able to write keys to footpedal

This commit is contained in:
2018-07-24 19:03:35 +02:00
parent 6bc9c31ed3
commit ab4dea3b5e
3 changed files with 47 additions and 18 deletions

View File

@@ -32,7 +32,7 @@ struct Opt {
}
fn main() {
let pedals = pedal_operations::Pedals::new();
let mut pedals = pedal_operations::Pedals::new();
check_sudo();
let opt = Opt::from_args();
@@ -70,15 +70,14 @@ fn main() {
let dev = api.open_path(dev_path.as_str()).unwrap();
println!("Succesfully opened device.");
//ToDo: This part of the code is just there to test functions
pedals.set_key(0, "b");
pedals.write_pedals(& dev);
// All options that need the device to be open
if opt.read {
pedals.read_pedals(& dev);
}
//ToDo: set right if condition
if true {
pedals.write_pedals(& dev);
}
}
/// Checks if user is super user