SYMEO Local Positioning Radar System
LPR-1DHP
Product Documentation
Protocol XP Description for TCP/IP and RS232
Copyright © Symeo GmbH 2010
Seite 37 von 40
8
Protocol XP Description for TCP/IP and RS232
8.1
General Description
This protocol is the interface between a LPR-1DHP station and the user. The binary protocol
XP protocol provides information in high density. Its structure ensures a simple
implementation. The transfer is done in single data frames.
The interface for the binary protocol XP can either be a serial (RS232) interface or a TCP/IP
or UDP interface. The baudrate of the serial interface must be set to 19200 baud.
8.1.1
Structure of Data Packet
The binary protocol XP was originally designed for transmission over RS232 interfaces.
When the protocol is used on a RS232 interface each data packet starts and ends with a
reserved symbol. This reserved symbol cannot appear in the data stream.
Figure 1 shows the general structure of the data packet.
TYPE
DATA
START
0x7e
1 byte
1 byte
1 byte
CRC
2 byte
END
0x7f
Figure 1: Structure of data the packet
The START and the STOP-field is in each data packet the reserved symbol
0x7e
and
0x7f
.
TYPE indicates the type of the data packet. Therefore up to 256 different types can be
defined . The TYPE-field is followed by the DATA-field. The DATA field contains the real data
of the packet of the type TYPE. The CRC-field contains a check sum. The check sum is
applied to all previous data fields except the START and END data field.
All multi-byte integers (e.g. CRC field) are encoded in Network-Byte-Order (Big Endian).
8.1.2
Byte Stuffing
The two symbols 0x7E and 0x7F are unique for START and STOP-fields. If these symbols
occur within any other field (TYPE, DATA or CRC), they must be replaced by the following
order:
original symbol
replaced by
0x7D
0x7D 0x5D
0x7E
0x7D 0x5E
0x7F
0x7D 0x5F
This byte stuffing scheme ensures that the receiver of the protocol can identify definitely the
START-field within a flow of data, even if the symbol of the start field occurs within the
DATA-field.
Example: If the symbol 0x7d is read, it must be cancelled. The following symbol must be
XOR combined with 0x20 to recreate the original symbol.