using InnovEnergy.Lib.Protocols.Modbus.Channels; using InnovEnergy.Lib.Protocols.Modbus.Clients; using InnovEnergy.Lib.Protocols.Modbus.Slaves; using InnovEnergy.Lib.Utils; namespace InnovEnergy.Lib.Devices.Doepke; public class DoepkeDevice : ModbusDevice { public DoepkeDevice(String hostname, Byte slaveId = 0, UInt16 port = 502) : this(new TcpChannel(hostname, port), slaveId) { } public DoepkeDevice(Channel channel, Byte slaveId = 0) : base(new ModbusTcpClient(channel, slaveId)) { } public new DoepkeRegisters? Read() { try { return base.Read(); } catch { "Failed to read data from Doepke".WriteLine(); return null; } } public new void Write(DoepkeRegisters registers) { try { base.Write(registers); } catch (Exception e) { // TODO: Log Console.WriteLine(e); } } }