Corrected the reported ETX in the initial callback, and fixed the coding style

This commit is contained in:
nvt-se 2010-12-15 14:35:07 +00:00
parent 1cc336f188
commit cd08939b38
2 changed files with 9 additions and 14 deletions

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: neighbor-info.c,v 1.17 2010/10/28 08:54:54 joxe Exp $
* $Id: neighbor-info.c,v 1.18 2010/12/15 14:35:07 nvt-se Exp $
*/
/**
* \file
@ -40,13 +40,8 @@
#include "net/neighbor-info.h"
#include "net/neighbor-attr.h"
#define DEBUG 0
#if DEBUG
#include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...)
#endif /* DEBUG */
#define DEBUG DEBUG_NONE
#include "net/uip-debug.h"
#define ETX_LIMIT 15
#define ETX_SCALE 100
@ -100,7 +95,7 @@ add_neighbor(const rimeaddr_t *addr)
break;
default:
if(subscriber_callback != NULL) {
subscriber_callback(addr, 1, ETX_FIRST_GUESS);
subscriber_callback(addr, 1, ETX2FIX(ETX_FIRST_GUESS));
}
break;
}
@ -139,7 +134,9 @@ neighbor_info_packet_sent(int status, int numtx)
break;
}
if (packet_etx > 0) update_etx(dest, packet_etx);
if(packet_etx > 0) {
update_etx(dest, packet_etx);
}
}
/*---------------------------------------------------------------------------*/
void

View File

@ -32,7 +32,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rpl.c,v 1.13 2010/11/03 15:41:23 adamdunkels Exp $
* $Id: rpl.c,v 1.14 2010/12/15 14:35:07 nvt-se Exp $
*/
/**
* \file
@ -128,13 +128,11 @@ rpl_link_neighbor_callback(const rimeaddr_t *addr, int known, int etx)
rpl_dag_t *dag;
rpl_parent_t *parent;
/* etx = FIX2ETX(etx); */
uip_ip6addr(&ipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, (uip_lladdr_t *)addr);
PRINTF("RPL: Neighbor ");
PRINT6ADDR(&ipaddr);
PRINTF(" is %sknown. ETX = %d\n", known ? "" : "no longer ", etx);
PRINTF(" is %sknown. ETX = %u\n", known ? "" : "no longer ", FIX2ETX(etx));
dag = rpl_get_dag(RPL_DEFAULT_INSTANCE);
if(dag == NULL) {