AP_RangeFinder: RDS02UF: avoid nuking partial messages after good parse

there may be a fragment of another packet in the buffer
This commit is contained in:
Peter Barker 2024-08-22 20:55:20 +10:00 committed by Peter Barker
parent 61e83dcd0e
commit 7a930637e0
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}