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.
Message
Re: [AVR-Chat] Bit fields
2010-06-07 by Russell Shaw
Attachments
- No local attachments were found for this message.