Class OptimizingRegisterBlockFetcher

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getAllowedGapReadSize() How many registers may needlessly be read to optimize fetching
      final Unit setAllowedGapReadSize(Integer allowedGapReadSize)
      List<ModbusQuery> calculateModbusQueries(Long maxAge) Determine which sets of registers need to be retrieved again.
      • Methods inherited from class nl.basjes.modbus.schema.fetcher.RegisterBlockFetcher

        getRegisters, update, update, update
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OptimizingRegisterBlockFetcher

        OptimizingRegisterBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
    • Method Detail

      • calculateModbusQueries

         List<ModbusQuery> calculateModbusQueries(Long maxAge)

        Determine which sets of registers need to be retrieved again.

        Parameters:
        maxAge - The maximum age (in milliseconds) of the data for it to need an update.
        Returns:

        The list of address ranges that must be retrieved (Sorted by the start address)