RTEMS Logo

RTEMS 4.9.2 On-Line Library


Event Manager EVENT_RECEIVE - Receive event condition

PREV UP NEXT Bookshelf RTEMS C User's Guide

11.4.2: EVENT_RECEIVE - Receive event condition

CALLING SEQUENCE:

rtems_status_code rtems_event_receive (
  rtems_event_set  event_in,
  rtems_option     option_set,
  rtems_interval   ticks,
  rtems_event_set *event_out
);

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 C User's Guide

Copyright © 1988-2008 OAR Corporation