From db938bb047d2eba5a3eed4ee293f28803ebe5667 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 20 Jan 2018 11:56:17 +0100 Subject: [PATCH] Build fix due to a change in the gr-iio v0.3 API A change in the API has removed the decimation parameter from sources (see https://github.com/analogdevicesinc/gr-iio/issues/15 ) This commit fixes the build against the current master of https://github.com/analogdevicesinc/gr-iio but it breaks compatibility with older versions. Users with gr-iio already installed will need to update it. --- README.md | 2 +- conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf | 2 -- conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf | 2 -- .../signal_source/adapters/fmcomms2_signal_source.cc | 3 +-- src/algorithms/signal_source/adapters/fmcomms2_signal_source.h | 1 - .../signal_source/adapters/plutosdr_signal_source.cc | 3 +-- src/algorithms/signal_source/adapters/plutosdr_signal_source.h | 1 - 7 files changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2c101387c..06f884a00 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,7 @@ $ sudo make install ###### Build FMCOMMS2 based SDR Hardware support (OPTIONAL): -Install the [libiio](https://github.com/analogdevicesinc/libiio.git) (>=v0.11), [libad9361](https://github.com/analogdevicesinc/libad9361-iio.git) (>=v0.1-1) libraries and [gr-iio](https://github.com/analogdevicesinc/gr-iio.git) (>v0.2) gnuradio block: +Install the [libiio](https://github.com/analogdevicesinc/libiio.git) (>=v0.11), [libad9361](https://github.com/analogdevicesinc/libad9361-iio.git) (>=v0.1-1) libraries and [gr-iio](https://github.com/analogdevicesinc/gr-iio.git) (>v0.3) gnuradio block: ~~~~~~ $ sudo apt-get install libxml2-dev bison flex diff --git a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf index ae832f901..6c8d8d85c 100644 --- a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf @@ -27,13 +27,11 @@ GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=Fmcomms2_Signal_Source -;SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat SignalSource.item_type=gr_complex SignalSource.device_address=10.42.0.196 SignalSource.sampling_frequency=2000000 SignalSource.freq=1575420000 SignalSource.bandwidth=2000000 -SignalSource.decimation=0 SignalSource.rx1_enable=true SignalSource.gain_mode_rx1=manual SignalSource.rf_port_select=A_BALANCED diff --git a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf index 97c9deded..83f808645 100644 --- a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf +++ b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf @@ -27,13 +27,11 @@ GNSS-SDR.SUPL_CI=0x31b0 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource.implementation=Plutosdr_Signal_Source -;SignalSource.filename=/media/DATALOGGER_/signals/RTL-SDR/geo/pmt4.dat SignalSource.item_type=gr_complex SignalSource.device_address=192.168.2.1 SignalSource.sampling_frequency=3000000 SignalSource.freq=1575420000 SignalSource.bandwidth=2600000 -SignalSource.decimation=0 SignalSource.gain_mode=manual SignalSource.gain=30 SignalSource.samples=0 diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc index 5c354e500..52916a19e 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.cc @@ -53,7 +53,6 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration rx1_en_ = configuration->property(role + ".rx1_enable", true); rx2_en_ = configuration->property(role + ".rx2_enable", false); buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000); - decimation_ = configuration->property(role + ".decimation", 1); quadrature_ = configuration->property(role + ".quadrature", true); rf_dc_ = configuration->property(role + ".rf_dc", true); bb_dc_ = configuration->property(role + ".bb_dc", true); @@ -79,7 +78,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration { fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make( uri_.c_str(), freq_, sample_rate_, - decimation_, bandwidth_, + bandwidth_, rx1_en_, rx2_en_, buffer_size_, quadrature_, rf_dc_, bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_, diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index fb62a12cb..78f3ebb58 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -83,7 +83,6 @@ private: unsigned long sample_rate_; unsigned long bandwidth_; unsigned long buffer_size_; //reception buffer - unsigned int decimation_; bool rx1_en_; bool rx2_en_; bool quadrature_; diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc index 34526f6a5..4e7e37b3e 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.cc @@ -52,7 +52,6 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration sample_rate_ = configuration->property(role + ".sampling_frequency", 3000000); bandwidth_ = configuration->property(role + ".bandwidth", 2000000); buffer_size_ = configuration->property(role + ".buffer_size", 0xA0000); - decimation_ = configuration->property(role + ".decimation", 1); quadrature_ = configuration->property(role + ".quadrature", true); rf_dc_ = configuration->property(role + ".rf_dc", true); bb_dc_ = configuration->property(role + ".bb_dc", true); @@ -81,7 +80,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration std::cout << "item type: " << item_type_ << std::endl; plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_, - decimation_, bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_, + bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_, gain_mode_.c_str(), rf_gain_,filter_file_.c_str(), filter_auto_); if (samples_ != 0) diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index 9bbdb4511..56c2334c8 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -83,7 +83,6 @@ private: unsigned long sample_rate_; unsigned long bandwidth_; unsigned long buffer_size_; // reception buffer - unsigned int decimation_; bool quadrature_; bool rf_dc_; bool bb_dc_;