AIDA_pstCreateEventEx

The AIDA_pstCreateEventEx function creates a new AIDA event.

AIDA_tstEvent *AIDA_pstCreateEventEx(
  handle hStack,
  AIDA_tenEventType enType,
  byte bLevel,
  dword dwSize
  bool boCyclic,
  word wCycles
);

Parameters

hStack
Specifies the AIDA stack where the new settings shall take effect. This is a handle to an AIDA stack created by one of the AIDA stack manipulation functions. Note the the event must be sent through the stack to which the handle belongs which was used when creating the event.
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.
boCyclic
This is used only in events of the type AIDA_nenTransmitData. Set to False for all other event types. Set to True to create a cyclic event. Please note that this is currently only supported in unmanaged id mode. In managed id mode use AIDA_pstCreateEvent and AIDA_boSetEventID to create a cyclic event.
dwCycles
This is used only in events of the type AIDA_nenTransmitData. When boCyclic is set to True this parameter determines the number of cycles (set to 0 for unlimited cycles).

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.

In contrast to AIDA_pstCreateEvent this function will assign a valid event id in any case. This function shall not be used when an event shall be used as cyclic event because it already has been assigned a unique event id as a regular event if the event id manager is used. To create cyclic events use AIDA_pstCreateEvent and AIDA_boSetEventID instead.

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