From 6e28b1d3fb1ad75249dc7744c1f07d89ccd3201c Mon Sep 17 00:00:00 2001 From: nvt-se Date: Thu, 21 Oct 2010 19:46:21 +0000 Subject: [PATCH] Reduced ETX_LIMIT in order to avoid overflows. Removed ETX_LOSS_PENALTY and set packet_etx to ETX_LIMIT instead upon packet loss. --- core/net/neighbor-info.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/core/net/neighbor-info.c b/core/net/neighbor-info.c index 708587185..f39802f0d 100644 --- a/core/net/neighbor-info.c +++ b/core/net/neighbor-info.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor-info.c,v 1.11 2010/09/15 15:59:52 nvt-se Exp $ + * $Id: neighbor-info.c,v 1.12 2010/10/21 19:46:21 nvt-se Exp $ */ /** * \file @@ -48,16 +48,10 @@ #define PRINTF(...) #endif /* DEBUG */ -#ifndef ETX_CONF_LIMIT -#define ETX_LIMIT 31 -#else -#define ETX_LIMIT ETX_CONF_LIMIT -#endif /* !ETX_CONF_LIMIT */ - +#define ETX_LIMIT 15 #define ETX_SCALE 100 -#define ETX_ALPHA 80 +#define ETX_ALPHA 70 #define ETX_FIRST_GUESS 3 -#define ETX_LOSS_PENALTY ETX_LIMIT #define ETX2FIX(etx) ((etx) << 4) #define FIX2ETX(fix) ((fix) >> 4) @@ -135,7 +129,7 @@ neighbor_info_packet_sent(int status, int numtx) case MAC_TX_ERR: case MAC_TX_NOACK: default: - packet_etx = numtx + ETX_LOSS_PENALTY; + packet_etx = ETX_LIMIT; break; }