RTEMS Logo

RTEMS 4.7.2 On-Line Library


Event Manager EVENT_RECEIVE - Receive event condition

PREV UP NEXT Bookshelf RTEMS Ada User's Guide

11.4.2: EVENT_RECEIVE - Receive event condition

CALLING SEQUENCE:

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
);

DIRECTIVE 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

DESCRIPTION:

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.

NOTES:

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:

A clock tick is required to support the functionality of this directive.


PREV UP NEXT Bookshelf RTEMS Ada User's Guide

Copyright © 1988-2004 OAR Corporation