mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-02 04:30:48 +00:00
Bugfix: energy consumption for retransmissions was miscounted
This commit is contained in:
parent
af4ce9ba9e
commit
74f1754d88
@ -241,6 +241,13 @@ packet_sent(void *ptr, int status, int num_transmissions)
|
|||||||
PRINTF("csma: retransmitting with time %lu %p\n", time, q);
|
PRINTF("csma: retransmitting with time %lu %p\n", time, q);
|
||||||
ctimer_set(&transmit_timer, time,
|
ctimer_set(&transmit_timer, time,
|
||||||
transmit_queued_packet, NULL);
|
transmit_queued_packet, NULL);
|
||||||
|
|
||||||
|
/* This is needed to correctly attribute energy that we spent
|
||||||
|
transmitting this packet. */
|
||||||
|
q = list_head(queued_packet_list);
|
||||||
|
queuebuf_free(q->buf);
|
||||||
|
q->buf = queuebuf_new_from_packetbuf();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PRINTF("csma: drop with status %d after %d transmissions, %d collisions\n",
|
PRINTF("csma: drop with status %d after %d transmissions, %d collisions\n",
|
||||||
status, q->transmissions, q->collisions);
|
status, q->transmissions, q->collisions);
|
||||||
|
Loading…
Reference in New Issue
Block a user