ResponseHandle.cs 468 B

123456789101112131415161718
  1. using Houdar.Core.Communication.Transport;
  2. namespace Houdar.PLC.Driver.Simenss
  3. {
  4. public class ResponseHandle<TResponse> where TResponse : IBuildResponse, new()
  5. {
  6. private TResponse Response { get; set; }
  7. public void Build(byte[] responseBytes)
  8. {
  9. ByteBuffer buffer = ByteBuffer.Allocate();
  10. buffer.Push(responseBytes);
  11. Response = new TResponse();
  12. Response.Build(buffer);
  13. }
  14. }
  15. }