* Change retransmission scheme both for unicasts and for
broadcasts. Only count retransmissions that actually caused transmission (according to the hardware).
This commit is contained in:
parent
b9a3721076
commit
d34db6ee92
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: cc2420.c,v 1.13 2007/05/02 14:51:20 bg- Exp $
|
* @(#)$Id: cc2420.c,v 1.14 2007/05/07 12:01:32 bg- Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* This code is almost device independent and should be easy to port.
|
* This code is almost device independent and should be easy to port.
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#include "dev/cc2420.h"
|
#include "dev/cc2420.h"
|
||||||
#include "dev/cc2420_const.h"
|
#include "dev/cc2420_const.h"
|
||||||
|
|
||||||
#define NDEBUG
|
//#define NDEBUG
|
||||||
#include "lib/assert.h"
|
#include "lib/assert.h"
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
|
@ -525,15 +525,18 @@ PROCESS_THREAD(cc2420_retransmit_process, ev, data)
|
||||||
break;
|
break;
|
||||||
} else if (seq != last_used_seq)
|
} else if (seq != last_used_seq)
|
||||||
break; /* Transmitting different packet. */
|
break; /* Transmitting different packet. */
|
||||||
else if (n < MAX_RETRANSMISSIONS) {
|
else if (last_dst == 0xffff) {
|
||||||
int ret;
|
n++;
|
||||||
PRINTF("RETRANS %d %d.%d\n", n, last_dst >> 8, last_dst & 0xff);
|
if (cc2420_resend() == UIP_FW_OK) {
|
||||||
ret = cc2420_resend();
|
PRINTF("REBCAST %d\n", n);
|
||||||
if (last_dst == 0xffff && ret == UIP_FW_OK) {
|
|
||||||
etimer_stop(&etimer);
|
etimer_stop(&etimer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
n++;
|
} else if (n < MAX_RETRANSMISSIONS) {
|
||||||
|
if (cc2420_resend() == UIP_FW_OK) {
|
||||||
|
n++;
|
||||||
|
PRINTF("RETRANS %d to %d.%d\n", n, last_dst & 0xff, last_dst >> 8);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue