AIDA Packer Component

The Packer component implements repacking of AIDA_tstEvents according to length information or special start codes contained in the data part of the AIDA_tstEvents. It can be used if data streams have been divided into AIDA_tstEvents at wrong places. The Packer component collects AIDA_tstEvents of the AIDA_tenEventType AIDA_nenReceiveData in a buffer until enough data is available to create a new AIDA_tstEvent with the number of data bytes found out in the data part.

Parameters

HeaderFlags (Broadcast Parameter)
Field of flags for special treatment of the header.
0x0000000FUL   SpecialModeMask  these bits are reserved for modes which require special treatment of the header (e.g. KWP 2000).
0x00000040UL   ExcludeFrameLengthMask  this bit is used for the calculation of the length information in the header.
0x00000040UL   ExcludeFrameLength  when set indicates, that the length of the frame is excluded from the calculation of the telegram length.
The currently implemented special modes are:
0x00000000UL   SpecialModeNone  There is no special treatment.
0x00000001UL   SpecialModeKWP2000COM  KWP2000 headers are used as defined in ISO 14230.
0x00000002UL   SpecialModeKWP2000CAN  KWP2000 over CAN is used. (2 byte header with 12 bit length info).
0x00000003UL   SpecialModeDS2  The ECU ID is generated as described in DS2 documentation (currently unimplemented).
When a special mode is selected, other parameters are modified according to the specs and can't be changed by the user anymore. These parameters are: LengthWidth, LengthPos, and LengthMask.
LengthWidth
Specifies how many bytes are used to transmit the telegram length.
LengthPos
Specifies the position of the length information in the telegram. Values ≤ 0 mean, that there is no length information in the header.
LengthOffset
Offset to be added to the length of the telegram to calculate the length information included in the header.

If ExcludeFrameLength in the HeaderFlags
is set:
telegram length (excluding header) + LengthOffset = length information in the telegram
If ExcludeFrameLength in the HeaderFlags is not set:
telegram length (including header) + LengthOffset = length information in the telegram
LengthMask
Mask to be used when merging length information and other information (e.g. like in the Format byte of KWP2000). If the Mask = 0 it is ignored, otherwise bits set in the mask mark this area as useable for the length information (The LengthMask is anded bitwise with the calculated length). The LengthMask doesn't imply any bit shifts.
IntermessageTimeout
Specifies how long the component waits for consecutive AIDA_nenReceiveData Events until it creates a new Event with the data still contained in the buffer. If no additional data is expected according to the length info, no new Events are created. Units used are ms.
StartCode
Code to identify the start of a new message. If the StartCode is found in the data part of an AIDA_tstEvent, the data before and after the StartCode are split and put into separate AIDA_tstEvents. The StartCode has to be different from the EscapeCode. Evaluation of StartCode is controlled by EscapeFlags.
EscapeCode
Code to identify the start of an escaped sequence. This code has to be different from the StartCode. Evaluation of EscapeCode is controlled by EscapeFlags.
EscapeFlags
Field of flags to control if and how StartCode and EscapeCode are interpreted.
0x00000001UL   UseSTX  Is STX detection and encoding/decoding of escape sequences active.

See Also

AIDA Overview, list of AIDA components, AIDA Structures And Datatypes, AIDA_tenEventType