Merge remote-tracking branch 'sf/master' into rpl-patch

This commit is contained in:
Nicolas Tsiftes 2011-11-21 14:59:31 +01:00
commit 0e32956a63
406 changed files with 26884 additions and 3635 deletions

View file

@ -5,6 +5,11 @@ PROJECT_SOURCEFILES += collect-common.c
WITH_UIP6=1
UIP_CONF_IPV6=1
CFLAGS+= -DUIP_CONF_IPV6_RPL
ifdef PERIOD
CFLAGS=-DPERIOD=$(PERIOD)
endif
all: $(CONTIKI_PROJECT)

View file

@ -26,7 +26,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: collect-common.c,v 1.2 2010/11/06 11:55:15 adamdunkels Exp $
*/
/**
@ -44,13 +43,16 @@
#include "collect-common.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
static unsigned long time_offset;
static int send_active = 1;
#ifndef PERIOD
#define PERIOD 60
#define RANDWAIT 60
#endif
#define RANDWAIT (PERIOD)
/*---------------------------------------------------------------------------*/
PROCESS(collect_common_process, "collect common process");

View file

@ -137,7 +137,9 @@ collect_common_send(void)
uip_ds6_nbr_t *nbr;
nbr = uip_ds6_nbr_lookup(&preferred_parent->addr);
if(nbr != NULL) {
rimeaddr_copy(&parent, (rimeaddr_t *)&nbr->ipaddr.u8[8]);
/* Use parts of the IPv6 address as the parent address, in reversed byte order. */
parent.u8[RIMEADDR_SIZE - 1] = nbr->ipaddr.u8[sizeof(uip_ipaddr_t) - 2];
parent.u8[RIMEADDR_SIZE - 2] = nbr->ipaddr.u8[sizeof(uip_ipaddr_t) - 1];
parent_etx = neighbor_info_get_metric((rimeaddr_t *) &nbr->lladdr) / 2;
}
}