]>
code.octet-stream.net Git - m17rt/blob - tools/m17rt-mod/src/main.rs
3bd672785c359dc2e01e1cc288734a436325645d
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 soundcard
.set_tx_inverted(true);
12 let ptt
= SerialPtt
::new("/dev/ttyUSB0", PttPin
::Rts
);
13 let soundmodem
= Soundmodem
::new(soundcard
.inp
ut
(), soundcard
.output(), ptt
);
14 let app
= M17App
::new(soundmodem
);
16 std
::thread
::sleep(std
::time
::Duration
::from_secs(1));
17 println
!("Beginning playback...");
19 PathBuf
::from("../../../Data/test_vk7xt_8k.wav"),
21 &M17Address
::from_callsign("VK7XT-1").unwrap
(),
22 &M17Address
::new_broadcast(),
25 println
!("Playback complete.");
26 std
::thread
::sleep(std
::time
::Duration
::from_secs(1));