- fn adapter_registered(&self, id: usize, handle: TxHandle);
- fn adapter_removed(&self);
- fn tnc_started(&self);
- fn tnc_closed(&self);
- fn stream_began(&self, lsf: LsfFrame);
- fn stream_data(&self, frame_number: u16, is_final: bool, data: Arc<[u8; 16]>);
- fn stream_lost(&self);
-
- // TODO
+ /// TNC is online. New streams may now be received and it is okay to transmit.
+ fn start(&self, handle: TxHandle) -> Result<(), AdapterError> {
+ let _ = handle;
+ Ok(())
+ }
+
+ /// This adapter or the whole TNC has been shut down. There will be no more tx/rx. This is a
+ /// permanent operation.
+ fn close(&self) -> Result<(), AdapterError> {
+ Ok(())
+ }
+
+ /// A new incoming stream has begun.
+ ///
+ /// If we did not receive the end of the previous stream, this may occur even there was never a
+ /// `stream_data` where `is_final` is true.
+ fn stream_began(&self, link_setup: LinkSetup) {
+ let _ = link_setup;
+ }
+
+ /// A frame has been received for an ongoing incoming stream.
+ ///
+ /// It is not guaranteed to receive every frame. Frame numbers may not start from 0, and they will
+ /// wrap around to 0 after 0x7fff. If we receive an indication that the frame is the final one then
+ /// `is_final` is set. If the transmitter never sends that frame or we fail to receive it then the
+ /// stream may trail off without that being set. Implementors should consider setting an appropriate
+ /// timeout to consider a stream "dead" and wait for the next `stream_began`.
+ fn stream_data(&self, frame_number: u16, is_final: bool, data: Arc<[u8; 16]>) {
+ let _ = frame_number;
+ let _ = is_final;
+ let _ = data;
+ }
+
+ // TODO: callbacks for LICH metadata received