Bugfix: when a packet is sent by the RDC layer, we should count the number of transmissions made because a single callback can pertain to multiple transmissions at the RDC layer.

This commit is contained in:
Adam Dunkels 2014-03-24 08:36:18 +01:00
parent a1cd642e6e
commit 5b1a9f5bc2
1 changed files with 4 additions and 3 deletions

View File

@ -212,16 +212,17 @@ packet_sent(void *ptr, int status, int num_transmissions)
switch(status) { switch(status) {
case MAC_TX_OK: case MAC_TX_OK:
case MAC_TX_NOACK: case MAC_TX_NOACK:
n->transmissions++; n->transmissions += num_transmissions;
break; break;
case MAC_TX_COLLISION: case MAC_TX_COLLISION:
n->collisions++; n->collisions += num_transmissions;
break; break;
case MAC_TX_DEFERRED: case MAC_TX_DEFERRED:
n->deferrals++; n->deferrals += num_transmissions;
break; break;
} }
/* Find out what packet this callback refers to */
for(q = list_head(n->queued_packet_list); for(q = list_head(n->queued_packet_list);
q != NULL; q = list_item_next(q)) { q != NULL; q = list_item_next(q)) {
if(queuebuf_attr(q->buf, PACKETBUF_ATTR_MAC_SEQNO) == if(queuebuf_attr(q->buf, PACKETBUF_ATTR_MAC_SEQNO) ==