Trickle Timer

Implementation of a generic Trickle Algorithm (RFC 6206) More...

Detailed Description

See also
https://tools.ietf.org/html/rfc6206

Files

file  trickle.h
 Trickle timer interface definition.
 

Data Structures

struct  trickle_callback_t
 Trickle callback function with arguments. More...
 
struct  trickle_t
 all state variables of a trickle timer More...
 

Functions

void trickle_reset_timer (trickle_t *trickle)
 resets the trickle timer More...
 
void trickle_start (kernel_pid_t pid, trickle_t *trickle, uint16_t msg_type, uint32_t Imin, uint8_t Imax, uint8_t k)
 start the trickle timer More...
 
void trickle_stop (trickle_t *trickle)
 stops the trickle timer More...
 
void trickle_increment_counter (trickle_t *trickle)
 increments the counter by one More...
 
void trickle_interval (trickle_t *trickle)
 is called after the interval is over and calculates the next interval More...
 
void trickle_callback (trickle_t *trickle)
 is called after the interval is over and executes callback function More...
 

Function Documentation

◆ trickle_callback()

void trickle_callback ( trickle_t trickle)
Parameters
[in]trickletrickle timer

◆ trickle_increment_counter()

void trickle_increment_counter ( trickle_t trickle)
Parameters
[in]trickletrickle timer

◆ trickle_interval()

void trickle_interval ( trickle_t trickle)
Precondition
(trickle->I > 0) required for trickle algorithm to work
Parameters
[in]trickletrickle timer

◆ trickle_reset_timer()

void trickle_reset_timer ( trickle_t trickle)
Precondition
trickle->I > trickle->Imin
See also
https://tools.ietf.org/html/rfc6206#section-4.2, number 6
Parameters
[in]tricklethe trickle timer

◆ trickle_start()

void trickle_start ( kernel_pid_t  pid,
trickle_t trickle,
uint16_t  msg_type,
uint32_t  Imin,
uint8_t  Imax,
uint8_t  k 
)
Precondition
Imin > 0
(Imin << Imax) < (UINT32_MAX / 2) to avoid overflow of uint32_t
Parameters
[in]pidtarget thread
[in]trickletrickle timer
[in]msg_typemsg_t.type for messages
[in]Iminminimum interval
[in]Imaxmaximum interval
[in]kredundancy constant

◆ trickle_stop()

void trickle_stop ( trickle_t trickle)
Parameters
[in]trickletrickle timer