lwIP  2.0.2
Lightweight IP stack
timeouts.h File Reference
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/sys.h"

Data Structures

struct  lwip_cyclic_timer
 

Typedefs

typedef void(* lwip_cyclic_timer_handler) (void)
 
typedef void(* sys_timeout_handler) (void *arg)
 

Functions

void sys_timeouts_init (void)
 
void sys_timeout (u32_t msecs, sys_timeout_handler handler, void *arg)
 
void sys_untimeout (sys_timeout_handler handler, void *arg)
 
void sys_restart_timeouts (void)
 
void sys_timeouts_mbox_fetch (sys_mbox_t *mbox, void **msg)
 

Variables

const struct lwip_cyclic_timer lwip_cyclic_timers []
 

Detailed Description

Timer implementations

Typedef Documentation

◆ lwip_cyclic_timer_handler

typedef void(* lwip_cyclic_timer_handler) (void)

Function prototype for a stack-internal timer function that has to be called at a defined interval

◆ sys_timeout_handler

typedef void(* sys_timeout_handler) (void *arg)

Function prototype for a timeout callback function. Register such a function using sys_timeout().

Parameters
argAdditional argument to pass to the function - set up by sys_timeout()

Function Documentation

◆ sys_restart_timeouts()

void sys_restart_timeouts ( void  )

Set back the timestamp of the last call to sys_check_timeouts() This is necessary if sys_check_timeouts() hasn't been called for a long time (e.g. while saving energy) to prevent all timer functions of that period being called.

◆ sys_timeout()

void sys_timeout ( u32_t  msecs,
sys_timeout_handler  handler,
void *  arg 
)

Create a one-shot timer (aka timeout). Timeouts are processed in the following cases:

Parameters
msecstime in milliseconds after that the timer should expire
handlercallback function to call when msecs have elapsed
argargument to pass to the callback function

◆ sys_timeouts_init()

void sys_timeouts_init ( void  )

Initialize this module

◆ sys_timeouts_mbox_fetch()

void sys_timeouts_mbox_fetch ( sys_mbox_t *  mbox,
void **  msg 
)

Wait (forever) for a message to arrive in an mbox. While waiting, timeouts are processed.

Parameters
mboxthe mbox to fetch the message from
msgthe place to store the message

◆ sys_untimeout()

void sys_untimeout ( sys_timeout_handler  handler,
void *  arg 
)

Go through timeout list (for this task only) and remove the first matching entry (subsequent entries remain untouched), even though the timeout has not triggered yet.

Parameters
handlercallback function that would be called by the timeout
argcallback argument that would be passed to handler

Variable Documentation

◆ lwip_cyclic_timers

const struct lwip_cyclic_timer lwip_cyclic_timers[]

This array contains all stack-internal cyclic timers. To get the number of timers, use LWIP_ARRAYSIZE()