]>
code.octet-stream.net Git - m17rt/blob - m17app/src/adapter.rs
1 use crate::app
::TxHandle
;
2 use m17core
::protocol
::{LsfFrame
, PacketType
};
5 pub trait PacketAdapter
: Send
+ Sync
+ '
static {
6 fn adapter_registered(&self, id
: usize, handle
: TxHandle
);
7 fn adapter_removed(&self);
10 fn packet_received(&self, lsf
: LsfFrame
, packet_type
: PacketType
, content
: Arc
<[u8]>);
13 pub trait StreamAdapter
: Send
+ Sync
+ '
static {
14 fn adapter_registered(&self, id
: usize, handle
: TxHandle
);
15 fn adapter_removed(&self);
16 fn tnc_started(&self);
18 fn stream_began(&self, lsf
: LsfFrame
);
19 fn stream_data(&self, frame_number
: u16, is_final
: bool
, data
: Arc
<[u8; 16]>);
22 // fn stream_lost(&self);
23 // fn stream_assembled_text_block()
24 // fn stream_gnss_data()
25 // fn stream_extended_callsign_data()
27 // fn stream_tx_ended_early(&self); // underrun/overrun