use of me.retrodaredevil.solarthing.config.request.modbus.ModbusDataRequester in project solarthing by wildmountainfarms.
the class RoverMain method doRover.
private static int doRover(RoverProgramOptions options, AnalyticsManager analyticsManager, List<DataRequester> dataRequesterList) throws Exception {
RoverModbusRequester roverModbusRequester = new RoverModbusRequester(options.isSendErrorPackets(), options.isBulkRequest(), // attach the given rover modbus environment to all commands
options.getCommandInfoList().stream().map(CommandInfo::getName).collect(Collectors.toList()), null, null);
Map<Integer, ModbusRequester> deviceMap = new HashMap<>();
deviceMap.put(options.getModbusAddress(), roverModbusRequester);
ModbusDataRequester dataRequester = new ModbusDataRequester(options.getIOBundleFile(), deviceMap, null, null);
List<DataRequester> list = new ArrayList<>(dataRequesterList);
list.add(dataRequester);
return RequestMain.startRequestProgram(options, analyticsManager, list, options.getPeriod(), options.getMinimumWait());
}
Aggregations