]>
code.octet-stream.net Git - m17rt/blob - m17core/src/tnc.rs
79adaa491a1f0461cf96a8710524c2d27000f37d
1 use crate::protocol
::Frame
;
3 /// Handles the KISS protocol and frame management for `SoftModulator` and `SoftDemodulator`.
5 /// These components work alongside each other. User is responsible for chaining them together
6 /// or doing something else with the data.
10 /// Process an individual `Frame` that has been decoded by the modem.
11 pub fn handle_frame(&mut self, _frame
: Frame
) -> Result
<(), SoftTncError
> {
15 /// Update the number of samples that have been received by the incoming stream, as a form of timekeeping
16 pub fn advance_samples(&mut self, _samples
: u64) {}
18 pub fn set_data_carrier_detect(&mut self, _dcd
: bool
) {}
20 pub fn read_tx_frame(&mut self) -> Result
<Option
<Frame
>, SoftTncError
> {
21 // yes we want to deal with Frames here
22 // it's important to establish successful decode that SoftDemodulator is aware of the frame innards
26 pub fn read_kiss(&mut self, _buf
: &mut [u8]) -> Result
<usize, SoftTncError
> {
30 pub fn write_kiss(&mut self, _buf
: &[u8]) -> Result
<usize, SoftTncError
> {
36 pub enum SoftTncError
{
37 General(&'
static str),