X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/71a448efcc3c8f53d523c291f12b0f08f3e2f372..9058451e46e4d36264282abe381aa9b6fd2c773f:/m17core/src/decode.rs diff --git a/m17core/src/decode.rs b/m17core/src/decode.rs index 7ec2224..76c40d3 100755 --- a/m17core/src/decode.rs +++ b/m17core/src/decode.rs @@ -94,7 +94,7 @@ pub(crate) fn parse_lsf(frame: &[f32] /* length 192 */) -> Option { None => return None, }; debug!("full lsf: {:?}", lsf.0); - let crc = lsf.crc(); + let crc = lsf.check_crc(); debug!("recv crc: {:04X}", crc); debug!("destination: {:?}", lsf.destination()); debug!("source: {:?}", lsf.source()); @@ -141,8 +141,10 @@ pub(crate) fn parse_packet(frame: &[f32] /* length 192 */) -> Option packet, None => return None, }; - let final_frame = (packet[25] & 0x80) > 0; - let number = (packet[25] >> 2) & 0x01f; + // TODO: the spec is inconsistent about which bit in packet[25] is EOF + // https://github.com/M17-Project/M17_spec/issues/147 + let final_frame = (packet[25] & 0x04) > 0; + let number = packet[25] >> 3; let counter = if final_frame { PacketFrameCounter::FinalFrame { payload_len: number as usize,