Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavnative.c: implement packet_rx_drop_count to fix ArduPilot's logging of MAV.rxdp #623

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions mavnative/mavnative.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,14 @@ MAVLINK_HELPER uint8_t py_mavlink_parse_char(uint8_t c, py_message_t* pymsg, mav
}

bufferIndex++;
// If a message has been sucessfully decoded, check index
// If a message has been successfully decoded, check index
if (status->msg_received == 1)
{
//while(status->current_seq != rxmsg->seq)
//{
// status->packet_rx_drop_count++;
// status->current_seq++;
//}
status->current_rx_seq = rxmsg->seq;
if (status->current_rx_seq != rxmsg->seq)
{
status->packet_rx_drop_count += (uint8_t)(rxmsg->seq - status->current_rx_seq);
}
status->current_rx_seq = rxmsg->seq + 1;
// Initial condition: If no packet has been received so far, drop count is undefined
if (status->packet_rx_success_count == 0) status->packet_rx_drop_count = 0;
// Count this packet as received
Expand Down