[Previous]

[Contents]

[Next]


evt_fetch_event()

Wait for an event to be signaled.

Synopsis:

#include <evt.h>
#include <lib_evt.h>
 
int evt_fetch_event( const evt_cnx_t *evtcnx, void *handle, int *value, int timeout_msec );

Description:

The evt_fetch_event() function wait for an event to be signaled over an event channel.

The evt_fetch_event function needs the following parameters:

evtcnx

Opaque structure pointer as returned by the initial call to evt_open.

handle

Event Channel handle which was returned by evt_create_channel.

value

Number provided with the signal information and set by the signaler task (evt_trigger). This parameter has no special meaning by the driver and can be used by the two tasks, the signaler and the signaled.

timeout_msec

This timeout (specified in milli-seconds) is only used in one particular case: if the queue of pending signals is empty.

Returns:

Return -1 if an error occurred (errno is then set), or a positive number (starting from 0) which indicates how many events are still in the queue.

Example:

See this simple example.

Errors:

EINVAL

Invalid handle.

ETIME

The operation times out (meaning that there was no event available from the event channel queue at the time of the call and until the timeout expires).

See also:

evt_open(), evt_create_channel(), evt_post_event()


[Previous]

[Contents]

[Next]