jn516x examples: print out network state periodically
This commit is contained in:
parent
3ff44f77b9
commit
bef32c20fb
4 changed files with 69 additions and 3 deletions
|
@ -58,6 +58,7 @@ AUTOSTART_PROCESSES(&node_process);
|
|||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(node_process, ev, data)
|
||||
{
|
||||
static struct etimer et;
|
||||
PROCESS_BEGIN();
|
||||
|
||||
/* 3 possible roles:
|
||||
|
@ -71,8 +72,6 @@ PROCESS_THREAD(node_process, ev, data)
|
|||
#if CONFIG_VIA_BUTTON
|
||||
{
|
||||
#define CONFIG_WAIT_TIME 10
|
||||
static struct etimer et;
|
||||
|
||||
SENSORS_ACTIVATE(button_sensor);
|
||||
etimer_set(&et, CLOCK_SECOND * CONFIG_WAIT_TIME);
|
||||
|
||||
|
@ -103,6 +102,16 @@ PROCESS_THREAD(node_process, ev, data)
|
|||
rpl_tools_init(&prefix);
|
||||
} else {
|
||||
rpl_tools_init(NULL);
|
||||
} PROCESS_END();
|
||||
}
|
||||
|
||||
/* Print out routing tables every minute */
|
||||
etimer_set(&et, CLOCK_SECOND * 60);
|
||||
while(1) {
|
||||
print_network_status();
|
||||
PROCESS_YIELD_UNTIL(etimer_expired(&et));
|
||||
etimer_reset(&et);
|
||||
}
|
||||
|
||||
PROCESS_END();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue