]> code.octet-stream.net Git - m17rt/blob - tools/m17rt-mod/src/main.rs
Address more clippy lints
[m17rt] / tools / m17rt-mod / src / main.rs
1 use m17app::app::M17App;
2 use m17app::link_setup::M17Address;
3 use m17app::serial::{PttPin, SerialPtt};
4 use m17app::soundcard::Soundcard;
5 use m17app::soundmodem::Soundmodem;
6 use m17codec2::WavePlayer;
7 use std::path::PathBuf;
8
9 pub fn mod_test() {
10 let soundcard = Soundcard::new("plughw:CARD=Device,DEV=0").unwrap();
11 let ptt = SerialPtt::new("/dev/ttyUSB0", PttPin::Rts);
12 let soundmodem = Soundmodem::new(soundcard.input(), soundcard.output(), ptt);
13 let app = M17App::new(soundmodem);
14 app.start();
15 std::thread::sleep(std::time::Duration::from_secs(1));
16 println!("Beginning playback...");
17 WavePlayer::play(
18 PathBuf::from("../../../Data/test_vk7xt_8k.wav"),
19 app.tx(),
20 &M17Address::from_callsign("VK7XT-1").unwrap(),
21 &M17Address::new_broadcast(),
22 0,
23 );
24 println!("Playback complete.");
25 std::thread::sleep(std::time::Duration::from_secs(1));
26 app.close();
27 }
28
29 fn main() {
30 env_logger::init();
31 mod_test();
32 }