/// Accepts `Voice` packets from a reflector and turns them into LSF and Stream frames.
///
/// This is the format required for the voice data to cross the KISS protocol boundary.
+#[derive(Debug, Default)]
pub struct VoiceToRf {
/// Link Setup most recently acquired
lsf: Option<LsfFrame>,
///
/// For a series of transmissions this object should be re-used so that Stream ID is correctly
/// changed after each new LSF.
+#[derive(Debug, Clone)]
pub struct RfToVoice {
lsf: LsfFrame,
stream_id: u16,
impl RfToVoice {
pub fn new(lsf: LsfFrame) -> Self {
- Self { lsf, stream_id: 0 }
+ // no_std "random"
+ let stream_id = &lsf as *const LsfFrame as u16;
+ Self { lsf, stream_id }
}
pub fn process_lsf(&mut self, lsf: LsfFrame) {