]>
code.octet-stream.net Git - m17rt/blob - tools/m17rt-mod/src/main.rs
50358bd7a34634c916c75b9367b2f7209b86df79
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
;
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
.inp
ut
(), soundcard
.output(), ptt
);
13 let app
= M17App
::new(soundmodem
);
15 std
::thread
::sleep(std
::time
::Duration
::from_secs(1));
16 println
!("Beginning playback...");
18 PathBuf
::from("../../../Data/test_vk7xt_8k.wav"),
20 &M17Address
::from_callsign("VK7XT-1").unwrap
(),
21 &M17Address
::new_broadcast(),
24 println
!("Playback complete.");
25 std
::thread
::sleep(std
::time
::Duration
::from_secs(1));