NegotiateRequestParams.cs 954 B

12345678910111213141516171819202122232425262728293031323334
  1. using PlcSiemens.O;
  2. using PlcSiemens.Protocol.Common;
  3. namespace PlcSiemens.Protocol.Negotiate
  4. {
  5. public class NegotiateRequestParams
  6. {
  7. public byte FunNegotiate { get; set; }
  8. public byte Unknown { get; set; }
  9. public ushort ParallelJobs1 { get; set; }
  10. public ushort ParallelJobs2 { get; set; }
  11. public ushort PduLength { get; set; }
  12. public ushort PacketLength = 0x08;
  13. public void GetByteBuffer(ByteBuffer buffer)
  14. {
  15. buffer.Push(FunNegotiate);
  16. buffer.Push(Unknown);
  17. buffer.Push(ParallelJobs1);
  18. buffer.Push(ParallelJobs2);
  19. buffer.Push(PduLength);
  20. }
  21. public void Build(ushort pduRequest)
  22. {
  23. FunNegotiate = (byte)PduFuncType.PduNegotiate;
  24. Unknown = 0x00;
  25. ParallelJobs1 = 0x0001;
  26. ParallelJobs2 = 0x0001;
  27. PduLength = pduRequest;
  28. }
  29. }
  30. }