Provides functionality to trigger events after timeout. More...
Provides functionality to trigger events after timeout.
event_timeout intentionally doesn't extend event structures in order to support events that are integrated in larger structs intrusively.
Example:
Event Timeout API
Definition in file timeout.h.
Go to the source code of this file.
Data Structures | |
struct | event_timeout_t |
Timeout Event structure. More... | |
void | event_timeout_init (event_timeout_t *event_timeout, event_queue_t *queue, event_t *event) |
Initialize timeout event object. More... | |
void | event_timeout_set (event_timeout_t *event_timeout, uint32_t timeout) |
Set a timeout. More... | |
void | event_timeout_clear (event_timeout_t *event_timeout) |
Clear a timeout event. More... | |
void event_timeout_clear | ( | event_timeout_t * | event_timeout | ) |
Clear a timeout event.
Calling this function will cancel the timeout by removing its underlying timer. If the timer has already fired before calling this function, the connected event will be put already into the given event queue and this function does not have any effect.
[in] | event_timeout | event_timeout context object to use |
void event_timeout_init | ( | event_timeout_t * | event_timeout, |
event_queue_t * | queue, | ||
event_t * | event | ||
) |
Initialize timeout event object.
[in] | event_timeout | event_timeout object to initialize |
[in] | queue | queue that the timed-out event will be added to |
[in] | event | event to add to queue after timeout |
void event_timeout_set | ( | event_timeout_t * | event_timeout, |
uint32_t | timeout | ||
) |
Set a timeout.
This will make the event as configured in event_timeout
be triggered after timeout
microseconds.
[in] | event_timeout | event_timout context object to use |
[in] | timeout | timeout in microseconds |