Skip to content

Commit

Permalink
mavnative.c: fix logging of MAV.rxdp by implementing packet_rx_drop_c…
Browse files Browse the repository at this point in the history
…ount
  • Loading branch information
amilcarlucas committed Jan 20, 2022
1 parent 57a6ab0 commit 867403f
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit 867403f

Please sign in to comment.