using System;
using System.Runtime.InteropServices;

namespace skyscraper5.Skyscraper.IO.LibDvbV5
{
    public class LibDvbV5SatLnb
    {
        public LibDvbV5SatLnb(int index)
        {
            ptr = LibDvbV5.DvbSatGetLnb(index);
            _wrapped = Marshal.PtrToStructure<Wrapped>(ptr);
        }

        internal IntPtr ptr;
        private Wrapped _wrapped;

        private struct Wrapped
        {
            public string name;
            public string alias;
            public uint lowfreq;
            public uint highfreq;
            public uint rangeswitch;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
            public FrequencyRange[] freqrange;
        }
        
        private struct FrequencyRange
        {
            public uint low;
            public uint high;
        }
    }
}