Serial interface
Overview
We suggest using the pre-built APIs for communicating with the LW24/C where possible.
The LW24/C uses a packet based binary protocol which can be accessed over the serial and I2C interfaces. All
higher-level APIs (C, Python, JavaScript) use this protocol to function.
If you require more control than the existing APIs offer or need to port the protocol to a different platform, then you
can use the information here to build a compatible system.
Communication is performed using encapsulated packets for both sending and receiving data. Every packet that is sent
to the LW24/C is known as a request and a correctly formatted request will always be replied to with a response. There
are cases where the LW24/C will send a request packet to the host, these packets are considered streaming packets as
they arrive without a direct request from the host - they do not require a response from the host.
Streaming data is only available through the Serial interface.
Requests are made using one of the available
and are either flagged as read or write. When a read request
is issued then the response will contain the requested data. When a write request is issued then the contents of the
response will vary depending on the command.
Default serial interface properties
●
Baud rate: 115200
●
Data: 8 bit
●
Parity: none
●
Stop: 1 bit
●
Flow control: none
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
LW24/C/SI microLiDAR™ sensor - Product guide
|
Version 0
|
03 March 2022
Page
20
of
36