The AIDA_tstEvent structure is used within all communication functions of the AIDA system. There are various types of events that belong to three groups: Events that may only be generated by the application (AIDA_nenTransmitData), events that may only be generated by the AIDA system (AIDA_nenTransmitDataDone, AIDA_nenReceiveData) and events that may be generated by either by the application to control or configure the AIDA system or by the AIDA system to report status information to the application.
typedef struct {
AIDA_tenEventType enEventType;
byte bStackLevel;
byte bEnvironment;
byte bEventsLost;
byte bReserved[1];
dword dwEventID;
tstTimeVal stTimeStamp;
dword dwFlags;
union {
AIDA_tstParamListA *pstParListA;
AIDA_tstParamListW *pstParListW;
} unAttachment;
union {
struct {
tstQword stSrcID;
tstQword stDstID;
byte bFlags;
byte bUpdateFlags;
byte bReserved[1];
byte bDataFlags;
dword dwDataSize;
void *pvData;
byte bReserved2[2];
word wCycleCount;
tstTimeVal
stCycleTime;
} stData;
struct {
dword dwStatusSize;
dword dwEntries;
struct AIDA_tstStatusHeader *pstStatus;
} stStatus;
tstTimeVal stTime;
} unEventData;
} AIDA_tstEvent;
The members enEventType, bStackLevel, stTimeStamp, dwFlags and unAttachment are filled in by the AIDA system and may not be modified directly by the application.
The following macros are defined to operate on event ids:
AIDA_boIsSpecialEventID
Available masks for special event ids are:
AIDA_nSpecialEventIDMask
AIDA_nCyclicEventIDMask
The following values for the masked part of special ids are defined:
AIDA_nCyclicEventID
AIDA_nAllEventsID
AIDA_nAllStdEventsID
AIDA_nAllCyclicEventsID
AIDA_boIsSpecialEventID returns true when a special event id is passed as argument. All other masks and values are applicable only for such special event ids.
AIDA_nSpecialEventIDMask can be used to extract the additional information from a special event id.
AIDA_nCyclicEventIDMask can be used to extract the cyclic flag from a special event id.
AIDA_nCyclicEventID is a flag that can be set for cyclic events. Please note that the AIDA stacks do not use this flag for marking and detecting cyclic events. Furthermore there is no way for AIDA_pstCreateEvent to automatically set this flag. So it is up to the application to change the event id after creation if necessary. It is ok to simply or AIDA_nCyclicEventID into the automatically created event id. Note that cyclic event ids are not within the range of special event ids.
AIDA_nAllEventsID may only be used in an event recall operation and matches all events for recall.
AIDA_nStdEventsID - like AIDA_nAllEventsID, but matches only non-cyclic events.
AIDA_nCyclicEventsID - like AIDA_nAllEventsID, but matches only cyclic events.
Flags for transmit events are:
AIDA_nStartCommu
AIDA_nStopCommu
AIDA_nSendBreak
AIDA_nSynchronize
Flags in receive events are:
AIDA_nCommuStarted
AIDA_nCommuStopped
AIDA_nBreakReceived
AIDA_nMoreFrags
AIDA_nNegativeResponse
AIDA_nUnexpectedData
Warning Flags in receive events are:
AIDA_nSendWarning
AIDA_nRecvWarning
Error flags in receive events are:
AIDA_nSendError
AIDA_nRecvError
AIDA_nCommuStartError
AIDA_nCommuStopError
AIDA_nIllegalID
AIDA_nOverrun
AIDA_nChecksumError
AIDA_nTimeout
AIDA_nInterrupted
AIDA_nFramingError
AIDA_nNegativeResponse
AIDA_nRecvQueueOverrun
Available masks are:
AIDA_nHints
AIDA_nErrors
AIDA_nStartCommu when used in a transmit event tells the AIDA system that the communication with the destination equipment may be started if necessary. If not set the AIDA system reports an error if the communication channel to the destination equipment is closed.
AIDA_nStopCommu when used in a transmit event tells the AIDA system that the communication with the destination equipment shall be stopped if possible.
AIDA_nSendBreak sends a "break" (not supported in every component).
AIDA_nSynchronize has a slightly different meaning for non-cyclic and cyclic events. When used in a non-cyclic transmit event indicates that when the component at the given stacklevel processes this event its time stamp has to be adjusted relative to the previous non-cylic event. When the previous event had been processed in time nothing happens. If the processing the previous event had been delayed e. g. because of a system overload or early e. g. because of the imprecise Windows time measurement the time stamp the current event will be corrected accordingly. The processing interval between the last and the current non-cyclic event will be no smaller than the difference of their time stamps. This may become important in case of CAN transport protocols or when slow gateways exist between the tester and the ECU. In case of cyclic events AIDA_nSynchronize switches between long-term stability (AIDA_nSynchronize not set) and minimum interval (AIDA_nSynchronize set). In case of AIDA_nSynchronize the transmission for the next cycle will be reschecduled when the transmit data done event is received. So the cycle time is the minimum time between end of transmission and the start of the next one. In case of long-term stable mode (AIDA_nSynchronize not set) the transmissions may follow in faster succession than indicated by stCycleTime if delays on previous transmissions had happened. To avoid queue overflows there is a maximum delay of 10 times the cycle time allowed. If the actual delay becomes greater all outstanding cycles will be skipped (and not be counted) and the event will be rescheduled for a time of stCycleTime in the future.
AIDA_nCommuStarted when set in a receive event indicates that the connection to the attached equipment has been
AIDA_nCommuStopped when set in a receive event indicates that the connection to the attached equipment has been closed.
AIDA_nBreakReceived indicates that a "break" has been received. When the event also contains data this data has been received after the break.
AIDA_nMoreFrags indicates that the received data is fragmented and that more data will be transferred in the following receive data events.
AIDA_nNegativeResponse when set indicates that a negative response from an ECU occured, e. g. the command is not implemented or the command or its parameters were invalid.
AIDA_nUnexpectedData when set indicates that data events have been received by the component while there weren't awaited any (e. g. when data is received in half duplex components while there is no pending request). Note: This flag typically does not indicate that the data in the current event is unexpected but that some additional data received before had been dropped.
AIDA_nSendWarning indicates that a problem occured when trying to send data. The stack is still operational. An example for the occurence of this bit is the CAN single wire operation. This flag may occur in data events.
AIDA_nRecvWarning indicates that a problem occured when receiving data. The stack is still operational. An example for the occurence of this bit is the CAN single wire operation. This flag may occur in data events.
AIDA_nSendError indicates that an error occured when trying to send data. This error may occur in various events.
AIDA_nRecvError indicates that an error occured when receiving data. This error may occur in various events.
AIDA_nCommuStartError when set in a receive event indicates that the connection to the attached equipment could not be opened.
AIDA_nCommuStopError when set in a receive event indicates that the connection to the attached equipment could not be closed.
AIDA_nIllegaID when set indicates that one of the IDs was not accepted by the AIDA stack.
AIDA_nOverrun when set indicates that a buffer overrun occured.
AIDA_nChecksumError when set indicates that a checksum error occured.
AIDA_nTimeout when set indicates that a timeout occured (when a half duplex component sets this flag within a receive event this means no answer had been received for a request).
AIDA_nInterrupted when set indicates that a send or receive operation had been interrupted.
AIDA_nFramingError when set indicates that a framing error occured.
AIDA_nParityError when set indicates that parity information is corrupted (e. g. COM component, receive data events).
AIDA_nCollision when set indicates that a collision occurred (e. g. multiple senders are transmitting simultaneously on a shared bus).
AIDA_nRecvQueueOverrun when set indicates that the number of events given in bEventsLost have been lost because a higher component did not empty the receive queue.
AIDA_nHints can be used to test for the hint part of dwFlags.
AIDA_nErrors can be used to test for the error part of dwFlags.
The following masks are available to separate the parts:
AIDA_nUpdateModeMask
AIDA_nUpdateDataCtrlMask
The following values are available for the UpdateMode part:
AIDA_nUpdateEvent
AIDA_nRecallEvent
The following values are available for the UpdateDataCtrl part:
AIDA_nUpdateDataCtrlAll
AIDA_nUpdateDataCtrlByFlags
AIDA_nUpdateDataCtrlAndFlagsByFlags
The following flags are available for event updates:
AIDA_nUpdateData
AIDA_nUpdateTimeStamp
AIDA_nUpdateFlags
AIDA_nUpdateAttachment
AIDA_nUpdateEvent must be set to indicate an update operation. The dwEventID member must be set to a standard event id. The other parts of bUpdateFlags contain information about which parts of the original event shall be updated. If no event with a corresponding id or more than one event with the corresponding id can be found in the stack the update operation fails and AIDA_boSendEvent will return false.
AIDA_nRecallEvent must be set to indicate an recall operation. The dwEventID member can either be set to a standard event id in which case it will only match exactly one event with this id in the stack or it can be set to one of the special event id values of AIDA_nAllEventsID, AIDA_nAllStdEventsID or AIDA_nAllCyclicEventsID. In case of a standard event id it is an error to have more than one event with the same id in the stack. If dwEventID is set to AIDA_nAllEventsID all events will be recalled, if dwEventID is set to AIDA_nAllStdEventsID or AIDA_nAllCyclicEventsID either all non-cyclic or all cyclic events will be recalled.
AIDA_nUpdateDataCtrlAll indicates an update of all members of the stData member.
AIDA_nUpdateDataCtrlByFlags indicates an update of all members of the stData member where the corresponding validity flags in the bFlags member are set. When AIDA_nCyclic is set the cycle time and cycle count will be updated. Note that bFlags itself will not be updated to the new value.
AIDA_nUpdateDataCtrlAndFlagsByFlags works like AIDA_nUpdateDataCtrlByFlags except that also the bFlags member will be updated.
AIDA_nUpdateData indicates an update of the dwDataSize member and the event data in pvData. Please note that increasing the dwDataSize member leads to an reallocation of the original event memory. As in the current AIDA stacks version the event ids are derived from the memory address of the newly created event the event id may be reused after reallocation. So it is advisable to create an event with varying data size with the maximum data size needed and to set the dwDataSize member to the actual size after the first creation. As the event id generation may change in future versions of the AIDA stacks this step may no longer necessary in the future.
AIDA_nUpdateTimeStamp indicates an update of the stTimeStamp member.
AIDA_nUpdateFlags indicates an update of the dwFlags member.
AIDA_nUpdateAttachment indicates an update of the unAttachment member.
typedef struct {
AIDA_tenStatusType enType;
dword dwSize;
} AIDA_tstStatusHeader;
typedef struct {
AIDA_tenStatusType enType;
dword dwSize;
dword dwFlags;
} AIDA_tstStackStatus;
typedef struct {
AIDA_tenStatusType enType;
dword dwSize;
tstTimeVal stTimeout;
} AIDA_tstRestartRXTimeoutStatus, AIDA_tstRestartTXTimeoutStatus;
AIDA_nStackComplete
AIDA_nStackOnline
AIDA_nStackForcedOffline
AIDA_nInvalidStatus
AIDA_nStackComplete is set when the stack is complete and can be set to online state.
AIDA_nStackOnline is set when the stack is online, that means the hardware driver component has opened a communication port.
AIDA_nStackForcedOffline is set when the stack is forced offline by the application.
AIDA_nInvalidStatus indicates that the dwFlags member is invalid and should normally not be seen by the application.
AIDA Overview, AIDA Structures And Datatypes, AIDA_tenEventType, AIDA_tstParamList