procedure Event_Receive ( Event_In : in RTEMS.Event_Set; Option_Set : in RTEMS.Option; Ticks : in RTEMS.Interval; Event_Out : out RTEMS.Event_Set; Result : out RTEMS.Status_Codes );
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