]>
code.octet-stream.net Git - m17rt/blob - m17app/src/adapter.rs
1 use crate::{app
::TxHandle
, link_setup
::LinkSetup
};
2 use m17core
::protocol
::PacketType
;
5 pub trait PacketAdapter
: Send
+ Sync
+ '
static {
6 fn adapter_registered(&self, id
: usize, handle
: TxHandle
) {
10 fn adapter_removed(&self) {}
11 fn tnc_started(&self) {}
12 fn tnc_closed(&self) {}
13 fn packet_received(&self, link_setup
: LinkSetup
, packet_type
: PacketType
, content
: Arc
<[u8]>) {
20 pub trait StreamAdapter
: Send
+ Sync
+ '
static {
21 fn adapter_registered(&self, id
: usize, handle
: TxHandle
) {
25 fn adapter_removed(&self) {}
26 fn tnc_started(&self) {}
27 fn tnc_closed(&self) {}
28 fn stream_began(&self, link_setup
: LinkSetup
) {
31 fn stream_data(&self, frame_number
: u16, is_final
: bool
, data
: Arc
<[u8; 16]>) {
38 // fn stream_lost(&self);
39 // fn stream_assembled_text_block()
40 // fn stream_gnss_data()
41 // fn stream_extended_callsign_data()
43 // fn stream_tx_ended_early(&self); // underrun/overrun