uwb-core DPL (Decawave Porting Layer) event queue wrappers More...

Detailed Description

uwb-core DPL (Decawave Porting Layer) event queue wrappers

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_eventq.h.

#include <dpl/dpl_types.h>
#include "uwb_core.h"
#include "event/callback.h"
+ Include dependency graph for dpl_eventq.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpl_event
 dpl event wrapper More...
 
struct  dpl_eventq
 dpl event queue wrapper More...
 

Typedefs

typedef void dpl_event_fn(struct dpl_event *ev)
 dpl event callback function
 

Functions

static void dpl_event_init (struct dpl_event *ev, dpl_event_fn *fn, void *arg)
 Init a event. More...
 
static bool dpl_event_is_queued (struct dpl_event *ev)
 Check if event is in queue. More...
 
static void * dpl_event_get_arg (struct dpl_event *ev)
 Runs an event. More...
 
static void dpl_event_set_arg (struct dpl_event *ev, void *arg)
 Set the vent arg. More...
 
static void dpl_event_run (struct dpl_event *ev)
 Runs an event. More...
 
static void dpl_eventq_init (struct dpl_eventq *evq)
 Initialize the event queue. More...
 
static int dpl_eventq_inited (struct dpl_eventq *evq)
 Check whether the event queue is initialized. More...
 
static void dpl_eventq_deinit (struct dpl_eventq *evq)
 Deinitialize an event queue. More...
 
static struct dpl_eventdpl_eventq_get (struct dpl_eventq *evq)
 Get next event from event queue, blocking. More...
 
static struct dpl_eventdpl_eventq_get_no_wait (struct dpl_eventq *evq)
 Get next event from event queue, non-blocking. More...
 
static void dpl_eventq_put (struct dpl_eventq *evq, struct dpl_event *ev)
 Put an event on the event queue. More...
 
static void dpl_eventq_remove (struct dpl_eventq *evq, struct dpl_event *ev)
 Remove an event from the queue. More...
 
static void dpl_eventq_run (struct dpl_eventq *evq)
 Gets and runs an event from the queue callback. More...
 
static bool dpl_eventq_is_empty (struct dpl_eventq *evq)
 Check if queue is empty. More...
 
static struct dpl_eventqdpl_eventq_dflt_get (void)
 Retrieves the default event queue. More...
 

Function Documentation

◆ dpl_event_get_arg()

static void* dpl_event_get_arg ( struct dpl_event ev)
inlinestatic

Runs an event.

Parameters
[in]evevent to run

Definition at line 90 of file dpl_eventq.h.

◆ dpl_event_init()

static void dpl_event_init ( struct dpl_event ev,
dpl_event_fn fn,
void *  arg 
)
inlinestatic

Init a event.

Parameters
[in]evpointer to event to set
[in]fnevent callback function
[in]argevent argument

Definition at line 61 of file dpl_eventq.h.

◆ dpl_event_is_queued()

static bool dpl_event_is_queued ( struct dpl_event ev)
inlinestatic

Check if event is in queue.

Parameters
[in]evevent to check
Returns
true if event is queues, false otherwise

Definition at line 80 of file dpl_eventq.h.

◆ dpl_event_run()

static void dpl_event_run ( struct dpl_event ev)
inlinestatic

Runs an event.

Parameters
[in]evevent to run

Definition at line 111 of file dpl_eventq.h.

◆ dpl_event_set_arg()

static void dpl_event_set_arg ( struct dpl_event ev,
void *  arg 
)
inlinestatic

Set the vent arg.

Parameters
[in]evevent
[in]argarg to set event

Definition at line 101 of file dpl_eventq.h.

◆ dpl_eventq_deinit()

static void dpl_eventq_deinit ( struct dpl_eventq evq)
inlinestatic

Deinitialize an event queue.

Note
Not supported in RIOT
Parameters
[in]evqthe event queue to deinit

Definition at line 143 of file dpl_eventq.h.

◆ dpl_eventq_dflt_get()

static struct dpl_eventq* dpl_eventq_dflt_get ( void  )
inlinestatic

Retrieves the default event queue.

As there is no default event queue in RIOT, uwb-core will start and handle a default event queue.

Returns
the default event queue.

Definition at line 232 of file dpl_eventq.h.

◆ dpl_eventq_get()

static struct dpl_event* dpl_eventq_get ( struct dpl_eventq evq)
inlinestatic

Get next event from event queue, blocking.

Parameters
[in]evqthe event queue to pull an event from
Returns
the event from the queue

Definition at line 156 of file dpl_eventq.h.

◆ dpl_eventq_get_no_wait()

static struct dpl_event* dpl_eventq_get_no_wait ( struct dpl_eventq evq)
inlinestatic

Get next event from event queue, non-blocking.

Returns
event from the queue, or NULL if none available.

Definition at line 170 of file dpl_eventq.h.

◆ dpl_eventq_init()

static void dpl_eventq_init ( struct dpl_eventq evq)
inlinestatic

Initialize the event queue.

Parameters
[in]evqThe event queue to initialize

Definition at line 121 of file dpl_eventq.h.

◆ dpl_eventq_inited()

static int dpl_eventq_inited ( struct dpl_eventq evq)
inlinestatic

Check whether the event queue is initialized.

Parameters
[in]evqthe event queue to check

Definition at line 131 of file dpl_eventq.h.

◆ dpl_eventq_is_empty()

static bool dpl_eventq_is_empty ( struct dpl_eventq evq)
inlinestatic

Check if queue is empty.

Parameters
[in]evqthe event queue to check
Returns
true if empty, false otherwise

Definition at line 219 of file dpl_eventq.h.

◆ dpl_eventq_put()

static void dpl_eventq_put ( struct dpl_eventq evq,
struct dpl_event ev 
)
inlinestatic

Put an event on the event queue.

Parameters
[in]evqevent queue
[in]evevent to put in queue

Definition at line 185 of file dpl_eventq.h.

◆ dpl_eventq_remove()

static void dpl_eventq_remove ( struct dpl_eventq evq,
struct dpl_event ev 
)
inlinestatic

Remove an event from the queue.

Parameters
[in]evqevent queue to remove the event from
[in]evevent to remove from the queue

Definition at line 196 of file dpl_eventq.h.

◆ dpl_eventq_run()

static void dpl_eventq_run ( struct dpl_eventq evq)
inlinestatic

Gets and runs an event from the queue callback.

Parameters
[in]evqThe event queue to pull the item off.

Definition at line 206 of file dpl_eventq.h.