ublox-rs / ublox

Rust crate to talk UBX protocol to u-blox GPS devices.
MIT License
54 stars 30 forks source link

Parser should return how many bytes are needed. #20

Open reitermarkus opened 2 years ago

reitermarkus commented 2 years ago

Currently, when the buffer length is < 6, None is returned. Instead, the parser should return the minimum number of bytes needed to progress, similar to nom's Err::Incomplete variant.

lkolbly commented 2 years ago

Thanks! Yes, the current parser I think can be greatly improved. I have a somewhat lower-level parser which I prototyped (see protocol::BufferHeadContents in the lkolbly/parse-buffer branch). Once we have a better handle on dealing with multiple protocol versions, I think this'll be the next thing I look at.