Search in sources :

Example 1 with ModbusSlave

use of me.retrodaredevil.io.modbus.ModbusSlave in project solarthing by wildmountainfarms.

the class DummyModbusIOConfig method createIOBundle.

@Override
public IOBundle createIOBundle() {
    Map<Integer, ModbusSlave> map = new HashMap<>(addressToSlaveMap.size());
    for (Map.Entry<Integer, DummyModbusSlave> entry : addressToSlaveMap.entrySet()) {
        int address = entry.getKey();
        DummyModbusSlave slave = entry.getValue();
        map.put(address, slave.createModbusSlave());
    }
    return new DummyModbusIO(map, new RtuDataEncoder());
}
Also used : ModbusSlave(me.retrodaredevil.io.modbus.ModbusSlave) RtuDataEncoder(me.retrodaredevil.io.modbus.RtuDataEncoder) HashMap(java.util.HashMap) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 ModbusSlave (me.retrodaredevil.io.modbus.ModbusSlave)1 RtuDataEncoder (me.retrodaredevil.io.modbus.RtuDataEncoder)1