]>
code.octet-stream.net Git - m17rt/blob - tools/m17rt-txpacket/src/main.rs
538291aecfd55fa3a5043fb7c91c41b2fc6496dd
1 use m17app
::app
::M17App
;
2 use m17app
::link_setup
::{LinkSetup
, M17Address
};
3 use m17app
::soundmodem
::{
4 InputRrcFile
, InputSoundcard
, NullInputSource
, NullOutputSink
, NullPtt
, OutputRrcFile
,
5 OutputSoundcard
, Soundmodem
,
7 use m17core
::protocol
::PacketType
;
8 use std
::path
::PathBuf
;
11 let out_path
= PathBuf
::from("../../../Data/mypacket.rrc");
12 let output
= OutputRrcFile
::new(out_path
);
13 //let output = OutputSoundcard::new();
14 let soundmodem
= Soundmodem
::new(NullInputSource
::new(), output
, NullPtt
::new());
15 let app
= M17App
::new(soundmodem
);
17 std
::thread
::sleep(std
::time
::Duration
::from_secs(1));
18 println
!("Transmitting packet...");
20 let source
= M17Address
::from_callsign("VK7XT").unwrap
();
21 let destination
= M17Address
::new_broadcast();
22 let link_setup
= LinkSetup
::new_packet(&source
, &destination
);
23 let payload
= b
"Hello, world!";
25 .transmit_packet(&link_setup
, PacketType
::Raw
, payload
);
27 std
::thread
::sleep(std
::time
::Duration
::from_secs(5));