using PlcSiemens.O;
using PlcSiemens.Protocol.Common;

namespace PlcSiemens.Protocol.Szl
{
    public class SzlDataNextResponse
    {
        public ResultCode Ret { get; set; }
        public byte Ts { get; set; }
        public ushort DLen { get; set; }
        public byte[] Data { get; set; }

        public void Build(ByteBuffer buffer)
        {
            Ret = (ResultCode)buffer.PopByte();
            Ts = buffer.PopByte();
            DLen = buffer.PopUshort();
            Data = buffer.PopBytes(DLen);
        }
    }
}
