summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
defaea0)
The GPS module sometimes sends incomplete NMEA messages such as this:
$GP$GGA...*
This changeset makes it so we'd only parse the second, complete message
in that example.
let hexdigits = b"0123456789abcdef";
while let Some(received) = try_read() {
let hexdigits = b"0123456789abcdef";
while let Some(received) = try_read() {
+ if received == b'$' {
+ self.state = ParseState::InPacket;
+ self.offset = 0;
+ self.checksum = 0x00;
+
+ continue;
+ }
+
match self.state {
ParseState::Start => {
match self.state {
ParseState::Start => {
- if received == b'$' {
- self.state = ParseState::InPacket;
- self.offset = 0;
- self.checksum = 0x00;
- }
},
ParseState::InPacket => {
if received == b'*' {
},
ParseState::InPacket => {
if received == b'*' {