
CHAPTER 3
Operations at the Application Level
99
space available and in order to minimize the radio traffic, the
frames are slightly compressed, in that twelve 12-bit values are
packed in nine 16-bit words.
Type 3 7
SIZE 31 (including the type byte).
F
ORMAT struct tlg_type37 {
BYTE RF_LevelIn;
BYTE RF_LevelOut;
BYTE DigiByte;
WORD PulseCounter0;
WORD PulseCounter1;
WORD PulseCounter2;
WORD PulseCounter3;
BYTE BatteryLevel;
BYTE Analog[18];
};
DESCRIPTION The analog values are 12 bits and must be converted accordingly,
depending on the sensor connected, while the pulse counters are
16-bit values. Only the RF and battery levels are 8-bit values.
Analog[18] is an array of 18 unsigned bytes that is the result of
packing the twelve 12-bit values. These are the values returned by
the internal A/D converter from the respective I/O connectors.
Note: The integers (16-bit values) are sent using the big endian
convention, that is, first the most significant byte and then
the least significant byte.
The packing mechanism is shown in Figure 27.
Twelve 16-bit values
8-bit packed values
Analog1 Analog2
Analog3
Analog4
12 bits 12 bits 12 bits 12 bits
Byte 0 Byte 1 Byte 2 Byte 3 Byte 6Byte 5Byte 4 Byte 16 Byte 17
etc....
0
00
0
Kommentare zu diesen Handbüchern