Microchip® Advanced Software Framework

trickle-timer.c File Reference

Trickle timer library implementation.

Author
George Oikonomou - oikon.nosp@m.omou.nosp@m.@user.nosp@m.s.so.nosp@m.urcef.nosp@m.orge.nosp@m..net
#include "contiki-conf.h"
#include "lib/trickle-timer.h"
#include "sys/ctimer.h"
#include "sys/cc.h"
#include "lib/random.h"

Macros

#define _DEBUG_   0
 
#define PRINTF(...)
 
#define tt_rand()   random_rand()
 Wide randoms for platforms using a 4-byte wide clock (see TRICKLE_TIMER_WIDE_RAND) More...
 

Functions

static void double_interval (void *ptr)
 
static void fire (void *ptr)
 
static clock_time_t get_t (clock_time_t i_cur)
 
static void new_interval (struct trickle_timer *tt)
 
static void schedule_for_end (struct trickle_timer *tt)
 
Trickle Timer Library: Functions called by protocol implementations
void trickle_timer_consistency (struct trickle_timer *tt)
 To be called by the protocol when it hears a consistent transmission. More...
 
void trickle_timer_inconsistency (struct trickle_timer *tt)
 To be called by the protocol when it hears an inconsistent transmission. More...
 
uint8_t trickle_timer_config (struct trickle_timer *tt, clock_time_t i_min, uint8_t i_max, uint8_t k)
 Configure a trickle timer. More...
 
uint8_t trickle_timer_set (struct trickle_timer *tt, trickle_timer_cb_t proto_cb, void *ptr)
 Start a previously configured trickle timer. More...
 

Variables

static clock_time_t loc_clock
 
static struct trickle_timerloctt