CotpDataHeader.cs 765 B

123456789101112131415161718192021
  1. using Core.Communication.Transport;
  2. namespace PLC.Siemens.Protocol.Header
  3. {
  4. public class CotpDataHeader
  5. {
  6. public byte Length { get; set; } // Header length : 3 for this header
  7. public byte PduType { get; set; } // 0xF0 for this header
  8. public byte EoTNum { get; set; } // EOT (bit 7) + PDU Number (bits 0..6)
  9. // EOT = 1 -> End of Trasmission Packet (This packet is complete)
  10. // PDU Number : Always 0
  11. public ushort PacketLength { get{return 0x03;} }
  12. public void GetByteBuffer(ByteBuffer buffer)
  13. {
  14. buffer.Push(Length);
  15. buffer.Push(PduType);
  16. buffer.Push(EoTNum);
  17. }
  18. }
  19. }