ECROS API Function OsAllEvents()

BoolE OsAllEvents( OsEventsT events );

Function OsAllEvents() may be called by the client application to test the events associated with the currently running task against all of a specified set of events. The function returns Bool_TRUE (non-zero) if all events that are set in the function argument are also set in the running task's event pattern. Otherwise, the function returns Bool_FALSE (zero).  The task's event pattern is not changed.

Example

The example below shows part of a task that processes some input data, buffers it and passes it to an output of some sort.  Input data must be processed only when both events ENABLE_INPUT and DO_INPUT are set.  This event pattern is formed with a bit-wise OR operation and passed as the argument of OsAllEvents().  If the function returns Bool_TRUE, which is non-zero, the task enters the body of the if statement and processes the input data.


Last edited December 11, 2002.  All material Copyright © 2002 Graham Davies, ECROS Technology.