public interface RtuModbusMessage
extends net.solarnetwork.io.modbus.ModbusMessage
| Modifier and Type | Field and Description |
|---|---|
static String |
CRC_MISMATCH_VALIDATION_MESSAGE
A
ModbusValidationException message template. |
| Modifier and Type | Method and Description |
|---|---|
short |
computeCrc()
Compute the 16-bit cyclic redundancy check value from the message data.
|
short |
getCrc()
Get the 16-bit cyclic redundancy check value presented in the RTU message
frame.
|
long |
getTimestamp()
Get a message creation date.
|
default boolean |
isCrcValid()
Test if the provided and computed CRC values match.
|
default RtuModbusMessage |
validate() |
static final String CRC_MISMATCH_VALIDATION_MESSAGE
ModbusValidationException message template.
The message accepts two short values: the provided CRC and the computed CRC.
long getTimestamp()
short getCrc()
short computeCrc()
If the getCrc() and this value differ, the message should be
considered corrupted.
default boolean isCrcValid()
getCrc() and computeCrc()
return the same valuedefault RtuModbusMessage validate() throws net.solarnetwork.io.modbus.ModbusValidationException
validate in interface net.solarnetwork.io.modbus.ModbusMessagenet.solarnetwork.io.modbus.ModbusValidationException