using skyscraper5.Skyscraper.IO;
using skyscraper5.T2MI.Packets.AdressingFunctions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.T2MI.Packets.AdressingFunctions
{
    internal class _0x17_Frequency : AddressingFunction
    {
        public _0x17_Frequency(byte[] buffer) : base(0x17, false, true)
        {
            if (buffer.Length != 5)
            {
                Valid = false;
                return;
            }
            MemoryStream ms = new MemoryStream(buffer, false);
            InBitStream ibs = new InBitStream(ms);

            RfIdx = ibs.ReadBitsAsByte(3);
            Frequency = ibs.ReadBitsAsULong(32);
            Valid = true;
        }

        public byte RfIdx { get; }
        public ulong Frequency { get; }
    }
}
