SF000 LiDAR Sensor
Product guide
Packets
A packet for both requests and responses is composed of the following bytes:
Header
Payload
Checksum
**Byte:**
Start
Flags
Low
Flags
High
ID
Data 0 .. N
CRC
Low
CRC
High
The Start byte is always 0xAA and indicates the beginning of a packet. It is important to verify that the payload
length is between (inclusive) 0 to 1023 and that the checksum is valid before processing a packet, rather than just
relying on the start byte.
The Flags bytes form a 16 bit integer that represents the payload length and read/write status of the packet. The
payload length is inclusive of the ID byte and the required number of data bytes. The write bit is set to 1 to indicate
write mode, or 0 to indicate read mode.
**Bit:*
*
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Payload length (0 to 1023)
Reserved
W
The
ID
byte represents which command the request/response relates to.
There will be between 1 and 1023 Payload bytes (inclusive) depending on the command type. Each command
under the
section documents how the data bytes are used. The ID byte will always
be present in the payload.
The CRC bytes form a 16 bit checksum value used to validate the integrity of the packet data. Every byte in the
packet except for the
CRC
itself is included in the checksum calculation.
Checksum
Each packet has a 2 byte checksum which is used to validate data integrity. The algorithm is CRC-16-CCITT 0x1021.
The CRC must be correctly formed for the SF000/B to accept and process packets. Below are some examples in
various languages for CRC calculation:
25 of 47
SF000 microLiDAR™ sensor - Product guide(Rev 5) | © LightWare Optoelectronics (Pty) Ltd, 2021 |