mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
RPL probing: make delay function user-configurable
This commit is contained in:
parent
2dd182f4a8
commit
6a5f238255
@ -249,4 +249,14 @@
|
|||||||
#define RPL_PROBING_SEND_FUNC(instance, addr) dio_output((instance), (addr))
|
#define RPL_PROBING_SEND_FUNC(instance, addr) dio_output((instance), (addr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function used to calculate next RPL probing interval
|
||||||
|
* */
|
||||||
|
#ifdef RPL_CONF_PROBING_DELAY_FUNC
|
||||||
|
#define RPL_PROBING_DELAY_FUNC RPL_CONF_PROBING_DELAY_FUNC
|
||||||
|
#else
|
||||||
|
#define RPL_PROBING_DELAY_FUNC() ((RPL_PROBING_INTERVAL / 2) \
|
||||||
|
+ random_rand() % (RPL_PROBING_INTERVAL))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* RPL_CONF_H */
|
#endif /* RPL_CONF_H */
|
||||||
|
@ -414,9 +414,7 @@ handle_probing_timer(void *ptr)
|
|||||||
void
|
void
|
||||||
rpl_schedule_probing(rpl_instance_t *instance)
|
rpl_schedule_probing(rpl_instance_t *instance)
|
||||||
{
|
{
|
||||||
clock_time_t delay = (RPL_PROBING_INTERVAL / 2) +
|
ctimer_set(&instance->probing_timer, RPL_PROBING_DELAY_FUNC(),
|
||||||
random_rand() % (RPL_PROBING_INTERVAL / 2);
|
|
||||||
ctimer_set(&instance->probing_timer, delay,
|
|
||||||
handle_probing_timer, instance);
|
handle_probing_timer, instance);
|
||||||
}
|
}
|
||||||
#endif /* RPL_WITH_PROBING */
|
#endif /* RPL_WITH_PROBING */
|
||||||
|
Loading…
Reference in New Issue
Block a user