X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/9058451e46e4d36264282abe381aa9b6fd2c773f..HEAD:/m17core/src/decode.rs diff --git a/m17core/src/decode.rs b/m17core/src/decode.rs index 76c40d3..6c8e02b 100755 --- a/m17core/src/decode.rs +++ b/m17core/src/decode.rs @@ -62,6 +62,7 @@ pub(crate) fn sync_burst_correlation(target: [i8; 8], samples: &[f32]) -> (f32, if gain < SYNC_MIN_GAIN { return (f32::MAX, gain, shift); } + let mut diff = 0.0; for i in 0..8 { let sym_diff = (((samples[i * 10] - shift) / gain) - target[i] as f32).abs(); @@ -143,8 +144,8 @@ pub(crate) fn parse_packet(frame: &[f32] /* length 192 */) -> Option 0; - let number = packet[25] >> 3; + let final_frame = (packet[25] & 0x80) > 0; + let number = (packet[25] >> 2) & 0x1f; let counter = if final_frame { PacketFrameCounter::FinalFrame { payload_len: number as usize,