EM-ODP  3.7.0
Event Machine on ODP
em_timer_attr_t Struct Reference

#include <event_machine_timer.h>

Collaboration diagram for em_timer_attr_t:

Data Fields

em_timer_res_param_t resparam
 
uint32_t num_tmo
 
em_timer_flag_t flags
 
char name [EM_TIMER_NAME_LEN]
 
em_timer_ring_param_t ringparam
 
uint32_t __internal_check
 

Detailed Description

Structure used to create a timer or inquire its configuration later.

This needs to be initialized with em_timer_attr_init(), which fills default values to each field. After that the values can be modified as needed. Values are considered a requirement, e.g. setting 'resparam.res_ns' to 1000(ns) requires at least 1us resolution. The timer creation will fail if the implementation cannot support such resolution (like only goes down to 1500ns). The implementation is free to provide better than requested, but not worse.

To know the implementation specific limits use em_timer_capability and em_timer_res_capability.

When creating the alternative periodic ring timer, this needs to be initialized with em_timer_ring_attr_init instead. EM_TIMER_FLAG_RING will be set by em_timer_ring_attr_init so it does not need to be manually set.

See also
em_timer_attr_init, em_timer_ring_attr_init, em_timer_capability
Examples
timer_hello.c, timer_test.c, timer_test_periodic.c, and timer_test_ring.c.

Definition at line 335 of file api/event_machine_timer.h.

Field Documentation

◆ __internal_check

uint32_t em_timer_attr_t::__internal_check

Internal check - don't touch!

EM will verify that em_timer_attr_init() has been called before creating a timer

Definition at line 359 of file api/event_machine_timer.h.

◆ flags

em_timer_flag_t em_timer_attr_t::flags

Extra flags. A set flag is a requirement

Examples
timer_test_ring.c.

Definition at line 343 of file api/event_machine_timer.h.

◆ name

char em_timer_attr_t::name[EM_TIMER_NAME_LEN]

Optional name for this timer

Examples
timer_hello.c, timer_test.c, timer_test_periodic.c, and timer_test_ring.c.

Definition at line 345 of file api/event_machine_timer.h.

◆ num_tmo

uint32_t em_timer_attr_t::num_tmo

Maximum simultaneous timeouts

Examples
timer_hello.c, timer_test.c, timer_test_periodic.c, and timer_test_ring.c.

Definition at line 341 of file api/event_machine_timer.h.

◆ resparam

em_timer_res_param_t em_timer_attr_t::resparam

Resolution parameters. Set when not creating periodic ring. This gets cleared by em_timer_ring_attr_init

Examples
timer_hello.c, timer_test.c, timer_test_periodic.c, and timer_test_ring.c.

Definition at line 339 of file api/event_machine_timer.h.

◆ ringparam

em_timer_ring_param_t em_timer_attr_t::ringparam

used when creating alternative periodic ring timer. Cleared by em_timer_attr_init

Examples
timer_test_ring.c.

Definition at line 351 of file api/event_machine_timer.h.


The documentation for this struct was generated from the following file: