Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Trickle Algorithm Library

Trickle algorithm library . More...

Data Structures

struct  net_trickle
 The variable names are taken directly from RFC 6206 when applicable. More...
 

Typedefs

typedef void(* net_trickle_cb_t) (struct net_trickle *trickle, bool do_suppress, void *user_data)
 Trickle timer callback.
 

Functions

int net_trickle_create (struct net_trickle *trickle, uint32_t Imin, uint8_t Imax, uint8_t k)
 Create a Trickle timer.
 
int net_trickle_start (struct net_trickle *trickle, net_trickle_cb_t cb, void *user_data)
 Start a Trickle timer.
 
int net_trickle_stop (struct net_trickle *trickle)
 Stop a Trickle timer.
 
void net_trickle_consistency (struct net_trickle *trickle)
 To be called by the protocol handler when it hears a consistent network transmission.
 
void net_trickle_inconsistency (struct net_trickle *trickle)
 To be called by the protocol handler when it hears an inconsistent network transmission.
 
static bool net_trickle_is_running (struct net_trickle *trickle)
 Check if the Trickle timer is running or not.
 

Detailed Description

Trickle algorithm library .

Since
1.7
Version
0.8.0

Typedef Documentation

◆ net_trickle_cb_t

typedef void(* net_trickle_cb_t) (struct net_trickle *trickle, bool do_suppress, void *user_data)

#include <zephyr/net/trickle.h>

Trickle timer callback.

The callback is called after Trickle timeout expires.

Parameters
trickleThe trickle context to use.
do_suppressIs TX allowed (true) or not (false).
user_dataThe user data given in net_trickle_start() call.

Function Documentation

◆ net_trickle_consistency()

void net_trickle_consistency ( struct net_trickle * trickle)

#include <zephyr/net/trickle.h>

To be called by the protocol handler when it hears a consistent network transmission.

Parameters
tricklePointer to Trickle struct.

◆ net_trickle_create()

int net_trickle_create ( struct net_trickle * trickle,
uint32_t Imin,
uint8_t Imax,
uint8_t k )

#include <zephyr/net/trickle.h>

Create a Trickle timer.

Parameters
tricklePointer to Trickle struct.
IminImin configuration parameter in ms.
ImaxMax number of doublings.
kRedundancy constant parameter. See RFC 6206 for details.
Returns
Return 0 if ok and <0 if error.

◆ net_trickle_inconsistency()

void net_trickle_inconsistency ( struct net_trickle * trickle)

#include <zephyr/net/trickle.h>

To be called by the protocol handler when it hears an inconsistent network transmission.

Parameters
tricklePointer to Trickle struct.

◆ net_trickle_is_running()

static bool net_trickle_is_running ( struct net_trickle * trickle)
inlinestatic

#include <zephyr/net/trickle.h>

Check if the Trickle timer is running or not.

Parameters
tricklePointer to Trickle struct.
Returns
Return True if timer is running and False if not.

◆ net_trickle_start()

int net_trickle_start ( struct net_trickle * trickle,
net_trickle_cb_t cb,
void * user_data )

#include <zephyr/net/trickle.h>

Start a Trickle timer.

Parameters
tricklePointer to Trickle struct.
cbUser callback to call at time T within the current trickle interval
user_dataUser pointer that is passed to callback.
Returns
Return 0 if ok and <0 if error.

◆ net_trickle_stop()

int net_trickle_stop ( struct net_trickle * trickle)

#include <zephyr/net/trickle.h>

Stop a Trickle timer.

Parameters
tricklePointer to Trickle struct.
Returns
Return 0 if ok and <0 if error.