Corrected the reported ETX in the initial callback, and fixed the coding style
This commit is contained in:
parent
1cc336f188
commit
cd08939b38
2 changed files with 9 additions and 14 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
* \file
|
||||||
|
@ -40,13 +40,8 @@
|
||||||
#include "net/neighbor-info.h"
|
#include "net/neighbor-info.h"
|
||||||
#include "net/neighbor-attr.h"
|
#include "net/neighbor-attr.h"
|
||||||
|
|
||||||
#define DEBUG 0
|
#define DEBUG DEBUG_NONE
|
||||||
#if DEBUG
|
#include "net/uip-debug.h"
|
||||||
#include <stdio.h>
|
|
||||||
#define PRINTF(...) printf(__VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define PRINTF(...)
|
|
||||||
#endif /* DEBUG */
|
|
||||||
|
|
||||||
#define ETX_LIMIT 15
|
#define ETX_LIMIT 15
|
||||||
#define ETX_SCALE 100
|
#define ETX_SCALE 100
|
||||||
|
@ -100,7 +95,7 @@ add_neighbor(const rimeaddr_t *addr)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(subscriber_callback != NULL) {
|
if(subscriber_callback != NULL) {
|
||||||
subscriber_callback(addr, 1, ETX_FIRST_GUESS);
|
subscriber_callback(addr, 1, ETX2FIX(ETX_FIRST_GUESS));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +134,9 @@ neighbor_info_packet_sent(int status, int numtx)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet_etx > 0) update_etx(dest, packet_etx);
|
if(packet_etx > 0) {
|
||||||
|
update_etx(dest, packet_etx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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
|
* \file
|
||||||
|
@ -128,13 +128,11 @@ rpl_link_neighbor_callback(const rimeaddr_t *addr, int known, int etx)
|
||||||
rpl_dag_t *dag;
|
rpl_dag_t *dag;
|
||||||
rpl_parent_t *parent;
|
rpl_parent_t *parent;
|
||||||
|
|
||||||
/* etx = FIX2ETX(etx); */
|
|
||||||
|
|
||||||
uip_ip6addr(&ipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);
|
uip_ip6addr(&ipaddr, 0xfe80, 0, 0, 0, 0, 0, 0, 0);
|
||||||
uip_ds6_set_addr_iid(&ipaddr, (uip_lladdr_t *)addr);
|
uip_ds6_set_addr_iid(&ipaddr, (uip_lladdr_t *)addr);
|
||||||
PRINTF("RPL: Neighbor ");
|
PRINTF("RPL: Neighbor ");
|
||||||
PRINT6ADDR(&ipaddr);
|
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);
|
dag = rpl_get_dag(RPL_DEFAULT_INSTANCE);
|
||||||
if(dag == NULL) {
|
if(dag == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue