Skip to content

Commit

Permalink
AP_RangeFinder: RDS02UF: avoid nuking partial messages after good parse
Browse files Browse the repository at this point in the history
there may be a fragment of another packet in the buffer
  • Loading branch information
peterbarker committed Sep 3, 2024
1 parent 61e83dc commit 7a93063
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/AP_RangeFinder/AP_RangeFinder_RDS02UF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ bool AP_RangeFinder_RDS02UF::get_reading(float &distance_m)
}
}

// reset buffer
body_length = 0;
// consume this message:
move_header_in_buffer(ARRAY_SIZE(u.parse_buffer));

return true;
}

Expand Down

0 comments on commit 7a93063

Please sign in to comment.