mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
		| @@ -51,9 +51,9 @@ IncludeBlocks: Merge | ||||
| IncludeCategories: | ||||
|   - Regex:           '^.*.h"' | ||||
|     Priority:        1 | ||||
|   - Regex:           '^.*(boost|gflags|glog|gtest|gnsssdr|gnuradio|pmt|uhd|volk)/' | ||||
|   - Regex:           '^.*(boost|gflags|glog|gnsssdr|gpstk|gtest|gnuradio|pmt|uhd|volk)/' | ||||
|     Priority:        2 | ||||
|   - Regex:           '^.*(armadillo|matio)' | ||||
|   - Regex:           '^.*(armadillo|matio|pugixml)' | ||||
|     Priority:        2 | ||||
|   - Regex:           '.*' | ||||
|     Priority:        3 | ||||
|   | ||||
| @@ -1,3 +1,3 @@ | ||||
| --- | ||||
| Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,readability-named-parameter,readability-string-compare' | ||||
| Checks: '-*,boost-use-to-string,cert-dcl21-cpp,cert-dcl58-cpp,cert-env33-c,cert-err52-cpp,cert-err60-cpp,cert-flp30-c,clang-analyzer-cplusplus*,cppcoreguidelines-pro-type-static-cast-downcast,cppcoreguidelines-slicing,google-build-namespaces,google-runtime-int,google-runtime-references,llvm-header-guard,misc-misplaced-const,misc-new-delete-overloads,misc-non-copyable-objects,misc-static-assert,misc-throw-by-value-catch-by-reference,misc-uniqueptr-reset-release,modernize-deprecated-headers,modernize-loop-convert,modernize-pass-by-value,modernize-raw-string-literal,modernize-use-auto,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-named-parameter,readability-string-compare' | ||||
| HeaderFilterRegex: '.*' | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|     //   dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||
|     //   acq_parameters.dump_filename = dump_filename_; | ||||
|     //--- Find number of samples per spreading code (4 ms)  ----------------- | ||||
|     unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); | ||||
|     //acq_parameters.samples_per_code = code_length_; | ||||
|     //int samples_per_ms = static_cast<int>(std::round(static_cast<double>(fs_in_) * 0.001)); | ||||
|     //acq_parameters.samples_per_ms = samples_per_ms; | ||||
| @@ -120,9 +120,9 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|  | ||||
|     // compute all the GALILEO E1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
|     gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     std::complex<float>* code = new std::complex<float>[nsamples_total];            // buffer for the local code | ||||
|     gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     auto* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     auto* code = new std::complex<float>[nsamples_total];           // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E1_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                      // temporary maxima search | ||||
|  | ||||
| @@ -174,7 +174,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( | ||||
|             //        // fill in zero padding | ||||
|             for (int s = code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(static_cast<float>(0, 0)); | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                     //code[s] = 0; | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|             acq_pilot_ = false; | ||||
|         } | ||||
|  | ||||
|     unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast<double>(Galileo_E5a_CODE_LENGTH_CHIPS))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length)); | ||||
| @@ -108,9 +108,9 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|  | ||||
|     // compute all the GALILEO E5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
|     gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     std::complex<float>* code = new std::complex<float>[nsamples_total];            // buffer for the local code | ||||
|     gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     auto* fft_if = new gr::fft::fft_complex(nsamples_total, true);  // Direct FFT | ||||
|     auto* code = new std::complex<float>[nsamples_total];           // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * Galileo_E5a_NUMBER_OF_CODES];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                                       // temporary maxima search | ||||
|  | ||||
| @@ -141,7 +141,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf | ||||
|             // fill in zero padding | ||||
|             for (int s = code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(static_cast<float>(0, 0)); | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                     //code[s] = 0; | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -74,7 +74,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||
|     acq_parameters.doppler_max = doppler_max_; | ||||
|     unsigned int sampled_ms = configuration_->property(role + ".coherent_integration_time_ms", 1); | ||||
|     acq_parameters.sampled_ms = sampled_ms; | ||||
|     unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length)); | ||||
| @@ -90,10 +90,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||
|  | ||||
|     // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
|     gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     auto* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     // allocate memory to compute all the PRNs and compute all the possible codes | ||||
|     std::complex<float>* code = new std::complex<float>[nsamples_total];  // buffer for the local code | ||||
|     gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     auto* code = new std::complex<float>[nsamples_total];  // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                    // temporary maxima search | ||||
|     for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
| @@ -102,7 +102,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( | ||||
|             // fill in zero padding | ||||
|             for (int s = code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(static_cast<float>(0, 0)); | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                     //code[s] = 0; | ||||
|                 } | ||||
|             int offset = 0; | ||||
|   | ||||
| @@ -104,10 +104,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | ||||
|  | ||||
|     // compute all the GPS L1 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
|     gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     auto* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     // allocate memory to compute all the PRNs and compute all the possible codes | ||||
|     std::complex<float>* code = new std::complex<float>[nsamples_total];  // buffer for the local code | ||||
|     gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     auto* code = new std::complex<float>[nsamples_total];  // buffer for the local code | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|     float max;                                                    // temporary maxima search | ||||
|     for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++) | ||||
| @@ -116,7 +116,7 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga( | ||||
|             // fill in zero padding | ||||
|             for (int s = code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(static_cast<float>(0, 0)); | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                     //code[s] = 0; | ||||
|                 } | ||||
|             memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total);            // copy to FFT buffer | ||||
|   | ||||
| @@ -89,7 +89,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     //dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); | ||||
|     //acq_parameters.dump_filename = dump_filename_; | ||||
|     //--- Find number of samples per spreading code ------------------------- | ||||
|     unsigned int code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)))); | ||||
|     auto code_length = static_cast<unsigned int>(std::round(static_cast<double>(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast<double>(GPS_L5i_CODE_LENGTH_CHIPS)))); | ||||
|     acq_parameters.code_length = code_length; | ||||
|     // The FPGA can only use FFT lengths that are a power of two. | ||||
|     float nbits = ceilf(log2f((float)code_length)); | ||||
| @@ -105,11 +105,11 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|     //printf("L5 ACQ CLASS MID 01\n"); | ||||
|     // compute all the GPS L5 PRN Codes (this is done only once upon the class constructor in order to avoid re-computing the PRN codes every time | ||||
|     // a channel is assigned) | ||||
|     gr::fft::fft_complex* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     auto* fft_if = new gr::fft::fft_complex(vector_length, true);  // Direct FFT | ||||
|     //printf("L5 ACQ CLASS MID 02\n"); | ||||
|     std::complex<float>* code = new gr_complex[vector_length]; | ||||
|     auto* code = new gr_complex[vector_length]; | ||||
|     //printf("L5 ACQ CLASS MID 03\n"); | ||||
|     gr_complex* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment())); | ||||
|     //printf("L5 ACQ CLASS MID 04\n"); | ||||
|     d_all_fft_codes_ = new lv_16sc_t[nsamples_total * NUM_PRNs];  // memory containing all the possible fft codes for PRN 0 to 32 | ||||
|  | ||||
| @@ -124,7 +124,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( | ||||
|             // fill in zero padding | ||||
|             for (int s = code_length; s < nsamples_total; s++) | ||||
|                 { | ||||
|                     code[s] = std::complex<float>(static_cast<float>(0, 0)); | ||||
|                     code[s] = std::complex<float>(0.0, 0.0); | ||||
|                     //code[s] = 0; | ||||
|                 } | ||||
|             memcpy(fft_if->get_inbuf(), code, sizeof(gr_complex) * nsamples_total);            // copy to FFT buffer | ||||
|   | ||||
| @@ -42,6 +42,7 @@ | ||||
| #include "pcps_acquisition_fpga.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| #define AQ_DOWNSAMPLING_DELAY 40  // delay due to the downsampling filter in the acquisition | ||||
| @@ -50,7 +51,7 @@ using google::LogMessage; | ||||
|  | ||||
| pcps_acquisition_fpga_sptr pcps_make_acquisition_fpga(pcpsconf_fpga_t conf_) | ||||
| { | ||||
|     return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(conf_)); | ||||
|     return pcps_acquisition_fpga_sptr(new pcps_acquisition_fpga(std::move(conf_))); | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -61,7 +62,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( | ||||
|     //   printf("acq constructor start\n"); | ||||
|     this->message_port_register_out(pmt::mp("events")); | ||||
|  | ||||
|     acq_parameters = conf_; | ||||
|     acq_parameters = std::move(conf_); | ||||
|     d_sample_counter = 0ULL;  // SAMPLE COUNTER | ||||
|     d_active = false; | ||||
|     d_state = 0; | ||||
| @@ -74,7 +75,7 @@ pcps_acquisition_fpga::pcps_acquisition_fpga(pcpsconf_fpga_t conf_) : gr::block( | ||||
|     d_doppler_step = 0U; | ||||
|     d_test_statistics = 0.0; | ||||
|     d_channel = 0U; | ||||
|     d_gnss_synchro = 0; | ||||
|     d_gnss_synchro = nullptr; | ||||
|  | ||||
|     //printf("zzzz acq_parameters.code_length = %d\n", acq_parameters.code_length); | ||||
|     //printf("zzzz acq_parameters.samples_per_ms = %d\n", acq_parameters.samples_per_ms); | ||||
| @@ -256,7 +257,7 @@ void pcps_acquisition_fpga::set_active(bool active) | ||||
|                     d_gnss_synchro->Acq_doppler_hz = static_cast<double>(doppler); | ||||
|                     d_gnss_synchro->Acq_samplestamp_samples = d_sample_counter; | ||||
|  | ||||
|                     d_test_statistics = (d_mag / d_input_power); //* correction_factor; | ||||
|                     d_test_statistics = (d_mag / d_input_power); // correction_factor; | ||||
|                 } | ||||
|  | ||||
|             // In the case of the FPGA the option of dumping the results of the acquisition to a file is not available | ||||
|   | ||||
| @@ -40,6 +40,7 @@ | ||||
| #include <fcntl.h>  // libraries used by the GIPO | ||||
| #include <iostream> | ||||
| #include <sys/mman.h>  // libraries used by the GIPO | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| #define PAGE_SIZE 0x10000                     // default page size for the multicorrelator memory map | ||||
| @@ -102,7 +103,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name, | ||||
|  | ||||
|     //printf("AAA- vector_length = %d\n ", vector_length); | ||||
|     // initial values | ||||
|     d_device_name = device_name; | ||||
|     d_device_name = std::move(device_name); | ||||
|     //d_freq = freq; | ||||
|     d_fs_in = fs_in; | ||||
|     d_vector_length = vector_length; | ||||
| @@ -121,7 +122,7 @@ fpga_acquisition::fpga_acquisition(std::string device_name, | ||||
|             LOG(WARNING) << "Cannot open deviceio" << d_device_name; | ||||
|             std::cout << "Acq: cannot open deviceio" << d_device_name << std::endl; | ||||
|         } | ||||
|     d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(NULL, PAGE_SIZE, | ||||
|     d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(nullptr, PAGE_SIZE, | ||||
|         PROT_READ | PROT_WRITE, MAP_SHARED, d_fd, 0)); | ||||
|  | ||||
|     if (d_map_base == reinterpret_cast<void *>(-1)) | ||||
| @@ -234,7 +235,7 @@ void fpga_acquisition::set_doppler_sweep(uint32_t num_sweeps) | ||||
|     float phase_step_rad_int_temp; | ||||
|     int32_t phase_step_rad_int; | ||||
|     //int32_t doppler = static_cast<int32_t>(-d_doppler_max) + d_doppler_step * doppler_index; | ||||
|     int32_t doppler = static_cast<int32_t>(-d_doppler_max); | ||||
|     auto doppler = static_cast<int32_t>(-d_doppler_max); | ||||
|     //float phase_step_rad = GPS_TWO_PI * (d_freq + doppler) / static_cast<float>(d_fs_in); | ||||
|     float phase_step_rad = GPS_TWO_PI * (doppler) / static_cast<float>(d_fs_in); | ||||
|     // The doppler step can never be outside the range -pi to +pi, otherwise there would be aliasing | ||||
| @@ -408,7 +409,7 @@ void fpga_acquisition::unblock_samples() | ||||
|  | ||||
| void fpga_acquisition::close_device() | ||||
| { | ||||
|     uint32_t *aux = const_cast<uint32_t *>(d_map_base); | ||||
|     auto *aux = const_cast<uint32_t *>(d_map_base); | ||||
|     if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1) | ||||
|         { | ||||
|             printf("Failed to unmap memory uio\n"); | ||||
|   | ||||
| @@ -33,9 +33,9 @@ | ||||
| #include "gnss_synchro.h" | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <cinttypes> | ||||
| #include <cmath> | ||||
| #include <fcntl.h>  // libraries used by the GIPO | ||||
| #include <inttypes.h> | ||||
| #include <iostream> | ||||
| #include <string> | ||||
| #include <sys/mman.h>  // libraries used by the GIPO | ||||
| @@ -129,7 +129,7 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__(( | ||||
|     // variable number). | ||||
|  | ||||
|     sample_counter = sample_counter + samples_passed;  //samples_per_output; | ||||
|     Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); | ||||
|     auto *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); | ||||
|     out[0] = Gnss_Synchro(); | ||||
|     out[0].Flag_valid_symbol_output = false; | ||||
|     out[0].Flag_valid_word = false; | ||||
| @@ -236,7 +236,7 @@ void gnss_sdr_fpga_sample_counter::open_device() | ||||
|             LOG(WARNING) << "Cannot open deviceio" << device_name; | ||||
|             std::cout << "Counter-Intr: cannot open deviceio" << device_name << std::endl; | ||||
|         } | ||||
|     map_base = reinterpret_cast<volatile uint32_t *>(mmap(NULL, PAGE_SIZE, | ||||
|     map_base = reinterpret_cast<volatile uint32_t *>(mmap(nullptr, PAGE_SIZE, | ||||
|         PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); | ||||
|  | ||||
|     if (map_base == reinterpret_cast<void *>(-1)) | ||||
| @@ -265,7 +265,7 @@ void gnss_sdr_fpga_sample_counter::close_device() | ||||
|     //printf("=========================================== NOW closing device ...\n"); | ||||
|     map_base[2] = 0;  // disable the generation of the interrupt in the device | ||||
|  | ||||
|     uint32_t *aux = const_cast<uint32_t *>(map_base); | ||||
|     auto *aux = const_cast<uint32_t *>(map_base); | ||||
|     if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1) | ||||
|         { | ||||
|             printf("Failed to unmap memory uio\n"); | ||||
|   | ||||
| @@ -63,8 +63,8 @@ gnss_sdr_time_counter_sptr gnss_sdr_make_time_counter() | ||||
| int gnss_sdr_time_counter::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | ||||
|     gr_vector_const_void_star &input_items __attribute__((unused)), gr_vector_void_star &output_items) | ||||
| { | ||||
|     Gnss_Synchro *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); | ||||
|     const Gnss_Synchro *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); | ||||
|     auto *out = reinterpret_cast<Gnss_Synchro *>(output_items[0]); | ||||
|     const auto *in = reinterpret_cast<const Gnss_Synchro *>(input_items[0]); | ||||
|     out[0] = in[0]; | ||||
|     if ((current_T_rx_ms % report_interval_ms) == 0) | ||||
|         { | ||||
|   | ||||
| @@ -38,6 +38,7 @@ | ||||
| #include <glog/logging.h> | ||||
| #include <exception> | ||||
| #include <iostream>  // for cout, endl | ||||
| #include <utility> | ||||
|  | ||||
| #ifdef __APPLE__ | ||||
| #include <iio/iio.h> | ||||
| @@ -46,8 +47,8 @@ | ||||
| #endif | ||||
|  | ||||
| Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) | ||||
|     const std::string& role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) | ||||
| { | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     std::string default_dump_file = "./data/signal_source.dat"; | ||||
|   | ||||
| @@ -45,7 +45,7 @@ class Ad9361FpgaSignalSource : public GNSSBlockInterface | ||||
| { | ||||
| public: | ||||
|     Ad9361FpgaSignalSource(ConfigurationInterface* configuration, | ||||
|         std::string role, unsigned int in_stream, | ||||
|         const std::string& role, unsigned int in_stream, | ||||
|         unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); | ||||
|  | ||||
|     ~Ad9361FpgaSignalSource(); | ||||
|   | ||||
| @@ -36,14 +36,15 @@ | ||||
| #include <boost/format.hpp> | ||||
| #include <glog/logging.h> | ||||
| #include <iostream> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
|  | ||||
| CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) | ||||
|     const std::string& role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) | ||||
| { | ||||
|     // DUMP PARAMETERS | ||||
|     std::string empty = ""; | ||||
| @@ -113,8 +114,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati | ||||
|  | ||||
|  | ||||
| CustomUDPSignalSource::~CustomUDPSignalSource() | ||||
| { | ||||
| } | ||||
| = default; | ||||
|  | ||||
|  | ||||
| void CustomUDPSignalSource::connect(gr::top_block_sptr top_block) | ||||
|   | ||||
| @@ -54,7 +54,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface | ||||
| { | ||||
| public: | ||||
|     CustomUDPSignalSource(ConfigurationInterface* configuration, | ||||
|         std::string role, unsigned int in_stream, | ||||
|         const std::string& role, unsigned int in_stream, | ||||
|         unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); | ||||
|  | ||||
|     virtual ~CustomUDPSignalSource(); | ||||
|   | ||||
| @@ -38,13 +38,14 @@ | ||||
| #include <glog/logging.h> | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
| Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, | ||||
|     std::string role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) | ||||
|     const std::string& role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) | ||||
| { | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     std::string default_dump_file = "./data/signal_source.dat"; | ||||
| @@ -85,7 +86,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration | ||||
|     std::cout << "LO frequency : " << freq_ << " Hz" << std::endl; | ||||
|     std::cout << "sample rate: " << sample_rate_ << " Hz" << std::endl; | ||||
|  | ||||
|     if (item_type_.compare("gr_complex") == 0) | ||||
|     if (item_type_ == "gr_complex") | ||||
|         { | ||||
|             if (RF_channels_ == 1) | ||||
|                 { | ||||
|   | ||||
| @@ -46,7 +46,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface | ||||
| { | ||||
| public: | ||||
|     Fmcomms2SignalSource(ConfigurationInterface* configuration, | ||||
|         std::string role, unsigned int in_stream, | ||||
|         const std::string& role, unsigned int in_stream, | ||||
|         unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); | ||||
|  | ||||
|     virtual ~Fmcomms2SignalSource(); | ||||
|   | ||||
| @@ -37,14 +37,15 @@ | ||||
| #include <glog/logging.h> | ||||
| #include <gnuradio/blocks/file_sink.h> | ||||
| #include <iostream> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
|  | ||||
| OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) | ||||
|     const std::string& role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) | ||||
| { | ||||
|     // DUMP PARAMETERS | ||||
|     std::string empty = ""; | ||||
| @@ -66,11 +67,11 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|     osmosdr_args_ = configuration->property(role + ".osmosdr_args", std::string()); | ||||
|     antenna_ = configuration->property(role + ".antenna", empty); | ||||
|  | ||||
|     if (item_type_.compare("short") == 0) | ||||
|     if (item_type_ == "short") | ||||
|         { | ||||
|             item_size_ = sizeof(short); | ||||
|         } | ||||
|     else if (item_type_.compare("gr_complex") == 0) | ||||
|     else if (item_type_ == "gr_complex") | ||||
|         { | ||||
|             item_size_ = sizeof(gr_complex); | ||||
|             // 1. Make the driver instance | ||||
| @@ -158,8 +159,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|  | ||||
|  | ||||
| OsmosdrSignalSource::~OsmosdrSignalSource() | ||||
| { | ||||
| } | ||||
| = default; | ||||
|  | ||||
|  | ||||
| void OsmosdrSignalSource::driver_instance() | ||||
|   | ||||
| @@ -52,7 +52,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface | ||||
| { | ||||
| public: | ||||
|     OsmosdrSignalSource(ConfigurationInterface* configuration, | ||||
|         std::string role, unsigned int in_stream, | ||||
|         const std::string& role, unsigned int in_stream, | ||||
|         unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); | ||||
|  | ||||
|     virtual ~OsmosdrSignalSource(); | ||||
|   | ||||
| @@ -34,14 +34,15 @@ | ||||
| #include "gnss_sdr_valve.h" | ||||
| #include <glog/logging.h> | ||||
| #include <iostream> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
|  | ||||
| PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, | ||||
|     std::string role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue) | ||||
|     const std::string& role, unsigned int in_stream, unsigned int out_stream, | ||||
|     boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue)) | ||||
| { | ||||
|     std::string default_item_type = "gr_complex"; | ||||
|     std::string default_dump_file = "./data/signal_source.dat"; | ||||
| @@ -63,7 +64,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration | ||||
|     dump_ = configuration->property(role + ".dump", false); | ||||
|     dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file); | ||||
|  | ||||
|     if (item_type_.compare("gr_complex") != 0) | ||||
|     if (item_type_ != "gr_complex") | ||||
|         { | ||||
|             std::cout << "Configuration error: item_type must be gr_complex" << std::endl; | ||||
|             LOG(FATAL) << "Configuration error: item_type must be gr_complex!"; | ||||
| @@ -106,8 +107,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration | ||||
|  | ||||
|  | ||||
| PlutosdrSignalSource::~PlutosdrSignalSource() | ||||
| { | ||||
| } | ||||
| = default; | ||||
|  | ||||
|  | ||||
| void PlutosdrSignalSource::connect(gr::top_block_sptr top_block) | ||||
|   | ||||
| @@ -48,7 +48,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface | ||||
| { | ||||
| public: | ||||
|     PlutosdrSignalSource(ConfigurationInterface* configuration, | ||||
|         std::string role, unsigned int in_stream, | ||||
|         const std::string& role, unsigned int in_stream, | ||||
|         unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue); | ||||
|  | ||||
|     virtual ~PlutosdrSignalSource(); | ||||
|   | ||||
| @@ -32,6 +32,7 @@ | ||||
|  | ||||
| #include "gr_complex_ip_packet_source.h" | ||||
| #include <gnuradio/io_signature.h> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| const int FIFO_SIZE = 1472000; | ||||
| @@ -76,15 +77,15 @@ typedef struct gr_udp_header | ||||
|  | ||||
| gr_complex_ip_packet_source::sptr | ||||
| gr_complex_ip_packet_source::make(std::string src_device, | ||||
|     std::string origin_address, | ||||
|     const std::string& origin_address, | ||||
|     int udp_port, | ||||
|     int udp_packet_size, | ||||
|     int n_baseband_channels, | ||||
|     std::string wire_sample_type, | ||||
|     const std::string& wire_sample_type, | ||||
|     size_t item_size, | ||||
|     bool IQ_swap_) | ||||
| { | ||||
|     return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(src_device, | ||||
|     return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(src_device), | ||||
|         origin_address, | ||||
|         udp_port, | ||||
|         udp_packet_size, | ||||
| @@ -99,11 +100,11 @@ gr_complex_ip_packet_source::make(std::string src_device, | ||||
|  * The private constructor | ||||
|  */ | ||||
| gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, | ||||
|     __attribute__((unused)) std::string origin_address, | ||||
|     __attribute__((unused)) const std::string& origin_address, | ||||
|     int udp_port, | ||||
|     int udp_packet_size, | ||||
|     int n_baseband_channels, | ||||
|     std::string wire_sample_type, | ||||
|     const std::string& wire_sample_type, | ||||
|     size_t item_size, | ||||
|     bool IQ_swap_) | ||||
|     : gr::sync_block("gr_complex_ip_packet_source", | ||||
| @@ -113,12 +114,12 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, | ||||
|     std::cout << "Start Ethernet packet capture\n"; | ||||
|  | ||||
|     d_n_baseband_channels = n_baseband_channels; | ||||
|     if (wire_sample_type.compare("cbyte") == 0) | ||||
|     if (wire_sample_type == "cbyte") | ||||
|         { | ||||
|             d_wire_sample_type = 1; | ||||
|             d_bytes_per_sample = d_n_baseband_channels * 2; | ||||
|         } | ||||
|     else if (wire_sample_type.compare("c4bits") == 0) | ||||
|     else if (wire_sample_type == "c4bits") | ||||
|         { | ||||
|             d_wire_sample_type = 2; | ||||
|             d_bytes_per_sample = d_n_baseband_channels; | ||||
| @@ -129,7 +130,7 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, | ||||
|             exit(0); | ||||
|         } | ||||
|     std::cout << "d_wire_sample_type:" << d_wire_sample_type << std::endl; | ||||
|     d_src_device = src_device; | ||||
|     d_src_device = std::move(src_device); | ||||
|     d_udp_port = udp_port; | ||||
|     d_udp_payload_size = udp_packet_size; | ||||
|     d_fifo_full = false; | ||||
| @@ -142,8 +143,8 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, | ||||
|     d_item_size = item_size; | ||||
|     d_IQ_swap = IQ_swap_; | ||||
|     d_sock_raw = 0; | ||||
|     d_pcap_thread = NULL; | ||||
|     descr = NULL; | ||||
|     d_pcap_thread = nullptr; | ||||
|     descr = nullptr; | ||||
|  | ||||
|     memset(reinterpret_cast<char *>(&si_me), 0, sizeof(si_me)); | ||||
| } | ||||
| @@ -171,7 +172,7 @@ bool gr_complex_ip_packet_source::start() | ||||
| bool gr_complex_ip_packet_source::stop() | ||||
| { | ||||
|     std::cout << "gr_complex_ip_packet_source STOP\n"; | ||||
|     if (descr != NULL) | ||||
|     if (descr != nullptr) | ||||
|         { | ||||
|             pcap_breakloop(descr); | ||||
|             d_pcap_thread->join(); | ||||
| @@ -187,7 +188,7 @@ bool gr_complex_ip_packet_source::open() | ||||
|     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) | ||||
|     if (descr == nullptr) | ||||
|         { | ||||
|             std::cout << "Error opening Ethernet device " << d_src_device << std::endl; | ||||
|             std::cout << "Fatal Error in pcap_open_live(): " << std::string(errbuf) << std::endl; | ||||
| @@ -220,7 +221,7 @@ bool gr_complex_ip_packet_source::open() | ||||
|  | ||||
| gr_complex_ip_packet_source::~gr_complex_ip_packet_source() | ||||
| { | ||||
|     if (d_pcap_thread != NULL) | ||||
|     if (d_pcap_thread != nullptr) | ||||
|         { | ||||
|             delete d_pcap_thread; | ||||
|         } | ||||
| @@ -232,7 +233,7 @@ gr_complex_ip_packet_source::~gr_complex_ip_packet_source() | ||||
| void gr_complex_ip_packet_source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, | ||||
|     const u_char *packet) | ||||
| { | ||||
|     gr_complex_ip_packet_source *bridge = reinterpret_cast<gr_complex_ip_packet_source *>(args); | ||||
|     auto *bridge = reinterpret_cast<gr_complex_ip_packet_source *>(args); | ||||
|     bridge->pcap_callback(args, pkthdr, packet); | ||||
| } | ||||
|  | ||||
| @@ -327,22 +328,22 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items | ||||
|             switch (d_wire_sample_type) | ||||
|                 { | ||||
|                 case 1:  // interleaved byte samples | ||||
|                     for (long unsigned int i = 0; i < output_items.size(); i++) | ||||
|                     for (auto & output_item : output_items) | ||||
|                         { | ||||
|                             real = fifo_buff[fifo_read_ptr++]; | ||||
|                             imag = fifo_buff[fifo_read_ptr++]; | ||||
|                             if (d_IQ_swap) | ||||
|                                 { | ||||
|                                     static_cast<gr_complex *>(output_items[i])[n] = gr_complex(real, imag); | ||||
|                                     static_cast<gr_complex *>(output_item)[n] = gr_complex(real, imag); | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     static_cast<gr_complex *>(output_items[i])[n] = gr_complex(imag, real); | ||||
|                                     static_cast<gr_complex *>(output_item)[n] = gr_complex(imag, real); | ||||
|                                 } | ||||
|                         } | ||||
|                     break; | ||||
|                 case 2:  // 4-bit samples | ||||
|                     for (long unsigned int i = 0; i < output_items.size(); i++) | ||||
|                     for (auto & output_item : output_items) | ||||
|                         { | ||||
|                             tmp_char2 = fifo_buff[fifo_read_ptr] & 0x0F; | ||||
|                             if (tmp_char2 >= 8) | ||||
| @@ -365,11 +366,11 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items | ||||
|                                 } | ||||
|                             if (d_IQ_swap) | ||||
|                                 { | ||||
|                                     static_cast<gr_complex *>(output_items[i])[n] = gr_complex(imag, real); | ||||
|                                     static_cast<gr_complex *>(output_item)[n] = gr_complex(imag, real); | ||||
|                                 } | ||||
|                             else | ||||
|                                 { | ||||
|                                     static_cast<gr_complex *>(output_items[i])[n] = gr_complex(real, imag); | ||||
|                                     static_cast<gr_complex *>(output_item)[n] = gr_complex(real, imag); | ||||
|                                 } | ||||
|                         } | ||||
|                     break; | ||||
|   | ||||
| @@ -84,19 +84,19 @@ private: | ||||
| public: | ||||
|     typedef boost::shared_ptr<gr_complex_ip_packet_source> sptr; | ||||
|     static sptr make(std::string src_device, | ||||
|         std::string origin_address, | ||||
|         const std::string& origin_address, | ||||
|         int udp_port, | ||||
|         int udp_packet_size, | ||||
|         int n_baseband_channels, | ||||
|         std::string wire_sample_type, | ||||
|         const std::string& wire_sample_type, | ||||
|         size_t item_size, | ||||
|         bool IQ_swap_); | ||||
|     gr_complex_ip_packet_source(std::string src_device, | ||||
|         std::string origin_address, | ||||
|         const std::string& origin_address, | ||||
|         int udp_port, | ||||
|         int udp_packet_size, | ||||
|         int n_baseband_channels, | ||||
|         std::string wire_sample_type, | ||||
|         const std::string& wire_sample_type, | ||||
|         size_t item_size, | ||||
|         bool IQ_swap_); | ||||
|     ~gr_complex_ip_packet_source(); | ||||
|   | ||||
| @@ -75,10 +75,10 @@ bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_dev | ||||
|         { | ||||
|         case TX: | ||||
|             *dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc"); | ||||
|             return *dev != NULL; | ||||
|             return *dev != nullptr; | ||||
|         case RX: | ||||
|             *dev = iio_context_find_device(ctx, "cf-ad9361-lpc"); | ||||
|             return *dev != NULL; | ||||
|             return *dev != nullptr; | ||||
|         default: | ||||
|             return false; | ||||
|         } | ||||
| @@ -100,7 +100,7 @@ bool get_ad9361_stream_ch(struct iio_context *ctx __attribute__((unused)), enum | ||||
|             name << chid; | ||||
|             *chn = iio_device_find_channel(dev, name.str().c_str(), d == TX); | ||||
|         } | ||||
|     return *chn != NULL; | ||||
|     return *chn != nullptr; | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -115,14 +115,14 @@ bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_ch | ||||
|             name << "voltage"; | ||||
|             name << chid; | ||||
|             *chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), false); | ||||
|             return *chn != NULL; | ||||
|             return *chn != nullptr; | ||||
|             break; | ||||
|         case TX: | ||||
|             name.str(""); | ||||
|             name << "voltage"; | ||||
|             name << chid; | ||||
|             *chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), true); | ||||
|             return *chn != NULL; | ||||
|             return *chn != nullptr; | ||||
|             break; | ||||
|         default: | ||||
|             return false; | ||||
| @@ -138,10 +138,10 @@ bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn | ||||
|         // LO chan is always output, i.e. true | ||||
|         case RX: | ||||
|             *chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage0", true); | ||||
|             return *chn != NULL; | ||||
|             return *chn != nullptr; | ||||
|         case TX: | ||||
|             *chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage1", true); | ||||
|             return *chn != NULL; | ||||
|             return *chn != nullptr; | ||||
|         default: | ||||
|             return false; | ||||
|         } | ||||
| @@ -151,7 +151,7 @@ bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn | ||||
| /* applies streaming configuration through IIO */ | ||||
| bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid) | ||||
| { | ||||
|     struct iio_channel *chn = NULL; | ||||
|     struct iio_channel *chn = nullptr; | ||||
|  | ||||
|     // Configure phy and lo channels | ||||
|     //LOG(INFO)<<"* Acquiring AD9361 phy channel"<<chid; | ||||
| @@ -179,9 +179,9 @@ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, en | ||||
| bool config_ad9361_rx_local(uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_, | ||||
|     std::string rf_port_select_, | ||||
|     std::string gain_mode_rx1_, | ||||
|     std::string gain_mode_rx2_, | ||||
|     const std::string& rf_port_select_, | ||||
|     const std::string& gain_mode_rx1_, | ||||
|     const std::string& gain_mode_rx2_, | ||||
|     double rf_gain_rx1_, | ||||
|     double rf_gain_rx2_) | ||||
|  | ||||
| @@ -291,13 +291,13 @@ bool config_ad9361_rx_local(uint64_t bandwidth_, | ||||
| } | ||||
|  | ||||
|  | ||||
| bool config_ad9361_rx_remote(std::string remote_host, | ||||
| bool config_ad9361_rx_remote(const std::string& remote_host, | ||||
|     uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_, | ||||
|     std::string rf_port_select_, | ||||
|     std::string gain_mode_rx1_, | ||||
|     std::string gain_mode_rx2_, | ||||
|     const std::string& rf_port_select_, | ||||
|     const std::string& gain_mode_rx1_, | ||||
|     const std::string& gain_mode_rx2_, | ||||
|     double rf_gain_rx1_, | ||||
|     double rf_gain_rx2_) | ||||
| { | ||||
| @@ -543,7 +543,7 @@ bool config_ad9361_lo_local(uint64_t bandwidth_, | ||||
| } | ||||
|  | ||||
|  | ||||
| bool config_ad9361_lo_remote(std::string remote_host, | ||||
| bool config_ad9361_lo_remote(const std::string& remote_host, | ||||
|     uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_rf_tx_hz_, | ||||
| @@ -680,7 +680,7 @@ bool config_ad9361_lo_remote(std::string remote_host, | ||||
| } | ||||
|  | ||||
|  | ||||
| bool ad9361_disable_lo_remote(std::string remote_host) | ||||
| bool ad9361_disable_lo_remote(const std::string& remote_host) | ||||
| { | ||||
|     std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl; | ||||
|     struct iio_context *ctx; | ||||
|   | ||||
| @@ -92,19 +92,19 @@ bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, en | ||||
| bool config_ad9361_rx_local(uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_, | ||||
|     std::string rf_port_select_, | ||||
|     std::string gain_mode_rx1_, | ||||
|     std::string gain_mode_rx2_, | ||||
|     const std::string& rf_port_select_, | ||||
|     const std::string& gain_mode_rx1_, | ||||
|     const std::string& gain_mode_rx2_, | ||||
|     double rf_gain_rx1_, | ||||
|     double rf_gain_rx2_); | ||||
|  | ||||
| bool config_ad9361_rx_remote(std::string remote_host, | ||||
| bool config_ad9361_rx_remote(const std::string& remote_host, | ||||
|     uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_, | ||||
|     std::string rf_port_select_, | ||||
|     std::string gain_mode_rx1_, | ||||
|     std::string gain_mode_rx2_, | ||||
|     const std::string& rf_port_select_, | ||||
|     const std::string& gain_mode_rx1_, | ||||
|     const std::string& gain_mode_rx2_, | ||||
|     double rf_gain_rx1_, | ||||
|     double rf_gain_rx2_); | ||||
|  | ||||
| @@ -115,7 +115,7 @@ bool config_ad9361_lo_local(uint64_t bandwidth_, | ||||
|     int64_t freq_dds_tx_hz_, | ||||
|     double scale_dds_dbfs_); | ||||
|  | ||||
| bool config_ad9361_lo_remote(std::string remote_host, | ||||
| bool config_ad9361_lo_remote(const std::string& remote_host, | ||||
|     uint64_t bandwidth_, | ||||
|     uint64_t sample_rate_, | ||||
|     uint64_t freq_rf_tx_hz_, | ||||
| @@ -124,7 +124,7 @@ bool config_ad9361_lo_remote(std::string remote_host, | ||||
|     double scale_dds_dbfs_); | ||||
|  | ||||
|  | ||||
| bool ad9361_disable_lo_remote(std::string remote_host); | ||||
| bool ad9361_disable_lo_remote(const std::string& remote_host); | ||||
|  | ||||
| bool ad9361_disable_lo_local(); | ||||
|  | ||||
|   | ||||
| @@ -45,7 +45,7 @@ | ||||
| const size_t PAGE_SIZE = 0x10000; | ||||
| const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; | ||||
|  | ||||
| fpga_switch::fpga_switch(std::string device_name) | ||||
| fpga_switch::fpga_switch(const std::string& device_name) | ||||
| { | ||||
|     if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1) | ||||
|         { | ||||
| @@ -108,7 +108,7 @@ unsigned fpga_switch::fpga_switch_test_register( | ||||
|  | ||||
| void fpga_switch::close_device() | ||||
| { | ||||
|     unsigned *aux = const_cast<unsigned *>(d_map_base); | ||||
|     auto *aux = const_cast<unsigned *>(d_map_base); | ||||
|     if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1) | ||||
|         { | ||||
|             std::cout << "Failed to unmap memory uio" << std::endl; | ||||
|   | ||||
| @@ -44,7 +44,7 @@ | ||||
| class fpga_switch | ||||
| { | ||||
| public: | ||||
|     fpga_switch(std::string device_name); | ||||
|     fpga_switch(const std::string& device_name); | ||||
|     ~fpga_switch(); | ||||
|     void set_switch_position(int switch_position); | ||||
|  | ||||
|   | ||||
| @@ -51,7 +51,7 @@ void GalileoE1DllPllVemlTrackingFpga::stop_tracking() | ||||
| } | ||||
|  | ||||
| GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( | ||||
|     ConfigurationInterface* configuration, std::string role, | ||||
|     ConfigurationInterface* configuration, const std::string& role, | ||||
|     unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||
| { | ||||
|     //dllpllconf_t trk_param; | ||||
|   | ||||
| @@ -52,7 +52,7 @@ class GalileoE1DllPllVemlTrackingFpga : public TrackingInterface | ||||
| { | ||||
| public: | ||||
|     GalileoE1DllPllVemlTrackingFpga(ConfigurationInterface* configuration, | ||||
|         std::string role, | ||||
|         const std::string& role, | ||||
|         unsigned int in_streams, | ||||
|         unsigned int out_streams); | ||||
|  | ||||
|   | ||||
| @@ -51,7 +51,7 @@ void GalileoE5aDllPllTrackingFpga::stop_tracking() | ||||
| } | ||||
|  | ||||
| GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|     ConfigurationInterface *configuration, std::string role, | ||||
|     ConfigurationInterface *configuration, const std::string &role, | ||||
|     unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||
| { | ||||
|     //printf("creating the E5A tracking"); | ||||
| @@ -136,9 +136,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     unsigned int code_samples_per_chip = 1; | ||||
|     unsigned int code_length_chips = static_cast<unsigned int>(Galileo_E5a_CODE_LENGTH_CHIPS); | ||||
|     auto code_length_chips = static_cast<unsigned int>(Galileo_E5a_CODE_LENGTH_CHIPS); | ||||
|  | ||||
|     gr_complex *aux_code = static_cast<gr_complex *>(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); | ||||
|     auto *aux_code = static_cast<gr_complex *>(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     float *tracking_code; | ||||
|     float *data_code; | ||||
|   | ||||
| @@ -52,7 +52,7 @@ class GalileoE5aDllPllTrackingFpga : public TrackingInterface | ||||
| { | ||||
| public: | ||||
|     GalileoE5aDllPllTrackingFpga(ConfigurationInterface* configuration, | ||||
|         std::string role, | ||||
|         const std::string& role, | ||||
|         unsigned int in_streams, | ||||
|         unsigned int out_streams); | ||||
|  | ||||
|   | ||||
| @@ -53,7 +53,7 @@ void GpsL1CaDllPllTrackingFpga::stop_tracking() | ||||
| } | ||||
|  | ||||
| GpsL1CaDllPllTrackingFpga::GpsL1CaDllPllTrackingFpga( | ||||
|     ConfigurationInterface* configuration, std::string role, | ||||
|     ConfigurationInterface* configuration, const std::string& role, | ||||
|     unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||
| { | ||||
|     Dll_Pll_Conf_Fpga trk_param_fpga = Dll_Pll_Conf_Fpga(); | ||||
|   | ||||
| @@ -53,7 +53,7 @@ class GpsL1CaDllPllTrackingFpga : public TrackingInterface | ||||
| { | ||||
| public: | ||||
|     GpsL1CaDllPllTrackingFpga(ConfigurationInterface* configuration, | ||||
|         std::string role, | ||||
|         const std::string& role, | ||||
|         unsigned int in_streams, | ||||
|         unsigned int out_streams); | ||||
|  | ||||
|   | ||||
| @@ -52,7 +52,7 @@ void GpsL2MDllPllTrackingFpga::stop_tracking() | ||||
| } | ||||
|  | ||||
| GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( | ||||
|     ConfigurationInterface* configuration, std::string role, | ||||
|     ConfigurationInterface* configuration, const std::string& role, | ||||
|     unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||
| { | ||||
|     //dllpllconf_t trk_param; | ||||
| @@ -125,7 +125,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( | ||||
|  | ||||
|     //d_tracking_code = static_cast<float *>(volk_gnsssdr_malloc(2 * static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|     d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * NUM_PRNs * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
|     float* ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|     auto* ca_codes_f = static_cast<float*>(volk_gnsssdr_malloc(static_cast<unsigned int>(GPS_L2_M_CODE_LENGTH_CHIPS) * sizeof(float), volk_gnsssdr_get_alignment())); | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     d_ca_codes = static_cast<int*>(volk_gnsssdr_malloc(static_cast<int>(GPS_L2_M_CODE_LENGTH_CHIPS * NUM_PRNs) * sizeof(int), volk_gnsssdr_get_alignment())); | ||||
| @@ -167,9 +167,7 @@ GpsL2MDllPllTrackingFpga::GpsL2MDllPllTrackingFpga( | ||||
| } | ||||
|  | ||||
|  | ||||
| GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() | ||||
| { | ||||
| } | ||||
| GpsL2MDllPllTrackingFpga::~GpsL2MDllPllTrackingFpga() = default; | ||||
|  | ||||
|  | ||||
| void GpsL2MDllPllTrackingFpga::start_tracking() | ||||
|   | ||||
| @@ -52,7 +52,7 @@ class GpsL2MDllPllTrackingFpga : public TrackingInterface | ||||
| { | ||||
| public: | ||||
|     GpsL2MDllPllTrackingFpga(ConfigurationInterface* configuration, | ||||
|         std::string role, | ||||
|         const std::string& role, | ||||
|         unsigned int in_streams, | ||||
|         unsigned int out_streams); | ||||
|  | ||||
|   | ||||
| @@ -52,7 +52,7 @@ void GpsL5DllPllTrackingFpga::stop_tracking() | ||||
| } | ||||
|  | ||||
| GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|     ConfigurationInterface *configuration, std::string role, | ||||
|     ConfigurationInterface *configuration, const std::string &role, | ||||
|     unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) | ||||
| { | ||||
|     //printf("L5 TRK CLASS CREATED\n"); | ||||
| @@ -136,7 +136,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( | ||||
|  | ||||
|     //################# PRE-COMPUTE ALL THE CODES ################# | ||||
|     unsigned int code_samples_per_chip = 1; | ||||
|     unsigned int code_length_chips = static_cast<unsigned int>(GPS_L5i_CODE_LENGTH_CHIPS); | ||||
|     auto code_length_chips = static_cast<unsigned int>(GPS_L5i_CODE_LENGTH_CHIPS); | ||||
|     //printf("TRK code_length_chips = %d\n", code_length_chips); | ||||
|  | ||||
|     float *tracking_code; | ||||
|   | ||||
| @@ -50,7 +50,7 @@ class GpsL5DllPllTrackingFpga : public TrackingInterface | ||||
| { | ||||
| public: | ||||
|     GpsL5DllPllTrackingFpga(ConfigurationInterface* configuration, | ||||
|         std::string role, | ||||
|         const std::string& role, | ||||
|         unsigned int in_streams, | ||||
|         unsigned int out_streams); | ||||
|  | ||||
|   | ||||
| @@ -103,7 +103,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|     if (trk_parameters.system == 'G') | ||||
|         { | ||||
|             systemName = "GPS"; | ||||
|             if (signal_type.compare("1C") == 0) | ||||
|             if (signal_type == "1C") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = GPS_L1_FREQ_HZ; | ||||
|                     d_code_period = GPS_L1_CA_CODE_PERIOD; | ||||
| @@ -124,11 +124,11 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     // preamble bits to sampled symbols | ||||
|                     d_gps_l1ca_preambles_symbols = static_cast<int32_t *>(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int32_t), volk_gnsssdr_get_alignment())); | ||||
|                     int32_t n = 0; | ||||
|                     for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) | ||||
|                     for (unsigned short preambles_bit : preambles_bits) | ||||
|                         { | ||||
|                             for (uint32_t j = 0; j < GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; j++) | ||||
|                                 { | ||||
|                                     if (preambles_bits[i] == 1) | ||||
|                                     if (preambles_bit == 1) | ||||
|                                         { | ||||
|                                             d_gps_l1ca_preambles_symbols[n] = 1; | ||||
|                                         } | ||||
| @@ -142,7 +142,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     d_symbol_history.resize(GPS_CA_PREAMBLE_LENGTH_SYMBOLS);  // Change fixed buffer size | ||||
|                     d_symbol_history.clear();                                 // Clear all the elements in the buffer | ||||
|                 } | ||||
|             else if (signal_type.compare("2S") == 0) | ||||
|             else if (signal_type == "2S") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = GPS_L2_FREQ_HZ; | ||||
|                     d_code_period = GPS_L2_M_PERIOD; | ||||
| @@ -156,7 +156,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     trk_parameters.track_pilot = false; | ||||
|                     interchange_iq = false; | ||||
|                 } | ||||
|             else if (signal_type.compare("L5") == 0) | ||||
|             else if (signal_type == "L5") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = GPS_L5_FREQ_HZ; | ||||
|                     d_code_period = GPS_L5i_PERIOD; | ||||
| @@ -199,7 +199,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|     else if (trk_parameters.system == 'E') | ||||
|         { | ||||
|             systemName = "Galileo"; | ||||
|             if (signal_type.compare("1B") == 0) | ||||
|             if (signal_type == "1B") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E1_FREQ_HZ; | ||||
|                     d_code_period = Galileo_E1_CODE_PERIOD; | ||||
| @@ -223,7 +223,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                         } | ||||
|                     interchange_iq = false;  // Note that E1-B and E1-C are in anti-phase, NOT IN QUADRATURE. See Galileo ICD. | ||||
|                 } | ||||
|             else if (signal_type.compare("5X") == 0) | ||||
|             else if (signal_type == "5X") | ||||
|                 { | ||||
|                     d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; | ||||
|                     d_code_period = GALILEO_E5a_CODE_PERIOD; | ||||
| @@ -428,10 +428,10 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|         { | ||||
|             d_dump_filename = trk_parameters.dump_filename; | ||||
|             std::string dump_path; | ||||
|             if (d_dump_filename.find_last_of("/") != std::string::npos) | ||||
|             if (d_dump_filename.find_last_of('/') != std::string::npos) | ||||
|                 { | ||||
|                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1); | ||||
|                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/")); | ||||
|                     std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of('/') + 1); | ||||
|                     dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of('/')); | ||||
|                     d_dump_filename = dump_filename_; | ||||
|                 } | ||||
|             else | ||||
| @@ -443,9 +443,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & | ||||
|                     d_dump_filename = "trk_channel_"; | ||||
|                 } | ||||
|             // remove extension if any | ||||
|             if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos) | ||||
|             if (d_dump_filename.substr(1).find_last_of('.') != std::string::npos) | ||||
|                 { | ||||
|                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of(".")); | ||||
|                     d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of('.')); | ||||
|                 } | ||||
|  | ||||
|             d_dump_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; | ||||
| @@ -501,15 +501,15 @@ void dll_pll_veml_tracking_fpga::start_tracking() | ||||
|     d_carrier_loop_filter.initialize();  // initialize the carrier filter | ||||
|     d_code_loop_filter.initialize();     // initialize the code filter | ||||
|  | ||||
|     if (systemName.compare("GPS") == 0 and signal_type.compare("1C") == 0) | ||||
|     if (systemName == "GPS" and signal_type == "1C") | ||||
|         { | ||||
|             // nothing to compute : the local codes are pre-computed in the adapter class | ||||
|         } | ||||
|     else if (systemName.compare("GPS") == 0 and signal_type.compare("2S") == 0) | ||||
|     else if (systemName == "GPS" and signal_type == "2S") | ||||
|         { | ||||
|             // nothing to compute : the local codes are pre-computed in the adapter class | ||||
|         } | ||||
|     else if (systemName.compare("GPS") == 0 and signal_type.compare("L5") == 0) | ||||
|     else if (systemName == "GPS" and signal_type == "L5") | ||||
|         { | ||||
|             if (trk_parameters.track_pilot) | ||||
|                 { | ||||
| @@ -520,7 +520,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() | ||||
|                     // nothing to compute : the local codes are pre-computed in the adapter class | ||||
|                 } | ||||
|         } | ||||
|     else if (systemName.compare("Galileo") == 0 and signal_type.compare("1B") == 0) | ||||
|     else if (systemName == "Galileo" and signal_type == "1B") | ||||
|         { | ||||
|             if (trk_parameters.track_pilot) | ||||
|                 { | ||||
| @@ -533,7 +533,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() | ||||
|                     // nothing to compute : the local codes are pre-computed in the adapter class | ||||
|                 } | ||||
|         } | ||||
|     else if (systemName.compare("Galileo") == 0 and signal_type.compare("5X") == 0) | ||||
|     else if (systemName == "Galileo" and signal_type == "5X") | ||||
|         { | ||||
|             if (trk_parameters.track_pilot) | ||||
|                 { | ||||
| @@ -604,7 +604,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() | ||||
|  | ||||
| dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() | ||||
| { | ||||
|     if (signal_type.compare("1C") == 0) | ||||
|     if (signal_type == "1C") | ||||
|         { | ||||
|             volk_gnsssdr_free(d_gps_l1ca_preambles_symbols); | ||||
|         } | ||||
| @@ -1025,26 +1025,26 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() | ||||
|         { | ||||
|             return 1; | ||||
|         } | ||||
|     float *abs_VE = new float[num_epoch]; | ||||
|     float *abs_E = new float[num_epoch]; | ||||
|     float *abs_P = new float[num_epoch]; | ||||
|     float *abs_L = new float[num_epoch]; | ||||
|     float *abs_VL = new float[num_epoch]; | ||||
|     float *Prompt_I = new float[num_epoch]; | ||||
|     float *Prompt_Q = new float[num_epoch]; | ||||
|     uint64_t *PRN_start_sample_count = new uint64_t[num_epoch]; | ||||
|     float *acc_carrier_phase_rad = new float[num_epoch]; | ||||
|     float *carrier_doppler_hz = new float[num_epoch]; | ||||
|     float *code_freq_chips = new float[num_epoch]; | ||||
|     float *carr_error_hz = new float[num_epoch]; | ||||
|     float *carr_error_filt_hz = new float[num_epoch]; | ||||
|     float *code_error_chips = new float[num_epoch]; | ||||
|     float *code_error_filt_chips = new float[num_epoch]; | ||||
|     float *CN0_SNV_dB_Hz = new float[num_epoch]; | ||||
|     float *carrier_lock_test = new float[num_epoch]; | ||||
|     float *aux1 = new float[num_epoch]; | ||||
|     double *aux2 = new double[num_epoch]; | ||||
|     uint32_t *PRN = new uint32_t[num_epoch]; | ||||
|     auto *abs_VE = new float[num_epoch]; | ||||
|     auto *abs_E = new float[num_epoch]; | ||||
|     auto *abs_P = new float[num_epoch]; | ||||
|     auto *abs_L = new float[num_epoch]; | ||||
|     auto *abs_VL = new float[num_epoch]; | ||||
|     auto *Prompt_I = new float[num_epoch]; | ||||
|     auto *Prompt_Q = new float[num_epoch]; | ||||
|     auto *PRN_start_sample_count = new uint64_t[num_epoch]; | ||||
|     auto *acc_carrier_phase_rad = new float[num_epoch]; | ||||
|     auto *carrier_doppler_hz = new float[num_epoch]; | ||||
|     auto *code_freq_chips = new float[num_epoch]; | ||||
|     auto *carr_error_hz = new float[num_epoch]; | ||||
|     auto *carr_error_filt_hz = new float[num_epoch]; | ||||
|     auto *code_error_chips = new float[num_epoch]; | ||||
|     auto *code_error_filt_chips = new float[num_epoch]; | ||||
|     auto *CN0_SNV_dB_Hz = new float[num_epoch]; | ||||
|     auto *carrier_lock_test = new float[num_epoch]; | ||||
|     auto *aux1 = new float[num_epoch]; | ||||
|     auto *aux2 = new double[num_epoch]; | ||||
|     auto *PRN = new uint32_t[num_epoch]; | ||||
|  | ||||
|     try | ||||
|         { | ||||
| @@ -1108,8 +1108,8 @@ int32_t dll_pll_veml_tracking_fpga::save_matfile() | ||||
|     std::string filename = dump_filename_; | ||||
|     filename.erase(filename.length() - 4, 4); | ||||
|     filename.append(".mat"); | ||||
|     matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); | ||||
|     if (reinterpret_cast<int64_t *>(matfp) != NULL) | ||||
|     matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); | ||||
|     if (reinterpret_cast<int64_t *>(matfp) != nullptr) | ||||
|         { | ||||
|             size_t dims[2] = {1, static_cast<size_t>(num_epoch)}; | ||||
|             matvar = Mat_VarCreate("abs_VE", MAT_C_SINGLE, MAT_T_SINGLE, 2, dims, abs_VE, 0); | ||||
| @@ -1264,7 +1264,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un | ||||
| { | ||||
|     gr::thread::scoped_lock l(d_setlock); | ||||
|     // Block input data and block output stream pointers | ||||
|     Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); | ||||
|     auto **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); | ||||
|  | ||||
|     // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder | ||||
|     Gnss_Synchro current_synchro_data = Gnss_Synchro(); | ||||
| @@ -1297,7 +1297,7 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un | ||||
|                 //printf("333333 d_correlation_length_samples = %d\n", d_correlation_length_samples); | ||||
|                 uint32_t num_frames = ceil((counter_value - current_synchro_data.Acq_samplestamp_samples - current_synchro_data.Acq_delay_samples) / d_correlation_length_samples); | ||||
|                 //printf("333333 num_frames = %d\n", num_frames); | ||||
|                 uint64_t absolute_samples_offset = static_cast<uint64_t>(current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames * d_correlation_length_samples); | ||||
|                 auto absolute_samples_offset = static_cast<uint64_t>(current_synchro_data.Acq_delay_samples + current_synchro_data.Acq_samplestamp_samples + num_frames * d_correlation_length_samples); | ||||
|                 //printf("333333 absolute_samples_offset = %llu\n", absolute_samples_offset); | ||||
|                 multicorrelator_fpga->set_initial_sample(absolute_samples_offset); | ||||
|                 d_absolute_samples_offset = absolute_samples_offset; | ||||
|   | ||||
| @@ -41,20 +41,20 @@ | ||||
| #include <new> | ||||
|  | ||||
| // libraries used by DMA test code and GIPO test code | ||||
| #include <errno.h> | ||||
| #include <cerrno> | ||||
| #include <cstdio> | ||||
| #include <fcntl.h> | ||||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
|  | ||||
| // libraries used by DMA test code | ||||
| #include <assert.h> | ||||
| #include <stdint.h> | ||||
| #include <cassert> | ||||
| #include <cstdint> | ||||
| #include <sys/stat.h> | ||||
| #include <unistd.h> | ||||
|  | ||||
| // libraries used by GPIO test code | ||||
| #include <signal.h> | ||||
| #include <stdlib.h> | ||||
| #include <csignal> | ||||
| #include <cstdlib> | ||||
| #include <sys/mman.h> | ||||
|  | ||||
| // logging | ||||
| @@ -62,6 +62,7 @@ | ||||
|  | ||||
| // string manipulation | ||||
| #include <string> | ||||
| #include <utility> | ||||
|  | ||||
| // constants | ||||
| #include "GPS_L1_CA.h" | ||||
| @@ -160,7 +161,7 @@ fpga_multicorrelator_8sc::fpga_multicorrelator_8sc(int32_t n_correlators, | ||||
| { | ||||
|     //printf("tracking fpga class created\n"); | ||||
|     d_n_correlators = n_correlators; | ||||
|     d_device_name = device_name; | ||||
|     d_device_name = std::move(device_name); | ||||
|     d_device_base = device_base; | ||||
|     d_track_pilot = track_pilot; | ||||
|     d_device_descriptor = 0; | ||||
| @@ -345,7 +346,7 @@ void fpga_multicorrelator_8sc::set_channel(uint32_t channel) | ||||
|     //            std::cout << "deviceio" << device_io_name << " opened successfully" << std::endl; | ||||
|     // | ||||
|     //        } | ||||
|     d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(NULL, PAGE_SIZE, | ||||
|     d_map_base = reinterpret_cast<volatile uint32_t *>(mmap(nullptr, PAGE_SIZE, | ||||
|         PROT_READ | PROT_WRITE, MAP_SHARED, d_device_descriptor, 0)); | ||||
|  | ||||
|     if (d_map_base == reinterpret_cast<void *>(-1)) | ||||
| @@ -709,7 +710,7 @@ void fpga_multicorrelator_8sc::unlock_channel(void) | ||||
|  | ||||
| void fpga_multicorrelator_8sc::close_device() | ||||
| { | ||||
|     uint32_t *aux = const_cast<uint32_t *>(d_map_base); | ||||
|     auto *aux = const_cast<uint32_t *>(d_map_base); | ||||
|     if (munmap(static_cast<void *>(aux), PAGE_SIZE) == -1) | ||||
|         { | ||||
|             printf("Failed to unmap memory uio\n"); | ||||
|   | ||||
| @@ -32,8 +32,8 @@ | ||||
|  */ | ||||
|  | ||||
| #include "gnss_sdr_supl_client.h" | ||||
| #include <cmath> | ||||
| #include <pugixml.hpp> | ||||
| #include <cmath> | ||||
| #include <utility> | ||||
|  | ||||
| gnss_sdr_supl_client::gnss_sdr_supl_client() | ||||
|   | ||||
| @@ -67,6 +67,7 @@ | ||||
| #include <sys/ipc.h> | ||||
| #include <sys/msg.h> | ||||
| #include <sys/types.h> | ||||
| #include <utility> | ||||
|  | ||||
|  | ||||
| extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map; | ||||
| @@ -294,14 +295,14 @@ int ControlThread::run() | ||||
| } | ||||
|  | ||||
|  | ||||
| void ControlThread::set_control_queue(gr::msg_queue::sptr control_queue) | ||||
| void ControlThread::set_control_queue(const gr::msg_queue::sptr& control_queue) | ||||
| { | ||||
|     if (flowgraph_->running()) | ||||
|         { | ||||
|             LOG(WARNING) << "Unable to set control queue while flowgraph is running"; | ||||
|             return; | ||||
|         } | ||||
|     control_queue_ = control_queue; | ||||
|     control_queue_ = std::move(control_queue); | ||||
|     cmd_interface_.set_msg_queue(control_queue_); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -93,7 +93,7 @@ public: | ||||
|      * | ||||
|      * \param[in] boost::shared_ptr<gr::msg_queue> control_queue | ||||
|      */ | ||||
|     void set_control_queue(gr::msg_queue::sptr control_queue); | ||||
|     void set_control_queue(const gr::msg_queue::sptr& control_queue); | ||||
|  | ||||
|  | ||||
|     unsigned int processed_control_messages() | ||||
|   | ||||
| @@ -50,6 +50,7 @@ | ||||
| #include <exception> | ||||
| #include <iostream> | ||||
| #include <set> | ||||
| #include <utility> | ||||
| #ifdef GR_GREATER_38 | ||||
| #include <gnuradio/filter/fir_filter_blk.h> | ||||
| #else | ||||
| @@ -61,12 +62,12 @@ | ||||
|  | ||||
| using google::LogMessage; | ||||
|  | ||||
| GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue) | ||||
| GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr& queue) | ||||
| { | ||||
|     connected_ = false; | ||||
|     running_ = false; | ||||
|     configuration_ = configuration; | ||||
|     queue_ = queue; | ||||
|     queue_ = std::move(queue); | ||||
|     init(); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -73,7 +73,7 @@ public: | ||||
|     /*! | ||||
|      * \brief Constructor that initializes the receiver flow graph | ||||
|      */ | ||||
|     GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, gr::msg_queue::sptr queue); | ||||
|     GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr& queue); | ||||
|  | ||||
|     /*! | ||||
|      * \brief Destructor | ||||
|   | ||||
| @@ -837,7 +837,7 @@ void PositionSystemTest::print_results(const arma::mat& R_eb_enu) | ||||
|                 { | ||||
|                     boost::filesystem::path p(gnuplot_executable); | ||||
|                     boost::filesystem::path dir = p.parent_path(); | ||||
|                     std::string gnuplot_path = dir.native(); | ||||
|                     const std::string& gnuplot_path = dir.native(); | ||||
|                     Gnuplot::set_GNUPlotPath(gnuplot_path); | ||||
|  | ||||
|                     Gnuplot g1("points"); | ||||
|   | ||||
| @@ -70,15 +70,15 @@ | ||||
| #include <gnuradio/blocks/null_sink.h> | ||||
| #include <gnuradio/filter/firdes.h> | ||||
| #include <gnuradio/top_block.h> | ||||
| #include <gtest/gtest.h> | ||||
| #include <matio.h> | ||||
| #include <chrono> | ||||
| #include <exception> | ||||
| #include <gpstk/Rinex3ObsBase.hpp> | ||||
| #include <gpstk/Rinex3ObsData.hpp> | ||||
| #include <gpstk/Rinex3ObsHeader.hpp> | ||||
| #include <gpstk/Rinex3ObsStream.hpp> | ||||
| #include <gpstk/RinexUtilities.hpp> | ||||
| #include <gtest/gtest.h> | ||||
| #include <matio.h> | ||||
| #include <chrono> | ||||
| #include <exception> | ||||
| #include <unistd.h> | ||||
| #ifdef GR_GREATER_38 | ||||
| #include <gnuradio/filter/fir_filter_blk.h> | ||||
|   | ||||
| @@ -54,10 +54,11 @@ | ||||
| #include <gnuradio/top_block.h> | ||||
| #include <gtest/gtest.h> | ||||
| #include <chrono> | ||||
| #include <cstdio>  // FPGA read input file | ||||
| #include <fcntl.h> | ||||
| #include <iostream> | ||||
| #include <stdio.h>  // FPGA read input file | ||||
| #include <unistd.h> | ||||
| #include <utility> | ||||
| #ifdef GR_GREATER_38 | ||||
| #include <gnuradio/analog/sig_source.h> | ||||
| #else | ||||
| @@ -69,7 +70,7 @@ | ||||
| #define FIVE_SECONDS 5000000          // five seconds in microseconds | ||||
|  | ||||
| void send_tracking_gps_input_samples(FILE *rx_signal_file, | ||||
|     int num_remaining_samples, gr::top_block_sptr top_block) | ||||
|     int num_remaining_samples, const gr::top_block_sptr& top_block) | ||||
| { | ||||
|     int num_samples_transferred = 0;   // number of samples that have been transferred to the DMA so far | ||||
|     static int flowgraph_stopped = 0;  // flag to indicate if the flowgraph is stopped already | ||||
| @@ -142,7 +143,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) | ||||
|     usleep(FIVE_SECONDS);  // wait for some time to give time to the other thread to program the device | ||||
|  | ||||
|     //send_tracking_gps_input_samples(dma_descr, rx_signal_file, file_length); | ||||
|     send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); | ||||
|     send_tracking_gps_input_samples(rx_signal_file, file_length, std::move(top_block)); | ||||
|  | ||||
|     fclose(rx_signal_file); | ||||
| } | ||||
| @@ -151,7 +152,7 @@ void sending_thread(gr::top_block_sptr top_block, const char *file_name) | ||||
| // ######## GNURADIO BLOCK MESSAGE RECEVER ######### | ||||
| class GpsL1CADllPllTrackingTestFpga_msg_rx; | ||||
|  | ||||
| typedef boost::shared_ptr<GpsL1CADllPllTrackingTestFpga_msg_rx> GpsL1CADllPllTrackingTestFpga_msg_rx_sptr; | ||||
| using GpsL1CADllPllTrackingTestFpga_msg_rx_sptr = boost::shared_ptr<GpsL1CADllPllTrackingTestFpga_msg_rx>; | ||||
|  | ||||
| GpsL1CADllPllTrackingTestFpga_msg_rx_sptr GpsL1CADllPllTrackingTestFpga_msg_rx_make(); | ||||
|  | ||||
| @@ -180,7 +181,7 @@ void GpsL1CADllPllTrackingTestFpga_msg_rx::msg_handler_events(pmt::pmt_t msg) | ||||
| { | ||||
|     try | ||||
|         { | ||||
|             int64_t message = pmt::to_long(msg); | ||||
|             int64_t message = pmt::to_long(std::move(msg)); | ||||
|             rx_message = message; | ||||
|         } | ||||
|     catch (boost::bad_any_cast &e) | ||||
| @@ -204,9 +205,7 @@ GpsL1CADllPllTrackingTestFpga_msg_rx::GpsL1CADllPllTrackingTestFpga_msg_rx() : g | ||||
| } | ||||
|  | ||||
|  | ||||
| GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() | ||||
| { | ||||
| } | ||||
| GpsL1CADllPllTrackingTestFpga_msg_rx::~GpsL1CADllPllTrackingTestFpga_msg_rx() = default; | ||||
|  | ||||
|  | ||||
| // ########################################################### | ||||
| @@ -243,9 +242,7 @@ public: | ||||
|         gnss_synchro = Gnss_Synchro(); | ||||
|     } | ||||
|  | ||||
|     ~GpsL1CADllPllTrackingTestFpga() | ||||
|     { | ||||
|     } | ||||
|     ~GpsL1CADllPllTrackingTestFpga() = default; | ||||
|  | ||||
|     void configure_receiver(); | ||||
|  | ||||
| @@ -283,7 +280,7 @@ int GpsL1CADllPllTrackingTestFpga::generate_signal() | ||||
|     int child_status; | ||||
|  | ||||
|     char *const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], | ||||
|         &p4[0], &p5[0], NULL}; | ||||
|         &p4[0], &p5[0], nullptr}; | ||||
|  | ||||
|     int pid; | ||||
|     if ((pid = fork()) == -1) | ||||
|   | ||||
| @@ -42,10 +42,10 @@ | ||||
| #include <boost/iostreams/filtering_streambuf.hpp> | ||||
| #include <boost/serialization/map.hpp> | ||||
| #include <gflags/gflags.h> | ||||
| #include <cstdlib> | ||||
| #include <gpstk/Rinex3NavData.hpp> | ||||
| #include <gpstk/Rinex3NavHeader.hpp> | ||||
| #include <gpstk/Rinex3NavStream.hpp> | ||||
| #include <cstdlib> | ||||
| #include <iostream> | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez