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 InfoBox : BaseInfo, IDeviceCommandCallback
    {
        public int Route { get; set; }
        public int Function { get; set; }
        public bool BoxCalled { get; set; }
        public bool BoxCancelCall { get; set; }

        public void Deserialize(byte[] data)
        {
            Function = data[1];
            Route = (data[6] << 8) + data[7] - 0x3030;

            BoxCalled = Function == 0x41;
            BoxCancelCall = Function == 0x42;

            LastUpdateTime = DateTime.Now;
        }
    }
}
