From 87fb81b9725bbce8bec985ca34447686885d7963 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 16 May 2018 20:00:14 +0200 Subject: [PATCH] Use https instead of http in links when available. Minor fixes --- cmake/Modules/FindPCAP.cmake | 5 +- .../signal_source/adapters/CMakeLists.txt | 50 +++++++++--------- .../adapters/custom_udp_signal_source.cc | 14 +++-- .../adapters/custom_udp_signal_source.h | 2 +- .../gnuradio_blocks/CMakeLists.txt | 51 +++++++++---------- .../gr_complex_ip_packet_source.cc | 7 ++- .../gr_complex_ip_packet_source.h | 10 ++-- .../unpack_byte_4bit_samples.cc | 4 +- .../unpack_byte_4bit_samples.h | 4 +- 9 files changed, 70 insertions(+), 77 deletions(-) diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index 7e0ea6995..3be89420e 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -1,4 +1,3 @@ - ################################################################### # # Copyright (c) 2006 Frederic Heem, @@ -112,11 +111,11 @@ CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) #Is pcap found ? IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) - SET( PCAP_FOUND "YES" ) + SET( PCAP_FOUND true ) ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES) MARK_AS_ADVANCED( PCAP_LIBRARIES PCAP_INCLUDE_DIRS -) \ No newline at end of file +) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index a591836e2..120fff27b 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -22,31 +22,31 @@ list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) # Optional drivers if(ENABLE_RAW_UDP) - # - Try to find libpcap include dirs and libraries - # - # Usage of this module as follows: - # - # find_package(PCAP) - # - # Variables used by this module, they can change the default behaviour and need - # to be set before calling find_package: - # - # PCAP_ROOT_DIR Set this variable to the root installation of - # libpcap if the module has problems finding the - # proper installation path. - # - # Variables defined by this module: - # - # PCAP_FOUND System has libpcap, include and library dirs found - # PCAP_INCLUDE_DIR The libpcap include directories. - # PCAP_LIBRARY The libpcap library (possibly includes a thread - # library e.g. required by pf_ring's libpcap) - # HAVE_PF_RING If a found version of libpcap supports PF_RING - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) + # - Try to find libpcap include dirs and libraries + # + # Usage of this module as follows: + # + # find_package(PCAP) + # + # Variables used by this module, they can change the default behaviour and need + # to be set before calling find_package: + # + # PCAP_ROOT_DIR Set this variable to the root installation of + # libpcap if the module has problems finding the + # proper installation path. + # + # Variables defined by this module: + # + # PCAP_FOUND System has libpcap, include and library dirs found + # PCAP_INCLUDE_DIR The libpcap include directories. + # PCAP_LIBRARY The libpcap library (possibly includes a thread + # library e.g. required by pf_ring's libpcap) + # HAVE_PF_RING If a found version of libpcap supports PF_RING + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") + endif() + get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index b754b5699..2ed2dd5ae 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -24,7 +24,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -50,8 +50,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati std::string default_dump_file = "./data/signal_source.dat"; std::string default_item_type = "gr_complex"; dump_ = configuration->property(role + ".dump", false); - dump_filename_ = configuration->property(role + ".dump_filename", - default_dump_file); + dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); // network PARAMETERS std::string default_capture_device = "eth0"; @@ -62,7 +61,6 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati int port = configuration->property(role + ".port", default_port); int payload_bytes = configuration->property(role + ".payload_bytes", 1024); - RF_channels_ = configuration->property(role + ".RF_channels", 1); channels_in_udp_ = configuration->property(role + ".channels_in_udp", 1); IQ_swap_ = configuration->property(role + ".IQ_swap", false); @@ -70,7 +68,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati std::string default_sample_type = "cbyte"; std::string sample_type = configuration->property(role + ".sample_type", default_sample_type); item_type_ = configuration->property(role + ".item_type", default_item_type); - //output item size is always gr_complex + // output item size is always gr_complex item_size_ = sizeof(gr_complex); udp_gnss_rx_source_ = gr_complex_ip_packet_source::make(capture_device, @@ -95,7 +93,6 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati exit(0); } - if (dump_) { for (int n = 0; n < channels_in_udp_; n++) @@ -114,7 +111,7 @@ CustomUDPSignalSource::~CustomUDPSignalSource() void CustomUDPSignalSource::connect(gr::top_block_sptr top_block) { - //connect null sinks to unused streams + // connect null sinks to unused streams for (int n = 0; n < channels_in_udp_; n++) { top_block->connect(udp_gnss_rx_source_, n, null_sinks_.at(n), 0); @@ -134,7 +131,7 @@ void CustomUDPSignalSource::connect(gr::top_block_sptr top_block) void CustomUDPSignalSource::disconnect(gr::top_block_sptr top_block) { - //disconnect null sinks to unused streams + // disconnect null sinks to unused streams for (int n = 0; n < channels_in_udp_; n++) { top_block->disconnect(udp_gnss_rx_source_, n, null_sinks_.at(n), 0); @@ -163,6 +160,7 @@ gr::basic_block_sptr CustomUDPSignalSource::get_right_block() return udp_gnss_rx_source_; } + gr::basic_block_sptr CustomUDPSignalSource::get_right_block(__attribute__((unused)) int RF_channel) { return udp_gnss_rx_source_; diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 9bed9ae32..fcd42071d 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -24,7 +24,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index b35caa37d..fdeb71c47 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -18,35 +18,34 @@ if(ENABLE_RAW_UDP) - # - Try to find libpcap include dirs and libraries - # - # Usage of this module as follows: - # - # find_package(PCAP) - # - # Variables used by this module, they can change the default behaviour and need - # to be set before calling find_package: - # - # PCAP_ROOT_DIR Set this variable to the root installation of - # libpcap if the module has problems finding the - # proper installation path. - # - # Variables defined by this module: - # - # PCAP_FOUND System has libpcap, include and library dirs found - # PCAP_INCLUDE_DIR The libpcap include directories. - # PCAP_LIBRARY The libpcap library (possibly includes a thread - # library e.g. required by pf_ring's libpcap) - # HAVE_PF_RING If a found version of libpcap supports PF_RING - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") - endif() - get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) + # - Try to find libpcap include dirs and libraries + # + # Usage of this module as follows: + # + # find_package(PCAP) + # + # Variables used by this module, they can change the default behaviour and need + # to be set before calling find_package: + # + # PCAP_ROOT_DIR Set this variable to the root installation of + # libpcap if the module has problems finding the + # proper installation path. + # + # Variables defined by this module: + # + # PCAP_FOUND System has libpcap, include and library dirs found + # PCAP_INCLUDE_DIR The libpcap include directories. + # PCAP_LIBRARY The libpcap library (possibly includes a thread + # library e.g. required by pf_ring's libpcap) + # HAVE_PF_RING If a found version of libpcap supports PF_RING + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)") + endif() + get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) - endif(ENABLE_RAW_UDP) set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index 038ea6fbe..8da6d4a5d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -24,17 +24,16 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ -#include #include "gr_complex_ip_packet_source.h" +#include -#include -#include +//#include #define FIFO_SIZE 1472000 diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 7b8d9f58e..0661e0911 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -24,7 +24,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -40,6 +40,7 @@ #include #include #include +#include #include class gr_complex_ip_packet_source : virtual public gr::sync_block @@ -77,12 +78,9 @@ private: void demux_samples(gr_vector_void_star output_items, int num_samples_readed); void my_pcap_loop_thread(pcap_t *pcap_handle); - void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); - static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); - public: typedef boost::shared_ptr sptr; static sptr make(std::string src_device, @@ -108,9 +106,9 @@ public: gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - //Called by gnuradio to enable drivers, etc for i/o devices. + // Called by gnuradio to enable drivers, etc for i/o devices. bool start(); - //Called by gnuradio to disable drivers, etc for i/o devices. + // Called by gnuradio to disable drivers, etc for i/o devices. bool stop(); }; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc index ba9f9365e..b3a1d61f7 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.cc @@ -7,7 +7,7 @@ * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -25,7 +25,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h index ccfe699b5..0a48bcb5f 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h @@ -7,7 +7,7 @@ * \author Javier Arribas jarribas (at) cttc.es * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -25,7 +25,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */