Loading...
Searching...
No Matches
dpl_callout.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Inria
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
23#ifndef DPL_DPL_CALLOUT_H
24#define DPL_DPL_CALLOUT_H
25
26#include "os/os_callout.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
36 struct os_callout co;
37};
38
53static inline void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
54 dpl_event_fn *e_cb, void *e_arg)
55{
56 os_callout_init(&c->co, &q->evq, (os_event_fn *) e_cb, e_arg);
57}
58
67static inline dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
68{
69 return (dpl_error_t) os_callout_reset(&c->co, ticks);
70}
71
77static inline void dpl_callout_stop(struct dpl_callout *c)
78{
79 os_callout_stop(&c->co);
80}
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* DPL_DPL_CALLOUT_H */
static void dpl_callout_stop(struct dpl_callout *c)
Stops the callout from firing.
Definition dpl_callout.h:77
static void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q, dpl_event_fn *e_cb, void *e_arg)
Initialize a callout.
Definition dpl_callout.h:53
static dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
Reset the callout to fire off in 'ticks' ticks.
Definition dpl_callout.h:67
os_error_t dpl_error_t
dpl error type
Definition dpl_error.h:51
void dpl_event_fn(struct dpl_event *ev)
dpl event callback function
Definition dpl_eventq.h:49
os_time_t dpl_time_t
dpl time type
Definition dpl_types.h:57
void os_event_fn(struct os_event *ev)
Event callback function.
Definition os_eventq.h:51
dpl callout wrapper
Definition dpl_callout.h:35
struct os_callout co
the callout
Definition dpl_callout.h:36
dpl event queue wrapper
Definition dpl_eventq.h:42
struct os_eventq evq
the event queue
Definition dpl_eventq.h:43