use u8 when writing rime addresses.

This commit is contained in:
nvt-se 2009-03-21 20:53:06 +00:00
parent 950f7696a3
commit cc85a36722
2 changed files with 9 additions and 6 deletions

View file

@ -33,7 +33,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: neighbor.c,v 1.16 2008/11/12 10:47:17 zhitao Exp $ * $Id: neighbor.c,v 1.17 2009/03/21 20:53:07 nvt-se Exp $
*/ */
/** /**
@ -252,7 +252,9 @@ neighbor_remove(rimeaddr_t *addr)
for(n = list_head(neighbors_list); n != NULL; n = n->next) { for(n = list_head(neighbors_list); n != NULL; n = n->next) {
if(rimeaddr_cmp(&n->addr, addr)) { if(rimeaddr_cmp(&n->addr, addr)) {
PRINTF("%d: removing %d\n", rimeaddr_node_addr.u16[0], addr->u16[0]); PRINTF("%d.%d: removing %d.%d\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
addr->u8[0], addr->u8[1]);
rimeaddr_copy(&n->addr, &rimeaddr_null); rimeaddr_copy(&n->addr, &rimeaddr_null);
n->rtmetric = RTMETRIC_MAX; n->rtmetric = RTMETRIC_MAX;
list_remove(neighbors_list, n); list_remove(neighbors_list, n);

View file

@ -33,7 +33,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: rmh.c,v 1.8 2009/03/12 21:58:21 adamdunkels Exp $ * $Id: rmh.c,v 1.9 2009/03/21 20:53:06 nvt-se Exp $
*/ */
/** /**
@ -70,8 +70,9 @@ received(struct runicast_conn *uc, rimeaddr_t *from, uint8_t seqno)
struct data_hdr *msg = packetbuf_dataptr(); struct data_hdr *msg = packetbuf_dataptr();
rimeaddr_t *nexthop; rimeaddr_t *nexthop;
PRINTF("data_packet_received from %d towards %d len %d\n", from->u16[0], PRINTF("data_packet_received from %d.%d towards %d.%d len %d\n",
msg->dest.u16[0], from->u8[0], from->u8[1],
msg->dest.u8[0], msg->dest.u8[1],
packetbuf_datalen()); packetbuf_datalen());
if(rimeaddr_cmp(&msg->dest, &rimeaddr_node_addr)) { if(rimeaddr_cmp(&msg->dest, &rimeaddr_node_addr)) {
@ -87,7 +88,7 @@ received(struct runicast_conn *uc, rimeaddr_t *from, uint8_t seqno)
&msg->dest, from, msg->hops); &msg->dest, from, msg->hops);
} }
if(nexthop) { if(nexthop) {
PRINTF("forwarding to %d\n", rt->nexthop.u16[0]); PRINTF("forwarding to %d.%d\n", nexthop->u8[0], nexthop->u8[1]);
msg->hops++; msg->hops++;
runicast_send(&c->c, nexthop, c->num_rexmit); runicast_send(&c->c, nexthop, c->num_rexmit);
} }