Spatial Reference Manual
Page 104 of 158
Version 4.4
04/06/2019
13.2 Packet Structure
The ANPP packet structure is shown in Table 25 and the header format is shown in
Table 26. Example code can be downloaded from the software section.
Header
Header LRC
Packet ID
Packet Length
CRC16
Packet Data
Table 25: ANPP packet structure
ANPP Header Format
Field
#
Bytes
Offset
Data
Type
Size
Description
1
0
u8
1
Header LRC, see section 13.2.1
2
1
u8
1
Packet ID, see section 13.2.2
3
2
u8
1
Packet Length, see section 13.2.3
4
3
u16
2
CRC16, see section 13.2.4
Table 26: ANPP header format
13.2.1
Header LRC
The header LRC (Longitudinal Redundancy Check) provides error checking on the
packet header. It also allows the decoder to find the start of a packet by scanning for a
valid LRC. The LRC can be found using the following:
LRC = ((pac packet_ crc[0] + crc[1])^0xFF) + 1
13.2.2
Packet ID
The packet ID is used to distinguish the contents of the packet. Packet IDs range from
0 to 255.
Within this range there are three different sub-ranges, these are system packets, state
packets and configuration packets.
System packets have packet IDs in the range 0 to 19. These packets are implemented
the same by every device using ANPP.
State packets are packets that contain data that changes with time, i.e. temperature.
State packets can be set to output at a certain rate. State packets are packet IDs in
the range 20 to 179.
Configuration packets are used for reading and writing device configuration.
Configuration packets are packet IDs in the range 180 to 255.