]> code.octet-stream.net Git - m17rt/blobdiff - m17core/src/modem.rs
Sound card input support for demodulation chain
[m17rt] / m17core / src / modem.rs
index af36ab4a88db3b38df0615a60ee2add25313590e..2f92ba9a7318a01c5fbf45399df50bfad43be476 100644 (file)
@@ -1,4 +1,6 @@
-use crate::decode::{parse_lsf, parse_stream, sync_burst_correlation, SyncBurst, SYNC_THRESHOLD};
+use crate::decode::{
+    parse_lsf, parse_packet, parse_stream, sync_burst_correlation, SyncBurst, SYNC_THRESHOLD,
+};
 use crate::protocol::Frame;
 use crate::shaping::RRC_48K;
 use log::debug;
 use crate::protocol::Frame;
 use crate::shaping::RRC_48K;
 use log::debug;
@@ -131,7 +133,11 @@ impl Demodulator for SoftDemodulator {
                             }
                         }
                         SyncBurst::Packet => {
                             }
                         }
                         SyncBurst::Packet => {
-                            debug!("Found PACKET at sample {} diff {}", start_sample, c.diff)
+                            debug!("Found PACKET at sample {} diff {}", start_sample, c.diff);
+                            if let Some(frame) = parse_packet(&pkt_samples) {
+                                self.suppress = 191 * 10;
+                                return Some(Frame::Packet(frame));
+                            }
                         }
                     }
                 }
                         }
                     }
                 }