IIO.cs 976 B

123456789101112131415161718192021222324252627282930
  1. namespace Universal.IO;
  2. public interface ITcpClient : IFilter, IDisposable
  3. {
  4. bool Initiallize(string name);
  5. bool Open(string remoteHost, ushort remotePort, out TcpConnection? tcpConnection, string? localHost = null, ushort localPort = 0, bool noDelay = false, int timeout = 1000, int receiveBufferSize = 4096);
  6. bool Close();
  7. }
  8. public interface ITcpServer : IFilter, IDisposable
  9. {
  10. bool Initialize(string name);
  11. bool Open(string ip, ushort port, bool noDelay = true, int receiveBufferSize = 4096);
  12. bool Close();
  13. }
  14. public interface IModBus<T_buffer>
  15. {
  16. bool Initialize(string name);
  17. T_buffer GetBuffer(ushort index, ushort count, byte slaveAddress = 1);
  18. bool SetUshort(ushort index, ushort value, byte slaveAddress = 1);
  19. bool SetValue<T>(ushort index, T value, byte slaveAddress = 1) where T : struct;
  20. bool SetFloat(ushort index, float value, byte slaveAddress = 1);
  21. bool Open(string ip, ushort port);
  22. bool Close();
  23. }