- pub fn new_with_input_and_output<I: InputSource, O: OutputSink>(input: I, output: O) -> Self {
+ pub fn new<I: InputSource, O: OutputSink, P: Ptt>(input: I, output: O, ptt: P) -> Self {
// must create TNC here
let (event_tx, event_rx) = sync_channel(128);
let (kiss_out_tx, kiss_out_rx) = sync_channel(128);
// must create TNC here
let (event_tx, event_rx) = sync_channel(128);
let (kiss_out_tx, kiss_out_rx) = sync_channel(128);
kiss_out_tx: SyncSender<Arc<[u8]>>,
input: Box<dyn InputSource>,
output: Box<dyn OutputSink>,
kiss_out_tx: SyncSender<Arc<[u8]>>,
input: Box<dyn InputSource>,
output: Box<dyn OutputSink>,
) {
std::thread::spawn(move || {
// TODO: should be able to provide a custom Demodulator for a soundmodem
) {
std::thread::spawn(move || {
// TODO: should be able to provide a custom Demodulator for a soundmodem
input.start(event_tx.clone());
output.start(event_tx.clone(), out_buffer.clone());
}
input.start(event_tx.clone());
output.start(event_tx.clone(), out_buffer.clone());
}
SoundmodemEvent::DidReadFromOutputBuffer { len, timestamp } => {
let (occupied, internal_latency) = {
let out_buffer = out_buffer.read().unwrap();
SoundmodemEvent::DidReadFromOutputBuffer { len, timestamp } => {
let (occupied, internal_latency) = {
let out_buffer = out_buffer.read().unwrap();