namespace InABox.DigitalMatter
{
    public class DMHelloResponse : DMMessage
    {
        public DMHelloResponse()
        {
            TimeStamp = SecondsSince2013UTC();
        }

        public override byte Type => 0x01;

        public uint TimeStamp { get; set; }

        public uint Flags { get; set; }

        protected override void DoEncode(IDMWriteBuffer buffer)
        {
            buffer.AddUInt32(TimeStamp);
            buffer.AddUInt32(Flags);
        }

        protected override void DoDecode(IDMReadBuffer buffer)
        {
            TimeStamp = buffer.TakeUInt32();
            Flags = buffer.TakeUInt32();
        }
    }
}