Initial restructuring after _actual_ spec added

This commit is contained in:
2024-11-03 12:52:18 -05:00
parent 84a105639c
commit 045237d44f
15 changed files with 659 additions and 983 deletions

View File

@ -35,26 +35,6 @@ use gem_remotes_lib::{
#[derive(Command)]
pub enum Menu{//<'a> {
/// Simulate the PIC controller sending aus n Up character
PicRecvUp {
/// 0 for not pressed, 1 for pressed
data: u8,
},
/// Simulate the PIC controller sending us a Down character
PicRecvDown {
/// 0 for not pressed, 1 for pressed
data: u8,
},
/// Simulate the PIC controller sending us a Stop character
PicRecvStop {
/// 0 for not pressed, 1 for pressed
data: u8,
},
/// Simulate the PIC controller sending a "pair" button press
PicRecvPair,
/// Send a bluetooth characteristic: Up
BluetoothUp {
@ -121,40 +101,6 @@ pub fn process_menu(
match command {
// We ignore sending errors throughout because the Cli interface is only for
// testing and debugging.
Menu::PicRecvUp {data} => {
let but = input_to_button(data);
match but {
Some(d) => {
println!("Sending PicRecvUp command");
let _ = dispatch.send_blocking(Commands::PicRecvUp{data: d});
}
None => {println!("Incorrect value; enter 0 or 1")}
}
}
Menu::PicRecvDown{data} => {
let but = input_to_button(data);
match but {
Some(d) => {
println!("Sending PicRecvUp command");
let _ = dispatch.send_blocking(Commands::PicRecvDown{data: d});
}
None => {println!("Incorrect value; enter 0 or 1")}
}
}
Menu::PicRecvStop{data} => {
let but = input_to_button(data);
match but {
Some(d) => {
println!("Sending PicRecvUp command");
let _ = dispatch.send_blocking(Commands::PicRecvStop{data: d});
}
None => {println!("Incorrect value; enter 0 or 1")}
}
}
Menu::PicRecvPair => {
cli.writer().write_str("Sending PIC command and timer reset (the job of the pair button driver, once PIC interface exists)")?; //TODO: PIC get this.
let _ = dispatch.send_blocking(Commands::AllowPairing);
}
Menu::BluetoothUp { data } => {
let but = input_to_button(data);
match but {