Loading...
Searching...
No Matches
timeout.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Daniel Krebs
3 * 2017 INRIA
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
21#ifndef NET_GNRC_MAC_TIMEOUT_H
22#define NET_GNRC_MAC_TIMEOUT_H
23
24#include <assert.h>
25#include <stdint.h>
26#include <stdbool.h>
27
28#include "evtimer_msg.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
37#define GNRC_MAC_EVENT_TIMEOUT_TYPE (0x4400)
38
49
57
68
78 gnrc_mac_timeout_event_t timeouts[],
79 uint8_t num);
80
90 uint32_t offset, kernel_pid_t pid);
91
101
109
119static inline bool gnrc_mac_timeout_is_running(gnrc_mac_timeout_t *mac_timeout,
121{
122 assert(mac_timeout);
123 return (gnrc_mac_find_timeout(mac_timeout, type) >= 0);
124}
125
136
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif /* NET_GNRC_MAC_TIMEOUT_H */
POSIX.1-2008 compliant version of the assert macro.
#define assert(cond)
abort the program if assertion is false
Definition assert.h:136
IPC-based evtimer definitions.
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:139
gnrc_mac_timeout_type_t
Definitions of GNRC_MAC timeout types.
Definition timeout.h:46
@ GNRC_MAC_TIMEOUT_DISABLED
Timeout is disabled, not in used.
Definition timeout.h:47
void gnrc_mac_clear_timeout(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_type_t type)
Clear a MAC timeout of type.
void gnrc_mac_init_timeouts(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_event_t timeouts[], uint8_t num)
Initialize the MAC timeout module of gnrc_mac before using, it also sets the timeout callback functio...
static bool gnrc_mac_timeout_is_running(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_type_t type)
Check whether a MAC timeout of type is running or not.
Definition timeout.h:119
bool gnrc_mac_timeout_is_expired(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_type_t type)
Check whether a MAC timeout of type has expired or not.
void gnrc_mac_set_timeout(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_type_t type, uint32_t offset, kernel_pid_t pid)
Set a MAC timeout of type.
int gnrc_mac_find_timeout(gnrc_mac_timeout_t *mac_timeout, gnrc_mac_timeout_type_t type)
Find a MAC timeout of type.
void gnrc_mac_reset_timeouts(gnrc_mac_timeout_t *mac_timeout)
Reset all the MAC timeouts.
IPC-message event.
Definition evtimer_msg.h:40
Event timer.
Definition evtimer.h:69
Structure of the GNRC_MAC timeout event.
Definition timeout.h:53
evtimer_msg_event_t msg_event
The timeout message event.
Definition timeout.h:54
gnrc_mac_timeout_type_t type
GNRC_MAC timeout type.
Definition timeout.h:55
Structure holding the GNRC_MAC timeouts.
Definition timeout.h:61
gnrc_mac_timeout_event_t * timeouts
The gnrc_mac timeout unites.
Definition timeout.h:64
uint8_t timeout_num
Timeout number.
Definition timeout.h:66
evtimer_t evtimer
evtimer entity which stores the timeout list.
Definition timeout.h:62