From 0327fe30201889de1558a9d73d85ec4102d3bb5e Mon Sep 17 00:00:00 2001 From: David Kopf Date: Sat, 11 Feb 2012 15:15:00 -0500 Subject: [PATCH] Turn off RDC before SLIP prefix interchange. Disable SIN/SUT prints, leave off-route prints. --- examples/ipv6/rpl-border-router/border-router.c | 11 +++++++---- examples/ipv6/rpl-border-router/slip-bridge.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/ipv6/rpl-border-router/border-router.c b/examples/ipv6/rpl-border-router/border-router.c index db1b1058d..418425ff9 100644 --- a/examples/ipv6/rpl-border-router/border-router.c +++ b/examples/ipv6/rpl-border-router/border-router.c @@ -225,6 +225,7 @@ PROCESS_THREAD(border_router_process, ev, data) rpl_dag_t *dag; PROCESS_BEGIN(); + prefix_set = 0; PROCESS_PAUSE(); @@ -233,6 +234,12 @@ PROCESS_THREAD(border_router_process, ev, data) PRINTF("RPL-Border router started\n"); + /* The border router runs with a 100% duty cycle in order to ensure high + packet reception rates. + Note if the MAC RDC is not turned off now, aggressive power management of the + cpu will interfere with establishing the SLIP connection */ + NETSTACK_MAC.off(1); + /* Request prefix until it has been received */ while(!prefix_set) { etimer_set(&et, CLOCK_SECOND); @@ -250,10 +257,6 @@ PROCESS_THREAD(border_router_process, ev, data) print_local_addresses(); #endif - /* The border router runs with a 100% duty cycle in order to ensure high - packet reception rates. */ - NETSTACK_MAC.off(1); - while(1) { PROCESS_YIELD(); if (ev == sensors_event && data == &button_sensor) { diff --git a/examples/ipv6/rpl-border-router/slip-bridge.c b/examples/ipv6/rpl-border-router/slip-bridge.c index 61ea5a358..3b4d26af7 100644 --- a/examples/ipv6/rpl-border-router/slip-bridge.c +++ b/examples/ipv6/rpl-border-router/slip-bridge.c @@ -57,7 +57,7 @@ static uip_ipaddr_t last_sender; static void slip_input_callback(void) { - PRINTF("SIN: %u\n", uip_len); + // PRINTF("SIN: %u\n", uip_len); if(uip_buf[0] == '!') { PRINTF("Got configuration message of type %c\n", uip_buf[1]); uip_len = 0; @@ -113,7 +113,7 @@ output(void) PRINT6ADDR(&UIP_IP_BUF->destipaddr); PRINTF("\n"); } else { - PRINTF("SUT: %u\n", uip_len); + // PRINTF("SUT: %u\n", uip_len); slip_send(); } }