using ProjectManagementSystem.Device.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProjectManagementSystem.Device.CommandCallback
{
    public class InfoVcu : BaseInfo, IDeviceCommandCallback
    {
        public InfoVcu()
        {
            TimeoutSecond = 90;
        }

        public int AgvId { get; set; }
        public string ScanMessage { get; set; }
        public void Deserialize(byte[] data)
        {
            AgvId = BitConverter.ToUInt16(data, 1);
            ushort dataLenght = BitConverter.ToUInt16(data, 3);
            ScanMessage = Encoding.Default.GetString(data, 5, dataLenght);
            //Barcode = BitConverter.ToUInt16(data, 5).ToString();

            LastUpdateTime = DateTime.Now;
        }
    }
}
