Пример #1
0
        public static Radio[] Scan()
        {
            int devs = Pal.GetNumDevices();

            if (devs == 0)
            {
                return(null);
            }

            Radio[] radios = new Radio[devs];

            for (uint i = 0; i < devs; i++)
            {
                uint model;
                uint sn;
                if (!Pal.GetDeviceInfo(i, out model, out sn))
                {
                    return(null);
                }

                Model m = Model.FLEX5000;
                if (model == 3)
                {
                    m = Model.FLEX3000;
                }

                string serial = FWCEEPROM.SerialToString(sn);

                radios[i] = new Radio(m, i, serial, true);
            }

            return(radios);
        }
Пример #2
0
        public static byte Calc(SortedDictionary <double, uint> dict)
        {
            byte sum = 0;

            foreach (KeyValuePair <double, uint> pair in dict)
            {
                ulong freq = FWCEEPROM.ToVitaFreq(Math.Round(pair.Key, 3));
                for (int i = 0; i < 8; i++)
                {
                    sum += (byte)(freq >> i * 8);
                }

                for (int i = 0; i < 4; i++)
                {
                    sum += (byte)(pair.Value >> i * 4);
                }
            }

            return(sum);
        }
Пример #3
0
        public static Radio[] Scan()
        {
            int devs = Pal.GetNumDevices();                 // get numer of radios found

            //    System.Diagnostics.Trace.WriteLine("pal=============================");

            if (devs == 0)
            {
                return(null);
            }

            Radio[] radios = new Radio[devs];

            for (uint i = 0; i < devs; i++)
            {
                uint model;
                uint sn;

                if (!Pal.GetDeviceInfo(i, out model, out sn))
                {
                    return(null);
                }

                Model m = Model.FLEX5000;
                if (model == 3)
                {
                    m = Model.FLEX3000;
                }

                string serial = FWCEEPROM.SerialToString(sn);   // radios serial#

                radios[i] = new Radio(m, i, serial, true);
            }

            return(radios);
        } // Scan()