rtems_status_code rtems_event_receive ( rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out );
RTEMS_SUCCESSFUL
- event received successfully
RTEMS_UNSATISFIED
- input event not satisfied (RTEMS_NO_WAIT
)
RTEMS_INVALID_ADDRESS
- event_out
is NULL
RTEMS_TIMEOUT
- timed out waiting for event
This directive attempts to receive the event
condition specified in event_in. If event_in is set to
RTEMS_PENDING_EVENTS
, then the current pending events are returned in
event_out and left pending. The RTEMS_WAIT
and RTEMS_NO_WAIT
options in the
option_set parameter are used to specify whether or not the task
is willing to wait for the event condition to be satisfied.
RTEMS_EVENT_ANY
and RTEMS_EVENT_ALL
are used in the option_set parameter are
used to specify whether a single event or the complete event set
is necessary to satisfy the event condition. The event_out
parameter is returned to the calling task with the value that
corresponds to the events in event_in that were satisfied.
If pending events satisfy the event condition, then
event_out is set to the satisfied events and the pending events
in the event condition are cleared. If the event condition is
not satisfied and RTEMS_NO_WAIT
is specified, then event_out is set to
the currently satisfied events. If the calling task chooses to
wait, then it will block waiting for the event condition.
If the calling task must wait for the event condition
to be satisfied, then the timeout parameter is used to specify
the maximum interval to wait. If it is set to RTEMS_NO_TIMEOUT
, then
the calling task will wait forever.
This directive only affects the events specified in event_in. Any pending events that do not correspond to any of the events specified in event_in will be left pending.
The following event receive option constants are defined by RTEMS:
RTEMS_WAIT
task will wait for event (default)
RTEMS_NO_WAIT
task should not wait
RTEMS_EVENT_ALL
return after all events (default)
RTEMS_EVENT_ANY
return after any events
A clock tick is required to support the functionality of this directive.
Copyright © 1988-2008 OAR Corporation