From b6d599b712fe5ca1522147232fc249e05c257818 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Mon, 21 Sep 2015 18:22:45 +0200 Subject: [PATCH] RPL: added callback for DIO interval update --- core/net/rpl/rpl-timers.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/net/rpl/rpl-timers.c b/core/net/rpl/rpl-timers.c index 54cb3ddef..f8c913b61 100644 --- a/core/net/rpl/rpl-timers.c +++ b/core/net/rpl/rpl-timers.c @@ -50,6 +50,11 @@ #define DEBUG DEBUG_NONE #include "net/ip/uip-debug.h" +/* A configurable function called after update of the RPL DIO interval */ +#ifdef RPL_CALLBACK_NEW_DIO_INTERVAL +void RPL_CALLBACK_NEW_DIO_INTERVAL(uint8_t dio_interval); +#endif /* RPL_CALLBACK_NEW_DIO_INTERVAL */ + /*---------------------------------------------------------------------------*/ static struct ctimer periodic_timer; @@ -124,6 +129,10 @@ new_dio_interval(rpl_instance_t *instance) /* schedule the timer */ PRINTF("RPL: Scheduling DIO timer %lu ticks in future (Interval)\n", ticks); ctimer_set(&instance->dio_timer, ticks, &handle_dio_timer, instance); + +#ifdef RPL_CALLBACK_NEW_DIO_INTERVAL + RPL_CALLBACK_NEW_DIO_INTERVAL(instance->dio_intcurrent); +#endif /* RPL_CALLBACK_NEW_DIO_INTERVAL */ } /*---------------------------------------------------------------------------*/ static void