AIDA_pstCreateEvent

The AIDA_pstCreateEvent function creates a new AIDA event.

AIDA_tstEvent *AIDA_pstCreateEvent(
  AIDA_tenEventType enType,
  byte bLevel,
  dword dwSize
);

Parameters

enType
Specifies the type of an event to be created. Possible types are the values of the AIDA_tenEventType enum.
bLevel
Specifies the stack level where the event shall be processed. For normal operation bLevel can be 0. The AIDA system then processes the event in the component that was added first to a new stack. For special purposes it is also possible to pass any other stack level that had been returned by the AIDA_bAddToStack function when the stack components were loaded.
dwSize
This is used only in events of the types AIDA_nenTransmitData, AIDA_nenTransmitDataDone, AIDA_nenReceiveData and AIDA_nenStatus and specifies the size of the data block of the new event in units of byte. For all other types of events dwSize is ignored and should be 0. To calculate dwSize for status events add up the sizeof()s of all status blocks to be added to the new event.

Return Values

AIDA_pstCreateEvent returns a pointer to the new event on success.

If the event could not be created the function returns NULL. The application can retrieve the error code using AIDA_iGetError.

Remarks

An AIDA application will only have to create events of the types AIDA_nenTransmitData, AIDA_nenStatus or AIDA_nenTimer for normal operation.

The dwSize parameter is placed in the dwDataSize or dwStatusSize member of the created event depending on the event type. This value may be decreased by the application if necessary but never be increased. In general the application should pass the final data block size to the AIDA_pstCreateEvent function so that no resizing is necessary.

If the event id manager is used then AIDA events require a unique event id before they may be sent. This requires a binding to the stack that cannot be done by this function so that an additional call to AIDA_boSetEventID is needed.

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_pstCreateEventEx, AIDA_boSetEventID, AIDA_boDeleteEvent, AIDA_pstCloneEvent, AIDA_boSendEvent, AIDA_pstReceiveEvent, AIDA_boWaitEvent, AIDA_boSetEventTypes, AIDA_boGetEventTypes