[Previous]

[Contents]

[Next]


evt_post_event()

Post a single event to an event channel.

Synopsis:

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

Description:

Allow a task (either a thread or a process) to post an event to an event channel. The event carry a 32-bits value and is queued by the device driver. If the queue is full (see parameter when creating the channel with evt_create_channel). then the function will wait until either the is queue is not full anymore or the specified timeout occurs.

The evt_post_event function needs the following parameters:

evtcnx

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

channel_handle

Event Channel handle which was returned by evt_locate_channel.

value

Number provided with the signal information. 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 the pending signals is full (meaning the signaled task is not ready to read the events using evt_fetch_event or evt_fetch_events).

Returns:

Return 0 is the operation succeeds, or -1 if an error occurred (errno is then set).

Example:

See this simple example.

Errors:

EINVAL

Invalid handle.

ETIME

The operation times out (meaning that the targetted event channel queue was full at the time of the call).

See also:

evt_open(), evt_create_channel(), evt_locate_channel(), evt_fetch_event(), evt_fetch_events()


[Previous]

[Contents]

[Next]