Package nl.basjes.modbus.schema.fetcher
Class OptimizingRegisterBlockFetcher
-
- All Implemented Interfaces:
public final class OptimizingRegisterBlockFetcher extends RegisterBlockFetcher
-
-
Field Summary
Fields Modifier and Type Field Description private IntegerallowedGapReadSize
-
Constructor Summary
Constructors Constructor Description OptimizingRegisterBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
Method Summary
Modifier and Type Method Description final IntegergetAllowedGapReadSize()How many registers may needlessly be read to optimize fetching final UnitsetAllowedGapReadSize(Integer allowedGapReadSize)List<RegisterBlockFetcher.FetchBatch>calculateFetchBatches(Long maxAge)Determine which sets of registers need to be retrieved again. -
-
Constructor Detail
-
OptimizingRegisterBlockFetcher
OptimizingRegisterBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
-
Method Detail
-
getAllowedGapReadSize
final Integer getAllowedGapReadSize()
How many registers may needlessly be read to optimize fetching
-
setAllowedGapReadSize
final Unit setAllowedGapReadSize(Integer allowedGapReadSize)
-
calculateFetchBatches
List<RegisterBlockFetcher.FetchBatch> calculateFetchBatches(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)
-
-
-
-