Interface ModbusReference


public interface ModbusReference
A reference to a Modbus register (or registers).
Since:
2.8
Version:
2.0
Author:
matt
  • Method Details

    • getAddress

      int getAddress()
      Get the register address.
      Returns:
      the address
    • getDataType

      ModbusDataType getDataType()
      Get the data type.
      Returns:
      the data type
    • getFunction

      ModbusReadFunction getFunction()
      Get the read function for accessing the register.
      Returns:
      the read function
    • getWordLength

      int getWordLength()
      Get the number of Modbus words to include.
      Returns:
      the word length
    • createAddressSet

      static <T extends Enum<?> & ModbusReference> net.solarnetwork.util.IntRangeSet createAddressSet(Class<T> clazz, Set<String> prefixes)
      Create a Modbus register address set from enum ModbusReference values.
      Type Parameters:
      T - the enum type that also implements ModbusReference
      Parameters:
      clazz - the enum class to extract the register set from
      prefixes - an optional set of enum prefixes to restrict the result to; if not provided then all enum values will be included
      Returns:
      the range set, never null
      Since:
      2.0
      See Also:
    • createAddressSet

      static net.solarnetwork.util.IntRangeSet createAddressSet(ModbusReference[] refs, Set<String> prefixes)
      Create a Modbus register address set from an array of ModbusReference values.
      Parameters:
      refs - the list of references to extract addresses from
      prefixes - an optional set of enum prefixes to restrict the result to, which are compared to the Object.toString() value of each ModbusReference in refs; if not provided then all values will be included
      Returns:
      the range set, never null
      Since:
      2.0