* 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:
bg- 2007-05-07 12:01:32 +00:00
parent b9a3721076
commit d34db6ee92

View File

@ -28,7 +28,7 @@
*
* 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.
@ -56,7 +56,7 @@
#include "dev/cc2420.h"
#include "dev/cc2420_const.h"
#define NDEBUG
//#define NDEBUG
#include "lib/assert.h"
#ifdef NDEBUG
@ -525,15 +525,18 @@ PROCESS_THREAD(cc2420_retransmit_process, ev, data)
break;
} else if (seq != last_used_seq)
break; /* Transmitting different packet. */
else if (n < MAX_RETRANSMISSIONS) {
int ret;
PRINTF("RETRANS %d %d.%d\n", n, last_dst >> 8, last_dst & 0xff);
ret = cc2420_resend();
if (last_dst == 0xffff && ret == UIP_FW_OK) {
else if (last_dst == 0xffff) {
n++;
if (cc2420_resend() == UIP_FW_OK) {
PRINTF("REBCAST %d\n", n);
etimer_stop(&etimer);
break;
}
} 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 {
break;
}