Skip to content

Commit

Permalink
The collect view functions now take the node's routing metric, not th…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
adamdunkels committed Oct 24, 2010
1 parent fd4c0e6 commit d0852a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions apps/collect-view/collect-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
*/

/**
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions apps/collect-view/collect-view.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ struct collect_view_data_msg {
uint16_t lpm;
uint16_t transmit;
uint16_t listen;
rimeaddr_t parent;
uint16_t parent;
uint16_t parent_etx;
uint16_t parent_rtmetric;
uint16_t current_rtmetric;
uint16_t num_neighbors;
uint16_t beacon_interval;

Expand All @@ -25,7 +25,7 @@ struct collect_view_data_msg {
void collect_view_construct_message(struct collect_view_data_msg *msg,
rimeaddr_t *parent,
uint16_t etx_to_parent,
uint16_t rtmetric_rtmetric,
uint16_t current_rtmetric,
uint16_t num_neighbors,
uint16_t beacon_interval);

Expand Down

0 comments on commit d0852a5

Please sign in to comment.