Improved DAO management.

This commit is contained in:
nvt-se 2010-12-17 15:24:25 +00:00
parent 79329573a0
commit 8f76c82433
4 changed files with 17 additions and 12 deletions

View file

@ -32,7 +32,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: rpl-timers.c,v 1.15 2010/12/15 12:12:27 nvt-se Exp $
* $Id: rpl-timers.c,v 1.16 2010/12/17 15:24:25 nvt-se Exp $
*/
/**
* \file
@ -224,10 +224,11 @@ rpl_schedule_dao(rpl_dag_t *dag)
if(!etimer_expired(&dag->dao_timer.etimer)) {
PRINTF("RPL: DAO timer already scheduled\n");
} else {
PRINTF("RPL: Scheduling DAO timer %u ticks in the future (%u %u)\n",
(unsigned)DEFAULT_DAO_LATENCY / dag->rank,
(unsigned)DEFAULT_DAO_LATENCY, (unsigned)dag->rank);
ctimer_set(&dag->dao_timer, DEFAULT_DAO_LATENCY,
expiration_time = DEFAULT_DAO_LATENCY / 2 +
(random_rand() % (DEFAULT_DAO_LATENCY));
PRINTF("RPL: Scheduling DAO timer %u ticks in the future\n",
(unsigned)expiration_time);
ctimer_set(&dag->dao_timer, expiration_time,
handle_dao_timer, dag);
}
}