create stub AMPS handset emulator
This commit is contained in:
33
amps-handset-emu/src/main.rs
Normal file
33
amps-handset-emu/src/main.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use fsk::fsk_modulate;
|
||||
use text_io::scan;
|
||||
use std::io;
|
||||
|
||||
mod fsk;
|
||||
mod audio;
|
||||
|
||||
fn main() -> Result<(), io::Error> {
|
||||
println!("Press 1 to send test tone");
|
||||
println!("Press 0 to exit");
|
||||
|
||||
let a: i32;
|
||||
scan!("{}", a);
|
||||
|
||||
match a {
|
||||
1 => {
|
||||
println!("1 has been pressed! No test tone implemented yet");
|
||||
let tone: signal;
|
||||
tone = fsk_modulate([0x25, 0x08, 0x00, 0x25, 0xA0]);
|
||||
play_audio(tone);
|
||||
return main();
|
||||
},
|
||||
0 => {
|
||||
return Ok(());
|
||||
}
|
||||
_ => {
|
||||
eprintln!("Invalid command.");
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
//Ok(())
|
||||
}
|
Reference in New Issue
Block a user