Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Bit fields

2010-06-07 by Russell Shaw

David VanHorn wrote:
> I have an application that needs to receive a variable number of
> packets in a block of data.
> I store them into a block-sized array with a packet-sized offset
> multiplied by the packet number..
> I need to know when I've received all the packets, but out-of-order
> and duplicate packets are possible.
> 
> I was thinking of doing this with a bit-field but that seems pretty messy.
> Are there other good ways to know when I've received all the packets,
> given that they may arrive out of order?

You could subtract the sequence number of the last packet of the last
batch from the highest sequence number packet of the latest batch of
received packets. The difference should agree with a counter for the
packets received in this batch so far.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.