mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-10-22 04:26:16 +00:00
examples/rpl-border-router: Fix two minor warnings.
- Remove unused variable i in generate_routes. - Add cast to unsigned long for printf(..%lu..) in generate_routes. Signed-off-by: Joakim Gebart <joakim.gebart@eistec.se>
This commit is contained in:
parent
fd5e79d0db
commit
d4179a0a0c
@ -99,7 +99,7 @@ PROCESS_THREAD(webserver_nogui_process, ev, data)
|
|||||||
PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);
|
PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event);
|
||||||
httpd_appcall(data);
|
httpd_appcall(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);
|
AUTOSTART_PROCESSES(&border_router_process,&webserver_nogui_process);
|
||||||
@ -143,7 +143,6 @@ ipaddr_add(const uip_ipaddr_t *addr)
|
|||||||
static
|
static
|
||||||
PT_THREAD(generate_routes(struct httpd_state *s))
|
PT_THREAD(generate_routes(struct httpd_state *s))
|
||||||
{
|
{
|
||||||
static int i;
|
|
||||||
static uip_ds6_route_t *r;
|
static uip_ds6_route_t *r;
|
||||||
static uip_ds6_nbr_t *nbr;
|
static uip_ds6_nbr_t *nbr;
|
||||||
#if BUF_USES_STACK
|
#if BUF_USES_STACK
|
||||||
@ -176,7 +175,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||||||
switch (nbr->state) {
|
switch (nbr->state) {
|
||||||
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
||||||
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
||||||
case NBR_STALE: ADD(" STALE");break;
|
case NBR_STALE: ADD(" STALE");break;
|
||||||
case NBR_DELAY: ADD(" DELAY");break;
|
case NBR_DELAY: ADD(" DELAY");break;
|
||||||
case NBR_PROBE: ADD(" NBR_PROBE");break;
|
case NBR_PROBE: ADD(" NBR_PROBE");break;
|
||||||
}
|
}
|
||||||
@ -188,7 +187,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||||||
switch (nbr->state) {
|
switch (nbr->state) {
|
||||||
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
case NBR_INCOMPLETE: ADD(" INCOMPLETE");break;
|
||||||
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
case NBR_REACHABLE: ADD(" REACHABLE");break;
|
||||||
case NBR_STALE: ADD(" STALE");break;
|
case NBR_STALE: ADD(" STALE");break;
|
||||||
case NBR_DELAY: ADD(" DELAY");break;
|
case NBR_DELAY: ADD(" DELAY");break;
|
||||||
case NBR_PROBE: ADD(" NBR_PROBE");break;
|
case NBR_PROBE: ADD(" NBR_PROBE");break;
|
||||||
}
|
}
|
||||||
@ -247,7 +246,7 @@ PT_THREAD(generate_routes(struct httpd_state *s))
|
|||||||
ADD("/%u (via ", r->length);
|
ADD("/%u (via ", r->length);
|
||||||
ipaddr_add(uip_ds6_route_nexthop(r));
|
ipaddr_add(uip_ds6_route_nexthop(r));
|
||||||
if(1 || (r->state.lifetime < 600)) {
|
if(1 || (r->state.lifetime < 600)) {
|
||||||
ADD(") %lus\n", r->state.lifetime);
|
ADD(") %lus\n", (unsigned long)r->state.lifetime);
|
||||||
} else {
|
} else {
|
||||||
ADD(")\n");
|
ADD(")\n");
|
||||||
}
|
}
|
||||||
@ -340,7 +339,7 @@ PROCESS_THREAD(border_router_process, ev, data)
|
|||||||
PROCESS_BEGIN();
|
PROCESS_BEGIN();
|
||||||
|
|
||||||
/* While waiting for the prefix to be sent through the SLIP connection, the future
|
/* While waiting for the prefix to be sent through the SLIP connection, the future
|
||||||
* border router can join an existing DAG as a parent or child, or acquire a default
|
* border router can join an existing DAG as a parent or child, or acquire a default
|
||||||
* router that will later take precedence over the SLIP fallback interface.
|
* router that will later take precedence over the SLIP fallback interface.
|
||||||
* Prevent that by turning the radio off until we are initialized as a DAG root.
|
* Prevent that by turning the radio off until we are initialized as a DAG root.
|
||||||
*/
|
*/
|
||||||
@ -359,7 +358,7 @@ PROCESS_THREAD(border_router_process, ev, data)
|
|||||||
cpu will interfere with establishing the SLIP connection */
|
cpu will interfere with establishing the SLIP connection */
|
||||||
NETSTACK_MAC.off(1);
|
NETSTACK_MAC.off(1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Request prefix until it has been received */
|
/* Request prefix until it has been received */
|
||||||
while(!prefix_set) {
|
while(!prefix_set) {
|
||||||
etimer_set(&et, CLOCK_SECOND);
|
etimer_set(&et, CLOCK_SECOND);
|
||||||
@ -371,7 +370,7 @@ PROCESS_THREAD(border_router_process, ev, data)
|
|||||||
* Since we are the DAG root, reception delays would constrain mesh throughbut.
|
* Since we are the DAG root, reception delays would constrain mesh throughbut.
|
||||||
*/
|
*/
|
||||||
NETSTACK_MAC.off(1);
|
NETSTACK_MAC.off(1);
|
||||||
|
|
||||||
#if DEBUG || 1
|
#if DEBUG || 1
|
||||||
print_local_addresses();
|
print_local_addresses();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user