X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/ed89ed42024f30e94e27084ec2b9ee0acb038b62..cd3124ca701db72364554f91fdb6a119faa876ec:/m17core/src/tnc.rs?ds=sidebyside diff --git a/m17core/src/tnc.rs b/m17core/src/tnc.rs index 8b8e5a1..f3622e5 100644 --- a/m17core/src/tnc.rs +++ b/m17core/src/tnc.rs @@ -1,4 +1,5 @@ use crate::kiss::{KissBuffer, KissFrame}; +use crate::modem::ModulatorFrame; use crate::protocol::{Frame, LichCollection, LsfFrame, Mode, PacketFrameCounter}; /// Handles the KISS protocol and frame management for `SoftModulator` and `SoftDemodulator`. @@ -65,6 +66,7 @@ impl SoftTnc { let end = start + payload_len; rx.packet[start..(start + payload_len)] .copy_from_slice(&packet.payload); + // TODO: compatible packets should be sent on port 0 too let kiss = KissFrame::new_full_packet(&rx.lsf.0, &rx.packet[0..end]) .unwrap(); @@ -128,15 +130,19 @@ impl SoftTnc { } } - /// Update the number of samples that have been received by the incoming stream, as a form of timekeeping - pub fn advance_samples(&mut self, _samples: u64) {} - pub fn set_data_carrier_detect(&mut self, _dcd: bool) {} + + pub fn set_now(&mut self, samples: u64) {} + + pub fn set_tx_end_time(&mut self, in_samples: usize) { + // This is a relative time from now, expressed in samples + // Use the time from set_now() to decide when to drop PTT + } - pub fn read_tx_frame(&mut self) -> Result, SoftTncError> { - // yes we want to deal with Frames here + pub fn read_tx_frame(&mut self) -> Option { + // yes we want to deal with frames here // it's important to establish successful decode that SoftDemodulator is aware of the frame innards - Ok(None) + None } /// Read KISS message to be sent to host.