Buffer Element Format
This topic lists the common fields that always occur at the start of a buffer element. The dataru field contains information specific to the particular message; see FMI Message Formats for details of individual message formats.
PTRBFELT hdreptr->elteptr;
INTEGER hdreptr->startd;
INTEGER hdreptr->endd;
CHAR hdreptr->trpad;
CHAR[268] hdreptr->dataru;
};
Members
-
hdreptr–>elteptr
-
Pointer to next buffer element in the chain; NULL if this element is the last or only element in the chain.
-
hdreptr–>startd
-
Start of valid data in this element. The index into dataru of the first byte of valid data.
-
hdreptr–>endd
-
End of valid data in this element. The index into dataru of the last byte of valid data.
-
hdreptr–>trpad
-
Pad byte (reserved).
-
hdreptr–>dataru
-
An array of characters that contains the data for this element. Note that the valid data might not occupy the whole of the element; startd and endd give the indexes into this array of the start and end of the valid data.
The following information will help you to interpret the message formats:
-
Certain messages are shown as having two elements in the message formats; for example, the Open(PLU) Request has the CICB field in the first element and the BIND RU in the second element. This indicates that the message consists of two distinct linked element chains; the elteptr field in the first element points to the second element.
-
Fields that occupy two bytes are represented with the arithmetically most significant byte in the lowest byte address, irrespective of the normal orientation used by the processor on which the software executes. That is, the 2-byte value 0x1234 has the byte 0x12 in the lowest byte address. The exceptions to this are the startd and endd fields in elements, which are always stored in low-byte, high-byte orientation (the normal orientation of an Intel processor).
-
The offsets indicated by the startd and endd fields are expressed in terms of the first byte of dataru being offset 1; the first byte of valid data is at dataru[startd–1]. For example, if startd is 11 and endd is 18, then dataru begins with 10 bytes that are not valid data, followed by 8 bytes of valid data.
-
It is possible for an element to arrive with startd greater than endd. This indicates there is no valid data in dataru.
In the sample message format illustrated in Overview of Message Formats, each element has a startd of 13, indicating 12 bytes of padding before the start of the valid data. This leaves room for 256 bytes of data, and hence the element data (300 bytes long in this example) requires two elements.