7.4. Receiving packets
Here is the process for reading the raw serial byte stream and identifyingpackets. Once a packet has been
successfully read it can be processed based on its commandID.
Start
Sucess
Read incomingbyte
Yes
No
Is startbyte? (0xAA)
Read 2 bytes: Flags (uint16)
No
Yes
Is payload
length 1 to 1023?
Failure: packet length invalid
Read 'payload length' bytes
Read 2 bytes: CRC (uint16)
No
Yes
Is CRC valid?
Failure: checksum invalid
Failure: invalid start byte
If the packet length or checksum is invalid then it is technically more correct to roll the incoming stream
back to when the start byte was found. However in practice this has little appreciable impact.
SF40/C
Product manual
SF40/C -Product manual
|
16 of 30 |
© LightWare Optoelectronics (Pty) Ltd, 2019 |
www.lightware.co.za