Пример #1
0
        public static AirSpyDevice OpenFromDefault()
        {
            airspy_error error = NativeMethods.airspy_open(out IntPtr device);

            if (error != airspy_error.AIRSPY_SUCCESS)
            {
                throw new HardwareNotFoundException();
            }
            return(new AirSpyDevice(device));
        }
Пример #2
0
        public static AirSpyDevice OpenFromSerialNumber(ulong serial)
        {
            airspy_error error = NativeMethods.airspy_open_sn(out IntPtr device, serial);

            if (error != airspy_error.AIRSPY_SUCCESS)
            {
                throw new HardwareNotFoundException();
            }
            return(new AirSpyDevice(device));
        }
Пример #3
0
        public static airspy_error airspy_r820t_write_mask(IntPtr device, byte reg, byte value, byte mask)
        {
            byte         b;
            airspy_error airspy_error = NativeMethods.airspy_r820t_read(device, reg, out b);

            if (airspy_error < airspy_error.AIRSPY_SUCCESS)
            {
                return(airspy_error);
            }
            value = (byte)((b & ~mask) | (value & mask));
            return(NativeMethods.airspy_r820t_write(device, reg, value));
        }
Пример #4
0
        public static airspy_error airspy_r820t_write_mask(
            IntPtr device,
            byte reg,
            byte value,
            byte mask)
        {
            byte         num;
            airspy_error airspyError = NativeMethods.airspy_r820t_read(device, reg, out num);

            if (airspyError < airspy_error.AIRSPY_SUCCESS)
            {
                return(airspyError);
            }
            value = (byte)((int)num & (int)~mask | (int)value & (int)mask);
            return(NativeMethods.airspy_r820t_write(device, reg, value));
        }
Пример #5
0
 private void SendCalibrationProlog()
 {
     if (this._calibrationState == CalibrationState.UnCalibrated)
     {
         airspy_error airspy_error = NativeMethods.airspy_r820t_read(this._dev, (byte)15, out this._old_0x0f_value);
         if (airspy_error >= airspy_error.AIRSPY_SUCCESS)
         {
             airspy_error = NativeMethods.airspy_r820t_read(this._dev, (byte)11, out this._old_0x0b_value);
             if (airspy_error >= airspy_error.AIRSPY_SUCCESS)
             {
                 NativeMethods.airspy_r820t_write(this._dev, 15, (byte)((this._old_0x0f_value & -5) | 4));
                 NativeMethods.airspy_r820t_write(this._dev, 11, (byte)((this._old_0x0b_value & -17) | 0x10));
                 this._calibrationState = CalibrationState.PrologSent;
             }
         }
     }
 }
Пример #6
0
 public AirSpyException(airspy_error error, string msg) : base($"{error.ToString()}: {msg}")
 {
     this.error = error;
 }