]>
code.octet-stream.net Git - m17rt/blob - m17app/src/adapter.rs
57e01bbbabae6e35947a07ceacdb50219446e67b
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
) {}
7 fn adapter_removed(&self) {}
8 fn tnc_started(&self) {}
9 fn tnc_closed(&self) {}
12 _link_setup
: LinkSetup
,
13 _packet_type
: PacketType
,
19 pub trait StreamAdapter
: Send
+ Sync
+ '
static {
20 fn adapter_registered(&self, _id
: usize, _handle
: TxHandle
) {}
21 fn adapter_removed(&self) {}
22 fn tnc_started(&self) {}
23 fn tnc_closed(&self) {}
24 fn stream_began(&self, _link_setup
: LinkSetup
) {}
25 fn stream_data(&self, _frame_number
: u16, _is_final
: bool
, _data
: Arc
<[u8; 16]>) {}
28 // fn stream_lost(&self);
29 // fn stream_assembled_text_block()
30 // fn stream_gnss_data()
31 // fn stream_extended_callsign_data()
33 // fn stream_tx_ended_early(&self); // underrun/overrun