uwb-core DPL (Decawave Porting Layer) callout abstraction More...

Detailed Description

uwb-core DPL (Decawave Porting Layer) callout abstraction

Callout sets a timer that on expiration will post an event to an event queue. This mimics the same as MyNewt callout api.

Author
Francisco Molina franc.nosp@m.ois-.nosp@m.xavie.nosp@m.r.mo.nosp@m.lina@.nosp@m.inri.nosp@m.a.fr

Definition in file dpl_callout.h.

#include "xtimer.h"
#include "dpl/dpl_types.h"
#include "dpl/dpl_eventq.h"
#include "dpl/dpl_error.h"
+ Include dependency graph for dpl_callout.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpl_callout
 callout structure More...
 

Functions

void dpl_callout_init (struct dpl_callout *c, struct dpl_eventq *q, dpl_event_fn *e_cb, void *e_arg)
 Initialize a callout. More...
 
dpl_error_t dpl_callout_reset (struct dpl_callout *c, dpl_time_t ticks)
 Reset the callout to fire off in 'ticks' ticks. More...
 
void dpl_callout_stop (struct dpl_callout *c)
 Stops the callout from firing. More...
 

Function Documentation

◆ dpl_callout_init()

void dpl_callout_init ( struct dpl_callout c,
struct dpl_eventq q,
dpl_event_fn e_cb,
void *  e_arg 
)

Initialize a callout.

Callouts are used to schedule events in the future onto an event queue. Callout timers are scheduled using the dpl_callout_reset() function. When the timer expires, an event is posted to the event queue specified in dpl_callout_init(). The event argument given here is posted in the ev_arg field of that event.

Parameters
[out]ccallout to initialize
[in]qevent queue to queue event in
[in]e_cbcallback function
[in]e_argcallback function argument

◆ dpl_callout_reset()

dpl_error_t dpl_callout_reset ( struct dpl_callout c,
dpl_time_t  ticks 
)

Reset the callout to fire off in 'ticks' ticks.

Parameters
[in]ccallout to reset
[in]ticksnumber of ticks to wait before posting an event
Returns
0 on success, non-zero on failure

◆ dpl_callout_stop()

void dpl_callout_stop ( struct dpl_callout c)

Stops the callout from firing.

Parameters
[in]cthe callout to stop