public class Checksum extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
compute(byte[] fullMessage,
boolean insert)
Compute checksum.
|
public static byte[] compute(byte[] fullMessage,
boolean insert)
The checksum is computed by summing the full message buffer up to and including the checksum's length field. The reference algorithm as listed in the ST takes two bytes at a time and treats them as uint16 values. It sums them into another uint16 register, so overflow is normal and ignored.
fullMessage - Byte array of the full message packetinsert - True to insert the computed checksum into fullMessageCopyright © 2022 West Ridge Systems. All rights reserved.