Class ModbusValue
-
- All Implemented Interfaces:
-
kotlin.Comparable
public class ModbusValue<VALUE extends ModbusValue<VALUE, TYPE>, TYPE extends Object> implements Comparable<VALUE>
Holds the single value of a single modbus coil/discrete input or register
-
-
Method Summary
Modifier and Type Method Description final StringgetFetchGroup()An identifier to that can be used to ensure some registers are retrieved together. final UnitsetFetchGroup(String fetchGroup)An identifier to that can be used to ensure some registers are retrieved together. final BooleangetImmutable()Some registers will NEVER change and thus do not need to be retrieved a second time final UnitsetImmutable(Boolean immutable)Some registers will NEVER change and thus do not need to be retrieved a second time final TYPEgetValue()final StringgetComment()If a value has a comment this can be used when converting it to a String (in yaml for example) final UnitsetComment(String comment)If a value has a comment this can be used when converting it to a String (in yaml for example) final LonggetTimestamp()final BooleangetHardReadError()final UnitsetHardReadError(Boolean hardReadError)final StringgetAsString()final AddressgetAddress()The modbus coil/discrete/register input address. final VALUEclone()final VALUEsetValue(TYPE value)final VALUEsetValue(VALUE modbusValue)final VALUEsetValue(TYPE value, Long timestamp)final BooleanhasValue()final UnitsetSoftReadError()final UnitsetHardReadError()final BooleanisReadError()final UnitclearSoftReadError()final BooleanneedsToBeUpdated(Long now, Long maxAge)final Unitclear()abstract StringtoSingleValueString()IntegercompareTo(VALUE other)Booleanequals(Object other)IntegerhashCode()-
-
Method Detail
-
getFetchGroup
final String getFetchGroup()
An identifier to that can be used to ensure some registers are retrieved together. By default, filled with a random unique value because we assume they are all independent.
-
setFetchGroup
final Unit setFetchGroup(String fetchGroup)
An identifier to that can be used to ensure some registers are retrieved together. By default, filled with a random unique value because we assume they are all independent.
-
getImmutable
final Boolean getImmutable()
Some registers will NEVER change and thus do not need to be retrieved a second time
-
setImmutable
final Unit setImmutable(Boolean immutable)
Some registers will NEVER change and thus do not need to be retrieved a second time
-
getComment
final String getComment()
If a value has a comment this can be used when converting it to a String (in yaml for example)
-
setComment
final Unit setComment(String comment)
If a value has a comment this can be used when converting it to a String (in yaml for example)
-
getTimestamp
final Long getTimestamp()
-
getHardReadError
final Boolean getHardReadError()
-
setHardReadError
final Unit setHardReadError(Boolean hardReadError)
-
getAsString
final String getAsString()
-
getAddress
final Address getAddress()
The modbus coil/discrete/register input address.
-
setSoftReadError
final Unit setSoftReadError()
-
setHardReadError
final Unit setHardReadError()
-
isReadError
final Boolean isReadError()
-
clearSoftReadError
final Unit clearSoftReadError()
-
needsToBeUpdated
final Boolean needsToBeUpdated(Long now, Long maxAge)
-
toSingleValueString
abstract String toSingleValueString()
-
-
-
-