From dfeb62871f58db2147e51d403ed52a2fb1b70c9c Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Wed, 16 May 2018 11:36:37 +0200 Subject: [PATCH] Adding optional compilation of the custom UDP packet source. Disabled by default --- CMakeLists.txt | 40 +-- .../signal_source/adapters/CMakeLists.txt | 33 +- ..._source.cc => custom_udp_signal_source.cc} | 16 +- ...al_source.h => custom_udp_signal_source.h} | 14 +- .../gnuradio_blocks/CMakeLists.txt | 38 ++- .../gnuradio_blocks/raw_ip_packet_source.cc | 289 ------------------ .../gnuradio_blocks/raw_ip_packet_source.h | 99 ------ src/core/receiver/CMakeLists.txt | 3 + src/core/receiver/gnss_block_factory.cc | 16 +- 9 files changed, 105 insertions(+), 443 deletions(-) rename src/algorithms/signal_source/adapters/{udp_signal_source.cc => custom_udp_signal_source.cc} (90%) rename src/algorithms/signal_source/adapters/{udp_signal_source.h => custom_udp_signal_source.h} (89%) delete mode 100644 src/algorithms/signal_source/gnuradio_blocks/raw_ip_packet_source.cc delete mode 100644 src/algorithms/signal_source/gnuradio_blocks/raw_ip_packet_source.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c2fe13617..954690ffb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,7 @@ option(ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experime option(ENABLE_PLUTOSDR "Enable the use of ADALM-PLUTO Evaluation Boards (Analog Devices Inc.), requires gr-iio" OFF) option(ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requires gr-iio" OFF) option(ENABLE_AD9361 "Enable the use of AD9361 directo to FPGA hardware, requires gr-iio" OFF) +option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample source, requires libpcap" OFF) # Performance analysis tools option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) @@ -1321,6 +1322,16 @@ else(ENABLE_CUDA) message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA." ) endif(ENABLE_CUDA) +############################################################################### +# CUSTOM UDP PACKET SOURCE (OPTIONAL) +############################################################################### +if(ENABLE_RAW_UDP) + message(STATUS "High-optimized custom UDP ip packet source will be enabled." ) + message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'" ) +else(ENABLE_RAW_UDP) + message(STATUS "High-optimized custom UDP ip packet source will be enabled." ) + message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'" ) +endif(ENABLE_RAW_UDP) ############################################################################### @@ -1455,35 +1466,6 @@ if(ENABLE_GPROF) endif(ENABLE_GPROF) -# - 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 dbfcttc") -endif() -get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE) - - - - ######################################################################## # Set compiler flags ######################################################################## diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index c1fc65c56..a591836e2 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -21,6 +21,38 @@ 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) + 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) + +endif(ENABLE_RAW_UDP) + if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) find_package(iio REQUIRED) if(NOT IIO_FOUND) @@ -166,7 +198,6 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc spir_gss6450_file_signal_source.cc rtl_tcp_signal_source.cc labsat_signal_source.cc - udp_signal_source.cc ${OPT_DRIVER_SOURCES} ) diff --git a/src/algorithms/signal_source/adapters/udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc similarity index 90% rename from src/algorithms/signal_source/adapters/udp_signal_source.cc rename to src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 93af9dd4a..b754b5699 100644 --- a/src/algorithms/signal_source/adapters/udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -30,7 +30,7 @@ */ -#include "udp_signal_source.h" +#include "custom_udp_signal_source.h" #include "configuration_interface.h" #include "GPS_L1_CA.h" #include @@ -41,7 +41,7 @@ using google::LogMessage; -UDPSignalSource::UDPSignalSource(ConfigurationInterface* configuration, +CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) { @@ -107,12 +107,12 @@ UDPSignalSource::UDPSignalSource(ConfigurationInterface* configuration, } -UDPSignalSource::~UDPSignalSource() +CustomUDPSignalSource::~CustomUDPSignalSource() { } -void UDPSignalSource::connect(gr::top_block_sptr top_block) +void CustomUDPSignalSource::connect(gr::top_block_sptr top_block) { //connect null sinks to unused streams for (int n = 0; n < channels_in_udp_; n++) @@ -132,7 +132,7 @@ void UDPSignalSource::connect(gr::top_block_sptr top_block) } -void UDPSignalSource::disconnect(gr::top_block_sptr top_block) +void CustomUDPSignalSource::disconnect(gr::top_block_sptr top_block) { //disconnect null sinks to unused streams for (int n = 0; n < channels_in_udp_; n++) @@ -151,19 +151,19 @@ void UDPSignalSource::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr UDPSignalSource::get_left_block() +gr::basic_block_sptr CustomUDPSignalSource::get_left_block() { LOG(WARNING) << "Left block of a signal source should not be retrieved"; return gr::block_sptr(); } -gr::basic_block_sptr UDPSignalSource::get_right_block() +gr::basic_block_sptr CustomUDPSignalSource::get_right_block() { return udp_gnss_rx_source_; } -gr::basic_block_sptr UDPSignalSource::get_right_block(int RF_channel) +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/udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h similarity index 89% rename from src/algorithms/signal_source/adapters/udp_signal_source.h rename to src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 3fc91b023..9bed9ae32 100644 --- a/src/algorithms/signal_source/adapters/udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -30,8 +30,8 @@ */ -#ifndef GNSS_SDR_UDP_SIGNAL_SOURCE_H -#define GNSS_SDR_UDP_SIGNAL_SOURCE_H +#ifndef GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H +#define GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H #include "gnss_block_interface.h" #include "gr_complex_ip_packet_source.h" @@ -50,14 +50,14 @@ class ConfigurationInterface; * \brief This class reads from UDP packets, which streams interleaved * I/Q samples over a network. */ -class UDPSignalSource : public GNSSBlockInterface +class CustomUDPSignalSource : public GNSSBlockInterface { public: - UDPSignalSource(ConfigurationInterface* configuration, + CustomUDPSignalSource(ConfigurationInterface* configuration, std::string role, unsigned int in_stream, unsigned int out_stream, boost::shared_ptr queue); - virtual ~UDPSignalSource(); + virtual ~CustomUDPSignalSource(); inline std::string role() override { @@ -69,7 +69,7 @@ public: */ inline std::string implementation() override { - return "UDP_Signal_Source"; + return "Custom_UDP_Signal_Source"; } inline size_t item_size() override @@ -102,4 +102,4 @@ private: boost::shared_ptr queue_; }; -#endif /*GNSS_SDR_UDP_SIGNAL_SOURCE_H */ +#endif /*GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H */ diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index dd2101462..b35caa37d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -17,6 +17,38 @@ # +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) + 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 unpack_byte_2bit_samples.cc unpack_byte_2bit_cpx_samples.cc @@ -26,8 +58,7 @@ set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES unpack_2bit_samples.cc unpack_spir_gss6450_samples.cc labsat23_source.cc - raw_ip_packet_source.cc - gr_complex_ip_packet_source.cc + ${OPT_DRIVER_SOURCES} ) include_directories( @@ -37,6 +68,7 @@ include_directories( ${GFlags_INCLUDE_DIRS} ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} + ${OPT_DRIVER_INCLUDE_DIRS} ) file(GLOB SIGNAL_SOURCE_GR_BLOCKS_HEADERS "*.h") @@ -47,6 +79,6 @@ target_link_libraries(signal_source_gr_blocks signal_source_lib ${GNURADIO_RUNTIME_LIBRARIES} ${Boost_LIBRARIES} - ${PCAP_LIBRARIES} + ${OPT_LIBRARIES} ) add_dependencies(signal_source_gr_blocks glog-${glog_RELEASE}) diff --git a/src/algorithms/signal_source/gnuradio_blocks/raw_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/raw_ip_packet_source.cc deleted file mode 100644 index 5ec4c4a2c..000000000 --- a/src/algorithms/signal_source/gnuradio_blocks/raw_ip_packet_source.cc +++ /dev/null @@ -1,289 +0,0 @@ -/*! - * \file raw_ip_packet_source.cc - * - * \brief Receives ip frames containing samples in UDP frame encapsulation - * using a high performance packet capture library (libpcap) - * \author Javier Arribas jarribas (at) cttc.es - * ------------------------------------------------------------------------- - * - * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) - * - * GNSS-SDR is a software defined Global Navigation - * Satellite Systems receiver - * - * This file is part of GNSS-SDR. - * - * GNSS-SDR is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNSS-SDR is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * 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 . - * - * ------------------------------------------------------------------------- - */ - - -#include -#include "raw_ip_packet_source.h" - -#include -#include - - -#define FIFO_SIZE 1000000 - - -/* 4 bytes IP address */ -typedef struct gr_ip_address{ - u_char byte1; - u_char byte2; - u_char byte3; - u_char byte4; -}gr_ip_address; - -/* IPv4 header */ -typedef struct gr_ip_header{ - u_char ver_ihl; // Version (4 bits) + Internet header length (4 bits) - u_char tos; // Type of service - u_short tlen; // Total length - u_short identification; // Identification - u_short flags_fo; // Flags (3 bits) + Fragment offset (13 bits) - u_char ttl; // Time to live - u_char proto; // Protocol - u_short crc; // Header checksum - gr_ip_address saddr; // Source address - gr_ip_address daddr; // Destination address - u_int op_pad; // Option + Padding -}gr_ip_header; - -/* UDP header*/ -typedef struct gr_udp_header{ - u_short sport; // Source port - u_short dport; // Destination port - u_short len; // Datagram length - u_short crc; // Checksum -}gr_udp_header; - -raw_ip_packet_source::sptr -raw_ip_packet_source::make(std::string src_device, std::string origin_address, int udp_port, int udp_packet_size) -{ - return gnuradio::get_initial_sptr - (new raw_ip_packet_source(src_device, origin_address, udp_port, udp_packet_size)); -} - -/* - * The private constructor - */ -raw_ip_packet_source::raw_ip_packet_source(std::string src_device, std::string origin_address, int udp_port, int udp_packet_size) -: gr::sync_block("raw_ip_packet_source", - gr::io_signature::make(0, 0, 0), - gr::io_signature::make(1, 1, sizeof(char))) -{ - - // constructor code here - std::cout<<"Start Ethernet packet capture\n"; - - d_src_device=src_device; - d_udp_port=udp_port; - d_udp_payload_size=udp_packet_size; - d_fifo_full=false; - d_last_frame_counter=0; - d_num_rx_errors=0; - - //allocate signal samples buffer - fifo_buff=new char[FIFO_SIZE]; - fifo_read_ptr=0; - fifo_write_ptr=0; - fifo_items=0; - - //open the ethernet device - if (open()==true) - { - // start pcap capture thread - d_pcap_thread=new boost::thread(boost::bind(&raw_ip_packet_source::my_pcap_loop_thread,this,descr)); - }else{ - exit(1); //ethernet error! - } -} - -bool raw_ip_packet_source::open() -{ - char errbuf[PCAP_ERRBUF_SIZE]; - boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function - /* open device for reading */ - descr = pcap_open_live(d_src_device.c_str(),1500,1,1000,errbuf); - if(descr == NULL) - { - std::cout<<"Error openning Ethernet device "<join(); - pcap_close(descr); - } - - delete fifo_buff; - std::cout<<"Stop Ethernet packet capture\n"; - -} - -void raw_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr* pkthdr, - const u_char* packet) -{ - raw_ip_packet_source *bridge=(raw_ip_packet_source*) args; - bridge->pcap_callback(args, pkthdr, packet); -} - -void raw_ip_packet_source::pcap_callback(u_char *args, const struct pcap_pkthdr* pkthdr, - const u_char* packet) -{ - boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function - - gr_ip_header *ih; - gr_udp_header *uh; - - // eth frame parameters - // **** UDP RAW PACKET DECODER **** - if ((packet[12]==0x08) & (packet[13]==0x00)) //IP FRAME - { - - /* retireve the position of the ip header */ - ih = (gr_ip_header *) (packet + - 14); //length of ethernet header - - /* retireve the position of the udp header */ - u_int ip_len; - ip_len = (ih->ver_ihl & 0xf) * 4; - uh = (gr_udp_header *) ((u_char*)ih + ip_len); - - /* convert from network byte order to host byte order */ - u_short sport,dport; - dport = ntohs( uh->dport ); - sport = ntohs( uh->sport ); - if (dport==d_udp_port) - { - // print ip addresses and udp ports -// printf("%d.%d.%d.%d.%d -> %d.%d.%d.%d.%d\n", -// ih->saddr.byte1, -// ih->saddr.byte2, -// ih->saddr.byte3, -// ih->saddr.byte4, -// sport, -// ih->daddr.byte1, -// ih->daddr.byte2, -// ih->daddr.byte3, -// ih->daddr.byte4, -// dport); -// std::cout<<"d_udp_port:"<=d_udp_payload_size) - { - //write all in a single memcpy - memcpy(&fifo_buff[fifo_write_ptr],&udp_payload[0],d_udp_payload_size); //size in bytes - fifo_write_ptr+=d_udp_payload_size; - if (fifo_write_ptr==FIFO_SIZE) fifo_write_ptr=0; - fifo_items+=d_udp_payload_size; - }else{ - //two step wrap write - memcpy(&fifo_buff[fifo_write_ptr],&udp_payload[0],aligned_write_items); //size in bytes - fifo_write_ptr=d_udp_payload_size-aligned_write_items; - memcpy(&fifo_buff[0],&udp_payload[aligned_write_items],fifo_write_ptr); //size in bytes - fifo_items+=d_udp_payload_size; - } - }else{ - std::cout<<"Ou"<=num_samples_readed) - { - //read all in a single memcpy - memcpy(&((char*)output_items[0])[0],&fifo_buff[fifo_read_ptr],num_samples_readed); - fifo_read_ptr=fifo_read_ptr+num_samples_readed; //increase the fifo pointer - if (fifo_read_ptr==FIFO_SIZE) fifo_read_ptr=0; - }else{ - //two step wrap read - memcpy(&((char*)output_items[0])[0],&fifo_buff[fifo_read_ptr],aligned_read_items); - fifo_read_ptr=num_samples_readed-aligned_read_items;//increase the fifo pointer considering the rollover - memcpy(&((char*)output_items[0])[aligned_read_items],&fifo_buff[0],fifo_read_ptr); - } - - fifo_items=fifo_items-num_samples_readed; - - // Tell runtime system how many output items we produced. - //std::cout<<"fifo_items:"<. - * - * ------------------------------------------------------------------------- - */ - - -#ifndef INCLUDED_RAW_IP_PACKET_SOURCE_H -#define INCLUDED_RAW_IP_PACKET_SOURCE_H - -#include -#include -#include -#include -#include -#include -#include -#include - -class raw_ip_packet_source : virtual public gr::sync_block -{ -private: - boost::mutex d_mutex; - - pcap_t* descr; //ethernet pcap device descriptor - int fifo_pipe[2]; - - char *fifo_buff; - - int fifo_read_ptr; - int fifo_write_ptr; - int fifo_items; - int d_sock_raw; - int d_udp_port; - struct sockaddr_in si_me; - std::string d_src_device; - std::string d_origin_address; - int d_udp_payload_size; - bool d_fifo_full; - - int d_last_frame_counter; - int d_num_rx_errors; - - - boost::thread *d_pcap_thread; - /*! - * \brief - * Opens the ethernet device using libpcap raw capture mode - * If any of these fail, the fuction retuns the error and exits. - */ - bool open(); - - 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, std::string origin_address, int udp_port, int udp_packet_size); - raw_ip_packet_source(std::string src_device, std::string origin_address, int udp_port, int udp_packet_size); - ~raw_ip_packet_source(); - - // Where all the action really happens - int work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items); -}; - -#endif /* INCLUDED_RAW_IP_PACKET_SOURCE_H */ - diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 09b24de96..7be920a47 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -40,6 +40,9 @@ if(ENABLE_FPGA) add_definitions(-DENABLE_FPGA=1) endif(ENABLE_FPGA) +if(ENABLE_RAW_UDP) + add_definitions(-DRAW_UDP=1) +endif(ENABLE_RAW_UDP) if(Boost_VERSION LESS 105000) add_definitions(-DOLD_BOOST=1) diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 0b7ffb678..237f2df40 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -35,6 +35,7 @@ #include "gnss_block_factory.h" + #include "configuration_interface.h" #include "in_memory_configuration.h" #include "gnss_block_interface.h" @@ -45,7 +46,6 @@ #include "spir_file_signal_source.h" #include "spir_gss6450_file_signal_source.h" #include "rtl_tcp_signal_source.h" -#include "udp_signal_source.h" #include "two_bit_packed_file_signal_source.h" #include "labsat_signal_source.h" #include "channel.h" @@ -104,6 +104,10 @@ #include "hybrid_observables.h" #include "rtklib_pvt.h" +#if RAW_UDP +#include "custom_udp_signal_source.h" +#endif + #if ENABLE_FPGA #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "gps_l1_ca_dll_pll_tracking_fpga.h" @@ -159,11 +163,7 @@ using google::LogMessage; GNSSBlockFactory::GNSSBlockFactory() {} - - GNSSBlockFactory::~GNSSBlockFactory() {} - - std::unique_ptr GNSSBlockFactory::GetSignalSource( std::shared_ptr configuration, gr::msg_queue::sptr queue, int ID) { @@ -1053,11 +1053,12 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } - else if (implementation.compare("UDP_Signal_Source") == 0) +#if RAW_UDP + else if (implementation.compare("Custom_UDP_Signal_Source") == 0) { try { - std::unique_ptr block_(new UDPSignalSource(configuration.get(), role, in_streams, + std::unique_ptr block_(new CustomUDPSignalSource(configuration.get(), role, in_streams, out_streams, queue)); block = std::move(block_); } @@ -1068,6 +1069,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( exit(1); } } +#endif else if (implementation.compare("Nsr_File_Signal_Source") == 0) { try