BlockItem.cs 530 B

12345678910111213141516171819
  1. using Core.Communication.Transport;
  2. using PLC.Siemens.Protocol.Common;
  3. namespace PLC.Siemens.Protocol.ListBlocks
  4. {
  5. public class BlockItem
  6. {
  7. public byte Zero { get; set; } // always 0x30 -> Ascii 0
  8. public BlockType Type { get; set; } // Block Type
  9. public ushort Count { get; set; } // Block count
  10. public void Build(ByteBuffer buffer)
  11. {
  12. Zero = buffer.PopByte();
  13. Type = (BlockType)buffer.PopByte();
  14. Count = buffer.PopUshort();
  15. }
  16. }
  17. }