use of me.retrodaredevil.solarthing.solar.renogy.rover.modbus.LocalRoverModbusSlave in project solarthing by wildmountainfarms.
the class DummyRoverModbusSlave method createModbusSlave.
@Override
public ModbusSlave createModbusSlave() {
final FileInputStream fileInputStream;
try {
fileInputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
throw new RuntimeException("The dummy file was not found!", e);
}
final RoverStatusPacket roverStatusPacket;
try {
roverStatusPacket = MAPPER.readValue(fileInputStream, RoverStatusPacket.class);
} catch (IOException e) {
throw new RuntimeException(e);
}
return new LocalRoverModbusSlave(roverStatusPacket);
}
Aggregations