X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/21b7d95e42fd374a33e0f18d3e3f406642e46322..1a444762d8fd7d48e4f56a87c6bd77f837522d5d:/m17app/src/adapter.rs diff --git a/m17app/src/adapter.rs b/m17app/src/adapter.rs index 1bc0971..57e01bb 100644 --- a/m17app/src/adapter.rs +++ b/m17app/src/adapter.rs @@ -1,12 +1,34 @@ -use crate::app::TxHandle; -use m17core::protocol::{LsfFrame, PacketType}; +use crate::{app::TxHandle, link_setup::LinkSetup}; +use m17core::protocol::PacketType; use std::sync::Arc; pub trait PacketAdapter: Send + Sync + 'static { - fn adapter_registered(&self, handle: TxHandle); - fn tnc_started(&self); - fn tnc_closed(&self); - fn packet_received(&self, lsf: LsfFrame, packet_type: PacketType, content: Arc<[u8]>); + fn adapter_registered(&self, _id: usize, _handle: TxHandle) {} + fn adapter_removed(&self) {} + fn tnc_started(&self) {} + fn tnc_closed(&self) {} + fn packet_received( + &self, + _link_setup: LinkSetup, + _packet_type: PacketType, + _content: Arc<[u8]>, + ) { + } } -pub trait StreamAdapter: Send + Sync + 'static {} +pub trait StreamAdapter: Send + Sync + 'static { + fn adapter_registered(&self, _id: usize, _handle: TxHandle) {} + fn adapter_removed(&self) {} + fn tnc_started(&self) {} + fn tnc_closed(&self) {} + fn stream_began(&self, _link_setup: LinkSetup) {} + fn stream_data(&self, _frame_number: u16, _is_final: bool, _data: Arc<[u8; 16]>) {} + + // TODO + // fn stream_lost(&self); + // fn stream_assembled_text_block() + // fn stream_gnss_data() + // fn stream_extended_callsign_data() + + // fn stream_tx_ended_early(&self); // underrun/overrun +}