The collect view functions now take the node's routing metric, not the parent's routing metric. The node ID is now given as the last two bytes of the Rime address, to make it play nice with 8-byte Rime addresses.

This commit is contained in:
adamdunkels 2010-10-24 21:03:52 +00:00
parent fd4c0e64aa
commit d0852a5bcc
2 changed files with 9 additions and 10 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: collect-view.c,v 1.3 2010/10/20 15:21:43 adamdunkels Exp $
* $Id: collect-view.c,v 1.4 2010/10/24 21:03:52 adamdunkels Exp $
*/
/**
@ -40,19 +40,18 @@
#include "contiki.h"
#include "net/rime/collect-neighbor.h"
#include "net/rime.h"
#include "net/rime/timesynch.h"
#include "collect-view.h"
#include <string.h>
/*---------------------------------------------------------------------------*/
void
collect_view_construct_message(struct collect_view_data_msg *msg,
rimeaddr_t *parent,
uint16_t parent_etx,
uint16_t parent_rtmetric,
uint16_t current_rtmetric,
uint16_t num_neighbors,
uint16_t beacon_interval)
{
@ -95,9 +94,9 @@ collect_view_construct_message(struct collect_view_data_msg *msg,
last_transmit = energest_type_time(ENERGEST_TYPE_TRANSMIT);
last_listen = energest_type_time(ENERGEST_TYPE_LISTEN);
rimeaddr_copy(&msg->parent, parent);
memcpy(&msg->parent, &parent->u8[RIMEADDR_SIZE - 2], 2);
msg->parent_etx = parent_etx;
msg->parent_rtmetric = parent_rtmetric;
msg->current_rtmetric = current_rtmetric;
msg->num_neighbors = num_neighbors;
msg->beacon_interval = beacon_interval;