AIDA_boSendEvent

The AIDA_boSendEvent function queues an AIDA event for processing.

bool AIDA_boSendEvent(
  handle hStack,
  AIDA_tstEvent *pstEvent,
  dword dwFlags,
  tstTimeVal *pstTime
);

Parameters

hStack
Specifies the AIDA stack where the given event shall be processed. This is a handle to an AIDA stack created by one of the AIDA stack manipulation functions.
pstEvent
Pointer to an event created with AIDA_pstCreateEvent or AIDA_pstCreateEventEx.
dwFlags
This is stored in the dwFlags member of the given event.
pstTime
This is stored in the stTimeStamp member of the given event. Values may be relative or absolute as described for tstTimeVal. AIDA_stTimeoutInfinite is not an allowed value for *pstTime.

Return Values

AIDA_boSendEvent returns True when the event is accepted for processing.

If the event is rejected the function returns False. The application can retrieve the error code using AIDA_iGetError.

Remarks

If the event is accepted the application must no longer touch any members of the structure. If it is rejected it is up to the application to delete the event using AIDA_boDeleteEvent.

The event has to be of one of these types:

AIDA_nenTransmitData
AIDA_nenTimer
AIDA_nenStatus
Normally there is no need for an application to generate status events directly. It may make sense in certain situations when an AIDA component allows to transfer empty data events. In this case the component may accept special flags like AIDA_nStartCommu or AIDA_nStopCommunication within a status event to simply trigger the given operation without actually transferring data. If a component supports this special feature it will be mentioned in the documentation of the given component.

Stack status events (status events containing a single entry with a new stack state) are processed synchronously, so when the function returns the stack already is in the requested state. As the new state has to be promoted to all stack levels bStackLebel has no meaning in those events. A stack status entry must be the only entry in a status event as otherwise it will not be detected and processed properly.

In case of transmit data events certain flags in the stData member of the AIDA_tstEvent are available to define an event as cyclic, update or recall event.

If the stack is online the component to which the event has been passed normally will mirror the event as soon as its timeout given in the stTimeStamp member is reached. Most AIDA components will define a latency time. An AIDA event will be removed from the transmit event queue at its execution time minus the latency time to compensate for possible latencies in a non realtime operating system. So the application will receive the mirrored event a few milliseconds before the time given in the event. Nevertheless the actual execution will not take place before the time given in the event.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Linux: Requires a kernel supporting ELF binaries.
  Header: Declared in bsk_aida.h, also requires portab.h.
  Import Library (Windows): Use BSK_AIDA.lib.

See Also

AIDA Overview, AIDA Functions, AIDA_pstCreateEvent, AIDA_pstCreateEventEx, AIDA_boSetEventID, AIDA_boDeleteEvent, AIDA_pstCloneEvent, AIDA_pstReceiveEvent, AIDA_boWaitEvent, AIDA_boSetEventTypes, AIDA_boGetEventTypes