diff --git a/.clang-tidy b/.clang-tidy index 50fa566d0..bfb1b252c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,130 @@ --- -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-bool-literals,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-using,performance-faster-string-find,performance-inefficient-algorithm,performance-move-const-arg,performance-type-promotion-in-math-fn,performance-unnecessary-copy-initialization,performance-unnecessary-value-param,readability-container-size-empty,readability-named-parameter,readability-non-const-parameter,readability-string-compare' -HeaderFilterRegex: '.*' +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, + 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, + misc-unused-using-decls, + modernize-loop-convert, + modernize-pass-by-value, + modernize-raw-string-literal, + modernize-use-auto, + modernize-use-bool-literals, + modernize-use-equals-default, + modernize-use-equals-delete, + modernize-use-noexcept, + modernize-use-nullptr, + performance-faster-string-find, + performance-inefficient-algorithm, + performance-move-const-arg, + performance-type-promotion-in-math-fn, + performance-unnecessary-copy-initialization, + performance-unnecessary-value-param, + readability-container-size-empty, + readability-identifier-naming, + readability-inconsistent-declaration-parameter-name, + readability-named-parameter, + readability-non-const-parameter, + readability-string-compare' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: 'file' +CheckOptions: + - key: google-build-namespaces.HeaderFileExtensions + value: ',h' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: google-runtime-int.SignedTypePrefix + value: int + - key: google-runtime-int.TypeSuffix + value: _t + - key: google-runtime-int.UnsignedTypePrefix + value: uint + - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries + value: '1' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-pass-by-value.ValuesOnly + value: '0' + - key: modernize-raw-string-literal.ReplaceShorterLiterals + value: '0' + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-auto.MinTypeNameLength + value: '5' + - key: modernize-use-auto.RemoveStars + value: '0' + - key: modernize-use-equals-default.IgnoreMacros + value: '1' + - key: modernize-use-noexcept.ReplacementString + value: '' + - key: modernize-use-noexcept.UseNoexceptFalse + value: '1' + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: performance-faster-string-find.StringLikeClasses + value: 'std::basic_string' + - key: performance-move-const-arg.CheckTriviallyCopyableMove + value: '1' + - key: performance-type-promotion-in-math-fn.IncludeStyle + value: llvm + - key: performance-unnecessary-value-param.IncludeStyle + value: llvm + - key: readability-identifier-naming.AbstractClassCase + value: CamelCase + - key: readability-identifier-naming.AbstractClassPrefix + value: '' + - key: readability-identifier-naming.AbstractClassSuffix + value: '' + - key: readability-identifier-naming.ClassCase + value: Camel_Snake_Case + - key: readability-identifier-naming.ClassPrefix + value: '' + - key: readability-identifier-naming.ClassSuffix + value: '' + - key: readability-identifier-naming.GlobalConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.GlobalConstantPrefix + value: '' + - key: readability-identifier-naming.GlobalConstantSuffix + value: '' + - key: readability-identifier-naming.IgnoreFailedSplit + value: '0' + - key: readability-identifier-naming.StructCase + value: aNy_CasE + - key: readability-identifier-naming.StructPrefix + value: '' + - key: readability-identifier-naming.StructSuffix + value: '' + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: '1' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: '0' +... diff --git a/CMakeLists.txt b/CMakeLists.txt index a24768c62..492169801 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -23,7 +23,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' ") endif() -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(gnss-sdr CXX C) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) file(RELATIVE_PATH RELATIVE_CMAKE_CALL ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) @@ -41,7 +41,7 @@ endif() ######################################################################## # Determine optional blocks/libraries to be built (default: not built) -# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ../' +# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..' ######################################################################## # Support of optional RF front-ends option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON) @@ -58,6 +58,9 @@ option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF) option(ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF) +# Code correctness +option(ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF) + # Acceleration option(ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF) option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF) @@ -324,12 +327,12 @@ endif() ################################################################################ # Minimum required versions ################################################################################ -set(GNSSSDR_CMAKE_MIN_VERSION "2.8.8") +set(GNSSSDR_CMAKE_MIN_VERSION "2.8.12") set(GNSSSDR_GCC_MIN_VERSION "4.7.2") set(GNSSSDR_CLANG_MIN_VERSION "3.4.0") set(GNSSSDR_APPLECLANG_MIN_VERSION "500") set(GNSSSDR_GNURADIO_MIN_VERSION "3.7.3") -set(GNSSSDR_BOOST_MIN_VERSION "1.45") +set(GNSSSDR_BOOST_MIN_VERSION "1.53") set(GNSSSDR_PYTHON_MIN_VERSION "2.7") set(GNSSSDR_PYTHON3_MIN_VERSION "3.4") set(GNSSSDR_MAKO_MIN_VERSION "0.4.2") @@ -407,12 +410,62 @@ endif() +################################################################################ +# Set C and C++ standard +################################################################################ +if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) + set(CMAKE_C_STANDARD 11) + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_EXTENSIONS OFF) +else() + add_compile_options("$<$,C>:-std=gnu11>") + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") + add_compile_options("$<$,CXX>:-std=c++11>") + else() + add_compile_options("$<$,CXX>:-std=c++14>") + endif() + endif() + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(OS_IS_MACOSX) + if(CLANG_VERSION VERSION_LESS "600") + add_compile_options("$<$,CXX>:-std=c++11>") + else() + add_compile_options("$<$,CXX>:-std=c++14>") + endif() + else() + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") + add_compile_options("$<$,CXX>:-std=c++11>") + else() + add_compile_options("$<$,CXX>:-std=c++14>") + endif() + endif() + endif() +endif() + +# Visibility +# See https://gcc.gnu.org/wiki/Visibility +if(POLICY CMP0053) + cmake_policy(SET CMP0063 NEW) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_C_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) +else() + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + add_definitions(-fvisibility=hidden) + endif() +endif() + + ################################################################################ # Check if the compiler defines the architecture as ARM ################################################################################ if(NOT OS_IS_MACOSX) if(CMAKE_CROSSCOMPILING) set(IS_ARM TRUE) + if(NOT CMAKE_NO_SYSTEM_FROM_IMPORTED) + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) + endif() else() include(TestForARM) endif() @@ -420,21 +473,25 @@ endif() -################################################################################ -# Check for availability of SSE -################################################################################ -if(NOT ENABLE_GENERIC_ARCH) - include(TestForSSE) -endif() - - - ################################################################################ # Find the POSIX thread (pthread) libraries ################################################################################ if(CMAKE_VERSION VERSION_LESS 3.1) + # Workaround for CMake < 3.1 find_package(Threads REQUIRED) - set(THREAD_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + add_library(Threads::Threads SHARED IMPORTED) + set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") + set_property(TARGET Threads::Threads PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") + include(GNUInstallDirs) + # Fix bug in Debian 8.11 + if(${LINUX_DISTRIBUTION} MATCHES "Debian") + if(${LINUX_VER} VERSION_LESS 8.12) + if(ARCH_64BITS) + set(FIX_PTHREADS_LOCATION "x86_64-linux-gnu/") + endif() + endif() + endif() + set_property(TARGET Threads::Threads PROPERTY IMPORTED_LOCATION /usr/${CMAKE_INSTALL_LIBDIR}/${FIX_PTHREADS_LOCATION}${CMAKE_FIND_LIBRARY_PREFIXES}pthread${CMAKE_SHARED_LIBRARY_SUFFIX}) else() set(CMAKE_THREAD_PREFER_PTHREAD TRUE) if(CMAKE_CROSSCOMPILING) @@ -443,7 +500,6 @@ else() set(THREADS_PREFER_PTHREAD_FLAG TRUE) endif() find_package(Threads REQUIRED) - set(THREAD_LIBRARIES Threads::Threads) endif() @@ -458,13 +514,13 @@ if(ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING) endif() if(GTEST_DIR) message(STATUS "Googletest root folder set at ${GTEST_DIR}") - find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR}) + find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR} ${GTEST_DIR}/googletest) if(LIBGTEST_DEV_DIR) message(STATUS "Googletest has been found.") else() message(FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.") endif() - find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include) + find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/googletest/include) else() find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/googletest/googletest /usr/src/gtest /usr/include/gtest /opt/local/src/gtest-1.7.0) find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include) @@ -487,8 +543,7 @@ if(UNIX AND EXISTS "/usr/lib64") list(APPEND BOOST_LIBRARYDIR "/usr/lib64") # Fedora 64-bit fix endif() set(Boost_ADDITIONAL_VERSIONS - "1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49" - "1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54" + "1.53.0" "1.53" "1.54.0" "1.54" "1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59" "1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64" "1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69" @@ -498,11 +553,84 @@ set(Boost_ADDITIONAL_VERSIONS ) set(Boost_USE_MULTITHREAD ON) set(Boost_USE_STATIC_LIBS OFF) -find_package(Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED) +find_package(Boost ${GNSSSDR_BOOST_MIN_VERSION} COMPONENTS atomic chrono date_time filesystem serialization system thread REQUIRED) if(NOT Boost_FOUND) message(FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required.") endif() +if(CMAKE_VERSION VERSION_LESS 3.5) + if(NOT TARGET Boost::boost) + add_library(Boost::boost SHARED IMPORTED) # Trick for CMake 2.8.12 + set_property(TARGET Boost::boost PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::boost PROPERTY + IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}) + endif() + if(NOT TARGET Boost::date_time) + add_library(Boost::date_time SHARED IMPORTED) + set_property(TARGET Boost::date_time PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::date_time PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_DATE_TIME_LIBRARIES}) + set_property(TARGET Boost::date_time PROPERTY + IMPORTED_LOCATION ${Boost_DATE_TIME_LIBRARIES}) + endif() + if(NOT TARGET Boost::system) + add_library(Boost::system SHARED IMPORTED) + set_property(TARGET Boost::system PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::system PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SYSTEM_LIBRARIES}) + set_property(TARGET Boost::system PROPERTY + IMPORTED_LOCATION ${Boost_SYSTEM_LIBRARIES}) + endif() + if(NOT TARGET Boost::filesystem) + add_library(Boost::filesystem SHARED IMPORTED) + set_property(TARGET Boost::filesystem PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::filesystem PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_FILESYSTEM_LIBRARIES}) + set_property(TARGET Boost::filesystem PROPERTY + IMPORTED_LOCATION ${Boost_FILESYSTEM_LIBRARIES}) + endif() + if(NOT TARGET Boost::thread) + add_library(Boost::thread SHARED IMPORTED) + set_property(TARGET Boost::thread PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::thread PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_THREAD_LIBRARIES}) + set_property(TARGET Boost::thread PROPERTY + IMPORTED_LOCATION ${Boost_THREAD_LIBRARIES}) + endif() + if(NOT TARGET Boost::serialization) + add_library(Boost::serialization SHARED IMPORTED) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZATION_LIBRARIES}) + set_property(TARGET Boost::serialization PROPERTY + IMPORTED_LOCATION ${Boost_SERIALIZATION_LIBRARIES}) + endif() + if(NOT TARGET Boost::chrono) + add_library(Boost::chrono SHARED IMPORTED) + set_property(TARGET Boost::chrono PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::chrono PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_CHRONO_LIBRARIES}) + set_property(TARGET Boost::chrono PROPERTY + IMPORTED_LOCATION ${Boost_CHRONO_LIBRARIES}) + endif() + if(NOT TARGET Boost::atomic) + add_library(Boost::atomic SHARED IMPORTED) + set_property(TARGET Boost::atomic PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::atomic PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_ATOMIC_LIBRARIES}) + set_property(TARGET Boost::atomic PROPERTY + IMPORTED_LOCATION ${Boost_ATOMIC_LIBRARIES}) + endif() +endif() + ################################################################################ @@ -530,22 +658,98 @@ if(NOT GNURADIO_RUNTIME_FOUND) message(" brew install gnuradio") message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") endif() +else() + if(NOT TARGET Gnuradio::runtime) + add_library(Gnuradio::runtime SHARED IMPORTED) + list(GET GNURADIO_RUNTIME_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_RUNTIME_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::runtime PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_RUNTIME_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_RUNTIME_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_RUNTIME_LIBRARIES}" + ) + endif() endif() if(NOT GNURADIO_ANALOG_FOUND) message(FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::analog) + add_library(Gnuradio::analog SHARED IMPORTED) + list(GET GNURADIO_ANALOG_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_ANALOG_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::analog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_ANALOG_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_ANALOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_ANALOG_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_BLOCKS_FOUND) message(FATAL_ERROR "*** The gnuradio-blocks library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::blocks) + add_library(Gnuradio::blocks SHARED IMPORTED) + list(GET GNURADIO_BLOCKS_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_BLOCKS_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::blocks PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_BLOCKS_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_BLOCKS_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_BLOCKS_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_FILTER_FOUND) message(FATAL_ERROR "*** The gnuradio-filter library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::filter) + add_library(Gnuradio::filter SHARED IMPORTED) + list(GET GNURADIO_FILTER_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_FILTER_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::filter PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_FILTER_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_FILTER_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_FILTER_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_FFT_FOUND) message(FATAL_ERROR "*** The gnuradio-fft library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::fft) + add_library(Gnuradio::fft SHARED IMPORTED) + list(GET GNURADIO_FFT_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_FFT_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::fft PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_FFT_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_FFT_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_FFT_LIBRARIES}" + ) + endif() endif() + if(NOT GNURADIO_PMT_FOUND) message(FATAL_ERROR "*** The gnuradio-pmt library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr") +else() + if(NOT TARGET Gnuradio::pmt) + add_library(Gnuradio::pmt SHARED IMPORTED) + list(GET GNURADIO_PMT_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_PMT_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::pmt PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_PMT_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_PMT_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_PMT_LIBRARIES}" + ) + endif() endif() @@ -695,6 +899,19 @@ if(NOT VOLKGNSSSDR_FOUND) set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES}) + if(NOT TARGET Volkgnsssdr::volkgnsssdr) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include) + add_library(Volkgnsssdr::volkgnsssdr STATIC IMPORTED) + add_dependencies(Volkgnsssdr::volkgnsssdr volk_gnsssdr_module) + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/lib/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" + ) + endif() + if(CMAKE_VERSION VERSION_LESS 3.2) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile @@ -756,16 +973,23 @@ if(NOT GFLAGS_FOUND) ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" ) - add_library(gflags UNKNOWN IMPORTED) - set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) - add_dependencies(gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBS gflags) - file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*") - set(GFlags_LIBRARY gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) - set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) - link_directories(${GFlags_LIBRARY_PATH}) - set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") - set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) + file(GLOB GFlags_SHARED_LIBS + "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*" + ) + + if(NOT TARGET Gflags::gflags) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include) + add_library(Gflags::gflags STATIC IMPORTED) + add_dependencies(Gflags::gflags gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set_target_properties(Gflags::gflags PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + endif() + set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) endif() @@ -899,6 +1123,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c INSTALL_COMMAND "" ) endif() + add_dependencies(glog-${GNSSSDR_GLOG_LOCAL_VERSION} Gflags::gflags) # Set up variables set(GLOG_INCLUDE_DIRS @@ -908,15 +1133,27 @@ ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/c set(GLOG_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) + + # Create Glog::glog target + if(NOT TARGET Glog::glog) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + add_library(Glog::glog STATIC IMPORTED) + add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION}) + set_target_properties(Glog::glog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}" + INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + endif() + set(LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE) -else() - add_library(glog-${GNSSSDR_GLOG_LOCAL_VERSION} UNKNOWN IMPORTED) - set_property(TARGET glog-${GNSSSDR_GLOG_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}") endif() if(NOT ENABLE_LOG) message(STATUS "Logging is not enabled") - add_definitions(-DGOOGLE_STRIP_LOG=1) endif() @@ -967,6 +1204,14 @@ if(ARMADILLO_FOUND) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) set(ARMADILLO_FOUND false) set(ENABLE_OWN_ARMADILLO true) + else() + add_library(Armadillo::armadillo SHARED IMPORTED) + set_target_properties(Armadillo::armadillo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}" + ) endif() endif() @@ -1028,17 +1273,22 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) # Set up variables ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir) - set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + #set(ARMADILLO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) if(NOT GFORTRAN) set(GFORTRAN "") endif() set(ARMADILLO_LIBRARIES ${BLAS} ${LAPACK} ${GFORTRAN} ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) -else() - set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING}) - add_library(armadillo-${armadillo_RELEASE} UNKNOWN IMPORTED) - set_property(TARGET armadillo-${armadillo_RELEASE} PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + add_library(Armadillo::armadillo STATIC IMPORTED) + add_dependencies(Armadillo::armadillo armadillo-${armadillo_RELEASE}) + set_target_properties(Armadillo::armadillo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include" + INTERFACE_LINK_LIBRARIES "${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) endif() @@ -1165,6 +1415,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS set(HDF5_BASE_DIR /usr/local) endif() endif() + if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} PREFIX ${CMAKE_CURRENT_BINARY_DIR}/matio @@ -1173,7 +1424,7 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make + BUILD_COMMAND $(MAKE) ) else() ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} @@ -1183,13 +1434,23 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= - BUILD_COMMAND make + BUILD_COMMAND $(MAKE) BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() - set(MATIO_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX} ${HDF5_LIBRARIES} ${ZLIB_LIBRARIES}) - set(MATIO_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/matio/include) set(MATIO_LOCAL true) + if(NOT TARGET Matio::matio) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/include) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/matio/lib) + add_library(Matio::matio SHARED IMPORTED) + add_dependencies(Matio::matio matio-${GNSSSDR_MATIO_LOCAL_VERSION}) + set_target_properties(Matio::matio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/matio/include" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + endif() else() message(STATUS " The hdf5 library has not been found in your system.") message(STATUS " Please try to install it by doing:") @@ -1250,37 +1511,30 @@ else() INSTALL_COMMAND "" ) endif() - set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) - set(PUGIXML_LOCAL true) -endif() - -################################################################################ -# USRP Hardware Driver (UHD) - OPTIONAL -################################################################################ -if(ENABLE_UHD) - find_package(UHD) - if(NOT UHD_FOUND) - set(ENABLE_UHD OFF) - message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") - message(STATUS " so all USRP-based front-ends will not be usable.") - message(STATUS " Please check https://files.ettus.com/manual/") - else() - set(GR_REQUIRED_COMPONENTS UHD) - find_package(Gnuradio) + if(NOT TARGET Pugixml::pugixml) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) + add_library(Pugixml::pugixml STATIC IMPORTED) + add_dependencies(Pugixml::pugixml pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) + set_target_properties(Pugixml::pugixml PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) endif() endif() + ################################################################################ # Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (OPTIONAL, used if found) ################################################################################ find_package(Doxygen) if(DOXYGEN_FOUND) message(STATUS "Doxygen found.") - message(STATUS "You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") - message(STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") + message(STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") + message(STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html") set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) @@ -1302,7 +1556,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating API documentation with Doxygen." VERBATIM ) if(LATEX_COMPILER) - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") add_custom_target(pdfmanual COMMAND ${CMAKE_MAKE_PROGRAM} COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf @@ -1312,7 +1566,7 @@ if(DOXYGEN_FOUND) COMMENT "Generating PDF manual with Doxygen." VERBATIM ) endif() - message(STATUS "'${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") add_custom_target(doc-clean COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex @@ -1350,7 +1604,7 @@ if(ENABLE_OPENCL) else() if(OPENCL_FOUND) message(STATUS "OpenCL has been found and will be used by some processing blocks") - message(STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' ") + message(STATUS " You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ..' ") endif() endif() if(ENABLE_GENERIC_ARCH) @@ -1377,10 +1631,10 @@ endif() if(ENABLE_CUDA) find_package(CUDA REQUIRED) message(STATUS "NVIDIA CUDA GPU Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'") else() message(STATUS "NVIDIA CUDA GPU Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA.") + message(STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA.") endif() @@ -1389,23 +1643,25 @@ endif() # 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() - message(STATUS "High-optimized custom UDP ip packet source will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ../'") + message(STATUS "High-optimized custom UDP IP packet source is enabled.") + message(STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'") + find_package(PCAP) + if(NOT PCAP_FOUND) + message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)") + endif() endif() + ############################################################################### # FPGA (OPTIONAL) ############################################################################### if(ENABLE_FPGA) message(STATUS "FPGA Acceleration will be enabled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FPGA=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'") else() message(STATUS "Fpga Acceleration will be not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FPGA=ON ../' to add support for GPU-based acceleration using the FPGA.") + message(STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA.") endif() @@ -1413,40 +1669,39 @@ endif() ################################################################################ # Setup of optional drivers ################################################################################ -if($ENV{GN3S_DRIVER}) - message(STATUS "GN3S_DRIVER environment variable found.") - set(ENABLE_GN3S ON) -endif() -if(GN3S_DRIVER) - set(ENABLE_GN3S ON) -endif() -if(ENABLE_GN3S) - message(STATUS "The GN3S driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'") -else() - message(STATUS "The (optional and experimental) GN3S driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle.") + +######################################## +# USRP Hardware Driver (UHD) - OPTIONAL +######################################## +if(ENABLE_UHD) + find_package(UHD) + if(NOT UHD_FOUND) + set(ENABLE_UHD OFF) + message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,") + message(STATUS " so all USRP-based front-ends will not be usable.") + message(STATUS " Please check https://files.ettus.com/manual/") + else() + set(GR_REQUIRED_COMPONENTS UHD) + find_package(Gnuradio) + if(NOT TARGET Gnuradio::uhd) + add_library(Gnuradio::uhd SHARED IMPORTED) + list(GET GNURADIO_UHD_LIBRARIES 0 FIRST_DIR) + get_filename_component(GNURADIO_UHD_DIR ${FIRST_DIR} ABSOLUTE) + set_target_properties(Gnuradio::uhd PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GNURADIO_UHD_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_UHD_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GNURADIO_UHD_LIBRARIES}" + ) + endif() + endif() endif() -if($ENV{RAW_ARRAY_DRIVER}) - message(STATUS "RAW_ARRAY_DRIVER environment variable found.") - set(ENABLE_ARRAY ON) -endif() - -if(RAW_ARRAY_DRIVER) - set(ENABLE_ARRAY ON) -endif() - -if(ENABLE_ARRAY) - message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'") - # copy firmware to install folder - # Build project gr-dbfcttc -else() - message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end.") -endif() +########################################## +# gr-osmosdr - OPTIONAL +# https://github.com/osmocom/gr-osmosdr +########################################## if($ENV{RTLSDR_DRIVER}) message(STATUS "RTLSDR_DRIVER environment variable found.") set(ENABLE_OSMOSDR ON) @@ -1456,7 +1711,7 @@ if(ENABLE_OSMOSDR) find_package(GROSMOSDR) if(GROSMOSDR_FOUND) message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'") else() if(ENABLE_PACKAGING) message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.") @@ -1466,9 +1721,34 @@ if(ENABLE_OSMOSDR) endif() else() message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") + message(STATUS " Enable it with 'cmake -DENABLE_OSMOSDR=ON ..' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)") endif() + +############################################## +# gr-iio - OPTIONAL +# IIO blocks for GNU Radio +# https://github.com/analogdevicesinc/gr-iio +############################################## +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + find_package(GRIIO) + find_package(LIBIIO) +endif() + + +################################################################################### +# libiio - OPTIONAL +# A cross platform library for interfacing with local and remote Linux IIO devices +# https://github.com/analogdevicesinc/libiio +################################################################################### +if(ENABLE_AD9361) + find_package(LIBIIO) +endif() + + +############################################## +# TELEORBIT FLEXIBAND FRONTEND - OPTIONAL +############################################## if($ENV{FLEXIBAND_DRIVER}) message(STATUS "FLEXIBAND_DRIVER environment variable found.") set(ENABLE_FLEXIBAND ON) @@ -1480,26 +1760,74 @@ endif() if(ENABLE_FLEXIBAND) message(STATUS "The Teleorbit Flexiband front-end source will be compiled.") - message(STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'") + message(STATUS " You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ..'") else() message(STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled.") - message(STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end.") + message(STATUS " Enable it with 'cmake -DENABLE_FLEXIBAND=ON ..' to add support for the Teleorbit Flexiband front-end.") +endif() +if(ENABLE_FLEXIBAND) + find_package(TELEORBIT) + if(NOT TELEORBIT_FOUND) + message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") + endif() +endif() + + +############################################## +# GN3S - OPTIONAL +############################################## +if($ENV{GN3S_DRIVER}) + message(STATUS "GN3S_DRIVER environment variable found.") + set(ENABLE_GN3S ON) +endif() +if(GN3S_DRIVER) + set(ENABLE_GN3S ON) +endif() +if(ENABLE_GN3S) + message(STATUS "The GN3S driver will be compiled.") + message(STATUS " You can disable it with 'cmake -DENABLE_GN3S=OFF ..'") + find_package(GRGN3S QUIET) +else() + message(STATUS "The (optional and experimental) GN3S driver is not enabled.") + message(STATUS " Enable it with 'cmake -DENABLE_GN3S=ON ..' to add support for the GN3S dongle.") +endif() + + +####################################################### +# CTTC's digital array beamformer prototype - OPTIONAL +####################################################### +if($ENV{RAW_ARRAY_DRIVER}) + message(STATUS "RAW_ARRAY_DRIVER environment variable found.") + set(ENABLE_ARRAY ON) +endif() + +if(RAW_ARRAY_DRIVER) + set(ENABLE_ARRAY ON) +endif() + +if(ENABLE_ARRAY) + message(STATUS "CTTC's Antenna Array front-end driver will be compiled.") + message(STATUS " You can disable it with 'cmake -DENABLE_ARRAY=OFF ..'") + find_package(GRDBFCTTC QUIET) +else() + message(STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled.") + message(STATUS " Enable it with 'cmake -DENABLE_ARRAY=ON ..' to add support for the CTTC experimental array front-end.") endif() ################################################################################ -# GPerftools - https://github.com/gperftools/gperftools (OPTIONAL) +# GPerftools - https://github.com/gperftools/gperftools - OPTIONAL) ################################################################################ if(ENABLE_GPERFTOOLS) find_package(GPERFTOOLS) if(NOT GPERFTOOLS_FOUND) message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") - message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") - message(STATUS "You can install GPerftools from https://github.com/gperftools/gperftools") + message(STATUS " Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") + message(STATUS " You can install GPerftools from https://github.com/gperftools/gperftools") else() message(STATUS "GPerftools libraries found.") - message(STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") + message(STATUS " Binaries will be compiled with 'tcmalloc' and 'profiler' libraries.") endif() endif() if(ENABLE_GPERFTOOLS) @@ -1507,10 +1835,10 @@ if(ENABLE_GPERFTOOLS) # See https://github.com/gperftools/gperftools/blob/master/README if(GPERFTOOLS_FOUND) if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free") + add_compile_options(-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin") + add_compile_options(-fno-builtin) endif() endif() endif() @@ -1521,7 +1849,7 @@ endif() # GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/ ######################################################################## if(ENABLE_GPROF) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg") + add_compile_options(-pg) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg") endif() @@ -1530,92 +1858,48 @@ endif() ######################################################################## # Set compiler flags ######################################################################## -# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) -# Enable C++14 support in GCC >= 6.1.1 -# Fallback to C++11 when using GCC < 6.1.1 if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") + # Add warning flags + # For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html + set(cxx_warning_flags -Wall -Wextra) + if(NOT (CMAKE_VERSION VERSION_LESS "3.3")) + add_compile_options("$<$:${cxx_warning_flags}>") else() - # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") + add_compile_options("$<$,CXX>:${cxx_warning_flags}>") endif() - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html -endif() - -# Support of C++17 is still not possible due to pm_remez.h (solved in GNU Radio 3.8) -# Enable C++14 support in Clang >= 3.5.0 or AppleClang >= 600 -# Fallback to C++11 if older version -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(OS_IS_MACOSX) - # See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences - if(CLANG_VERSION VERSION_LESS "600") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else() - # if(CLANG_VERSION VERSION_LESS "900") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CLANG_VERSION VERSION_LESS "900") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CLANG_VERSION VERSION_LESS "900") - endif() - else() - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11") - else() - # if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14") - # else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - # set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17") - # endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0") - endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0") + add_compile_options(-Wno-missing-field-initializers) endif() - - if(OS_IS_MACOSX) - set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -stdlib=libc++") - endif() -endif() - -if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) AND NOT WIN32) - if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) - set(CMAKE_C_STANDARD 11) - set(CMAKE_CXX_STANDARD 14) + if(CMAKE_CROSSCOMPILING) + add_compile_options(-Wno-psabi) endif() endif() # Processor-architecture related flags # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html -if(NOT ARCH_COMPILER_FLAGS) - if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - if(OS_IS_MACOSX) - set(ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse") - else() - if(NOT ${ENABLE_GENERIC_ARCH}) - if(IS_ARM) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html) - if(NOT CMAKE_CROSSCOMPILING) - if(ARM_VERSION STREQUAL "arm") - # Unknown arm version - try our best to detect - set(ARCH_COMPILER_FLAGS "-mcpu=native") - else() - set(ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}") - endif() - endif() - else() - set(ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse") - endif() - endif() - endif() +if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + if(OS_IS_MACOSX) + add_compile_options(-march=corei7 -mfpmath=sse) + else() + if(NOT ENABLE_GENERIC_ARCH) + if(IS_ARM) + # ARM-specific options + # See https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html + if(NOT CMAKE_CROSSCOMPILING) + if(ARM_VERSION STREQUAL "arm") + # Unknown arm version - try our best to detect + add_compile_options(-mcpu=native) + else() + add_compile_options(-march=${ARM_VERSION}) + endif() + endif() + else() + add_compile_options(-march=native -mfpmath=sse) + endif() + endif() endif() endif() -set(MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}") -if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) - # https://gcc.gnu.org/wiki/Visibility - add_definitions(-fvisibility=hidden) -endif() ######################################################################## @@ -1632,7 +1916,12 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") message(STATUS "clang-tidy not found.") else() message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") - set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*") + if(ENABLE_CLANG_TIDY) + message(STATUS " clang-tidy will be used in compilation. You can disable it with 'cmake -DENABLE_CLANG_TIDY=OFF ..'") + else() + message(STATUS " You can enable clang-tidy usage in compilation with 'cmake -DENABLE_CLANG_TIDY=ON ..'") + endif() + set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() endif() diff --git a/README.md b/README.md index 4b5645a2c..f8f48bfd2 100644 --- a/README.md +++ b/README.md @@ -112,12 +112,12 @@ Once you have installed these packages, you can jump directly to [download the s #### Arch Linux -If you are using Arch Linux (with base-devel group installed): +If you are using Arch Linux: ~~~~~~ -$ pacman -S cmake git boost boost-libs log4cpp libvolk gnuradio gnuradio-osmosdr \ - blas lapack gflags google-glog openssl pugixml python-mako python-six \ - libmatio libpcap gtest +$ pacman -S gcc make cmake git boost boost-libs log4cpp libvolk gnuradio \ + gnuradio-osmosdr blas lapack gflags google-glog openssl pugixml \ + python-mako python-six libmatio libpcap gtest ~~~~~~ Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux). @@ -573,7 +573,7 @@ First, install [Homebrew](https://brew.sh/). Paste this in a terminal prompt: $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ~~~~~~ -The script explains what it will do and then pauses before it does it. There are more installation options [here](https://docs.brew.sh/Installation.html). +The script explains what it will do, and then it pauses before doing it. There are more installation options [here](https://docs.brew.sh/Installation.html). Install pip: @@ -584,17 +584,26 @@ $ sudo easy_install pip Install the required dependencies: ~~~~~~ -$ brew tap homebrew/science -$ brew install cmake hdf5 arpack superlu -$ brew install armadillo -$ brew install glog gflags gnutls +$ brew install cmake +$ brew install hdf5 arpack superlu armadillo +$ brew install glog gflags $ brew install gnuradio $ brew install libmatio +$ brew install log4cpp $ brew install pugixml $ pip install mako $ pip install six +$ brew install openssl ~~~~~~ +In the last step, Homebrew installs OpenSSL but it does not link it to `/usr/local`. Thus, you must manually link it instead: + +~~~~~~ +$ ln -s /usr/local/opt/openssl/include/openssl /usr/local/include +$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/ +~~~~~~ + + #### Build GNSS-SDR Finally, you are ready to clone the GNSS-SDR repository, configure and build the software: diff --git a/cmake/Modules/FindGFLAGS.cmake b/cmake/Modules/FindGFLAGS.cmake index 31739e216..db1f9d891 100644 --- a/cmake/Modules/FindGFLAGS.cmake +++ b/cmake/Modules/FindGFLAGS.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,6 +26,10 @@ # GFlags_INCLUDE_DIRS # GFlags_LIBS # GFlags_LIBRARY_DIRS +# +# Provides the following imported target: +# Gflags::gflags +# if(APPLE) find_path(GFlags_ROOT_DIR @@ -95,9 +99,6 @@ if(GFlags_ROOT_DIR) else() set(GFLAGS_GREATER_20 FALSE) endif() - # set up include and link directory - include_directories(${GFlags_INCLUDE_DIRS}) - link_directories(${GFlags_LIBRARY_DIRS}) message(STATUS "gflags library found at ${GFlags_lib}") set(GFlags_LIBS ${GFlags_lib}) set(GFlags_FOUND true) @@ -109,3 +110,13 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS) + +if(GFLAGS_FOUND AND NOT TARGET Gflags::gflags) + add_library(Gflags::gflags SHARED IMPORTED) + set_target_properties(Gflags::gflags PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GFlags_LIBS}" + INTERFACE_INCLUDE_DIRECTORIES "${GFlags_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GFlags_LIBS}" + ) +endif() diff --git a/cmake/Modules/FindGLOG.cmake b/cmake/Modules/FindGLOG.cmake index 2d8f154f3..b85339195 100644 --- a/cmake/Modules/FindGLOG.cmake +++ b/cmake/Modules/FindGLOG.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,6 +27,9 @@ # # GLOG_ROOT - Can be set to Glog install path or Windows build path # +# Provides the following imported target: +# Glog::glog +# if(NOT DEFINED GLOG_ROOT) set(GLOG_ROOT /usr /usr/local) @@ -135,6 +138,12 @@ else() string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) endif() -if(GLOG_FOUND) - # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) +if(GLOG_FOUND AND NOT TARGET Glog::glog) + add_library(Glog::glog SHARED IMPORTED) + set_target_properties(Glog::glog PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GLOG_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GLOG_LIBRARIES}" + ) endif() diff --git a/cmake/Modules/FindGPERFTOOLS.cmake b/cmake/Modules/FindGPERFTOOLS.cmake index 67dfff8af..1c778574f 100644 --- a/cmake/Modules/FindGPERFTOOLS.cmake +++ b/cmake/Modules/FindGPERFTOOLS.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -33,6 +33,12 @@ # GPERFTOOLS_FOUND System has Gperftools libs/headers # GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler) # GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers +# +# Provides the following imported targets: +# Gperftools::tcmalloc +# Gperftools::profiler +# Gperftools::gperftools +# find_library(GPERFTOOLS_TCMALLOC NAMES tcmalloc @@ -41,6 +47,8 @@ find_library(GPERFTOOLS_TCMALLOC $ENV{GPERFTOOLS_ROOT}/lib ${GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64 + /usr/lib + /usr/lib64 ) find_library(GPERFTOOLS_PROFILER @@ -50,6 +58,8 @@ find_library(GPERFTOOLS_PROFILER $ENV{GPERFTOOLS_ROOT}/lib ${GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64 + /usr/lib + /usr/lib64 ) find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER @@ -59,6 +69,8 @@ find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER $ENV{GPERFTOOLS_ROOT}/lib ${GPERFTOOLS_ROOT}/lib64 $ENV{GPERFTOOLS_ROOT}/lib64 + /usr/lib + /usr/lib64 ) find_path(GPERFTOOLS_INCLUDE_DIR @@ -66,6 +78,7 @@ find_path(GPERFTOOLS_INCLUDE_DIR HINTS ${Gperftools_ROOT_DIR}/include ${GPERFTOOLS_ROOT}/include $ENV{GPERFTOOLS_ROOT}/include + /usr/include ) set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER}) @@ -76,10 +89,42 @@ find_package_handle_standard_args( DEFAULT_MSG GPERFTOOLS_LIBRARIES GPERFTOOLS_INCLUDE_DIR + GPERFTOOLS_TCMALLOC + GPERFTOOLS_PROFILER + ) +if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::tcmalloc) + add_library(Gperftools::tcmalloc SHARED IMPORTED) + set_target_properties(Gperftools::tcmalloc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC}" + INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC}" + ) +endif() + +if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::profiler) + add_library(Gperftools::profiler SHARED IMPORTED) + set_target_properties(Gperftools::profiler PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPERFTOOLS_PROFILER}" + INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_PROFILER}" + ) +endif() + +if(GPERFTOOLS_FOUND AND NOT TARGET Gperftools::gperftools) + add_library(Gperftools::gperftools SHARED IMPORTED) + set_target_properties(Gperftools::gperftools PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPERFTOOLS_TCMALLOC_AND_PROFILER}" + INTERFACE_INCLUDE_DIRECTORIES "${GPERFTOOLS_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${GPERFTOOLS_TCMALLOC_AND_PROFILER}" + ) +endif() + mark_as_advanced( - Gperftools_ROOT_DIR GPERFTOOLS_TCMALLOC GPERFTOOLS_PROFILER GPERFTOOLS_TCMALLOC_AND_PROFILER diff --git a/cmake/Modules/FindGPSTK.cmake b/cmake/Modules/FindGPSTK.cmake index f5ecb667e..1959c3ff6 100644 --- a/cmake/Modules/FindGPSTK.cmake +++ b/cmake/Modules/FindGPSTK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -32,18 +32,30 @@ find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) +include(GNUInstallDirs) + find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} HINTS /usr/lib /usr/local/lib + /usr/${CMAKE_INSTALL_LIBDIR} + /usr/local/${CMAKE_INSTALL_LIBDIR} /opt/local/lib - ${GPSTK_ROOT}/lib - $ENV{GPSTK_ROOT}/lib - ${GPSTK_ROOT}/lib64 - $ENV{GPSTK_ROOT}/lib64 + ${GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR} + $ENV{GPSTK_ROOT}/${CMAKE_INSTALL_LIBDIR} ) # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) -mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR) +mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR) + +if(GPSTK_FOUND AND NOT TARGET Gpstk::gpstk) + add_library(Gpstk::gpstk SHARED IMPORTED) + set_target_properties(Gpstk::gpstk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPSTK_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk" + INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindGRDBFCTTC.cmake b/cmake/Modules/FindGRDBFCTTC.cmake index e0689aeaf..64c838af1 100644 --- a/cmake/Modules/FindGRDBFCTTC.cmake +++ b/cmake/Modules/FindGRDBFCTTC.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -53,4 +53,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) + +if(GRDBFCTTC_FOUND AND NOT TARGET Gnuradio::dbfcttc) + add_library(Gnuradio::dbfcttc SHARED IMPORTED) + set_target_properties(Gnuradio::dbfcttc PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GR_DBFCTTC_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GR_DBFCTTC_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GR_DBFCTTC_LIBRARIES}" + ) +endif() + mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRGN3S.cmake b/cmake/Modules/FindGRGN3S.cmake index 93f7bda89..4664a6edb 100644 --- a/cmake/Modules/FindGRGN3S.cmake +++ b/cmake/Modules/FindGRGN3S.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -53,4 +53,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) + +if(GRGN3S_FOUND AND NOT TARGET Gnuradio::gn3s) + add_library(Gnuradio::gn3s SHARED IMPORTED) + set_target_properties(Gnuradio::gn3s PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GR_GN3S_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GR_GN3S_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${GR_GN3S_LIBRARIES}" + ) +endif() + mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake index 6d341e7fd..8cb8e9efc 100644 --- a/cmake/Modules/FindGRIIO.cmake +++ b/cmake/Modules/FindGRIIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Gnuradio::iio +# + + include(FindPkgConfig) pkg_check_modules(PC_IIO gnuradio-iio) @@ -69,4 +75,15 @@ find_library(IIO_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) + +if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio) + add_library(Gnuradio::iio SHARED IMPORTED) + set_target_properties(Gnuradio::iio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${IIO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${IIO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${IIO_LIBRARIES}" + ) +endif() + mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake index 48379ed76..0054db97d 100644 --- a/cmake/Modules/FindGROSMOSDR.cmake +++ b/cmake/Modules/FindGROSMOSDR.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -33,6 +33,11 @@ # GROSMOSDR_FOUND System has gr-osmosdr libs/headers # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers +# +# Provides the following imported target: +# Gnuradio::osmosdr +# + include(FindPkgConfig) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr) @@ -89,4 +94,15 @@ find_library(GROSMOSDR_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) + +if(GROSMOSDR_FOUND AND NOT TARGET Gnuradio::osmosdr) + add_library(Gnuradio::osmosdr SHARED IMPORTED) + set_target_properties(Gnuradio::osmosdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GROSMOSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GROSMOSDR_INCLUDE_DIR};${GROSMOSDR_INCLUDE_DIR}/osmosdr" + INTERFACE_LINK_LIBRARIES "${GROSMOSDR_LIBRARIES}" + ) +endif() + mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR) diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake index a76180ca2..5a9a3806f 100644 --- a/cmake/Modules/FindLIBIIO.cmake +++ b/cmake/Modules/FindLIBIIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,11 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Iio::iio +# + include(FindPkgConfig) pkg_check_modules(PC_LIBIIO libiio) @@ -73,4 +78,15 @@ find_library( include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) + +if(LIBIIO_FOUND AND NOT TARGET Iio::iio) + add_library(Iio::iio SHARED IMPORTED) + set_target_properties(Iio::iio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LIBIIO_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBIIO_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${LIBIIO_LIBRARIES}" + ) +endif() + mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake index 1e3aaf5e0..7534f4a00 100644 --- a/cmake/Modules/FindLIBOSMOSDR.cmake +++ b/cmake/Modules/FindLIBOSMOSDR.cmake @@ -27,6 +27,10 @@ # LIBOSMOSDR_FOUND System has libosmosdr libs/headers # LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers +# +# Provides the following imported target: +# Osmosdr::osmosdr +# include(FindPkgConfig) pkg_check_modules(LIBOSMOSDR_PKG libosmosdr) @@ -77,4 +81,15 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) + +if(LIBOSMOSDR_FOUND AND NOT TARGET Osmosdr::osmosdr) + add_library(Osmosdr::osmosdr SHARED IMPORTED) + set_target_properties(Osmosdr::osmosdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LIBOSMOSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBOSMOSDR_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${LIBOSMOSDR_LIBRARIES}" + ) +endif() + mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) diff --git a/cmake/Modules/FindLOG4CPP.cmake b/cmake/Modules/FindLOG4CPP.cmake index 283c3ddf9..29c7308fa 100644 --- a/cmake/Modules/FindLOG4CPP.cmake +++ b/cmake/Modules/FindLOG4CPP.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -21,7 +21,10 @@ # LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. # LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. # LOG4CPP_FOUND - True if LOG4CPP found. - +# +# Provides the following imported target: +# Log4cpp::log4cpp +# if(LOG4CPP_INCLUDE_DIR) # Already in cache, be silent @@ -90,3 +93,18 @@ endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES) + +if (LOG4CPP_FOUND AND NOT TARGET Log4cpp::log4cpp) + add_library(Log4cpp::log4cpp SHARED IMPORTED) + set_target_properties(Log4cpp::log4cpp PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LOG4CPP_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${LOG4CPP_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${LOG4CPP_LIBRARIES}" + ) +endif() + +mark_as_advanced( + LOG4CPP_LIBRARIES + LOG4CPP_INCLUDE_DIRS +) diff --git a/cmake/Modules/FindMATIO.cmake b/cmake/Modules/FindMATIO.cmake index 08facf069..623939690 100644 --- a/cmake/Modules/FindMATIO.cmake +++ b/cmake/Modules/FindMATIO.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,6 +26,9 @@ # MATIO_INCLUDE_DIRS - where to find matio.h, etc.. # MATIO_VERSION_STRING - version number as a string (e.g.: "1.3.4") # +# Provides the following imported target: +# Matio::matio +# #============================================================================= # Copyright 2015 Avtech Scientific # @@ -127,3 +130,13 @@ else() set(MATIO_LIBRARIES) set(MATIO_INCLUDE_DIRS) endif() + +if(MATIO_FOUND AND NOT TARGET Matio::matio) + add_library(Matio::matio SHARED IMPORTED) + set_target_properties(Matio::matio PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${MATIO_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${MATIO_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${MATIO_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake index af746c852..6c8e52f8f 100644 --- a/cmake/Modules/FindPCAP.cmake +++ b/cmake/Modules/FindPCAP.cmake @@ -43,7 +43,10 @@ # PCAP_INCLUDE_DIRS - where to find pcap.h, etc. # PCAP_LIBRARIES - List of libraries when using pcap. # PCAP_FOUND - True if pcap found. - +# +# Provides the following imported target: +# Pcap::pcap +# if(EXISTS $ENV{PCAPDIR}) find_path(PCAP_INCLUDE_DIR @@ -113,10 +116,20 @@ check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) + +if(PCAP_FOUND AND NOT TARGET Pcap::pcap) + add_library(Pcap::pcap SHARED IMPORTED) + set_target_properties(Pcap::pcap PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${PCAP_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${PCAP_LIBRARIES}" + ) +endif() + mark_as_advanced( PCAP_LIBRARIES PCAP_INCLUDE_DIRS ) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/Modules/FindPUGIXML.cmake b/cmake/Modules/FindPUGIXML.cmake index 236a4c95a..3d8ce2bdc 100644 --- a/cmake/Modules/FindPUGIXML.cmake +++ b/cmake/Modules/FindPUGIXML.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -22,15 +22,22 @@ # PUGIXML_INCLUDE_DIR - header location # PUGIXML_LIBRARIES - library to link against # PUGIXML_FOUND - true if pugixml was found. +# +# Provides the following imported target: +# Pugixml::pugixml +# find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include /usr/include /usr/local/include + /usr/local/include/pugixml-1.9 /opt/local/include ${PUGIXML_ROOT}/include $ENV{PUGIXML_ROOT}/include + ${PUGIXML_ROOT}/include/pugixml-1.9 + $ENV{PUGIXML_ROOT}/include/pugixml-1.9 ) find_library(PUGIXML_LIBRARY @@ -47,6 +54,7 @@ find_library(PUGIXML_LIBRARY /usr/lib/powerpc64le-linux-gnu /usr/lib/s390x-linux-gnu /usr/local/lib + /usr/local/lib/pugixml-1.9 /opt/local/lib /usr/lib /usr/lib64 @@ -55,6 +63,10 @@ find_library(PUGIXML_LIBRARY $ENV{PUGIXML_ROOT}/lib ${PUGIXML_ROOT}/lib64 $ENV{PUGIXML_ROOT}/lib64 + ${PUGIXML_ROOT}/lib/pugixml-1.9 + $ENV{PUGIXML_ROOT}/lib/pugixml-1.9 + ${PUGIXML_ROOT}/lib64/pugixml-1.9 + $ENV{PUGIXML_ROOT}/lib64/pugixml-1.9 ) # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. @@ -73,3 +85,13 @@ else() endif() mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR) + +if(PUGIXML_FOUND AND NOT TARGET Pugixml::pugixml) + add_library(Pugixml::pugixml SHARED IMPORTED) + set_target_properties(Pugixml::pugixml PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${PUGIXML_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${PUGIXML_LIBRARY}" + ) +endif() diff --git a/cmake/Modules/FindTELEORBIT.cmake b/cmake/Modules/FindTELEORBIT.cmake index eb2420687..bdb3d861c 100644 --- a/cmake/Modules/FindTELEORBIT.cmake +++ b/cmake/Modules/FindTELEORBIT.cmake @@ -47,4 +47,15 @@ find_library(TELEORBIT_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) + +if(TELEORBIT_FOUND AND NOT TARGET Gnuradio::teleorbit) + add_library(Gnuradio::teleorbit SHARED IMPORTED) + set_target_properties(Gnuradio::teleorbit PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${TELEORBIT_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIRS}/teleorbit" + INTERFACE_LINK_LIBRARIES "${TELEORBIT_LIBRARIES}" + ) +endif() + mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake index 31d299937..e0d6d77e0 100644 --- a/cmake/Modules/FindUHD.cmake +++ b/cmake/Modules/FindUHD.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,10 +15,14 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Iio::iio +# + ######################################################################## # Find the library for the USRP Hardware Driver ######################################################################## - include(FindPkgConfig) pkg_check_modules(PC_UHD uhd) @@ -72,4 +76,15 @@ find_library(UHD_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) + +if(UHD_FOUND AND NOT TARGET Uhd::uhd) + add_library(Uhd::uhd SHARED IMPORTED) + set_target_properties(Uhd::uhd PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${UHD_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${UHD_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${UHD_LIBRARIES}" + ) +endif() + mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS) diff --git a/cmake/Modules/FindVOLK.cmake b/cmake/Modules/FindVOLK.cmake index 97191179c..26d236625 100644 --- a/cmake/Modules/FindVOLK.cmake +++ b/cmake/Modules/FindVOLK.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,11 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Volk::volk +# + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) ######################################################################## @@ -74,3 +79,13 @@ find_library(VOLK_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION) + +if(VOLK_FOUND AND NOT TARGET Volk::volk) + add_library(Volk::volk SHARED IMPORTED) + set_target_properties(Volk::volk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${VOLK_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_LIBRARIES}" + ) +endif() diff --git a/cmake/Modules/FindVOLKGNSSSDR.cmake b/cmake/Modules/FindVOLKGNSSSDR.cmake index 5cdc4e61d..57abd1d99 100644 --- a/cmake/Modules/FindVOLKGNSSSDR.cmake +++ b/cmake/Modules/FindVOLKGNSSSDR.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -15,6 +15,12 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . +# +# Provides the following imported target: +# Volkgnsssdr::volkgnsssdr +# + + ######################################################################## # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library ######################################################################## @@ -51,3 +57,14 @@ find_library(VOLK_GNSSSDR_LIBRARIES include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) + + +if(VOLKGNSSSDR_FOUND AND NOT TARGET Volkgnsssdr::volkgnsssdr) + add_library(Volkgnsssdr::volkgnsssdr SHARED IMPORTED) + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${VOLK_GNSSSDR_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" + ) +endif() diff --git a/docs/changelog b/docs/changelog index 8d276b5ce..312543bc6 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,8 +1,27 @@ ## [Unreleased](https://github.com/gnss-sdr/gnss-sdr/tree/next) +### Improvements in Efficiency + +- Applied clang-tidy checks and fixes related to performance. + ### Improvements in Interoperability: - Added the BeiDou B1I receiver chain. +- Fix bug in GLONASS dual frequency receiver. + +### Improvements in Maintainability: + +- Usage of clang-tidy integrated into CMake scripts. New option -DENABLE_CLANG_TIDY=ON executes clang-tidy along with compilation. Requires clang compiler. +- Applied clang-tidy checks and fixes related to readability. + +### Improvements in Portability: + +- CMake scripts now follow a modern approach (targets and properties) but still work in 2.8.12 + + +## Improvements in Reliability + +- Applied clang-tidy checks and fixes related to High Integrity C++. ## [0.0.10](https://github.com/gnss-sdr/gnss-sdr/releases/tag/v0.0.10) diff --git a/docs/doxygen/images/GeneralBlockDiagram.png b/docs/doxygen/images/GeneralBlockDiagram.png index b208624ef..51e433ec0 100644 Binary files a/docs/doxygen/images/GeneralBlockDiagram.png and b/docs/doxygen/images/GeneralBlockDiagram.png differ diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index d8c055506..954d057bc 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,10 +17,6 @@ # -if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) -endif() - set(PVT_ADAPTER_SOURCES rtklib_pvt.cc ) @@ -29,28 +25,40 @@ set(PVT_ADAPTER_HEADERS rtklib_pvt.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS}) -source_group(Headers FILES ${PVT_ADAPTER_HEADERS}) - target_link_libraries(pvt_adapters - pvt_gr_blocks - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} + PUBLIC + Armadillo::armadillo + Gnuradio::runtime + pvt_gr_blocks + pvt_libs + core_system_parameters + PRIVATE + Boost::serialization +) + +target_include_directories(pvt_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(Boost_VERSION LESS 105800) + target_compile_definitions(pvt_adapters PRIVATE -DOLD_BOOST=1) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET pvt_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc index bf8dfc9dc..61b243633 100644 --- a/src/algorithms/PVT/adapters/rtklib_pvt.cc +++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc @@ -42,6 +42,7 @@ namespace bc = boost::math; #else #include +#include namespace bc = boost::integer; #endif @@ -52,7 +53,7 @@ using google::LogMessage; RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, - unsigned int out_streams) : role_(std::move(role)), + unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -190,58 +191,174 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int glo_2G_count = configuration->property("Channels_2G.count", 0); int bds_B1_count = configuration->property("Channels_B1.count", 0); - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1 - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 2; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5 - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1 - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 6; - - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 7; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5 - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1 - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 10; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 11; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 12; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 14; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 15; + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 1; // L1 + } + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 2; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 3; // L5 + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 4; // E1 + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 5; // E5a + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 6; + } + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 7; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 8; // L1+L5 + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 9; // L1+E1 + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 10; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 11; + } + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 12; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 13; // L5+E5a + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 14; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 15; + } //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 17; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 18; + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 17; + } + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 18; + } //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19; //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20; - if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 21; + if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 21; + } //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 23; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 24; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 25; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 26; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 27; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 28; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 29; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 30; - if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 31; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 23; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 24; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 25; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 26; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 27; + } + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 28; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 29; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 30; + } + if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 31; + } - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count == 0)) + { + pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a + } // BeiDou B1I Receiver - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 50; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 51; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 52; - if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 53; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 54; - if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) pvt_output_parameters.type_of_receiver = 55; + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 50; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 51; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 52; + } + if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 53; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 54; + } + if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0) && (bds_B1_count != 0)) + { + pvt_output_parameters.type_of_receiver = 55; + } // RTKLIB PVT solver options // Settings 1 int positioning_mode = -1; std::string default_pos_mode("Single"); std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h - if (positioning_mode_str == "Single") positioning_mode = PMODE_SINGLE; - if (positioning_mode_str == "Static") positioning_mode = PMODE_STATIC; - if (positioning_mode_str == "Kinematic") positioning_mode = PMODE_KINEMA; - if (positioning_mode_str == "PPP_Static") positioning_mode = PMODE_PPP_STATIC; - if (positioning_mode_str == "PPP_Kinematic") positioning_mode = PMODE_PPP_KINEMA; + if (positioning_mode_str == "Single") + { + positioning_mode = PMODE_SINGLE; + } + if (positioning_mode_str == "Static") + { + positioning_mode = PMODE_STATIC; + } + if (positioning_mode_str == "Kinematic") + { + positioning_mode = PMODE_KINEMA; + } + if (positioning_mode_str == "PPP_Static") + { + positioning_mode = PMODE_PPP_STATIC; + } + if (positioning_mode_str == "PPP_Kinematic") + { + positioning_mode = PMODE_PPP_KINEMA; + } if (positioning_mode == -1) { @@ -255,10 +372,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int num_bands = 0; - if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) num_bands = 1; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0))) num_bands = 2; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2; - if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3; + if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0) || (bds_B1_count > 0)) + { + num_bands = 1; + } + if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0))) + { + num_bands = 2; + } + if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) + { + num_bands = 2; + } + if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) + { + num_bands = 3; + } int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */ if ((number_of_frequencies < 1) || (number_of_frequencies > 3)) @@ -286,12 +415,30 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_iono_model("OFF"); std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ int iono_model = -1; - if (iono_model_str == "OFF") iono_model = IONOOPT_OFF; - if (iono_model_str == "Broadcast") iono_model = IONOOPT_BRDC; - if (iono_model_str == "SBAS") iono_model = IONOOPT_SBAS; - if (iono_model_str == "Iono-Free-LC") iono_model = IONOOPT_IFLC; - if (iono_model_str == "Estimate_STEC") iono_model = IONOOPT_EST; - if (iono_model_str == "IONEX") iono_model = IONOOPT_TEC; + if (iono_model_str == "OFF") + { + iono_model = IONOOPT_OFF; + } + if (iono_model_str == "Broadcast") + { + iono_model = IONOOPT_BRDC; + } + if (iono_model_str == "SBAS") + { + iono_model = IONOOPT_SBAS; + } + if (iono_model_str == "Iono-Free-LC") + { + iono_model = IONOOPT_IFLC; + } + if (iono_model_str == "Estimate_STEC") + { + iono_model = IONOOPT_EST; + } + if (iono_model_str == "IONEX") + { + iono_model = IONOOPT_TEC; + } if (iono_model == -1) { //warn user and set the default @@ -305,11 +452,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_trop_model("OFF"); int trop_model = -1; std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (trop_model_str == "OFF") trop_model = TROPOPT_OFF; - if (trop_model_str == "Saastamoinen") trop_model = TROPOPT_SAAS; - if (trop_model_str == "SBAS") trop_model = TROPOPT_SBAS; - if (trop_model_str == "Estimate_ZTD") trop_model = TROPOPT_EST; - if (trop_model_str == "Estimate_ZTD_Grad") trop_model = TROPOPT_ESTG; + if (trop_model_str == "OFF") + { + trop_model = TROPOPT_OFF; + } + if (trop_model_str == "Saastamoinen") + { + trop_model = TROPOPT_SAAS; + } + if (trop_model_str == "SBAS") + { + trop_model = TROPOPT_SBAS; + } + if (trop_model_str == "Estimate_ZTD") + { + trop_model = TROPOPT_EST; + } + if (trop_model_str == "Estimate_ZTD_Grad") + { + trop_model = TROPOPT_ESTG; + } if (trop_model == -1) { //warn user and set the default @@ -339,10 +501,22 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, int earth_tide = configuration->property(role + ".earth_tide", 0); int nsys = 0; - if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS; - if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL; - if ((glo_1G_count > 0) || (glo_2G_count > 0)) nsys += SYS_GLO; - if ((bds_B1_count > 0)) nsys += SYS_BDS; + if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) + { + nsys += SYS_GPS; + } + if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) + { + nsys += SYS_GAL; + } + if ((glo_1G_count > 0) || (glo_2G_count > 0)) + { + nsys += SYS_GLO; + } + if ((bds_B1_count > 0)) + { + nsys += SYS_BDS; + } int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */ if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */ @@ -356,11 +530,26 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, std::string default_gps_ar("Continuous"); std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ int integer_ambiguity_resolution_gps = -1; - if (integer_ambiguity_resolution_gps_str == "OFF") integer_ambiguity_resolution_gps = ARMODE_OFF; - if (integer_ambiguity_resolution_gps_str == "Continuous") integer_ambiguity_resolution_gps = ARMODE_CONT; - if (integer_ambiguity_resolution_gps_str == "Instantaneous") integer_ambiguity_resolution_gps = ARMODE_INST; - if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if (integer_ambiguity_resolution_gps_str == "PPP-AR") integer_ambiguity_resolution_gps = ARMODE_PPPAR; + if (integer_ambiguity_resolution_gps_str == "OFF") + { + integer_ambiguity_resolution_gps = ARMODE_OFF; + } + if (integer_ambiguity_resolution_gps_str == "Continuous") + { + integer_ambiguity_resolution_gps = ARMODE_CONT; + } + if (integer_ambiguity_resolution_gps_str == "Instantaneous") + { + integer_ambiguity_resolution_gps = ARMODE_INST; + } + if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") + { + integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; + } + if (integer_ambiguity_resolution_gps_str == "PPP-AR") + { + integer_ambiguity_resolution_gps = ARMODE_PPPAR; + } if (integer_ambiguity_resolution_gps == -1) { //warn user and set the default @@ -520,6 +709,11 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration, pvt_output_parameters.nmea_output_file_path = configuration->property(role + ".nmea_output_file_path", default_output_path); pvt_output_parameters.rtcm_output_file_path = configuration->property(role + ".rtcm_output_file_path", default_output_path); + // Read PVT MONITOR Configuration + pvt_output_parameters.monitor_enabled = configuration->property(role + ".enable_monitor", false); + pvt_output_parameters.udp_addresses = configuration->property(role + ".monitor_client_addresses", std::string("127.0.0.1")); + pvt_output_parameters.udp_port = configuration->property(role + ".monitor_udp_port", 1234); + // make PVT object pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk); DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")"; @@ -609,5 +803,5 @@ gr::basic_block_sptr RtklibPvt::get_left_block() gr::basic_block_sptr RtklibPvt::get_right_block() { - return pvt_; // this is a sink, nothing downstream + return nullptr; // this is a sink, nothing downstream } diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index eb58c0894..6c36caa24 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,11 +16,6 @@ # along with GNSS-SDR. If not, see . # - -if(Boost_VERSION LESS 105800) - add_definitions(-DOLD_BOOST=1) -endif() - set(PVT_GR_BLOCKS_SOURCES rtklib_pvt_cc.cc ) @@ -29,21 +24,43 @@ set(PVT_GR_BLOCKS_HEADERS rtklib_pvt_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS}) -target_link_libraries(pvt_gr_blocks pvt_lib ${ARMADILLO_LIBRARIES}) + +target_link_libraries(pvt_gr_blocks + PUBLIC + Boost::date_time + Gnuradio::runtime + pvt_libs + PRIVATE + Gflags::gflags + Glog::glog + Boost::filesystem + Boost::system + core_system_parameters +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +target_include_directories(pvt_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs +) + +if(Boost_VERSION LESS 105800) + target_compile_definitions(pvt_gr_blocks PRIVATE -DOLD_BOOST=1) +endif() + +set_property(TARGET pvt_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ +) diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc index 23f3d8c1e..fcf93d12f 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc @@ -46,6 +46,7 @@ #include #include #include +#include #if OLD_BOOST #include namespace bc = boost::math; @@ -67,7 +68,7 @@ rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, } -void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) +void rtklib_pvt_cc::msg_handler_telemetry(const pmt::pmt_t& msg) { try { @@ -175,9 +176,18 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2); Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3); - if (sv1.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; - if (sv2.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; - if (sv3.i_satellite_PRN != 0) d_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + if (sv1.i_satellite_PRN != 0) + { + d_pvt_solver->galileo_almanac_map[sv1.i_satellite_PRN] = sv1; + } + if (sv2.i_satellite_PRN != 0) + { + d_pvt_solver->galileo_almanac_map[sv2.i_satellite_PRN] = sv2; + } + if (sv3.i_satellite_PRN != 0) + { + d_pvt_solver->galileo_almanac_map[sv3.i_satellite_PRN] = sv3; + } DLOG(INFO) << "New Galileo Almanac data have arrived "; } else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) @@ -223,7 +233,7 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg) } // ************* BeiDou telemetry ***************** - if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) + else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr)) { // ### Beidou EPHEMERIS ### std::shared_ptr bds_dnav_eph; @@ -307,6 +317,7 @@ std::map rtklib_pvt_cc::get_beidou_dnav_almanac_map() return d_pvt_solver->beidou_dnav_almanac_map; } + void rtklib_pvt_cc::clear_ephemeris() { d_pvt_solver->gps_ephemeris_map.clear(); @@ -334,10 +345,10 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, { std::string dump_path; // Get 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 @@ -349,9 +360,9 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, d_dump_filename = "pvt"; } // 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('.')); } dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename; dump_ls_pvt_filename.append(".dat"); @@ -552,13 +563,27 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator; } - d_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); - d_pvt_solver->set_averaging_depth(1); d_rx_time = 0.0; d_last_status_print_seg = 0; + // PVT MONITOR + flag_monitor_pvt_enabled = conf_.monitor_enabled; + if (flag_monitor_pvt_enabled) + { + std::string address_string = conf_.udp_addresses; + std::vector udp_addr_vec = split_string(address_string, '_'); + std::sort(udp_addr_vec.begin(), udp_addr_vec.end()); + udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end()); + + udp_sink_ptr = std::unique_ptr(new Monitor_Pvt_Udp_Sink(udp_addr_vec, conf_.udp_port)); + } + else + { + udp_sink_ptr = nullptr; + } + // Create Sys V message queue first_fix = true; sysv_msg_key = 1101; @@ -568,410 +593,556 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels, std::cout << "GNSS-SDR can not create message queues!" << std::endl; throw std::exception(); } + + d_pvt_solver = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk); + d_pvt_solver->set_averaging_depth(1); start = std::chrono::system_clock::now(); } rtklib_pvt_cc::~rtklib_pvt_cc() { - msgctl(sysv_msqid, IPC_RMID, NULL); - if (d_xml_storage) + msgctl(sysv_msqid, IPC_RMID, nullptr); + try { - // save GPS L2CM ephemeris to XML file - std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; - if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) + if (d_xml_storage) { - std::ofstream ofs; - try + // save GPS L2CM ephemeris to XML file + std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml"; + if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map); - LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map); + LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty"; - } - // save GPS L1 CA ephemeris to XML file - file_name = xml_base_path + "gps_ephemeris.xml"; - if (d_pvt_solver->gps_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GPS L1 CA ephemeris to XML file + file_name = xml_base_path + "gps_ephemeris.xml"; + if (d_pvt_solver->gps_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map); - LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map); + LOG(INFO) << "Saved GPS L1 CA Ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty"; - } - // save Galileo E1 ephemeris to XML file - file_name = xml_base_path + "gal_ephemeris.xml"; - if (d_pvt_solver->galileo_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save Galileo E1 ephemeris to XML file + file_name = xml_base_path + "gal_ephemeris.xml"; + if (d_pvt_solver->galileo_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map); - LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map); + LOG(INFO) << "Saved Galileo E1 Ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty"; - } - // save GLONASS GNAV ephemeris to XML file - file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; - if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GLONASS GNAV ephemeris to XML file + file_name = xml_base_path + "eph_GLONASS_GNAV.xml"; + if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); - LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); + LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty"; - } - // Save GPS UTC model parameters - file_name = xml_base_path + "gps_utc_model.xml"; - if (d_pvt_solver->gps_utc_model.valid) - { - std::ofstream ofs; - try + // Save GPS UTC model parameters + file_name = xml_base_path + "gps_utc_model.xml"; + if (d_pvt_solver->gps_utc_model.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model); - LOG(INFO) << "Saved GPS UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model); + LOG(INFO) << "Saved GPS UTC model parameters"; + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data"; - } - // Save Galileo UTC model parameters - file_name = xml_base_path + "gal_utc_model.xml"; - if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) - { - std::ofstream ofs; - try + // Save Galileo UTC model parameters + file_name = xml_base_path + "gal_utc_model.xml"; + if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model); - LOG(INFO) << "Saved Galileo UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model); + LOG(INFO) << "Saved Galileo UTC model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data"; - } - // Save GPS iono parameters - file_name = xml_base_path + "gps_iono.xml"; - if (d_pvt_solver->gps_iono.valid == true) - { - std::ofstream ofs; - try + // Save GPS iono parameters + file_name = xml_base_path + "gps_iono.xml"; + if (d_pvt_solver->gps_iono.valid == true) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono); - LOG(INFO) << "Saved GPS ionospheric model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono); + LOG(INFO) << "Saved GPS ionospheric model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data"; - } - // Save GPS CNAV iono parameters - file_name = xml_base_path + "gps_cnav_iono.xml"; - if (d_pvt_solver->gps_cnav_iono.valid == true) - { - std::ofstream ofs; - try + // Save GPS CNAV iono parameters + file_name = xml_base_path + "gps_cnav_iono.xml"; + if (d_pvt_solver->gps_cnav_iono.valid == true) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono); - LOG(INFO) << "Saved GPS CNAV ionospheric model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono); + LOG(INFO) << "Saved GPS CNAV ionospheric model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data"; - } - // Save Galileo iono parameters - file_name = xml_base_path + "gal_iono.xml"; - if (d_pvt_solver->galileo_iono.ai0_5 != 0.0) - { - std::ofstream ofs; - try + // Save Galileo iono parameters + file_name = xml_base_path + "gal_iono.xml"; + if (d_pvt_solver->galileo_iono.ai0_5 != 0.0) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono); - LOG(INFO) << "Saved Galileo ionospheric model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono); + LOG(INFO) << "Saved Galileo ionospheric model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data"; - } - // save GPS almanac to XML file - file_name = xml_base_path + "gps_almanac.xml"; - if (d_pvt_solver->gps_almanac_map.empty() == false) - { - std::ofstream ofs; - try + // save GPS almanac to XML file + file_name = xml_base_path + "gps_almanac.xml"; + if (d_pvt_solver->gps_almanac_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map); - LOG(INFO) << "Saved GPS almanac map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map); + LOG(INFO) << "Saved GPS almanac map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS almanac, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GPS almanac, map is empty"; - } - // Save Galileo almanac - file_name = xml_base_path + "gal_almanac.xml"; - if (d_pvt_solver->galileo_almanac_map.empty() == false) - { - std::ofstream ofs; - try + // Save Galileo almanac + file_name = xml_base_path + "gal_almanac.xml"; + if (d_pvt_solver->galileo_almanac_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map); - LOG(INFO) << "Saved Galileo almanac data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map); + LOG(INFO) << "Saved Galileo almanac data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save Galileo almanac, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save Galileo almanac, not valid data"; - } - // Save GPS CNAV UTC model parameters - file_name = xml_base_path + "gps_cnav_utc_model.xml"; - if (d_pvt_solver->gps_cnav_utc_model.valid) - { - std::ofstream ofs; - try + // Save GPS CNAV UTC model parameters + file_name = xml_base_path + "gps_cnav_utc_model.xml"; + if (d_pvt_solver->gps_cnav_utc_model.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model); - LOG(INFO) << "Saved GPS CNAV UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model); + LOG(INFO) << "Saved GPS CNAV UTC model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data"; - } - // save GLONASS GNAV ephemeris to XML file - file_name = xml_base_path + "glo_gnav_ephemeris.xml"; - if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save GLONASS GNAV ephemeris to XML file + file_name = xml_base_path + "glo_gnav_ephemeris.xml"; + if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); - LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map); + LOG(INFO) << "Saved GLONASS GNAV ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty"; - } - // save GLONASS UTC model parameters to XML file - file_name = xml_base_path + "glo_utc_model.xml"; - if (d_pvt_solver->glonass_gnav_utc_model.valid) - { - std::ofstream ofs; - try + // save GLONASS UTC model parameters to XML file + file_name = xml_base_path + "glo_utc_model.xml"; + if (d_pvt_solver->glonass_gnav_utc_model.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model); - LOG(INFO) << "Saved GLONASS UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model); + LOG(INFO) << "Saved GLONASS UTC model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data"; - } - // save BeiDou DNAV ephemeris to XML file - file_name = xml_base_path + "bds_dnav_ephemeris.xml"; - if (d_pvt_solver->beidou_dnav_ephemeris_map.empty() == false) - { - std::ofstream ofs; - try + // save BeiDou DNAV ephemeris to XML file + file_name = xml_base_path + "bds_dnav_ephemeris.xml"; + if (d_pvt_solver->beidou_dnav_ephemeris_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_pvt_solver->beidou_dnav_ephemeris_map); - LOG(INFO) << "Saved BeiDou DNAV Ephemeris map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_pvt_solver->beidou_dnav_ephemeris_map); + LOG(INFO) << "Saved BeiDou DNAV Ephemeris map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save BeiDou DNAV Ephemeris, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save BeiDou DNAV Ephemeris, map is empty"; - } - // Save BeiDou DNAV iono parameters - file_name = xml_base_path + "bds_dnav_iono.xml"; - if (d_pvt_solver->beidou_dnav_iono.valid) - { - std::ofstream ofs; - try + // Save BeiDou DNAV iono parameters + file_name = xml_base_path + "bds_dnav_iono.xml"; + if (d_pvt_solver->beidou_dnav_iono.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_pvt_solver->beidou_dnav_iono); - LOG(INFO) << "Saved BeiDou DNAV ionospheric model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_pvt_solver->beidou_dnav_iono); + LOG(INFO) << "Saved BeiDou DNAV ionospheric model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save BeiDou DNAV ionospheric model parameters, not valid data"; } - } - else - { - LOG(INFO) << "Failed to save BeiDou DNAV ionospheric model parameters, not valid data"; - } - // save BeiDou DNAV almanac to XML file - file_name = xml_base_path + "bds_dnav_almanac.xml"; - if (d_pvt_solver->beidou_dnav_almanac_map.empty() == false) - { - std::ofstream ofs; - try + // save BeiDou DNAV almanac to XML file + file_name = xml_base_path + "bds_dnav_almanac.xml"; + if (d_pvt_solver->beidou_dnav_almanac_map.empty() == false) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_pvt_solver->beidou_dnav_almanac_map); - LOG(INFO) << "Saved BeiDou DNAV almanac map data"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_pvt_solver->beidou_dnav_almanac_map); + LOG(INFO) << "Saved BeiDou DNAV almanac map data"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (const std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save BeiDou DNAV almanac, map is empty"; } - } - else - { - LOG(INFO) << "Failed to save BeiDou DNAV almanac, map is empty"; - } - // Save BeiDou UTC model parameters - file_name = xml_base_path + "bds_dnav_utc_model.xml"; - if (d_pvt_solver->beidou_dnav_utc_model.valid) - { - std::ofstream ofs; - try + // Save BeiDou UTC model parameters + file_name = xml_base_path + "bds_dnav_utc_model.xml"; + if (d_pvt_solver->beidou_dnav_utc_model.valid) { - ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); - boost::archive::xml_oarchive xml(ofs); - xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_pvt_solver->beidou_dnav_utc_model); - LOG(INFO) << "Saved BeiDou DNAV UTC model parameters"; + std::ofstream ofs; + try + { + ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); + boost::archive::xml_oarchive xml(ofs); + xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_pvt_solver->beidou_dnav_utc_model); + LOG(INFO) << "Saved BeiDou DNAV UTC model parameters"; + } + catch (const boost::archive::archive_exception& e) + { + LOG(WARNING) << e.what(); + } + catch (const std::ofstream::failure& e) + { + LOG(WARNING) << "Problem opening output XML file"; + } + catch (const std::exception& e) + { + LOG(WARNING) << e.what(); + } } - catch (std::exception& e) + else { - LOG(WARNING) << e.what(); + LOG(INFO) << "Failed to save BeiDou DNAV UTC model parameters, not valid data"; } } - else - { - LOG(INFO) << "Failed to save BeiDou DNAV UTC model parameters, not valid data"; - } + } + catch (std::length_error& e) + { + LOG(WARNING) << e.what(); } } @@ -1010,7 +1181,7 @@ bool rtklib_pvt_cc::save_gnss_synchro_map_xml(const std::string& file_name) xml << boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); LOG(INFO) << "Saved gnss_sychro map data"; } - catch (std::exception& e) + catch (const std::exception& e) { LOG(WARNING) << e.what(); return false; @@ -1035,7 +1206,7 @@ bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) xml >> boost::serialization::make_nvp("GNSS-SDR_gnss_synchro_map", gnss_observables_map); //std::cout << "Loaded gnss_synchro map data with " << gnss_synchro_map.size() << " pseudoranges" << std::endl; } - catch (std::exception& e) + catch (const std::exception& e) { std::cout << e.what() << "File: " << file_name; return false; @@ -1044,14 +1215,28 @@ bool rtklib_pvt_cc::load_gnss_synchro_map_xml(const std::string& file_name) } +std::vector rtklib_pvt_cc::split_string(const std::string& s, char delim) +{ + std::vector v; + std::stringstream ss(s); + std::string item; + + while (std::getline(ss, item, delim)) + { + *(std::back_inserter(v)++) = item; + } + + return v; +} + + bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, double* latitude_deg, double* height_m, double* ground_speed_kmh, double* course_over_ground_deg, - time_t* UTC_time) + time_t* UTC_time) const { - gr::thread::scoped_lock lock(d_setlock); if (d_pvt_solver->is_valid_position()) { *latitude_deg = d_pvt_solver->get_latitude(); @@ -1059,7 +1244,7 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, *height_m = d_pvt_solver->get_height(); *ground_speed_kmh = d_pvt_solver->get_speed_over_ground() * 3600.0 / 1000.0; *course_over_ground_deg = d_pvt_solver->get_course_over_ground(); - *UTC_time = to_time_t(d_pvt_solver->get_position_UTC_time()); + *UTC_time = convert_to_time_t(d_pvt_solver->get_position_UTC_time()); return true; } @@ -1071,8 +1256,6 @@ bool rtklib_pvt_cc::get_latest_PVT(double* longitude_deg, int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { - gr::thread::scoped_lock l(d_setlock); - for (int32_t epoch = 0; epoch < noutput_items; epoch++) { bool flag_display_pvt = false; @@ -1085,7 +1268,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item bool flag_write_RINEX_nav_output = false; gnss_observables_map.clear(); - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer // ############ 1. READ PSEUDORANGES #### for (uint32_t i = 0; i < d_nchannels; i++) { @@ -1264,10 +1447,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item send_sys_v_ttff_msg(ttff); first_fix = false; } - if (d_kml_output_enabled) d_kml_dump->print_position(d_pvt_solver, false); - if (d_gpx_output_enabled) d_gpx_dump->print_position(d_pvt_solver, false); - if (d_geojson_output_enabled) d_geojson_printer->print_position(d_pvt_solver, false); - if (d_nmea_output_file_enabled) d_nmea_printer->Print_Nmea_Line(d_pvt_solver, false); + if (d_kml_output_enabled) + { + d_kml_dump->print_position(d_pvt_solver, false); + } + if (d_gpx_output_enabled) + { + d_gpx_dump->print_position(d_pvt_solver, false); + } + if (d_geojson_output_enabled) + { + d_geojson_printer->print_position(d_pvt_solver, false); + } + if (d_nmea_output_file_enabled) + { + d_nmea_printer->Print_Nmea_Line(d_pvt_solver, false); + } /* * TYPE | RECEIVER @@ -1481,7 +1676,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string glo_signal("1G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + { + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + } if (d_rinex_version == 2) { rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); @@ -1515,7 +1712,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string glo_signal("2G"); rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal); if (d_rinex_version == 3) - rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + { + rp->rinex_nav_header(rp->navMixFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model, d_pvt_solver->glonass_gnav_utc_model, d_pvt_solver->glonass_gnav_almanac); + } if (d_rinex_version == 2) { rp->rinex_nav_header(rp->navFile, d_pvt_solver->gps_iono, d_pvt_solver->gps_utc_model); @@ -1623,7 +1822,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item break; case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + { + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + } if (d_rinex_version == 2) { rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); @@ -1638,7 +1839,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rinex_version == 3) - rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + { + rp->log_rinex_nav(rp->navMixFile, d_pvt_solver->gps_ephemeris_map, d_pvt_solver->glonass_gnav_ephemeris_map); + } if (d_rinex_version == 2) { rp->log_rinex_nav(rp->navFile, d_pvt_solver->gps_ephemeris_map); @@ -1996,17 +2199,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2015,76 +2218,76 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 7: // GPS L1 C/A + GPS L2C if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 8: // L1+L5 if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 9: // GPS L1 C/A + Galileo E1B if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2092,7 +2295,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item std::string system(&gnss_observables_iter->second.System, 1); if (gps_channel == 0) { - if (system.compare("G") == 0) + if (system == "G") { // This is a channel with valid GPS signal gps_eph_iter = d_pvt_solver->gps_ephemeris_map.find(gnss_observables_iter->second.PRN); @@ -2104,7 +2307,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_channel == 0) { - if (system.compare("E") == 0) + if (system == "E") { gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) @@ -2116,28 +2319,28 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 13: // L5+E5a if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output and d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2170,11 +2373,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend() and (d_rtcm_MT1077_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2182,17 +2385,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2201,17 +2404,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_MSM_output == true) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2219,14 +2422,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) + for (auto glonass_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2234,8 +2437,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2268,34 +2471,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 27: // GLONASS L1 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2327,25 +2530,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 29: // GPS L1 C/A + GLONASS L2 C/A if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2353,8 +2556,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2386,34 +2589,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 30: // GLONASS L2 C/A + Galileo E1B if (flag_write_RTCM_1020_output == true) { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gal_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2445,34 +2648,34 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; case 32: // L1+E1+L5+E5a if (flag_write_RTCM_1019_output == true) { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (flag_write_RTCM_1045_output == true) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (flag_write_RTCM_MSM_output == true) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gal_channel = 0; int gps_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2504,11 +2707,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } break; @@ -2524,18 +2727,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 1: // GPS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2545,17 +2748,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 6: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2563,18 +2766,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 7: // GPS L1 C/A + GPS L2C if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2582,18 +2785,18 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 8: // L1+L5 if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gps_cnav_eph_iter = d_pvt_solver->gps_cnav_ephemeris_map.cbegin(); if ((gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_pvt_solver->gps_cnav_ephemeris_map.cend())) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2601,23 +2804,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 9: // GPS L1 C/A + Galileo E1B if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2649,11 +2852,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2662,15 +2865,15 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 13: // L5+E5a if (d_rtcm_MT1045_rate_ms != 0) { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { @@ -2690,7 +2893,7 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0)) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2699,17 +2902,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 15: if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2719,17 +2922,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 25: if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto glo_gnav_ephemeris_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); if (glo_gnav_ephemeris_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2737,14 +2940,14 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 26: // GPS L1 C/A + GLONASS L1 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } @@ -2752,8 +2955,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); int gps_channel = 0; int glo_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -2785,11 +2988,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2797,16 +3000,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 27: // GLONASS L1 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2814,8 +3017,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2845,11 +3048,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2857,22 +3060,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 29: // GPS L1 C/A + GLONASS L2 C/A if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MSM_rate_ms != 0) { - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); std::map::const_iterator gnss_observables_iter; int gps_channel = 0; int glo_channel = 0; @@ -2905,12 +3108,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2918,16 +3121,16 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 30: // GLONASS L2 C/A + Galileo E1B if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) + for (auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++) { d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_pvt_solver->glonass_gnav_utc_model); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) @@ -2935,8 +3138,8 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item int gal_channel = 0; int glo_channel = 0; std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto glonass_gnav_eph_iter = d_pvt_solver->glonass_gnav_ephemeris_map.cbegin(); for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) { std::string system(&gnss_observables_iter->second.System, 1); @@ -2966,11 +3169,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (glonass_gnav_eph_iter != d_pvt_solver->glonass_gnav_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -2978,23 +3181,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item case 32: // L1+E1+L5+E5a if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend(); gps_eph_iter++) + for (const auto& gps_eph_iter : d_pvt_solver->gps_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter.second); } } if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0 { - for (std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend(); gal_eph_iter++) + for (const auto& gal_eph_iter : d_pvt_solver->galileo_ephemeris_map) { - d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second); + d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter.second); } } if (d_rtcm_MSM_rate_ms != 0) { std::map::const_iterator gnss_observables_iter; - std::map::const_iterator gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); - std::map::const_iterator gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); + auto gal_eph_iter = d_pvt_solver->galileo_ephemeris_map.cbegin(); + auto gps_eph_iter = d_pvt_solver->gps_ephemeris_map.cbegin(); int gps_channel = 0; int gal_channel = 0; for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++) @@ -3026,11 +3229,11 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item } if (gps_eph_iter != d_pvt_solver->gps_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } if (gal_eph_iter != d_pvt_solver->galileo_ephemeris_map.cend()) { - d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0); + d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, false, false); } } b_rtcm_writing_started = true; @@ -3086,6 +3289,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item << d_pvt_solver->get_vdop() << " GDOP = " << d_pvt_solver->get_gdop() << std::endl; */ } + + // PVT MONITOR + if (d_pvt_solver->is_valid_position() and flag_monitor_pvt_enabled) + { + Monitor_Pvt monitor_pvt = d_pvt_solver->get_monitor_pvt(); + udp_sink_ptr->write_monitor_pvt(monitor_pvt); + } } } diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h index df79836c7..23ecb0206 100644 --- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h +++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h @@ -35,6 +35,7 @@ #include "gps_ephemeris.h" #include "gpx_printer.h" #include "kml_printer.h" +#include "monitor_pvt_udp_sink.h" #include "nmea_printer.h" #include "pvt_conf.h" #include "rinex_printer.h" @@ -55,9 +56,9 @@ class rtklib_pvt_cc; -typedef boost::shared_ptr rtklib_pvt_cc_sptr; +using rtklib_pvt_cc_sptr = boost::shared_ptr; -rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels, +rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk); @@ -71,7 +72,7 @@ private: const Pvt_Conf& conf_, const rtk_t& rtk); - void msg_handler_telemetry(pmt::pmt_t msg); + void msg_handler_telemetry(const pmt::pmt_t& msg); bool d_dump; bool d_dump_mat; @@ -84,15 +85,15 @@ private: bool b_rtcm_writing_started; bool b_rtcm_enabled; - int32_t d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris - int32_t d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits) - int32_t d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits) - int32_t d_rtcm_MT1077_rate_ms; //!< The type 7 Multiple Signal Message format for the USA’s GPS system, popular - int32_t d_rtcm_MT1087_rate_ms; //!< GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system - int32_t d_rtcm_MT1097_rate_ms; //!< Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system + int32_t d_rtcm_MT1045_rate_ms; // Galileo Broadcast Ephemeris + int32_t d_rtcm_MT1019_rate_ms; // GPS Broadcast Ephemeris (orbits) + int32_t d_rtcm_MT1020_rate_ms; // GLONASS Broadcast Ephemeris (orbits) + int32_t d_rtcm_MT1077_rate_ms; // The type 7 Multiple Signal Message format for the USA’s GPS system, popular + int32_t d_rtcm_MT1087_rate_ms; // GLONASS MSM7. The type 7 Multiple Signal Message format for the Russian GLONASS system + int32_t d_rtcm_MT1097_rate_ms; // Galileo MSM7. The type 7 Multiple Signal Message format for Europe’s Galileo system int32_t d_rtcm_MSM_rate_ms; - int32_t d_last_status_print_seg; //for status printer + int32_t d_last_status_print_seg; // for status printer uint32_t d_nchannels; std::string d_dump_filename; @@ -113,7 +114,7 @@ private: bool d_kml_output_enabled; bool d_nmea_output_file_enabled; - std::shared_ptr d_pvt_solver; + std::shared_ptr d_pvt_solver; std::map gnss_observables_map; bool observables_pairCompare_min(const std::pair& a, const std::pair& b); @@ -131,26 +132,31 @@ private: bool send_sys_v_ttff_msg(ttff_msgbuf ttff); std::chrono::time_point start, end; - bool save_gnss_synchro_map_xml(const std::string& file_name); //debug helper function + bool save_gnss_synchro_map_xml(const std::string& file_name); // debug helper function - bool load_gnss_synchro_map_xml(const std::string& file_name); //debug helper function + bool load_gnss_synchro_map_xml(const std::string& file_name); // debug helper function bool d_xml_storage; std::string xml_base_path; - inline std::time_t to_time_t(boost::posix_time::ptime pt) + inline std::time_t convert_to_time_t(const boost::posix_time::ptime pt) const { return (pt - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1))).total_seconds(); } + bool flag_monitor_pvt_enabled; + std::unique_ptr udp_sink_ptr; + std::vector split_string(const std::string& s, char delim); public: rtklib_pvt_cc(uint32_t nchannels, const Pvt_Conf& conf_, const rtk_t& rtk); + ~rtklib_pvt_cc(); //!< Default destructor + /*! - * \brief Get latest set of ephemeris from PVT block + * \brief Get latest set of GPS ephemeris from PVT block * */ std::map get_gps_ephemeris_map() const; @@ -179,9 +185,7 @@ public: double* height_m, double* ground_speed_kmh, double* course_over_ground_deg, - time_t* UTC_time); - - ~rtklib_pvt_cc(); //!< Default destructor + time_t* UTC_time) const; int work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items); //!< PVT Signal Processing diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 25a4c592a..d04fa0cb5 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,7 +16,6 @@ # along with GNSS-SDR. If not, see . # -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(PVT_LIB_SOURCES pvt_solution.cc @@ -30,6 +29,7 @@ set(PVT_LIB_SOURCES geojson_printer.cc rtklib_solver.cc pvt_conf.cc + monitor_pvt_udp_sink.cc ) set(PVT_LIB_HEADERS @@ -44,50 +44,53 @@ set(PVT_LIB_HEADERS geojson_printer.h rtklib_solver.h pvt_conf.h -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${Boost_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} + monitor_pvt_udp_sink.h + monitor_pvt.h ) list(SORT PVT_LIB_HEADERS) list(SORT PVT_LIB_SOURCES) -add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) source_group(Headers FILES ${PVT_LIB_HEADERS}) -if(MATIO_FOUND) - add_dependencies(pvt_lib - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - ) -else() - add_dependencies(pvt_lib - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) +add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS}) + +target_link_libraries(pvt_libs + PUBLIC + Armadillo::armadillo + Boost::date_time + algorithms_libs + algorithms_libs_rtklib + core_system_parameters + PRIVATE + Boost::filesystem + Boost::system + Gflags::gflags + Glog::glog + Matio::matio +) + +target_include_directories(pvt_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib + ${CMAKE_SOURCE_DIR}/src/core/receiver +) + +target_compile_definitions(pvt_libs PRIVATE -DGNSS_SDR_VERSION="${VERSION}") + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(pvt_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() -target_link_libraries(pvt_lib - rtklib_lib - gnss_sdr_flags - gnss_sp_libs - ${Boost_LIBRARIES} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${BLAS} - ${LAPACK} - ${MATIO_LIBRARIES} +set_property(TARGET pvt_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ + $ + $ ) diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc index 7f4da17c1..504393422 100644 --- a/src/algorithms/PVT/libs/geojson_printer.cc +++ b/src/algorithms/PVT/libs/geojson_printer.cc @@ -36,6 +36,7 @@ #include // for path, operator<< #include // for filesystem #include +#include #include #include @@ -79,7 +80,14 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path) GeoJSON_Printer::~GeoJSON_Printer() { - GeoJSON_Printer::close_file(); + try + { + GeoJSON_Printer::close_file(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } } @@ -213,7 +221,10 @@ bool GeoJSON_Printer::close_file() // if nothing is written, erase the file if (first_pos == true) { - if (remove(filename_.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(filename_.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } return true; } diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc index 7ca86052a..d37b77908 100644 --- a/src/algorithms/PVT/libs/gpx_printer.cc +++ b/src/algorithms/PVT/libs/gpx_printer.cc @@ -36,6 +36,7 @@ #include // for path, operator<< #include // for filesystem #include +#include #include using google::LogMessage; @@ -154,14 +155,14 @@ bool Gpx_Printer::set_headers(const std::string& filename, bool time_tag_name) } -bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Gpx_Printer::print_position(const std::shared_ptr& position, bool print_average_values) { double latitude; double longitude; double height; positions_printed = true; - const std::shared_ptr& position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg @@ -170,7 +171,10 @@ bool Gpx_Printer::print_position(const std::shared_ptr& position, double vdop = position_->get_vdop(); double pdop = position_->get_pdop(); std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); - if (utc_time.length() < 23) utc_time += "."; + if (utc_time.length() < 23) + { + utc_time += "."; + } utc_time.resize(23, '0'); // time up to ms utc_time.append("Z"); // UTC time zone @@ -218,9 +222,19 @@ bool Gpx_Printer::close_file() Gpx_Printer::~Gpx_Printer() { - close_file(); + try + { + close_file(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } if (!positions_printed) { - if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file"; + if (remove(gpx_filename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary GPX file"; + } } } diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h index 27e9fe4ff..c584eba4c 100644 --- a/src/algorithms/PVT/libs/gpx_printer.h +++ b/src/algorithms/PVT/libs/gpx_printer.h @@ -58,7 +58,7 @@ public: Gpx_Printer(const std::string& base_path = "."); ~Gpx_Printer(); bool set_headers(const std::string& filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 5fbc52ab8..2b1adf739 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -40,7 +40,7 @@ using google::LogMessage; -hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt() +Hybrid_Ls_Pvt::Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file) : Ls_Pvt() { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; @@ -69,7 +69,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag } -hybrid_ls_pvt::~hybrid_ls_pvt() +Hybrid_Ls_Pvt::~Hybrid_Ls_Pvt() { if (d_dump_file.is_open() == true) { @@ -85,7 +85,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt() } -bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging) +bool Hybrid_Ls_Pvt::get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging) { std::map::iterator gnss_observables_iter; std::map::iterator galileo_ephemeris_iter; @@ -133,7 +133,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // COMMON RX TIME PVT ALGORITHM double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_m_s; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GALILEO_C_M_S; // 2- compute the clock drift using the clock model (broadcast) for this SV SV_clock_bias_s = galileo_ephemeris_iter->second.sv_clock_drift(Tx_time); @@ -150,7 +150,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // 4- fill the observations vector with the corrected observables obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_m_s - this->get_time_offset_s() * GALILEO_C_m_s; + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + SV_clock_bias_s * GALILEO_C_M_S - this->get_time_offset_s() * GALILEO_C_M_S; Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time); @@ -188,7 +188,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) // first estimate of transmit time double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S; // 2- compute the clock drift using the clock model (broadcast) for this SV, not including relativistic effect SV_clock_bias_s = gps_ephemeris_iter->second.sv_clock_drift(Tx_time); //- gps_ephemeris_iter->second.d_TGD; @@ -208,10 +208,10 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // See IS-GPS-200E section 20.3.3.3.3.2 double sqrt_Gamma = GPS_L1_FREQ_HZ / GPS_L2_FREQ_HZ; double Gamma = sqrt_Gamma * sqrt_Gamma; - double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_m_s); + double P1_P2 = (1.0 - Gamma) * (gps_ephemeris_iter->second.d_TGD * GPS_C_M_S); double Code_bias_m = P1_P2 / (1.0 - Gamma); obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s - Code_bias_m - this->get_time_offset_s() * GPS_C_m_s; + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S - Code_bias_m - this->get_time_offset_s() * GPS_C_M_S; // SV ECEF DEBUG OUTPUT LOG(INFO) << "(new)ECEF GPS L1 CA satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN @@ -243,7 +243,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files) // first estimate of transmit time double Rx_time = hybrid_current_time; - double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_m_s; + double Tx_time = Rx_time - gnss_observables_iter->second.Pseudorange_m / GPS_C_M_S; // 2- compute the clock drift using the clock model (broadcast) for this SV SV_clock_bias_s = gps_cnav_ephemeris_iter->second.sv_clock_drift(Tx_time); @@ -261,7 +261,7 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do // 4- fill the observations vector with the corrected observables obs.resize(valid_obs + 1, 1); - obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_m_s + SV_clock_bias_s * GPS_C_m_s; + obs(valid_obs) = gnss_observables_iter->second.Pseudorange_m + dtr * GPS_C_M_S + SV_clock_bias_s * GPS_C_M_S; GPS_week = gps_cnav_ephemeris_iter->second.i_GPS_week; GPS_week = GPS_week % 1024; //Necessary due to the increase of WN bits in CNAV message (10 in GPS NAV and 13 in CNAV) @@ -311,17 +311,17 @@ bool hybrid_ls_pvt::get_PVT(std::map gnss_observables_map, do DLOG(INFO) << " Executing Bancroft algorithm..."; rx_position_and_time = bancroftPos(satpos.t(), obs); this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration - this->set_time_offset_s(rx_position_and_time(3) / GPS_C_m_s); // save time for the next iteration [meters]->[seconds] + this->set_time_offset_s(rx_position_and_time(3) / GPS_C_M_S); // save time for the next iteration [meters]->[seconds] } // Execute WLS using previous position as the initialization point rx_position_and_time = leastSquarePos(satpos, obs, W); this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration - this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_m_s); // accumulate the rx time error for the next iteration [meters]->[seconds] + this->set_time_offset_s(this->get_time_offset_s() + rx_position_and_time(3) / GPS_C_M_S); // accumulate the rx time error for the next iteration [meters]->[seconds] DLOG(INFO) << "Hybrid Position at TOW=" << hybrid_current_time << " in ECEF (X,Y,Z,t[meters]) = " << rx_position_and_time; - DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_m_s << " [s]"; + DLOG(INFO) << "Accumulated rx clock error=" << this->get_time_offset_s() << " clock error for this iteration=" << rx_position_and_time(3) / GPS_C_M_S << " [s]"; // Compute GST and Gregorian time if (GST != 0.0) diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 8a9c2b590..79313c92b 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -46,7 +46,7 @@ /*! * \brief This class implements a simple PVT Least Squares solution */ -class hybrid_ls_pvt : public Ls_Pvt +class Hybrid_Ls_Pvt : public Ls_Pvt { private: int count_valid_position; @@ -57,10 +57,10 @@ private: double d_galileo_current_time; public: - hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file); - ~hybrid_ls_pvt(); + Hybrid_Ls_Pvt(int nchannels, std::string dump_filename, bool flag_dump_to_file); + ~Hybrid_Ls_Pvt(); - bool get_PVT(std::map gnss_observables_map, double Rx_time, bool flag_averaging); + bool get_PVT(std::map gnss_observables_map, double hybrid_current_time, bool flag_averaging); std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc index 76018ba35..790090544 100644 --- a/src/algorithms/PVT/libs/kml_printer.cc +++ b/src/algorithms/PVT/libs/kml_printer.cc @@ -36,6 +36,7 @@ #include // for path, operator<< #include // for filesystem #include +#include #include using google::LogMessage; @@ -211,7 +212,7 @@ bool Kml_Printer::set_headers(const std::string& filename, bool time_tag_name) } -bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) +bool Kml_Printer::print_position(const std::shared_ptr& position, bool print_average_values) { double latitude; double longitude; @@ -219,7 +220,7 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, positions_printed = true; - const std::shared_ptr& position_ = position; + const std::shared_ptr& position_ = position; double speed_over_ground = position_->get_speed_over_ground(); // expressed in m/s double course_over_ground = position_->get_course_over_ground(); // expressed in deg @@ -228,7 +229,10 @@ bool Kml_Printer::print_position(const std::shared_ptr& position, double vdop = position_->get_vdop(); double pdop = position_->get_pdop(); std::string utc_time = to_iso_extended_string(position_->get_position_UTC_time()); - if (utc_time.length() < 23) utc_time += "."; + if (utc_time.length() < 23) + { + utc_time += "."; + } utc_time.resize(23, '0'); // time up to ms utc_time.append("Z"); // UTC time zone @@ -319,9 +323,19 @@ bool Kml_Printer::close_file() Kml_Printer::~Kml_Printer() { - close_file(); + try + { + close_file(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } if (!positions_printed) { - if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file"; + if (remove(kml_filename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary KML file"; + } } } diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h index 7909ad619..1608158b4 100644 --- a/src/algorithms/PVT/libs/kml_printer.h +++ b/src/algorithms/PVT/libs/kml_printer.h @@ -61,7 +61,7 @@ public: Kml_Printer(const std::string& base_path = std::string(".")); ~Kml_Printer(); bool set_headers(const std::string& filename, bool time_tag_name = true); - bool print_position(const std::shared_ptr& position, bool print_average_values); + bool print_position(const std::shared_ptr& position, bool print_average_values); bool close_file(); }; diff --git a/src/algorithms/PVT/libs/ls_pvt.cc b/src/algorithms/PVT/libs/ls_pvt.cc index 9077dcd68..5f9b9ad48 100644 --- a/src/algorithms/PVT/libs/ls_pvt.cc +++ b/src/algorithms/PVT/libs/ls_pvt.cc @@ -95,7 +95,7 @@ arma::vec Ls_Pvt::bancroftPos(const arma::mat& satpos, const arma::vec& obs) { int z = B(i, 2); double rho = (x - pos(0)) * (x - pos(0)) + (y - pos(1)) * (y - pos(1)) + (z - pos(2)) * (z - pos(2)); - traveltime = sqrt(rho) / GPS_C_m_s; + traveltime = sqrt(rho) / GPS_C_M_S; } double angle = traveltime * 7.292115147e-5; double cosa = cos(angle); @@ -228,7 +228,7 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, (X(1, i) - pos(1)) + (X(2, i) - pos(2)) * (X(2, i) - pos(2)); - traveltime = sqrt(rho2) / GPS_C_m_s; + traveltime = sqrt(rho2) / GPS_C_M_S; //--- Correct satellite position (do to earth rotation) -------- Rot_X = Ls_Pvt::rotateSatellite(traveltime, X.col(i)); //armadillo @@ -253,7 +253,10 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, { //--- Find delay due to troposphere (in meters) Ls_Pvt::tropo(&trop, sin(*elev * GPS_PI / 180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); - if (trop > 5.0) trop = 0.0; //check for erratic values + if (trop > 5.0) + { + trop = 0.0; //check for erratic values + } } } } @@ -280,9 +283,9 @@ arma::vec Ls_Pvt::leastSquarePos(const arma::mat& satpos, const arma::vec& obs, } // check the consistency of the PVT solution - if (((fabs(pos(3)) * 1000.0) / GPS_C_m_s) > GPS_STARTOFFSET_ms * 2) + if (((fabs(pos(3)) * 1000.0) / GPS_C_M_S) > GPS_STARTOFFSET_MS * 2) { - LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_m_s; + LOG(WARNING) << "Receiver time offset out of range! Estimated RX Time error [s]:" << pos(3) / GPS_C_M_S; throw std::runtime_error("Receiver time offset out of range!"); } return pos; diff --git a/src/algorithms/PVT/libs/monitor_pvt.h b/src/algorithms/PVT/libs/monitor_pvt.h new file mode 100644 index 000000000..41f22a1de --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt.h @@ -0,0 +1,140 @@ +/*! + * \file monitor_pvt.h + * \brief Interface of the Monitor_Pvt class + * \author + * Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * ------------------------------------------------------------------------- + * + * 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 . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_MONITOR_PVT_H_ +#define GNSS_SDR_MONITOR_PVT_H_ + +#include +#include + +/*! + * \brief This class contains parameters and outputs of the PVT block + */ +class Monitor_Pvt +{ +public: + // TOW + uint32_t TOW_at_current_symbol_ms; + // WEEK + uint32_t week; + // PVT GPS time + double RX_time; + // User clock offset [s] + double user_clk_offset; + + // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) + double pos_x; + double pos_y; + double pos_z; + double vel_x; + double vel_y; + double vel_z; + + // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) + double cov_xx; + double cov_yy; + double cov_zz; + double cov_xy; + double cov_yz; + double cov_zx; + + // GEO user position Latitude [deg] + double latitude; + // GEO user position Longitude [deg] + double longitude; + // GEO user position Height [m] + double height; + + // NUMBER OF VALID SATS + uint8_t valid_sats; + // RTKLIB solution status + uint8_t solution_status; + // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) + uint8_t solution_type; + // AR ratio factor for validation + float AR_ratio_factor; + // AR ratio threshold for validation + float AR_ratio_threshold; + + // GDOP / PDOP/ HDOP/ VDOP + double gdop; + double pdop; + double hdop; + double vdop; + + /*! + * \brief This member function serializes and restores + * Monitor_Pvt objects from a byte stream. + */ + template + + void serialize(Archive& ar, const unsigned int version) + { + if (version) + { + }; + + ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms); + ar& BOOST_SERIALIZATION_NVP(week); + ar& BOOST_SERIALIZATION_NVP(RX_time); + ar& BOOST_SERIALIZATION_NVP(user_clk_offset); + + ar& BOOST_SERIALIZATION_NVP(pos_x); + ar& BOOST_SERIALIZATION_NVP(pos_y); + ar& BOOST_SERIALIZATION_NVP(pos_z); + ar& BOOST_SERIALIZATION_NVP(vel_x); + ar& BOOST_SERIALIZATION_NVP(vel_y); + ar& BOOST_SERIALIZATION_NVP(vel_z); + + ar& BOOST_SERIALIZATION_NVP(cov_xx); + ar& BOOST_SERIALIZATION_NVP(cov_yy); + ar& BOOST_SERIALIZATION_NVP(cov_zz); + ar& BOOST_SERIALIZATION_NVP(cov_xy); + ar& BOOST_SERIALIZATION_NVP(cov_yz); + ar& BOOST_SERIALIZATION_NVP(cov_zx); + + ar& BOOST_SERIALIZATION_NVP(latitude); + ar& BOOST_SERIALIZATION_NVP(longitude); + ar& BOOST_SERIALIZATION_NVP(height); + + ar& BOOST_SERIALIZATION_NVP(valid_sats); + ar& BOOST_SERIALIZATION_NVP(solution_status); + ar& BOOST_SERIALIZATION_NVP(solution_type); + ar& BOOST_SERIALIZATION_NVP(AR_ratio_factor); + ar& BOOST_SERIALIZATION_NVP(AR_ratio_threshold); + + ar& BOOST_SERIALIZATION_NVP(gdop); + ar& BOOST_SERIALIZATION_NVP(pdop); + ar& BOOST_SERIALIZATION_NVP(hdop); + ar& BOOST_SERIALIZATION_NVP(vdop); + } +}; + +#endif /* GNSS_SDR_MONITOR_PVT_H_ */ diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc new file mode 100644 index 000000000..2982ec401 --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.cc @@ -0,0 +1,98 @@ +/*! + * \file monitor_pvt_udp_sink.cc + * \brief Implementation of a class that sends serialized Monitor_Pvt + * objects over udp to one or multiple endpoints + * \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * + * ------------------------------------------------------------------------- + * + * 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 "monitor_pvt_udp_sink.h" +#include +#include +#include + + +Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(std::vector addresses, const uint16_t& port) : socket{io_service} +{ + for (const auto& address : addresses) + { + boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port); + endpoints.push_back(endpoint); + } + monitor_pvt.TOW_at_current_symbol_ms = 0U; + monitor_pvt.week = 0U; + monitor_pvt.RX_time = 0.0; + monitor_pvt.user_clk_offset = 0.0; + monitor_pvt.pos_x = 0.0; + monitor_pvt.pos_y = 0.0; + monitor_pvt.pos_z = 0.0; + monitor_pvt.vel_x = 0.0; + monitor_pvt.vel_y = 0.0; + monitor_pvt.vel_z = 0.0; + monitor_pvt.cov_xx = 0.0; + monitor_pvt.cov_yy = 0.0; + monitor_pvt.cov_zz = 0.0; + monitor_pvt.cov_xy = 0.0; + monitor_pvt.cov_yz = 0.0; + monitor_pvt.cov_zx = 0.0; + monitor_pvt.latitude = 0.0; + monitor_pvt.longitude = 0.0; + monitor_pvt.height = 0.0; + monitor_pvt.valid_sats = 0; + monitor_pvt.solution_status = 0; + monitor_pvt.solution_type = 0; + monitor_pvt.AR_ratio_factor = 0.0; + monitor_pvt.AR_ratio_threshold = 0.0; + monitor_pvt.gdop = 0.0; + monitor_pvt.pdop = 0.0; + monitor_pvt.hdop = 0.0; + monitor_pvt.vdop = 0.0; +} + + +bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt) +{ + std::ostringstream archive_stream; + boost::archive::binary_oarchive oa{archive_stream}; + oa << monitor_pvt; + std::string outbound_data = archive_stream.str(); + + for (const auto& endpoint : endpoints) + { + socket.open(endpoint.protocol(), error); + socket.connect(endpoint, error); + + try + { + socket.send(boost::asio::buffer(outbound_data)); + } + catch (boost::system::system_error const& e) + { + return false; + } + } + return true; +} diff --git a/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h new file mode 100644 index 000000000..bf132bad4 --- /dev/null +++ b/src/algorithms/PVT/libs/monitor_pvt_udp_sink.h @@ -0,0 +1,53 @@ +/*! + * \file monitor_pvt_udp_sink.h + * \brief Interface of a class that sends serialized Monitor_Pvt objects + * over udp to one or multiple endpoints + * \author Álvaro Cebrián Juan, 2019. acebrianjuan(at)gmail.com + * + * ------------------------------------------------------------------------- + * + * 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 . + * + * ------------------------------------------------------------------------- + */ + +#ifndef GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ +#define GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ + +#include "monitor_pvt.h" +#include + +class Monitor_Pvt_Udp_Sink +{ +public: + Monitor_Pvt_Udp_Sink(std::vector addresses, const uint16_t &port); + bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt); + +private: + boost::asio::io_service io_service; + boost::asio::ip::udp::socket socket; + boost::system::error_code error; + std::vector endpoints; + Monitor_Pvt monitor_pvt; +}; + + +#endif /* GNSS_SDR_MONITOR_PVT_UDP_SINK_H_ */ diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc index 2470b1819..bbef7b0c7 100644 --- a/src/algorithms/PVT/libs/nmea_printer.cc +++ b/src/algorithms/PVT/libs/nmea_printer.cc @@ -41,6 +41,7 @@ #include // for filesystem #include #include +#include #include #include @@ -118,11 +119,29 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi Nmea_Printer::~Nmea_Printer() { - if (nmea_file_descriptor.is_open()) + try { - nmea_file_descriptor.close(); + if (nmea_file_descriptor.is_open()) + { + nmea_file_descriptor.close(); + } + } + catch (const std::ofstream::failure& e) + { + std::cerr << "Problem closing NMEA dump file: " << nmea_filename << '\n'; + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } + try + { + close_serial(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; } - close_serial(); } @@ -142,10 +161,16 @@ int Nmea_Printer::init_serial(const std::string& serial_device) int64_t PARITY; fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); - if (fd == -1) return fd; // failed to open TTY port + if (fd == -1) + { + return fd; // failed to open TTY port + } - if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O - tcgetattr(fd, &options); // read serial port options + if (fcntl(fd, F_SETFL, 0) == -1) + { + LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O + } + tcgetattr(fd, &options); // read serial port options BAUD = B9600; // BAUD = B38400; @@ -174,7 +199,7 @@ void Nmea_Printer::close_serial() } -bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values) +bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values) { std::string GPRMC; std::string GPGGA; @@ -348,13 +373,22 @@ std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_ utc_seconds = td.seconds(); utc_milliseconds = td.total_milliseconds() - td.total_seconds() * 1000; - if (utc_hours < 10) sentence_str << "0"; // two digits for hours + if (utc_hours < 10) + { + sentence_str << "0"; // two digits for hours + } sentence_str << utc_hours; - if (utc_mins < 10) sentence_str << "0"; // two digits for minutes + if (utc_mins < 10) + { + sentence_str << "0"; // two digits for minutes + } sentence_str << utc_mins; - if (utc_seconds < 10) sentence_str << "0"; // two digits for seconds + if (utc_seconds < 10) + { + sentence_str << "0"; // two digits for seconds + } sentence_str << utc_seconds; if (utc_milliseconds < 10) diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h index c73ef91ff..6ceab023c 100644 --- a/src/algorithms/PVT/libs/nmea_printer.h +++ b/src/algorithms/PVT/libs/nmea_printer.h @@ -38,6 +38,7 @@ #include "rtklib_solver.h" #include +#include #include @@ -58,7 +59,7 @@ public: /*! * \brief Print NMEA PVT and satellite info to the initialized device */ - bool Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values); + bool Print_Nmea_Line(const std::shared_ptr& pvt_data, bool print_average_values); /*! * \brief Default destructor. @@ -71,7 +72,7 @@ private: std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file std::string nmea_devname; int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port) - std::shared_ptr d_PVT_data; + std::shared_ptr d_PVT_data; int init_serial(const std::string& serial_device); //serial port control void close_serial(); std::string get_GPGGA(); // fix data diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc index 0f528f438..6a1e1023c 100644 --- a/src/algorithms/PVT/libs/pvt_conf.cc +++ b/src/algorithms/PVT/libs/pvt_conf.cc @@ -67,4 +67,7 @@ Pvt_Conf::Pvt_Conf() kml_output_path = std::string("."); xml_output_path = std::string("."); rtcm_output_file_path = std::string("."); + + monitor_enabled = false; + udp_port = 0; } diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h index f5e9af10e..45c960c2f 100644 --- a/src/algorithms/PVT/libs/pvt_conf.h +++ b/src/algorithms/PVT/libs/pvt_conf.h @@ -80,6 +80,10 @@ public: std::string xml_output_path; std::string rtcm_output_file_path; + bool monitor_enabled; + std::string udp_addresses; + int udp_port; + Pvt_Conf(); }; diff --git a/src/algorithms/PVT/libs/pvt_solution.h b/src/algorithms/PVT/libs/pvt_solution.h index 116cd771e..7afd074d2 100644 --- a/src/algorithms/PVT/libs/pvt_solution.h +++ b/src/algorithms/PVT/libs/pvt_solution.h @@ -37,8 +37,6 @@ #include #include -const unsigned int PVT_MAX_CHANNELS = 90; -const unsigned int PVT_MAX_PRN = 127; // 126 is SBAS /*! * \brief Base class for a PVT solution diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index e630b8dd8..10f552559 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -31,7 +31,6 @@ #include "rinex_printer.h" #include #include -#include #include #include // for create_directories, exists #include // for path, operator<< @@ -40,6 +39,7 @@ #include // for min and max #include // for floor #include // for getenv() +#include #include #include #include @@ -214,41 +214,68 @@ Rinex_Printer::~Rinex_Printer() posmn = navMixFile.tellp(); posnr = navGloFile.tellp(); posnc = navBdsFile.tellp(); - - Rinex_Printer::navFile.close(); - Rinex_Printer::obsFile.close(); - Rinex_Printer::sbsFile.close(); - Rinex_Printer::navGalFile.close(); - Rinex_Printer::navGloFile.close(); - Rinex_Printer::navBdsFile.close(); + try + { + Rinex_Printer::navFile.close(); + Rinex_Printer::obsFile.close(); + Rinex_Printer::sbsFile.close(); + Rinex_Printer::navGalFile.close(); + Rinex_Printer::navGloFile.close(); + Rinex_Printer::navBdsFile.close(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } // If nothing written, erase the files. if (posn == 0) { - if (remove(navfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (poso == 0) { - if (remove(obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (poss == 0) { - if (remove(sbsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(sbsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (posng == 0) { - if (remove(navGalfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navGalfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (posmn == 0) { - if (remove(navMixfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navMixfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (posnr == 0) { - if (remove(navGlofilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navGlofilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } if (posnc == 0) { - if (remove(navBdsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(navBdsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } } @@ -271,8 +298,14 @@ std::string Rinex_Printer::createFilename(const std::string& type) boost::gregorian::date today = boost::gregorian::day_clock::local_day(); const int32_t dayOfTheYear = today.day_of_year(); std::stringstream strm0; - if (dayOfTheYear < 100) strm0 << "0"; // three digits for day of the year - if (dayOfTheYear < 10) strm0 << "0"; // three digits for day of the year + if (dayOfTheYear < 100) + { + strm0 << "0"; // three digits for day of the year + } + if (dayOfTheYear < 10) + { + strm0 << "0"; // three digits for day of the year + } strm0 << dayOfTheYear; std::string dayOfTheYearTag = strm0.str(); @@ -326,7 +359,10 @@ std::string Rinex_Printer::createFilename(const std::string& type) int32_t local_minute = pt_tm.tm_min; std::stringstream strm2; - if (local_minute < 10) strm2 << "0"; // at least two digits for minutes + if (local_minute < 10) + { + strm2 << "0"; // at least two digits for minutes + } strm2 << local_minute; std::string minTag = strm2.str(); @@ -368,12 +404,18 @@ std::string Rinex_Printer::getLocalTime() std::stringstream strmHour; int32_t utc_hour = pt_tm.tm_hour; - if (utc_hour < 10) strmHour << "0"; // two digits for hours + if (utc_hour < 10) + { + strmHour << "0"; // two digits for hours + } strmHour << utc_hour; std::stringstream strmMin; int32_t utc_minute = pt_tm.tm_min; - if (utc_minute < 10) strmMin << "0"; // two digits for minutes + if (utc_minute < 10) + { + strmMin << "0"; // two digits for minutes + } strmMin << utc_minute; if (version == 2) @@ -415,7 +457,10 @@ std::string Rinex_Printer::getLocalTime() std::stringstream strm2; int32_t utc_seconds = pt_tm.tm_sec; - if (utc_seconds < 10) strm2 << "0"; // two digits for seconds + if (utc_seconds < 10) + { + strm2 << "0"; // two digits for seconds + } strm2 << utc_seconds; line += strm2.str(); line += std::string(1, ' '); @@ -1651,8 +1696,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Beidou_Dnav_Iono& // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line += std::string(36, ' '); @@ -1710,19 +1755,31 @@ void Rinex_Printer::rinex_sbs_header(std::fstream& out) strYear << utc_year; std::stringstream strMonth; int32_t utc_month = pt.date().month().as_number(); - if (utc_month < 10) strMonth << "0"; // two digits for months + if (utc_month < 10) + { + strMonth << "0"; // two digits for months + } strMonth << utc_month; std::stringstream strmDay; int32_t utc_day = pt.date().day().as_number(); - if (utc_day < 10) strmDay << "0"; // two digits for days + if (utc_day < 10) + { + strmDay << "0"; // two digits for days + } strmDay << utc_day; std::stringstream strmHour; int32_t utc_hour = pt_tm.tm_hour; - if (utc_hour < 10) strmHour << "0"; // two digits for hours + if (utc_hour < 10) + { + strmHour << "0"; // two digits for hours + } strmHour << utc_hour; std::stringstream strmMin; int32_t utc_minute = pt_tm.tm_min; - if (utc_minute < 10) strmMin << "0"; // two digits for minutes + if (utc_minute < 10) + { + strmMin << "0"; // two digits for minutes + } strmMin << utc_minute; std::string time_str; time_str += strmDay.str(); @@ -2825,8 +2882,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_M } else if (line_str.find("LEAP SECONDS", 59) != std::string::npos) { - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); @@ -2953,7 +3010,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (gps_ephemeris_iter->second.i_satellite_PRN < 10) + { + line += std::string("0"); + } line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); @@ -3150,12 +3210,30 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIA") { // Block II/IIA (Table 20-XI IS-GPS-200E ) - if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; - if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) curve_fit_interval = 14; - if ((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) curve_fit_interval = 26; - if ((gps_ephemeris_iter->second.d_IODC > 503) && (gps_ephemeris_iter->second.d_IODC < 511)) curve_fit_interval = 50; - if (((gps_ephemeris_iter->second.d_IODC > 751) && (gps_ephemeris_iter->second.d_IODC < 757)) || (gps_ephemeris_iter->second.d_IODC == 511)) curve_fit_interval = 74; - if (gps_ephemeris_iter->second.d_IODC == 757) curve_fit_interval = 98; + if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) + { + curve_fit_interval = 8; + } + if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) + { + curve_fit_interval = 14; + } + if ((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) + { + curve_fit_interval = 26; + } + if ((gps_ephemeris_iter->second.d_IODC > 503) && (gps_ephemeris_iter->second.d_IODC < 511)) + { + curve_fit_interval = 50; + } + if (((gps_ephemeris_iter->second.d_IODC > 751) && (gps_ephemeris_iter->second.d_IODC < 757)) || (gps_ephemeris_iter->second.d_IODC == 511)) + { + curve_fit_interval = 74; + } + if (gps_ephemeris_iter->second.d_IODC == 757) + { + curve_fit_interval = 98; + } } if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIR") || @@ -3164,9 +3242,18 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN) == "IIIA")) { // Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200E ) - if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8; - if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) curve_fit_interval = 14; - if (((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) || ((gps_ephemeris_iter->second.d_IODC > 1020) && (gps_ephemeris_iter->second.d_IODC < 1024))) curve_fit_interval = 26; + if ((gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) + { + curve_fit_interval = 8; + } + if (((gps_ephemeris_iter->second.d_IODC > 247) && (gps_ephemeris_iter->second.d_IODC < 256)) || (gps_ephemeris_iter->second.d_IODC == 496)) + { + curve_fit_interval = 14; + } + if (((gps_ephemeris_iter->second.d_IODC > 496) && (gps_ephemeris_iter->second.d_IODC < 504)) || ((gps_ephemeris_iter->second.d_IODC > 1020) && (gps_ephemeris_iter->second.d_IODC < 1024))) + { + curve_fit_interval = 26; + } } line += Rinex_Printer::doub2for(curve_fit_interval, 18, 2); line += std::string(1, ' '); @@ -3202,7 +3289,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (gps_ephemeris_iter->second.i_satellite_PRN < 10) + { + line += std::string("0"); + } line += std::to_string(gps_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); @@ -3236,7 +3326,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (galileo_ephemeris_iter->second.i_satellite_PRN < 10) + { + line += std::string("0"); + } line += std::to_string(galileo_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); @@ -3464,22 +3560,58 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.E1B_HS_5 == 0) E1B_HS = "00"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) E1B_HS = "01"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) E1B_HS = "10"; - if (galileo_ephemeris_iter->second.E1B_HS_5 == 3) E1B_HS = "11"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 0) E5B_HS = "00"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 1) E5B_HS = "01"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) E5B_HS = "10"; - if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) E5B_HS = "11"; + if (galileo_ephemeris_iter->second.E1B_HS_5 == 0) + { + E1B_HS = "00"; + } + if (galileo_ephemeris_iter->second.E1B_HS_5 == 1) + { + E1B_HS = "01"; + } + if (galileo_ephemeris_iter->second.E1B_HS_5 == 2) + { + E1B_HS = "10"; + } + if (galileo_ephemeris_iter->second.E1B_HS_5 == 3) + { + E1B_HS = "11"; + } + if (galileo_ephemeris_iter->second.E5b_HS_5 == 0) + { + E5B_HS = "00"; + } + if (galileo_ephemeris_iter->second.E5b_HS_5 == 1) + { + E5B_HS = "01"; + } + if (galileo_ephemeris_iter->second.E5b_HS_5 == 2) + { + E5B_HS = "10"; + } + if (galileo_ephemeris_iter->second.E5b_HS_5 == 3) + { + E5B_HS = "11"; + } - if (E1B_HS == "11") LOG(WARNING) << "Signal Component currently in Test"; - if (E1B_HS == "10") LOG(WARNING) << "Signal will be out of service"; - if (E1B_HS == "01") LOG(WARNING) << "Signal out of service"; + if (E1B_HS == "11") + { + LOG(WARNING) << "Signal Component currently in Test"; + } + if (E1B_HS == "10") + { + LOG(WARNING) << "Signal will be out of service"; + } + if (E1B_HS == "01") + { + LOG(WARNING) << "Signal out of service"; + } E1B_HS = "00"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID std::string E1B_DVS = std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); - if (E1B_DVS == "1") LOG(WARNING) << "Navigation data without guarantee"; + if (E1B_DVS == "1") + { + LOG(WARNING) << "Navigation data without guarantee"; + } E1B_DVS = "0"; // *************** CHANGE THIS WHEN GALILEO SIGNAL IS VALID std::string SVhealth_str = E5B_HS + std::to_string(galileo_ephemeris_iter->second.E5b_DVS_5) + "11" + "1" + E1B_DVS + E1B_HS + std::to_string(galileo_ephemeris_iter->second.E1B_DVS_5); @@ -3601,7 +3733,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (glonass_gnav_ephemeris_iter->second.i_satellite_PRN < 10) + { + line += std::string("0"); + } line += std::to_string(glonass_gnav_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); @@ -3732,9 +3867,9 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_eph_map, const std::map& glonass_gnav_eph_map) +void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map& gps_cnav_eph_map, const std::map& glonass_gnav_eph_map) { - Rinex_Printer::log_rinex_nav(out, gps_eph_map); + Rinex_Printer::log_rinex_nav(out, gps_cnav_eph_map); Rinex_Printer::log_rinex_nav(out, glonass_gnav_eph_map); } @@ -3767,7 +3902,10 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.i_satellite_PRN < 10) line += std::string("0"); + if (bds_ephemeris_iter->second.i_satellite_PRN < 10) + { + line += std::string("0"); + } line += std::to_string(bds_ephemeris_iter->second.i_satellite_PRN); std::string year(timestring, 0, 4); line += std::string(1, ' '); @@ -4003,7 +4141,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Glonass_Gnav_Ephem line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4326,7 +4467,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4571,7 +4715,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps } -void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) +void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands) { if (glonass_gnav_eph.d_m) { @@ -4678,7 +4822,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -4815,7 +4962,7 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris // -------- TIME OF FIRST OBS line.clear(); - boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_eph, d_TOW_first_observation); + boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(gps_cnav_eph, d_TOW_first_observation); std::string timestring = boost::posix_time::to_iso_string(p_gps_time); std::string year(timestring, 0, 4); std::string month(timestring, 4, 2); @@ -4984,7 +5131,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5304,7 +5454,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5558,7 +5711,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -5806,7 +5962,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& eph line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -6084,7 +6243,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -6427,7 +6589,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -6742,7 +6907,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -7006,7 +7174,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -7285,7 +7456,10 @@ void Rinex_Printer::rinex_obs_header(std::fstream& out, const Beidou_Dnav_Epheme line += Rinex_Printer::leftJustify("GNSS-SDR", 20); // add flag and property line += Rinex_Printer::leftJustify("Software Receiver", 20); // add flag and property //line += Rinex_Printer::leftJustify(google::VersionString(), 20); // add flag and property - if (gnss_sdr_version.length() > 20) gnss_sdr_version.resize(9, ' '); + if (gnss_sdr_version.length() > 20) + { + gnss_sdr_version.resize(9, ' '); + } line += Rinex_Printer::leftJustify(gnss_sdr_version, 20); line += Rinex_Printer::leftJustify("REC # / TYPE / VERS", 20); lengthCheck(line); @@ -7660,8 +7834,8 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Beidou_Dnav_Utc_M if (line_str.find("TIME OF FIRST OBS", 59) != std::string::npos) { data.push_back(line_str); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LS), 6); - line_aux += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.d_DeltaT_LSF), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LS), 6); + line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_DeltaT_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_LSF), 6); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_DN), 6); line_aux += std::string(36, ' '); @@ -7773,7 +7947,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri observables_iter++) { line += satelliteSystem["GLONASS"]; - if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + line += std::string(1, '0'); + } line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) @@ -7831,7 +8008,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); //GLONASS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -7887,7 +8067,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri std::string lineObs; lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -7935,7 +8118,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Glonass_Gnav_Ephemeri //GLONASS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -8098,7 +8284,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep observables_iter++) { line += satelliteSystem["GPS"]; - if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + line += std::string(1, '0'); + } line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L1 satellites @@ -8107,7 +8296,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep observables_iter++) { line += satelliteSystem["GLONASS"]; - if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + line += std::string(1, '0'); + } line += std::to_string(static_cast(observables_iter->second.PRN)); } // Add list of GLONASS L2 satellites @@ -8116,7 +8308,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep observables_iter++) { line += satelliteSystem["GLONASS"]; - if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + line += std::string(1, '0'); + } line += std::to_string(static_cast(observables_iter->second.PRN)); } } @@ -8137,9 +8332,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep if (version == 3) { // Specify system only if in version 3 - if (s == "G") lineObs += satelliteSystem["GPS"]; - if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (s == "G") + { + lineObs += satelliteSystem["GPS"]; + } + if (s == "R") + { + lineObs += satelliteSystem["GLONASS"]; // should not happen + } + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); } @@ -8188,7 +8392,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } @@ -8201,7 +8408,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep if (version == 3) { lineObs += satelliteSystem["GLONASS"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); } ret = total_glo_map.equal_range(*it); @@ -8254,7 +8464,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -8380,9 +8593,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g s.assign(1, observables_iter->second.System); // Specify system only if in version 3 - if (s == "G") lineObs += satelliteSystem["GPS"]; - if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (s == "G") + { + lineObs += satelliteSystem["GPS"]; + } + if (s == "R") + { + lineObs += satelliteSystem["GLONASS"]; // should not happen + } + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); // Pseudorange Measurements @@ -8430,7 +8652,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g // SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } @@ -8441,7 +8666,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g { lineObs.clear(); lineObs += satelliteSystem["GLONASS"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); @@ -8494,7 +8722,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& g lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -8620,9 +8851,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s == "E") lineObs += satelliteSystem["Galileo"]; - if (s == "R") lineObs += satelliteSystem["GLONASS"]; // should not happen - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (s == "E") + { + lineObs += satelliteSystem["Galileo"]; + } + if (s == "R") + { + lineObs += satelliteSystem["GLONASS"]; // should not happen + } + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8668,7 +8908,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga // SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } @@ -8679,7 +8922,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_glo_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -8729,7 +8975,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ga lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -8806,7 +9055,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c observables_iter++) { line += satelliteSystem["GPS"]; - if (static_cast(observables_iter->second.PRN) < 10) line += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + line += std::string(1, '0'); + } line += std::to_string(static_cast(observables_iter->second.PRN)); } // Receiver clock offset (optional) @@ -8864,7 +9116,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += Rinex_Printer::rightJustify(Rinex_Printer::asString(ssi), 1); //GPS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -8921,7 +9176,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c std::string lineObs; lineObs.clear(); lineObs += satelliteSystem["GPS"]; - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -8969,7 +9227,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c //GPS L1 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -9042,7 +9303,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e std::string lineObs; lineObs.clear(); lineObs += satelliteSystem["GPS"]; - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); //lineObs += std::string(2, ' '); //GPS L2 PSEUDORANGE @@ -9091,7 +9355,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e //GPS L2 SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -9260,7 +9527,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c { lineObs.clear(); lineObs += satelliteSystem["GPS"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_mmap.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -9310,7 +9580,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& eph, c lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -9500,7 +9773,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -9550,7 +9826,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -9695,9 +9974,18 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs.clear(); s.assign(1, observables_iter->second.System); - if (s == "G") lineObs += satelliteSystem["GPS"]; - if (s == "E") lineObs += satelliteSystem["Galileo"]; // should not happen - if (static_cast(observables_iter->second.PRN) < 10) lineObs += std::string(1, '0'); + if (s == "G") + { + lineObs += satelliteSystem["GPS"]; + } + if (s == "E") + { + lineObs += satelliteSystem["Galileo"]; // should not happen + } + if (static_cast(observables_iter->second.PRN) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(observables_iter->second.PRN)); lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.Pseudorange_m, 3), 14); @@ -9743,7 +10031,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep // SIGNAL STRENGTH lineObs += Rinex_Printer::rightJustify(asString(observables_iter->second.CN0_dB_hz, 3), 14); - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } @@ -9754,7 +10045,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -9804,7 +10098,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } @@ -9983,7 +10280,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { lineObs.clear(); lineObs += satelliteSystem["GPS"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -10042,7 +10342,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& e { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -10292,7 +10595,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs.clear(); lineObs += satelliteSystem["GPS"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_gps_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -10351,7 +10657,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Gps_Ephemeris& gps_ep { lineObs.clear(); lineObs += satelliteSystem["Galileo"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_gal_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -10533,7 +10842,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris { lineObs.clear(); lineObs += satelliteSystem["Beidou"]; - if (static_cast(*it) < 10) lineObs += std::string(1, '0'); + if (static_cast(*it) < 10) + { + lineObs += std::string(1, '0'); + } lineObs += std::to_string(static_cast(*it)); ret = total_map.equal_range(*it); for (auto iter = ret.first; iter != ret.second; ++iter) @@ -10571,7 +10883,10 @@ void Rinex_Printer::log_rinex_obs(std::fstream& out, const Beidou_Dnav_Ephemeris lineObs += Rinex_Printer::rightJustify(asString(iter->second.CN0_dB_hz, 3), 14); } - if (lineObs.size() < 80) lineObs += std::string(80 - lineObs.size(), ' '); + if (lineObs.size() < 80) + { + lineObs += std::string(80 - lineObs.size(), ' '); + } out << lineObs << std::endl; } } diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index b5ea3357d..0e189dc80 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -186,17 +186,17 @@ public: /*! * \brief Generates the Mixed (GPS L1 C/A /GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1C"); + void rinex_obs_header(std::fstream& out, const Gps_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1C"); /*! * \brief Generates the Mixed (Galileo/GLONASS) Observation data header. Example: galileo_bands("1C"), galileo_bands("1B 5X"), galileo_bands("5X"), ... Default: "1B". */ - void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glo_bands = "1C"); + void rinex_obs_header(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& galileo_bands = "1B", const std::string& glonass_bands = "1C"); /*! * \brief Generates the Mixed (GPS L2C/GLONASS) Observation data header. Example: galileo_bands("1G")... Default: "1G". */ - void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glo_bands = "1G"); + void rinex_obs_header(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double d_TOW_first_observation, const std::string& glonass_bands = "1G"); /*! * \brief Generates the a Beidou B1I Observation data header. Example: beidou_bands("B1") @@ -351,12 +351,12 @@ public: /*! * \brief Writes Mixed GPS L2C - GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_cnav_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); + void log_rinex_obs(std::fstream& out, const Gps_CNAV_Ephemeris& gps_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); /*! * \brief Writes Mixed Galileo/GLONASS observables into the RINEX file */ - void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double gps_obs_time, const std::map& observables); + void log_rinex_obs(std::fstream& out, const Galileo_Ephemeris& galileo_eph, const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const double galileo_obs_time, const std::map& observables); /*! * \brief Writes BDS B1I observables into the RINEX file @@ -374,7 +374,7 @@ public: */ //void log_rinex_sbs(std::fstream & out, const Sbas_Raw_Msg & sbs_message); - void update_nav_header(std::fstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono); + void update_nav_header(std::fstream& out, const Gps_Utc_Model& utc_model, const Gps_Iono& gps_iono); void update_nav_header(std::fstream& out, const Gps_CNAV_Utc_Model& utc_model, const Gps_CNAV_Iono& iono); @@ -388,11 +388,11 @@ public: void update_nav_header(std::fstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_cnav_iono, const Gps_CNAV_Utc_Model& gps_cnav_utc, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); + void update_nav_header(std::fstream& out, const Gps_CNAV_Iono& gps_iono, const Gps_CNAV_Utc_Model& gps_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); void update_nav_header(std::fstream& out, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model, const Glonass_Gnav_Almanac& glonass_gnav_almanac); - void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& beidou_dnav_utc, const Beidou_Dnav_Iono& beidou_dnav_iono); + void update_nav_header(std::fstream& out, const Beidou_Dnav_Utc_Model& utc_model, const Beidou_Dnav_Iono& beidou_dnav_iono); void update_obs_header(std::fstream& out, const Gps_Utc_Model& utc_model); @@ -676,8 +676,15 @@ inline std::string Rinex_Printer::doub2for(const double& d, short exponentLength = expLen; /* Validate the assumptions regarding the input arguments */ - if (exponentLength < 0) exponentLength = 1; - if (exponentLength > 3 && checkSwitch) exponentLength = 3; + if (exponentLength < 0) + { + exponentLength = 1; + } + + if (exponentLength > 3 && checkSwitch) + { + exponentLength = 3; + } std::string toReturn = doub2sci(d, length, exponentLength, true, checkSwitch); sci2for(toReturn, 0, length, exponentLength, checkSwitch); @@ -696,8 +703,15 @@ inline std::string Rinex_Printer::doub2sci(const double& d, short exponentLength = expLen; /* Validate the assumptions regarding the input arguments */ - if (exponentLength < 0) exponentLength = 1; - if (exponentLength > 3 && checkSwitch) exponentLength = 3; + if (exponentLength < 0) + { + exponentLength = 1; + } + + if (exponentLength > 3 && checkSwitch) + { + exponentLength = 3; + } std::stringstream c; c.setf(std::ios::scientific, std::ios::floatfield); @@ -709,7 +723,10 @@ inline std::string Rinex_Printer::doub2sci(const double& d, // an extra -1 for '-' or ' ' if it's positive or negative int expSize = 0; if (showSign) - expSize = 1; + { + expSize = 1; + } + c.precision(length - 3 - exponentLength - 1 - expSize); c << d; c >> toReturn; @@ -751,7 +768,9 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr, aStr[idx - 1] = '.'; // Only add one to the exponent if the number is non-zero if (asDouble(aStr.substr(startPos, length)) != 0.0) - expAdd = 1; + { + expAdd = 1; + } } idx = aStr.find('e', startPos); @@ -766,9 +785,13 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr, // Change the exponent character to D normally, or E of checkSwitch is false. if (checkSwitch) - aStr[idx] = 'D'; + { + aStr[idx] = 'D'; + } else - aStr[idx] = 'E'; + { + aStr[idx] = 'E'; + } // Change the exponent itself if (redoexp) @@ -784,7 +807,10 @@ inline std::string& Rinex_Printer::sci2for(std::string& aStr, iexp -= iexp * 2; } else - aStr += "+"; + { + aStr += "+"; + } + aStr += Rinex_Printer::rightJustify(asString(iexp), expLen, '0'); } diff --git a/src/algorithms/PVT/libs/rtcm_printer.cc b/src/algorithms/PVT/libs/rtcm_printer.cc index da32c0e9b..d3416be6e 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.cc +++ b/src/algorithms/PVT/libs/rtcm_printer.cc @@ -38,6 +38,7 @@ #include // for filesystem #include #include +#include #include // for O_RDWR #include #include // for tcgetattr @@ -143,7 +144,7 @@ Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump } } - rtcm_devname = std::move(rtcm_dump_devname); + rtcm_devname = rtcm_dump_devname; if (flag_rtcm_tty_port == true) { rtcm_dev_descriptor = init_serial(rtcm_devname.c_str()); @@ -190,13 +191,30 @@ Rtcm_Printer::~Rtcm_Printer() { int64_t pos; pos = rtcm_file_descriptor.tellp(); - rtcm_file_descriptor.close(); + try + { + rtcm_file_descriptor.close(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } if (pos == 0) { - if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file"; + if (remove(rtcm_filename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary RTCM file"; + } } } - close_serial(); + try + { + close_serial(); + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; + } } @@ -353,10 +371,16 @@ int Rtcm_Printer::init_serial(const std::string& serial_device) int64_t PARITY; fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY | O_CLOEXEC); - if (fd == -1) return fd; // failed to open TTY port + if (fd == -1) + { + return fd; // failed to open TTY port + } - if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O - tcgetattr(fd, &options); // read serial port options + if (fcntl(fd, F_SETFL, 0) == -1) + { + LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O + } + tcgetattr(fd, &options); // read serial port options BAUD = B9600; //BAUD = B38400; diff --git a/src/algorithms/PVT/libs/rtcm_printer.h b/src/algorithms/PVT/libs/rtcm_printer.h index aca7197bb..9db248eb9 100644 --- a/src/algorithms/PVT/libs/rtcm_printer.h +++ b/src/algorithms/PVT/libs/rtcm_printer.h @@ -36,8 +36,8 @@ #include "rtcm.h" #include // std::ofstream -#include // std::shared_ptr - +#include +#include // std::shared_ptr /*! * \brief This class provides a implementation of a subset of the RTCM Standard 10403.2 messages @@ -48,7 +48,7 @@ public: /*! * \brief Default constructor. */ - Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_filename, bool time_tag_name = true, const std::string& base_path = "."); + Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name = true, const std::string& base_path = "."); /*! * \brief Default destructor. @@ -112,7 +112,7 @@ public: * \param utc_model GLONASS GNAV Clock Information broadcast in string 5 * \return true or false upon operation success */ - bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glo_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model); + bool Print_Rtcm_MT1020(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& utc_model); bool Print_Rtcm_MSM(uint32_t msm_number, const Gps_Ephemeris& gps_eph, diff --git a/src/algorithms/PVT/libs/rtklib_solver.cc b/src/algorithms/PVT/libs/rtklib_solver.cc index c1b984804..72e40d2fe 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.cc +++ b/src/algorithms/PVT/libs/rtklib_solver.cc @@ -60,12 +60,13 @@ #include "rtklib_solution.h" #include #include +#include #include using google::LogMessage; -rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) +Rtklib_Solver::Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t &rtk) { // init empty ephemeris for all the available GNSS channels d_nchannels = nchannels; @@ -75,7 +76,10 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag count_valid_position = 0; this->set_averaging_flag(false); rtk_ = rtk; - for (double &i : dop_) i = 0.0; + for (double &i : dop_) + { + i = 0.0; + } pvt_sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0}; ssat_t ssat0 = {0, 0, {0.0}, {0.0}, {0.0}, {'0'}, {'0'}, {'0'}, {'0'}, {'0'}, {}, {}, {}, {}, 0.0, 0.0, 0.0, 0.0, {{{0, 0}}, {{0, 0}}}, {{}, {}}}; for (auto &i : pvt_ssat) @@ -89,19 +93,48 @@ rtklib_solver::rtklib_solver(int nchannels, std::string dump_filename, bool flag { try { - d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); + d_dump_file.exceptions(std::ofstream::failbit | std::ofstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); LOG(INFO) << "PVT lib dump enabled Log file: " << d_dump_filename.c_str(); } - catch (const std::ifstream::failure &e) + catch (const std::ofstream::failure &e) { LOG(WARNING) << "Exception opening RTKLIB dump file " << e.what(); } } } + // PVT MONITOR + monitor_pvt.TOW_at_current_symbol_ms = 0U; + monitor_pvt.week = 0U; + monitor_pvt.RX_time = 0.0; + monitor_pvt.user_clk_offset = 0.0; + monitor_pvt.pos_x = 0.0; + monitor_pvt.pos_y = 0.0; + monitor_pvt.pos_z = 0.0; + monitor_pvt.vel_x = 0.0; + monitor_pvt.vel_y = 0.0; + monitor_pvt.vel_z = 0.0; + monitor_pvt.cov_xx = 0.0; + monitor_pvt.cov_yy = 0.0; + monitor_pvt.cov_zz = 0.0; + monitor_pvt.cov_xy = 0.0; + monitor_pvt.cov_yz = 0.0; + monitor_pvt.cov_zx = 0.0; + monitor_pvt.latitude = 0.0; + monitor_pvt.longitude = 0.0; + monitor_pvt.height = 0.0; + monitor_pvt.valid_sats = 0; + monitor_pvt.solution_status = 0; + monitor_pvt.solution_type = 0; + monitor_pvt.AR_ratio_factor = 0.0; + monitor_pvt.AR_ratio_threshold = 0.0; + monitor_pvt.gdop = 0.0; + monitor_pvt.pdop = 0.0; + monitor_pvt.hdop = 0.0; + monitor_pvt.vdop = 0.0; } -bool rtklib_solver::save_matfile() +bool Rtklib_Solver::save_matfile() { // READ DUMP FILE std::string dump_filename = d_dump_filename; @@ -397,7 +430,8 @@ bool rtklib_solver::save_matfile() return true; } -rtklib_solver::~rtklib_solver() + +Rtklib_Solver::~Rtklib_Solver() { if (d_dump_file.is_open() == true) { @@ -412,36 +446,47 @@ rtklib_solver::~rtklib_solver() } if (d_flag_dump_mat_enabled) { - save_matfile(); + try + { + save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Exception in destructor saving the PVT .mat dump file " << ex.what(); + } } } -double rtklib_solver::get_gdop() const +double Rtklib_Solver::get_gdop() const { return dop_[0]; } -double rtklib_solver::get_pdop() const +double Rtklib_Solver::get_pdop() const { return dop_[1]; } -double rtklib_solver::get_hdop() const +double Rtklib_Solver::get_hdop() const { return dop_[2]; } -double rtklib_solver::get_vdop() const +double Rtklib_Solver::get_vdop() const { return dop_[3]; } +Monitor_Pvt Rtklib_Solver::get_monitor_pvt() const +{ + return monitor_pvt; +} -bool rtklib_solver::get_PVT(const std::map &gnss_observables_map, bool flag_averaging) +bool Rtklib_Solver::get_PVT(const std::map &gnss_observables_map, bool flag_averaging) { std::map::const_iterator gnss_observables_iter; std::map::const_iterator galileo_ephemeris_iter; @@ -492,7 +537,10 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } } - if (band1 == true and band2 == true) gps_dual_band = true; + if (band1 == true and band2 == true) + { + gps_dual_band = true; + } for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); @@ -851,7 +899,10 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } } - if (index_aux > 0) dops(index_aux, azel.data(), 0.0, dop_.data()); + if (index_aux > 0) + { + dops(index_aux, azel.data(), 0.0, dop_.data()); + } this->set_valid_position(true); arma::vec rx_position_and_time(4); rx_position_and_time(0) = pvt_sol.rr[0]; // [m] @@ -865,7 +916,7 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ } else { - rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_m_s; // the receiver clock offset is expressed in [meters], so we convert it into [s] + rx_position_and_time(3) = pvt_sol.dtr[0] / GPS_C_M_S; // the receiver clock offset is expressed in [meters], so we convert it into [s] } this->set_rx_pos(rx_position_and_time.rows(0, 2)); // save ECEF position for the next iteration @@ -880,7 +931,10 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ if (ground_speed_ms >= 1.0) { new_cog = atan2(enuv[0], enuv[1]) * R2D; - if (new_cog < 0.0) new_cog += 360.0; + if (new_cog < 0.0) + { + new_cog += 360.0; + } this->set_course_over_ground(new_cog); } @@ -907,6 +961,58 @@ bool rtklib_solver::get_PVT(const std::map &gnss_observables_ << " [deg], Height= " << this->get_height() << " [m]" << " RX time offset= " << this->get_time_offset_s() << " [s]"; + // PVT MONITOR + + // TOW + monitor_pvt.TOW_at_current_symbol_ms = gnss_observables_map.begin()->second.TOW_at_current_symbol_ms; + // WEEK + monitor_pvt.week = adjgpsweek(nav_data.eph[0].week); + // PVT GPS time + monitor_pvt.RX_time = gnss_observables_map.begin()->second.RX_time; + // User clock offset [s] + monitor_pvt.user_clk_offset = rx_position_and_time(3); + + // ECEF POS X,Y,X [m] + ECEF VEL X,Y,X [m/s] (6 x double) + monitor_pvt.pos_x = pvt_sol.rr[0]; + monitor_pvt.pos_y = pvt_sol.rr[1]; + monitor_pvt.pos_z = pvt_sol.rr[2]; + monitor_pvt.vel_x = pvt_sol.rr[3]; + monitor_pvt.vel_y = pvt_sol.rr[4]; + monitor_pvt.vel_z = pvt_sol.rr[5]; + + // position variance/covariance (m^2) {c_xx,c_yy,c_zz,c_xy,c_yz,c_zx} (6 x double) + monitor_pvt.cov_xx = pvt_sol.qr[0]; + monitor_pvt.cov_yy = pvt_sol.qr[1]; + monitor_pvt.cov_zz = pvt_sol.qr[2]; + monitor_pvt.cov_xy = pvt_sol.qr[3]; + monitor_pvt.cov_yz = pvt_sol.qr[4]; + monitor_pvt.cov_zx = pvt_sol.qr[5]; + + // GEO user position Latitude [deg] + monitor_pvt.latitude = get_latitude(); + // GEO user position Longitude [deg] + monitor_pvt.longitude = get_longitude(); + // GEO user position Height [m] + monitor_pvt.height = get_height(); + + // NUMBER OF VALID SATS + monitor_pvt.valid_sats = pvt_sol.ns; + // RTKLIB solution status + monitor_pvt.solution_status = pvt_sol.stat; + // RTKLIB solution type (0:xyz-ecef,1:enu-baseline) + monitor_pvt.solution_type = pvt_sol.type; + // AR ratio factor for validation + monitor_pvt.AR_ratio_factor = pvt_sol.ratio; + // AR ratio threshold for validation + monitor_pvt.AR_ratio_threshold = pvt_sol.thres; + + // GDOP / PDOP/ HDOP/ VDOP + monitor_pvt.gdop = dop_[0]; + monitor_pvt.pdop = dop_[1]; + monitor_pvt.hdop = dop_[2]; + monitor_pvt.vdop = dop_[3]; + + // ######## LOG FILE ######### if (d_flag_dump_enabled == true) { diff --git a/src/algorithms/PVT/libs/rtklib_solver.h b/src/algorithms/PVT/libs/rtklib_solver.h index db0a47d1a..9f8bd86f9 100644 --- a/src/algorithms/PVT/libs/rtklib_solver.h +++ b/src/algorithms/PVT/libs/rtklib_solver.h @@ -62,6 +62,7 @@ #include "gnss_synchro.h" #include "gps_cnav_navigation_message.h" #include "gps_navigation_message.h" +#include "monitor_pvt.h" #include "pvt_solution.h" #include "rtklib_rtkpos.h" #include @@ -73,7 +74,7 @@ /*! * \brief This class implements a simple PVT Least Squares solution */ -class rtklib_solver : public Pvt_Solution +class Rtklib_Solver : public Pvt_Solution { private: rtk_t rtk_; @@ -85,18 +86,20 @@ private: bool d_flag_dump_mat_enabled; int d_nchannels; // Number of available channels for positioning std::array dop_; + Monitor_Pvt monitor_pvt; public: sol_t pvt_sol; ssat_t pvt_ssat[MAXSAT]; - rtklib_solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); - ~rtklib_solver(); + Rtklib_Solver(int nchannels, std::string dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat, const rtk_t& rtk); + ~Rtklib_Solver(); bool get_PVT(const std::map& gnss_observables_map, bool flag_averaging); double get_hdop() const; double get_vdop() const; double get_pdop() const; double get_gdop() const; + Monitor_Pvt get_monitor_pvt() const; std::map galileo_ephemeris_map; //!< Map storing new Galileo_Ephemeris std::map gps_ephemeris_map; //!< Map storing new GPS_Ephemeris diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 553bfd2b3..bfe54fa8e 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -83,33 +83,43 @@ if(OPENCL_FOUND) ) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - list(SORT ACQ_ADAPTER_HEADERS) list(SORT ACQ_ADAPTER_SOURCES) -add_library(acq_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) + source_group(Headers FILES ${ACQ_ADAPTER_HEADERS}) -target_link_libraries(acq_adapters - acquisition_lib - gnss_sp_libs - gnss_sdr_flags - acq_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} + +add_library(acquisition_adapters ${ACQ_ADAPTER_SOURCES} ${ACQ_ADAPTER_HEADERS}) + +target_link_libraries(acquisition_adapters + PUBLIC + Gnuradio::blocks + algorithms_libs + gnss_sdr_flags + acquisition_gr_blocks + core_system_parameters + PRIVATE + Boost::boost + Gflags::gflags + Glog::glog + Volkgnsssdr::volkgnsssdr + acquisition_libs +) + +target_include_directories(acquisition_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET acquisition_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc index d2c8a99e2..7ee2a7277 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.cc @@ -68,7 +68,10 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters.doppler_max = doppler_max_; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); acq_parameters.sampled_ms = sampled_ms_; @@ -81,7 +84,7 @@ BeidouB1iPcpsAcquisition::BeidouB1iPcpsAcquisition( dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename); acq_parameters.dump_filename = dump_filename_; //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::round(static_cast(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::round(static_cast(fs_in_) / (BEIDOU_B1I_CODE_RATE_HZ / BEIDOU_B1I_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; @@ -144,7 +147,7 @@ void BeidouB1iPcpsAcquisition::stop_acquisition() { } -void BeidouB1iPcpsAcquisition::set_channel(unsigned int channel) +void BeidouB1iPcpsAcquisition::set_channel(uint32_t channel) { channel_ = channel; acquisition_->set_channel(channel_); @@ -170,7 +173,7 @@ void BeidouB1iPcpsAcquisition::set_threshold(float threshold) } -void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max) +void BeidouB1iPcpsAcquisition::set_doppler_max(uint32_t doppler_max) { doppler_max_ = doppler_max; @@ -178,7 +181,7 @@ void BeidouB1iPcpsAcquisition::set_doppler_max(unsigned int doppler_max) } -void BeidouB1iPcpsAcquisition::set_doppler_step(unsigned int doppler_step) +void BeidouB1iPcpsAcquisition::set_doppler_step(uint32_t doppler_step) { doppler_step_ = doppler_step; @@ -213,7 +216,7 @@ void BeidouB1iPcpsAcquisition::set_local_code() beidou_b1i_code_gen_complex_sampled(code, gnss_synchro_->PRN, fs_in_, 0); - for (unsigned int i = 0; i < sampled_ms_; i++) + for (uint32_t i = 0; i < sampled_ms_; i++) { memcpy(&(code_[i * code_length_]), code, sizeof(gr_complex) * code_length_); @@ -239,7 +242,7 @@ void BeidouB1iPcpsAcquisition::set_state(int state) float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) { //Calculate the threshold - unsigned int frequency_bins = 0; + uint32_t frequency_bins = 0; /* for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_) { @@ -250,7 +253,7 @@ float BeidouB1iPcpsAcquisition::calculate_threshold(float pfa) frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa; - unsigned int ncells = vector_length_ * frequency_bins; + uint32_t ncells = vector_length_ * frequency_bins; double exponent = 1 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); auto lambda = static_cast(vector_length_); @@ -315,7 +318,7 @@ gr::basic_block_sptr BeidouB1iPcpsAcquisition::get_left_block() { return acquisition_; } - else if (item_type_ == "cshort") + if (item_type_ == "cshort") { return acquisition_; } diff --git a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h index 711c5a13b..334aff555 100644 --- a/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h +++ b/src/algorithms/acquisition/adapters/beidou_b1i_pcps_acquisition.h @@ -34,7 +34,6 @@ #ifndef GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ #define GNSS_SDR_BEIDOU_B1I_PCPS_ACQUISITION_H_ -#include "acq_conf.h" #include "acquisition_interface.h" #include "complex_byte_to_float_x2.h" #include "gnss_synchro.h" @@ -42,6 +41,7 @@ #include #include #include +#include #include @@ -93,7 +93,7 @@ public: /*! * \brief Set acquisition channel unique ID */ - void set_channel(unsigned int channel) override; + void set_channel(uint32_t channel) override; /*! * \brief Set statistics threshold of PCPS algorithm @@ -103,12 +103,12 @@ public: /*! * \brief Set maximum Doppler off grid search */ - void set_doppler_max(unsigned int doppler_max) override; + void set_doppler_max(uint32_t doppler_max) override; /*! * \brief Set Doppler steps for the grid search */ - void set_doppler_step(unsigned int doppler_step) override; + void set_doppler_step(uint32_t doppler_step) override; /*! * \brief Initializes acquisition algorithm. @@ -154,25 +154,25 @@ private: complex_byte_to_float_x2_sptr cbyte_to_float_x2_; size_t item_size_; std::string item_type_; - unsigned int vector_length_; - unsigned int code_length_; + uint32_t vector_length_; + uint32_t code_length_; bool bit_transition_flag_; bool use_CFAR_algorithm_flag_; - unsigned int channel_; + uint32_t channel_; float threshold_; - unsigned int doppler_max_; - unsigned int doppler_step_; - unsigned int sampled_ms_; - unsigned int max_dwells_; - long fs_in_; + uint32_t doppler_max_; + uint32_t doppler_step_; + uint32_t sampled_ms_; + uint32_t max_dwells_; + int64_t fs_in_; bool dump_; bool blocking_; std::string dump_filename_; std::complex* code_; Gnss_Synchro* gnss_synchro_; std::string role_; - unsigned int in_streams_; - unsigned int out_streams_; + uint32_t in_streams_; + uint32_t out_streams_; float calculate_threshold(float pfa); }; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 7af5d228f..14aa840fa 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -61,7 +61,10 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) @@ -79,7 +82,7 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); @@ -145,7 +148,10 @@ void GalileoE1Pcps8msAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 79e25061c..24bdc155e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -62,7 +62,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); acq_parameters_.fs_in = fs_in_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters_.doppler_max = doppler_max_; acq_parameters_.ms_per_code = 4; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", acq_parameters_.ms_per_code); @@ -95,10 +98,10 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( } if (acq_parameters_.use_automatic_resampler) { - if (acq_parameters_.fs_in > Galileo_E1_OPT_ACQ_FS_HZ) + if (acq_parameters_.fs_in > GALILEO_E1_OPT_ACQ_FS_HZ) { - acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / Galileo_E1_OPT_ACQ_FS_HZ); - uint32_t decimation = acq_parameters_.fs_in / Galileo_E1_OPT_ACQ_FS_HZ; + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / GALILEO_E1_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / GALILEO_E1_OPT_ACQ_FS_HZ; while (acq_parameters_.fs_in % decimation > 0) { decimation--; @@ -107,19 +110,19 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( acq_parameters_.resampled_fs = acq_parameters_.fs_in / static_cast(acq_parameters_.resampler_ratio); } //--- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); } else { //--- Find number of samples per spreading code (4 ms) ----------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GALILEO_E1_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); } - acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(Galileo_E1_CODE_PERIOD_MS); + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GALILEO_E1_CODE_PERIOD_MS); vector_length_ = sampled_ms_ * acq_parameters_.samples_per_ms; if (bit_transition_flag_) { @@ -187,7 +190,10 @@ void GalileoE1PcpsAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index a3c391313..30ebc957f 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -105,7 +105,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) ----------------- - auto code_length = static_cast(std::round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(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(std::round(static_cast(fs_in_) * 0.001)); //acq_parameters.samples_per_ms = samples_per_ms; @@ -117,8 +117,8 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( // } //printf("fs_in = %d\n", fs_in); - //printf("Galileo_E1_B_CODE_LENGTH_CHIPS = %f\n", Galileo_E1_B_CODE_LENGTH_CHIPS); - //printf("Galileo_E1_CODE_CHIP_RATE_HZ = %f\n", Galileo_E1_CODE_CHIP_RATE_HZ); + //printf("GALILEO_E1_B_CODE_LENGTH_CHIPS = %f\n", GALILEO_E1_B_CODE_LENGTH_CHIPS); + //printf("GALILEO_E1_CODE_CHIP_RATE_HZ = %f\n", GALILEO_E1_CODE_CHIP_RATE_HZ); //printf("acq adapter code_length = %d\n", code_length); acq_parameters.code_length = code_length; // The FPGA can only use FFT lengths that are a power of two. @@ -136,19 +136,19 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( acq_parameters.device_name = device_name; acq_parameters.samples_per_ms = nsamples_total / sampled_ms; acq_parameters.samples_per_code = nsamples_total; - acq_parameters.excludelimit = static_cast(std::round(static_cast(fs_in) / Galileo_E1_CODE_CHIP_RATE_HZ)); + acq_parameters.excludelimit = static_cast(std::round(static_cast(fs_in) / GALILEO_E1_CODE_CHIP_RATE_HZ)); // 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) auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* code = new std::complex[nsamples_total]; // buffer for the local code auto* fft_codes_padded = static_cast(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 + 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 //int tmp_re, tmp_im; - for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) + for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) { //code_ = new gr_complex[vector_length_]; @@ -288,7 +288,7 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga( } - // for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) + // for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) // { // // debug // char filename2[25]; diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index 76869f266..eab75852e 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -60,7 +60,10 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) @@ -79,7 +82,7 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index b409eee0b..490ff99bd 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -61,12 +61,15 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 8); /*--- Find number of samples per spreading code (4 ms) -----------------*/ code_length_ = round( - fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); int samples_per_ms = round(code_length_ / 4.0); @@ -179,7 +182,10 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc index 20418f7ef..2f538e8f8 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_tong_ambiguous_acquisition.cc @@ -61,7 +61,10 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); if (sampled_ms_ % 4 != 0) @@ -82,7 +85,7 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition( //--- Find number of samples per spreading code (4 ms) ----------------- code_length_ = round( - fs_in_ / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + fs_in_ / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * static_cast(sampled_ms_ / 4); @@ -149,7 +152,10 @@ void GalileoE1PcpsTongAmbiguousAcquisition::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc index c6c4f663d..277c48b91 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_noncoherent_iq_acquisition_caf.cc @@ -66,7 +66,10 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } CAF_window_hz_ = configuration_->property(role + ".CAF_window_hz", 0); Zero_padding = configuration_->property(role + ".Zero_padding", 0); sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); @@ -88,7 +91,7 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf( bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); //--- Find number of samples per spreading code (1ms)------------------------- - code_length_ = round(static_cast(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS)); + code_length_ = round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS)); vector_length_ = code_length_ * sampled_ms_; @@ -155,7 +158,10 @@ void GalileoE5aNoncoherentIQAcquisitionCaf::set_threshold(float threshold) { float pfa = configuration_->property(role_ + std::to_string(channel_) + ".pfa", 0.0); - if (pfa == 0.0) pfa = configuration_->property(role_ + ".pfa", 0.0); + if (pfa == 0.0) + { + pfa = configuration_->property(role_ + ".pfa", 0.0); + } if (pfa == 0.0) { diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc index 4b7abfc8f..963cfe5f3 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition.cc @@ -70,7 +70,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con acq_parameters_.dump = dump_; acq_parameters_.dump_channel = configuration_->property(role + ".dump_channel", 0); doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters_.doppler_max = doppler_max_; sampled_ms_ = 1; max_dwells_ = configuration_->property(role + ".max_dwells", 1); @@ -93,10 +96,10 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con } if (acq_parameters_.use_automatic_resampler) { - if (acq_parameters_.fs_in > Galileo_E5a_OPT_ACQ_FS_HZ) + if (acq_parameters_.fs_in > GALILEO_E5A_OPT_ACQ_FS_HZ) { - acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / Galileo_E5a_OPT_ACQ_FS_HZ); - uint32_t decimation = acq_parameters_.fs_in / Galileo_E5a_OPT_ACQ_FS_HZ; + acq_parameters_.resampler_ratio = floor(static_cast(acq_parameters_.fs_in) / GALILEO_E5A_OPT_ACQ_FS_HZ); + uint32_t decimation = acq_parameters_.fs_in / GALILEO_E5A_OPT_ACQ_FS_HZ; while (acq_parameters_.fs_in % decimation > 0) { decimation--; @@ -106,21 +109,21 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con } //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); } else { acq_parameters_.resampled_fs = fs_in_; //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters_.fs_in))); } //--- Find number of samples per spreading code (1ms)------------------------- - code_length_ = static_cast(std::round(static_cast(fs_in_) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::round(static_cast(fs_in_) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); vector_length_ = code_length_ * sampled_ms_; code_ = new gr_complex[vector_length_]; @@ -141,7 +144,7 @@ GalileoE5aPcpsAcquisition::GalileoE5aPcpsAcquisition(ConfigurationInterface* con acq_parameters_.it_size = item_size_; acq_parameters_.sampled_ms = sampled_ms_; acq_parameters_.ms_per_code = 1; - acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GALILEO_E5a_CODE_PERIOD_MS); + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GALILEO_E5A_CODE_PERIOD_MS); acq_parameters_.num_doppler_bins_step2 = configuration_->property(role + ".second_nbins", 4); acq_parameters_.doppler_step2 = configuration_->property(role + ".second_doppler_step", 125.0); acq_parameters_.make_2_steps = configuration_->property(role + ".make_two_steps", false); diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 7b83848e6..56b154fb1 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -98,7 +98,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf acq_pilot_ = false; } - auto code_length = static_cast(std::round(static_cast(fs_in) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + auto code_length = static_cast(std::round(static_cast(fs_in) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(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*2)); @@ -117,7 +117,7 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf acq_parameters.samples_per_code = nsamples_total; - acq_parameters.excludelimit = static_cast(ceil((1.0 / Galileo_E5a_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters.excludelimit = static_cast(ceil((1.0 / GALILEO_E5A_CODE_CHIP_RATE_HZ) * static_cast(acq_parameters.fs_in))); //vector_length_ = code_length_ * sampled_ms_; @@ -126,15 +126,13 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf auto* fft_if = new gr::fft::fft_complex(nsamples_total, true); // Direct FFT auto* code = new std::complex[nsamples_total]; // buffer for the local code auto* fft_codes_padded = static_cast(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 + 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 //printf("creating the E5A acquisition CONT"); //printf("nsamples_total = %d\n", nsamples_total); - //printf("number of codes = %d\n", Galileo_E5a_NUMBER_OF_CODES); - - for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++) + for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) { // gr_complex* code = new gr_complex[code_length_]; char signal_[3]; diff --git a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc index 050190ee7..4480fd30b 100644 --- a/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l1_ca_pcps_acquisition.cc @@ -71,7 +71,10 @@ GlonassL1CaPcpsAcquisition::GlonassL1CaPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters.doppler_max = doppler_max_; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); acq_parameters.sampled_ms = sampled_ms_; diff --git a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc index 93aa9736d..6770310d7 100644 --- a/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/glonass_l2_ca_pcps_acquisition.cc @@ -70,7 +70,10 @@ GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters.doppler_max = doppler_max_; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc index ce0ea4065..e27f37581 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition.cc @@ -70,7 +70,10 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters_.blocking = blocking_; doppler_max_ = configuration_->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters_.doppler_max = doppler_max_; sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); acq_parameters_.sampled_ms = sampled_ms_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc index 4e16b54ec..4fb0e46cf 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fine_doppler.cc @@ -67,7 +67,10 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler( dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); acq_parameters.dump_filename = dump_filename_; doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters.doppler_max = doppler_max_; sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); acq_parameters.sampled_ms = sampled_ms_; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 27e9839de..a9a61a116 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -193,7 +193,7 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga( delete fft_if; delete[] fft_codes_padded; - acq_parameters.total_block_exp = 10; + acq_parameters.total_block_exp = 14; acquisition_fpga_ = pcps_make_acquisition_fpga(acq_parameters); DLOG(INFO) << "acquisition(" << acquisition_fpga_->unique_id() << ")"; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc index fb7a140b7..3770b7c7a 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_assisted_acquisition.cc @@ -61,7 +61,10 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition( fs_in_ = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } doppler_min_ = configuration->property(role + ".doppler_min", -doppler_max_); sampled_ms_ = configuration->property(role + ".coherent_integration_time_ms", 1); max_dwells_ = configuration->property(role + ".max_dwells", 1); diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index a3d896ccc..2691b1161 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -61,7 +61,10 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 4); //--- Find number of samples per spreading code ------------------------- diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 0b3a627ba..162ea96ae 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -61,7 +61,10 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump_ = configuration_->property(role + ".dump", false); doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1); tong_init_val_ = configuration->property(role + ".tong_init_val", 1); diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index dcf663121..00fcb7624 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -68,7 +68,10 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters_.blocking = blocking_; doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters_.doppler_max = doppler_max_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); acq_parameters_.bit_transition_flag = bit_transition_flag_; diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc index f436da1d4..69503c7bd 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition.cc @@ -69,7 +69,10 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( blocking_ = configuration_->property(role + ".blocking", true); acq_parameters_.blocking = blocking_; doppler_max_ = configuration->property(role + ".doppler_max", 5000); - if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max; + if (FLAGS_doppler_max != 0) + { + doppler_max_ = FLAGS_doppler_max; + } acq_parameters_.doppler_max = doppler_max_; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); acq_parameters_.bit_transition_flag = bit_transition_flag_; @@ -118,20 +121,20 @@ GpsL5iPcpsAcquisition::GpsL5iPcpsAcquisition( } //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(acq_parameters_.resampled_fs) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(acq_parameters_.resampled_fs) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast(acq_parameters_.resampled_fs))); } else { acq_parameters_.resampled_fs = fs_in_; //--- Find number of samples per spreading code ------------------------- - code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); + code_length_ = static_cast(std::floor(static_cast(fs_in_) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS))); acq_parameters_.samples_per_ms = static_cast(fs_in_) * 0.001; - acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters_.fs_in))); + acq_parameters_.samples_per_chip = static_cast(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast(acq_parameters_.fs_in))); } - acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GPS_L5i_PERIOD * 1000.0); + acq_parameters_.samples_per_code = acq_parameters_.samples_per_ms * static_cast(GPS_L5I_PERIOD * 1000.0); vector_length_ = std::floor(acq_parameters_.sampled_ms * acq_parameters_.samples_per_ms) * (acq_parameters_.bit_transition_flag ? 2 : 1); code_ = new gr_complex[vector_length_]; acquisition_ = pcps_make_acquisition(acq_parameters_); diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 336164646..f4a2ff2b5 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -96,7 +96,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 ------------------------- - auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); + auto code_length = static_cast(std::round(static_cast(fs_in) / (GPS_L5I_CODE_RATE_HZ / static_cast(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*2)); @@ -115,7 +115,7 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga( acq_parameters.samples_per_code = nsamples_total; //acq_parameters.excludelimit = static_cast(std::round(static_cast(fs_in) / GPS_L5i_CODE_RATE_HZ)); - acq_parameters.excludelimit = static_cast(ceil((1.0 / GPS_L5i_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); + acq_parameters.excludelimit = static_cast(ceil((1.0 / GPS_L5I_CODE_RATE_HZ) * static_cast(acq_parameters.fs_in))); //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 diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 60825d6f0..5a135364b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -49,21 +49,6 @@ if(OPENCL_FOUND) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} -) if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) @@ -76,35 +61,49 @@ endif() list(SORT ACQ_GR_BLOCKS_HEADERS) list(SORT ACQ_GR_BLOCKS_SOURCES) -add_library(acq_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) + source_group(Headers FILES ${ACQ_GR_BLOCKS_HEADERS}) -if(ENABLE_FPGA) - target_link_libraries(acq_gr_blocks - acquisition_lib - gnss_sp_libs - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} +add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS}) + +target_link_libraries(acquisition_gr_blocks + PUBLIC + Gnuradio::runtime + Gnuradio::fft + Volk::volk + acquisition_libs + core_system_parameters ${OPT_LIBRARIES} - ${OPT_ACQUISITION_LIBRARIES} - ) -else() - target_link_libraries(acq_gr_blocks - gnss_sp_libs - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${OPT_LIBRARIES} - ${MATIO_LIBRARIES} - ${OPT_ACQUISITION_LIBRARIES} - ) + PRIVATE + Boost::filesystem + Gflags::gflags + Glog::glog + Matio::matio + Volkgnsssdr::volkgnsssdr + algorithms_libs +) + +target_include_directories(acquisition_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + PRIVATE + ${CMAKE_SOURCE_DIR}/src/core/receiver +) + +if(OPENCL_FOUND) + target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) endif() -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(acq_gr_blocks volk_gnsssdr_module) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET acquisition_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index c884bcf34..c6f14d597 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -36,11 +36,11 @@ */ #include "galileo_e5a_noncoherent_iq_acquisition_caf_cc.h" -#include "control_message_factory.h" #include #include #include #include +#include #include #include @@ -214,9 +214,20 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi delete d_fft_if; delete d_ifft; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h index 352dc938c..c95a74b82 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.h @@ -47,7 +47,7 @@ class galileo_e5a_noncoherentIQ_acquisition_caf_cc; -typedef boost::shared_ptr galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr; +using galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr = boost::shared_ptr; galileo_e5a_noncoherentIQ_acquisition_caf_cc_sptr galileo_e5a_noncoherentIQ_make_acquisition_caf_cc(unsigned int sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 275b8aad0..cb528d0b1 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -30,11 +30,11 @@ */ #include "galileo_pcps_8ms_acquisition_cc.h" -#include "control_message_factory.h" #include #include #include #include +#include #include #include @@ -54,6 +54,7 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc( samples_per_code, dump, std::move(dump_filename))); } + galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( uint32_t sampled_ms, uint32_t max_dwells, @@ -126,9 +127,20 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc() delete d_ifft; delete d_fft_if; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h index d9f794d1e..0c1b81e20 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.h @@ -41,7 +41,7 @@ class galileo_pcps_8ms_acquisition_cc; -typedef boost::shared_ptr galileo_pcps_8ms_acquisition_cc_sptr; +using galileo_pcps_8ms_acquisition_cc_sptr = boost::shared_ptr; galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(uint32_t sampled_ms, diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc index d95bb24cb..8a806c80f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.cc @@ -317,7 +317,10 @@ void pcps_acquisition::init() d_num_doppler_bins = static_cast(std::ceil(static_cast(static_cast(acq_parameters.doppler_max) - static_cast(-acq_parameters.doppler_max)) / static_cast(d_doppler_step))); // Create the carrier Doppler wipeoff signals - if (d_grid_doppler_wipeoffs == nullptr) d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + if (d_grid_doppler_wipeoffs == nullptr) + { + d_grid_doppler_wipeoffs = new gr_complex*[d_num_doppler_bins]; + } if (acq_parameters.make_2_steps && (d_grid_doppler_wipeoffs_step_two == nullptr)) { d_grid_doppler_wipeoffs_step_two = new gr_complex*[d_num_doppler_bins_step2]; @@ -629,7 +632,10 @@ float pcps_acquisition::first_vs_second_peak_statistic(uint32_t& indext, int32_t { d_tmp_buffer[idx] = 0.0; idx++; - if (idx == static_cast(d_fft_size)) idx = 0; + if (idx == static_cast(d_fft_size)) + { + idx = 0; + } } while (idx != excludeRangeIndex2); @@ -842,7 +848,10 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count) if (d_num_noncoherent_integrations_counter == acq_parameters.max_dwells) { - if (d_state != 0) send_negative_acquisition(); + if (d_state != 0) + { + send_negative_acquisition(); + } d_state = 0; d_active = false; d_step_two = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h index c403b7d50..0447dd308 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition.h @@ -63,7 +63,7 @@ class pcps_acquisition; -typedef boost::shared_ptr pcps_acquisition_sptr; +using pcps_acquisition_sptr = boost::shared_ptr; pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index 51b821e36..db21bbc2b 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -32,7 +32,6 @@ #include "pcps_acquisition_fine_doppler_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_create_directory.h" #include "gps_sdr_signal_processing.h" #include @@ -314,7 +313,10 @@ double pcps_acquisition_fine_doppler_cc::compute_CAF() { d_grid_data[index_doppler][idx] = 0.0; idx++; - if (idx == static_cast(d_fft_size)) idx = 0; + if (idx == static_cast(d_fft_size)) + { + idx = 0; + } } while (idx != excludeRangeIndex2); diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index d92ed1db7..e414c6611 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -55,13 +55,13 @@ #include #include #include +#include #include #include class pcps_acquisition_fine_doppler_cc; -typedef boost::shared_ptr - pcps_acquisition_fine_doppler_cc_sptr; +using pcps_acquisition_fine_doppler_cc_sptr = boost::shared_ptr; pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf& conf_); @@ -87,7 +87,7 @@ private: bool start(); Acq_Conf acq_parameters; - long d_fs_in; + int64_t d_fs_in; int d_samples_per_ms; int d_max_dwells; int d_gnuradio_forecast_samples; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index b01652ec3..bf7184488 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -33,16 +33,16 @@ #include "pcps_assisted_acquisition_cc.h" #include "GPS_L1_CA.h" #include "concurrent_map.h" -#include "control_message_factory.h" #include "gps_acq_assist.h" #include #include #include #include +#include #include #include -extern concurrent_map global_gps_acq_assist_map; +extern Concurrent_Map global_gps_acq_assist_map; using google::LogMessage; @@ -132,9 +132,20 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc() volk_gnsssdr_free(d_fft_codes); delete d_ifft; delete d_fft_if; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } @@ -381,7 +392,10 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items, switch (d_state) { case 0: // S0. StandBy - if (d_active == true) d_state = 1; + if (d_active == true) + { + d_state = 1; + } d_sample_counter += static_cast(ninput_items[0]); // sample counter consume_each(ninput_items[0]); break; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index d582821c6..b27f920df 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -57,8 +57,7 @@ class pcps_assisted_acquisition_cc; -typedef boost::shared_ptr - pcps_assisted_acquisition_cc_sptr; +using pcps_assisted_acquisition_cc_sptr = boost::shared_ptr; pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 99841b5b6..17082ae25 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -36,11 +36,11 @@ #include "pcps_cccwsr_acquisition_cc.h" #include "GPS_L1_CA.h" // GPS_TWO_PI -#include "control_message_factory.h" #include #include #include #include +#include #include #include @@ -118,6 +118,7 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_channel = 0; } + pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() { if (d_num_doppler_bins > 0) @@ -140,12 +141,24 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc() delete d_ifft; delete d_fft_if; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } + void pcps_cccwsr_acquisition_cc::set_local_code(std::complex *code_data, std::complex *code_pilot) { @@ -166,6 +179,7 @@ void pcps_cccwsr_acquisition_cc::set_local_code(std::complex *code_data, volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size); } + void pcps_cccwsr_acquisition_cc::init() { d_gnss_synchro->Flag_valid_acquisition = false; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h index 85050cc21..b1edf0106 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.h @@ -47,7 +47,7 @@ class pcps_cccwsr_acquisition_cc; -typedef boost::shared_ptr pcps_cccwsr_acquisition_cc_sptr; +using pcps_cccwsr_acquisition_cc_sptr = boost::shared_ptr; pcps_cccwsr_acquisition_cc_sptr pcps_cccwsr_make_acquisition_cc( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc index 0944b9ed8..774022fb2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_opencl_acquisition_cc.cc @@ -50,7 +50,6 @@ #include "pcps_opencl_acquisition_cc.h" #include "GPS_L1_CA.h" //GPS_TWO_PI -#include "control_message_factory.h" #include "opencl/fft_base_kernels.h" #include "opencl/fft_internal.h" #include @@ -58,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -187,9 +187,20 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc() delete d_fft_if; } - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index 11c13a979..a55b352c9 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -30,12 +30,12 @@ #include "pcps_quicksync_acquisition_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include #include #include #include #include +#include #include #include @@ -159,11 +159,21 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc() delete d_corr_output_f; delete[] d_code_folded; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure& e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception& e) + { + std::cerr << e.what() << '\n'; } - // DLOG(INFO) << "END DESTROYER"; } @@ -208,7 +218,10 @@ void pcps_quicksync_acquisition_cc::init() d_mag = 0.0; d_input_power = 0.0; - if (d_doppler_step == 0) d_doppler_step = 250; + if (d_doppler_step == 0) + { + d_doppler_step = 250; + } // Count the number of bins d_num_doppler_bins = 0; @@ -535,7 +548,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "folding factor " << d_folding_factor; DLOG(INFO) << "possible delay correlation output"; - for (int32_t i = 0; i < static_cast(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + for (int32_t i = 0; i < static_cast(d_folding_factor); i++) + { + DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + } DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude folded " << d_mag; @@ -564,7 +580,10 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items, DLOG(INFO) << "test statistics threshold " << d_threshold; DLOG(INFO) << "folding factor " << d_folding_factor; DLOG(INFO) << "possible delay corr output"; - for (int32_t i = 0; i < static_cast(d_folding_factor); i++) DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + for (int32_t i = 0; i < static_cast(d_folding_factor); i++) + { + DLOG(INFO) << d_possible_delay[i] << "\t\t\t" << d_corr_output_f[i]; + } DLOG(INFO) << "code phase " << d_gnss_synchro->Acq_delay_samples; DLOG(INFO) << "doppler " << d_gnss_synchro->Acq_doppler_hz; DLOG(INFO) << "magnitude folded " << d_mag; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h index 1e8e07a05..cf24625a5 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.h @@ -63,8 +63,7 @@ class pcps_quicksync_acquisition_cc; -typedef boost::shared_ptr - pcps_quicksync_acquisition_cc_sptr; +using pcps_quicksync_acquisition_cc_sptr = boost::shared_ptr; pcps_quicksync_acquisition_cc_sptr pcps_quicksync_make_acquisition_cc( diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index dced14810..7fc685028 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -50,11 +50,11 @@ #include "pcps_tong_acquisition_cc.h" #include "GPS_L1_CA.h" // for GPS_TWO_PI -#include "control_message_factory.h" #include #include #include #include +#include #include #include @@ -76,6 +76,7 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename))); } + pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( uint32_t sampled_ms, uint32_t doppler_max, @@ -153,12 +154,24 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc() delete d_ifft; delete d_fft_if; - if (d_dump) + try { - d_dump_file.close(); + if (d_dump) + { + d_dump_file.close(); + } + } + catch (const std::ofstream::failure &e) + { + std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } + void pcps_tong_acquisition_cc::set_local_code(std::complex *code) { memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size); @@ -169,6 +182,7 @@ void pcps_tong_acquisition_cc::set_local_code(std::complex *code) volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); } + void pcps_tong_acquisition_cc::init() { d_gnss_synchro->Flag_valid_acquisition = false; @@ -213,6 +227,7 @@ void pcps_tong_acquisition_cc::init() } } + void pcps_tong_acquisition_cc::set_state(int32_t state) { d_state = state; @@ -245,6 +260,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state) } } + int pcps_tong_acquisition_cc::general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items __attribute__((unused))) diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index f4cb31068..e2443fa33 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -61,7 +61,7 @@ class pcps_tong_acquisition_cc; -typedef boost::shared_ptr pcps_tong_acquisition_cc_sptr; +using pcps_tong_acquisition_cc_sptr = boost::shared_ptr; pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc( diff --git a/src/algorithms/acquisition/libs/CMakeLists.txt b/src/algorithms/acquisition/libs/CMakeLists.txt index c3f368be6..4b8eefec8 100644 --- a/src/algorithms/acquisition/libs/CMakeLists.txt +++ b/src/algorithms/acquisition/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,17 +19,6 @@ if(ENABLE_FPGA) set(ACQUISITION_LIB_SOURCES fpga_acquisition.cc) set(ACQUISITION_LIB_HEADERS fpga_acquisition.h) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ) endif() set(ACQUISITION_LIB_HEADERS ${ACQUISITION_LIB_HEADERS} acq_conf.h) @@ -38,21 +27,34 @@ set(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} acq_conf.cc) list(SORT ACQUISITION_LIB_HEADERS) list(SORT ACQUISITION_LIB_SOURCES) -add_library(acquisition_lib +source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) + +add_library(acquisition_libs ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS} ) -source_group(Headers FILES ${ACQUISITION_LIB_HEADERS}) - -target_link_libraries(acquisition_lib - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} +target_link_libraries(acquisition_libs + PUBLIC + Volk::volk + Gnuradio::fft + PRIVATE + Gflags::gflags + Glog::glog + algorithms_libs + core_system_parameters ) -if(VOLKGNSSSDR_FOUND) - add_dependencies(acquisition_lib glog-${glog_RELEASE}) -else() - add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(acquisition_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET acquisition_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index 65591834c..7bf49e73d 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,19 +19,6 @@ set(CHANNEL_ADAPTER_SOURCES channel.cc) set(CHANNEL_ADAPTER_HEADERS channel.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES} ${CHANNEL_ADAPTER_HEADERS} @@ -40,8 +27,30 @@ add_library(channel_adapters source_group(Headers FILES ${CHANNEL_ADAPTER_HEADERS}) target_link_libraries(channel_adapters - channel_fsm - ${GNURADIO_RUNTIME_LIBRARIES} - ${Boost_LIBRARIES} - gnss_sdr_flags + PUBLIC + Gnuradio::runtime + channel_libs + PRIVATE + Gflags::gflags + Glog::glog + gnss_sdr_flags +) + +target_include_directories(channel_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET channel_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 946f17a65..12fafc3de 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -75,14 +75,23 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s // IMPORTANT: Do not change the order between set_doppler_step and set_threshold uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0); - if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); - if (FLAGS_doppler_step != 0) doppler_step = static_cast(FLAGS_doppler_step); + if (doppler_step == 0) + { + doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500); + } + if (FLAGS_doppler_step != 0) + { + doppler_step = static_cast(FLAGS_doppler_step); + } DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step; acq_->set_doppler_step(doppler_step); float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0); - if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); + if (threshold == 0.0) + { + threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0); + } acq_->set_threshold(threshold); diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 70bee59f9..c055123bc 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,23 +26,33 @@ set(CHANNEL_FSM_HEADERS channel_msg_receiver_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_SOURCES) -add_library(channel_fsm ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) source_group(Headers FILES ${CHANNEL_FSM_HEADERS}) -add_dependencies(channel_fsm glog-${glog_RELEASE}) -target_link_libraries(channel_fsm gnss_rx) +add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS}) + +target_link_libraries(channel_libs + PUBLIC + Gnuradio::runtime + core_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + core_receiver +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(channel_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET channel_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/channel/libs/channel_msg_receiver_cc.h b/src/algorithms/channel/libs/channel_msg_receiver_cc.h index 7fc172923..cc05892d8 100644 --- a/src/algorithms/channel/libs/channel_msg_receiver_cc.h +++ b/src/algorithms/channel/libs/channel_msg_receiver_cc.h @@ -36,7 +36,7 @@ class channel_msg_receiver_cc; -typedef boost::shared_ptr channel_msg_receiver_cc_sptr; +using channel_msg_receiver_cc_sptr = boost::shared_ptr; channel_msg_receiver_cc_sptr channel_msg_receiver_make_cc(std::shared_ptr channel_fsm, bool repeat); diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index 38d606824..6e0e68a45 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,21 +27,36 @@ set(COND_ADAPTER_HEADERS array_signal_conditioner.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT COND_ADAPTER_HEADERS) list(SORT COND_ADAPTER_SOURCES) -add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) source_group(Headers FILES ${COND_ADAPTER_HEADERS}) -add_dependencies(conditioner_adapters glog-${glog_RELEASE}) + +add_library(conditioner_adapters ${COND_ADAPTER_SOURCES} ${COND_ADAPTER_HEADERS}) + +target_link_libraries(conditioner_adapters + PUBLIC + Gnuradio::runtime + PRIVATE + Gflags::gflags + Glog::glog +) + +target_include_directories(conditioner_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(conditioner_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET conditioner_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index 1977f7a5a..a9042d832 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -35,30 +35,44 @@ set(DATATYPE_ADAPTER_HEADERS ishort_to_complex.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT DATATYPE_ADAPTER_HEADERS) list(SORT DATATYPE_ADAPTER_SOURCES) -add_library(datatype_adapters +source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) + +add_library(data_type_adapters ${DATATYPE_ADAPTER_SOURCES} ${DATATYPE_ADAPTER_HEADERS} ) -source_group(Headers FILES ${DATATYPE_ADAPTER_HEADERS}) -add_dependencies(datatype_adapters glog-${glog_RELEASE}) -target_link_libraries(datatype_adapters - data_type_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} +target_link_libraries(data_type_adapters + PUBLIC + Gnuradio::blocks + data_type_gr_blocks + algorithms_libs + core_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) + +target_include_directories(data_type_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(data_type_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET data_type_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index b4f429db9..9090d9c43 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -29,23 +29,26 @@ set(DATA_TYPE_GR_BLOCKS_HEADERS interleaved_byte_to_complex_short.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT DATA_TYPE_GR_BLOCKS_HEADERS) list(SORT DATA_TYPE_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) + add_library(data_type_gr_blocks ${DATA_TYPE_GR_BLOCKS_SOURCES} ${DATA_TYPE_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${DATA_TYPE_GR_BLOCKS_HEADERS}) - target_link_libraries(data_type_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} + PUBLIC + Gnuradio::runtime + Boost::boost + algorithms_libs + PRIVATE + Volk::volk +) + +set_property(TARGET data_type_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h index c9ce17b4a..437d60d4e 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_byte.h @@ -37,7 +37,7 @@ class interleaved_byte_to_complex_byte; -typedef boost::shared_ptr interleaved_byte_to_complex_byte_sptr; +using interleaved_byte_to_complex_byte_sptr = boost::shared_ptr; interleaved_byte_to_complex_byte_sptr make_interleaved_byte_to_complex_byte(); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h index 5eab0f314..0b0fbdf1b 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_byte_to_complex_short.h @@ -36,7 +36,7 @@ class interleaved_byte_to_complex_short; -typedef boost::shared_ptr interleaved_byte_to_complex_short_sptr; +using interleaved_byte_to_complex_short_sptr = boost::shared_ptr; interleaved_byte_to_complex_short_sptr make_interleaved_byte_to_complex_short(); diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h index 10287459a..e31b6ac98 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/interleaved_short_to_complex_short.h @@ -36,7 +36,7 @@ class interleaved_short_to_complex_short; -typedef boost::shared_ptr interleaved_short_to_complex_short_sptr; +using interleaved_short_to_complex_short_sptr = boost::shared_ptr; interleaved_short_to_complex_short_sptr make_interleaved_short_to_complex_short(); diff --git a/src/algorithms/input_filter/adapters/CMakeLists.txt b/src/algorithms/input_filter/adapters/CMakeLists.txt index 8153c6c3c..8459dea90 100644 --- a/src/algorithms/input_filter/adapters/CMakeLists.txt +++ b/src/algorithms/input_filter/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -34,36 +34,48 @@ set(INPUT_FILTER_ADAPTER_HEADERS notch_filter_lite.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - list(SORT INPUT_FILTER_ADAPTER_HEADERS) list(SORT INPUT_FILTER_ADAPTER_SOURCES) +source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) + add_library(input_filter_adapters ${INPUT_FILTER_ADAPTER_SOURCES} ${INPUT_FILTER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${INPUT_FILTER_ADAPTER_HEADERS}) -add_dependencies(input_filter_adapters glog-${glog_RELEASE} gnss_sp_libs) target_link_libraries(input_filter_adapters - input_filter_gr_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_sp_libs + PUBLIC + Gnuradio::blocks + Gnuradio::filter + input_filter_gr_blocks + algorithms_libs + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) + +target_include_directories(input_filter_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET input_filter_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.cc b/src/algorithms/input_filter/adapters/beamformer_filter.cc index 52c19352d..dae0d1386 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.cc +++ b/src/algorithms/input_filter/adapters/beamformer_filter.cc @@ -67,7 +67,7 @@ BeamformerFilter::BeamformerFilter( file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")"; } - samples_ = 0; + samples_ = 0ULL; if (in_stream_ > 8) { LOG(ERROR) << "This implementation only supports eight input streams"; diff --git a/src/algorithms/input_filter/adapters/beamformer_filter.h b/src/algorithms/input_filter/adapters/beamformer_filter.h index c97c32732..89df25223 100644 --- a/src/algorithms/input_filter/adapters/beamformer_filter.h +++ b/src/algorithms/input_filter/adapters/beamformer_filter.h @@ -34,6 +34,7 @@ #include "gnss_block_interface.h" #include +#include #include class ConfigurationInterface; @@ -78,7 +79,7 @@ private: unsigned int out_stream_; std::string item_type_; size_t item_size_; - unsigned long long samples_; + uint64_t samples_; bool dump_; std::string dump_filename_; gr::block_sptr beamformer_; diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index b436b1407..48dfb4871 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -299,11 +299,8 @@ gr::basic_block_sptr FirFilter::get_left_block() { return cshort_to_float_x2_; } - else - { - return nullptr; - LOG(ERROR) << " Unknown item type conversion"; - } + LOG(WARNING) << "Unknown item type conversion"; + return nullptr; } @@ -329,11 +326,8 @@ gr::basic_block_sptr FirFilter::get_right_block() { return float_to_complex_; } - else - { - return nullptr; - LOG(ERROR) << " unknown input filter item type"; - } + LOG(WARNING) << "Unknown input filter taps item type"; + return nullptr; } diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc index 9e904d2e8..17ab25dab 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.cc @@ -339,7 +339,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_left_block() { return gr_char_to_short_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte")) + if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte")) { return gr_char_to_short_; } @@ -373,7 +373,7 @@ gr::basic_block_sptr FreqXlatingFirFilter::get_right_block() { return freq_xlating_fir_filter_scf_; } - else if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte")) + if ((taps_item_type_ == "float") && (input_item_type_ == "byte") && (output_item_type_ == "cbyte")) { return complex_to_complex_byte_; } diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index 8a4aefc11..e45410533 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -31,31 +31,34 @@ set(INPUT_FILTER_GR_BLOCKS_HEADERS notch_lite_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} -) - list(SORT INPUT_FILTER_GR_BLOCKS_HEADERS) list(SORT INPUT_FILTER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) + add_library(input_filter_gr_blocks ${INPUT_FILTER_GR_BLOCKS_SOURCES} ${INPUT_FILTER_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${INPUT_FILTER_GR_BLOCKS_HEADERS}) - target_link_libraries(input_filter_gr_blocks - ${GNURADIO_FILTER_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${LOG4CPP_LIBRARIES}) + PUBLIC + Gnuradio::blocks + Gnuradio::filter + Volkgnsssdr::volkgnsssdr + PRIVATE + Log4cpp::log4cpp +) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(input_filter_gr_blocks volk_gnsssdr_module glog-${glog_RELEASE}) -else() - add_dependencies(input_filter_gr_blocks glog-${glog_RELEASE}) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(input_filter_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET input_filter_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h index 8236b11d3..6fc126272 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/beamformer.h +++ b/src/algorithms/input_filter/gnuradio_blocks/beamformer.h @@ -34,7 +34,7 @@ #include class beamformer; -typedef boost::shared_ptr beamformer_sptr; +using beamformer_sptr = boost::shared_ptr; beamformer_sptr make_beamformer(); diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc index 3a3c9f8a3..dee531eaf 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.cc @@ -30,13 +30,11 @@ #include "notch_cc.h" #include -#include #include #include #include #include -using google::LogMessage; notch_sptr make_notch_filter(float pfa, float p_c_factor, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset) diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h index ab8f3b693..186d1feb1 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_cc.h @@ -39,7 +39,7 @@ class Notch; -typedef boost::shared_ptr notch_sptr; +using notch_sptr = boost::shared_ptr; notch_sptr make_notch_filter(float pfa, float p_c_factor, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset); diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc index 03a3639db..d73b5cbb8 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.cc @@ -30,13 +30,11 @@ #include "notch_lite_cc.h" #include -#include #include #include #include #include -using google::LogMessage; notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff) { diff --git a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h index c312c2b98..111dd65b0 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/notch_lite_cc.h @@ -39,7 +39,7 @@ class NotchLite; -typedef boost::shared_ptr notch_lite_sptr; +using notch_lite_sptr = boost::shared_ptr; notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset, int32_t n_segments_coeff); diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc index 02c98fb5c..593339bc6 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.cc @@ -30,12 +30,10 @@ #include "pulse_blanking_cc.h" #include -#include #include #include #include -using google::LogMessage; pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset) diff --git a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h index 4d0f72f00..af5584463 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h +++ b/src/algorithms/input_filter/gnuradio_blocks/pulse_blanking_cc.h @@ -37,7 +37,7 @@ class pulse_blanking_cc; -typedef boost::shared_ptr pulse_blanking_cc_sptr; +using pulse_blanking_cc_sptr = boost::shared_ptr; pulse_blanking_cc_sptr make_pulse_blanking_cc(float pfa, int32_t length_, int32_t n_segments_est, int32_t n_segments_reset); diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 407e67c65..78878897b 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -22,7 +22,6 @@ set(GNSS_SPLIBS_SOURCES gps_l2c_signal.cc gps_l5_signal.cc galileo_e1_signal_processing.cc - gnss_sdr_valve.cc gnss_sdr_sample_counter.cc gnss_signal_processing.cc gps_sdr_signal_processing.cc @@ -41,13 +40,13 @@ set(GNSS_SPLIBS_SOURCES conjugate_ic.cc gnss_sdr_create_directory.cc geofunctions.cc + rtcm.cc ) set(GNSS_SPLIBS_HEADERS gps_l2c_signal.h gps_l5_signal.h galileo_e1_signal_processing.h - gnss_sdr_valve.h gnss_sdr_sample_counter.h gnss_signal_processing.h gps_sdr_signal_processing.h @@ -67,6 +66,7 @@ set(GNSS_SPLIBS_HEADERS gnss_sdr_create_directory.h gnss_circular_deque.h geofunctions.h + rtcm.h ) if(ENABLE_FPGA) @@ -90,20 +90,6 @@ if(OPENCL_FOUND) ) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) if(OPENCL_FOUND) include_directories(${OPENCL_INCLUDE_DIRS}) @@ -114,38 +100,94 @@ if(OPENCL_FOUND) endif() endif() -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") - list(SORT GNSS_SPLIBS_HEADERS) list(SORT GNSS_SPLIBS_SOURCES) -add_library(gnss_sp_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) source_group(Headers FILES ${GNSS_SPLIBS_HEADERS}) -target_link_libraries(gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_LIBRARIES} ${ORC_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GFlags_LIBS} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${OPT_LIBRARIES} - gnss_rx +add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS}) + +target_link_libraries(algorithms_libs + PUBLIC + Armadillo::armadillo + Boost::boost + Gflags::gflags + Gnuradio::runtime + Gnuradio::blocks + Volk::volk ${ORC_LIBRARIES} + Volkgnsssdr::volkgnsssdr + core_system_parameters + ${OPT_LIBRARIES} + PRIVATE + Boost::filesystem + Gflags::gflags + Glog::glog ) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(gnss_sp_libs volk_gnsssdr_module - armadillo-${armadillo_RELEASE}) -else() - add_dependencies(gnss_sp_libs armadillo-${armadillo_RELEASE}) +target_include_directories(algorithms_libs + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${CMAKE_SOURCE_DIR}/src/core/receiver +) + +target_compile_definitions(algorithms_libs + PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +set_property(TARGET algorithms_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) + +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(algorithms_libs + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() endif() -if(${GFLAGS_GREATER_20}) - add_definitions(-DGFLAGS_GREATER_2_0=1) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(algorithms_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() +############################################################################### + +source_group(Headers FILES gnss_sdr_flags.h) + add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) -source_group(Headers FILES gnss_sdr_flags.h) -target_link_libraries(gnss_sdr_flags ${GFlags_LIBS}) + +target_link_libraries(gnss_sdr_flags + PUBLIC + Gflags::gflags + PRIVATE + Boost::filesystem +) + +if(${GFLAGS_GREATER_20}) + target_compile_definitions(gnss_sdr_flags PRIVATE -DGFLAGS_GREATER_2_0=1) +endif() + +target_compile_definitions(gnss_sdr_flags + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss_sdr_flags + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET gnss_sdr_flags + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.cc b/src/algorithms/libs/beidou_b1i_signal_processing.cc index 47230943a..61e1ffa47 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.cc +++ b/src/algorithms/libs/beidou_b1i_signal_processing.cc @@ -7,7 +7,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -32,33 +32,35 @@ #include "beidou_b1i_signal_processing.h" -auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; +auto auxCeil = [](float x) { return static_cast(static_cast((x) + 1)); }; -void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift) { - const unsigned int _code_length = 2046; + const uint32_t _code_length = 2046; bool G1[_code_length]; bool G2[_code_length]; bool G1_register[11] = {false, true, false, true, false, true, false, true, false, true, false}; bool G2_register[11] = {false, true, false, true, false, true, false, true, false, true, false}; bool feedback1, feedback2; bool aux; - unsigned int lcv, lcv2; - unsigned int delay; - signed int prn_idx; + uint32_t lcv, lcv2; + uint32_t delay; + int32_t prn_idx; /* G2 Delays as defined in GPS-ISD-200D */ - const signed int delays[33] = {712 /*PRN1*/, 1581, 1414, 1550, 581, 771, 1311, 1043, 1549, 359, 710, 1579, 1548, 1103, 579, 769, 358, 709, 1411, 1547, + const int32_t delays[33] = {712 /*PRN1*/, 1581, 1414, 1550, 581, 771, 1311, 1043, 1549, 359, 710, 1579, 1548, 1103, 579, 769, 358, 709, 1411, 1547, 1102, 578, 357, 1577, 1410, 1546, 1101, 707, 1576, 1409, 1545, 354 /*PRN32*/, 705}; - const signed int phase1[37] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 10}; - const signed int phase2[37] = {3, 4, 5, 6, 8, 9, 10, 11, 7, 4, 5, 6, 8, 9, 10, 11, 5, 6, 8, 9, 10, 11, 6, 8, 9, 10, 11, 8, 9, 10, 11, 9, 10, 11, 10, 11, 11}; + const int32_t phase1[37] = {1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 10}; + const int32_t phase2[37] = {3, 4, 5, 6, 8, 9, 10, 11, 7, 4, 5, 6, 8, 9, 10, 11, 5, 6, 8, 9, 10, 11, 6, 8, 9, 10, 11, 8, 9, 10, 11, 9, 10, 11, 10, 11, 11}; // compute delay array index for given PRN number prn_idx = _prn - 1; /* A simple error check */ - if ((prn_idx < 0) || (prn_idx > 51)) - return; + if ((prn_idx < 0) || (prn_idx > 32)) + { + return; + } /*for (lcv = 0; lcv < 11; lcv++) { @@ -110,28 +112,28 @@ void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shi } -void beidou_b1i_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b1i_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift) { - unsigned int _code_length = 2046; - int b1i_code_int[_code_length]; + uint32_t _code_length = 2046; + int32_t b1i_code_int[_code_length]; beidou_b1i_code_gen_int(b1i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = static_cast(b1i_code_int[ii]); } } -void beidou_b1i_code_gen_complex(std::complex* _dest, signed int _prn, unsigned int _chip_shift) +void beidou_b1i_code_gen_complex(std::complex* _dest, int32_t _prn, uint32_t _chip_shift) { - unsigned int _code_length = 2046; - int b1i_code_int[_code_length]; + uint32_t _code_length = 2046; + int32_t b1i_code_int[_code_length]; beidou_b1i_code_gen_int(b1i_code_int, _prn, _chip_shift); - for (unsigned int ii = 0; ii < _code_length; ++ii) + for (uint32_t ii = 0; ii < _code_length; ++ii) { _dest[ii] = std::complex(static_cast(b1i_code_int[ii]), 0.0f); } @@ -141,26 +143,26 @@ void beidou_b1i_code_gen_complex(std::complex* _dest, signed int _prn, un /* * Generates complex GPS L1 C/A code for the desired SV ID and sampled to specific sampling frequency */ -void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift) +void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift) { // This function is based on the GNU software GPS for MATLAB in the Kay Borre book std::complex _code[2046]; - signed int _samplesPerCode, _codeValueIndex; + int32_t _samplesPerCode, _codeValueIndex; float _ts; float _tc; float aux; - const signed int _codeFreqBasis = 2046000; //Hz - const signed int _codeLength = 2046; + const int32_t _codeFreqBasis = 2046000; //Hz + const int32_t _codeLength = 2046; //--- Find number of samples per spreading code ---------------------------- - _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); + _samplesPerCode = static_cast(static_cast(_fs) / static_cast(_codeFreqBasis / _codeLength)); //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec _tc = 1.0 / static_cast(_codeFreqBasis); // C/A chip period in sec beidou_b1i_code_gen_complex(_code, _prn, _chip_shift); //generate C/A code 1 sample per chip - for (signed int i = 0; i < _samplesPerCode; i++) + for (int32_t i = 0; i < _samplesPerCode; i++) { //=== Digitizing ======================================================= diff --git a/src/algorithms/libs/beidou_b1i_signal_processing.h b/src/algorithms/libs/beidou_b1i_signal_processing.h index 4c03328f0..2e420eaae 100644 --- a/src/algorithms/libs/beidou_b1i_signal_processing.h +++ b/src/algorithms/libs/beidou_b1i_signal_processing.h @@ -7,7 +7,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -30,25 +30,26 @@ * ------------------------------------------------------------------------- */ -#ifndef BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ -#define BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ +#ifndef GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ +#define GNSS_SDR_BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ #include +#include #include -//!Generates int GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_int(int* _dest, signed int _prn, unsigned int _chip_shift); +//! Generates int32_t GPS L1 C/A code for the desired SV ID and code shift +void beidou_b1i_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift); -//!Generates float GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_float(float* _dest, signed int _prn, unsigned int _chip_shift); +//! Generates float GPS L1 C/A code for the desired SV ID and code shift +void beidou_b1i_code_gen_float(float* _dest, int32_t _prn, uint32_t _chip_shift); -//!Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency -void beidou_b1i_code_gen_complex(std::complex* _dest, signed int _prn, unsigned int _chip_shift); +//! Generates complex GPS L1 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency +void beidou_b1i_code_gen_complex(std::complex* _dest, int32_t _prn, uint32_t _chip_shift); //! Generates N complex GPS L1 C/A codes for the desired SV ID and code shift -void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift, unsigned int _ncodes); +void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift, uint32_t _ncodes); //! Generates complex GPS L1 C/A code for the desired SV ID and code shift -void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, unsigned int _prn, int _fs, unsigned int _chip_shift); +void beidou_b1i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _fs, uint32_t _chip_shift); #endif /* BEIDOU_B1I_SDR_SIGNAL_PROCESSING_H_ */ diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.h b/src/algorithms/libs/byte_x2_to_complex_byte.h index c7e49bc98..05db6cb2d 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.h +++ b/src/algorithms/libs/byte_x2_to_complex_byte.h @@ -37,7 +37,7 @@ class byte_x2_to_complex_byte; -typedef boost::shared_ptr byte_x2_to_complex_byte_sptr; +using byte_x2_to_complex_byte_sptr = boost::shared_ptr; byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); diff --git a/src/algorithms/libs/complex_byte_to_float_x2.h b/src/algorithms/libs/complex_byte_to_float_x2.h index 74c2e9c55..170cd6033 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.h +++ b/src/algorithms/libs/complex_byte_to_float_x2.h @@ -37,7 +37,7 @@ class complex_byte_to_float_x2; -typedef boost::shared_ptr complex_byte_to_float_x2_sptr; +using complex_byte_to_float_x2_sptr = boost::shared_ptr; complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); diff --git a/src/algorithms/libs/complex_float_to_complex_byte.h b/src/algorithms/libs/complex_float_to_complex_byte.h index 74eb0b5c3..f8368543e 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.h +++ b/src/algorithms/libs/complex_float_to_complex_byte.h @@ -36,7 +36,7 @@ class complex_float_to_complex_byte; -typedef boost::shared_ptr complex_float_to_complex_byte_sptr; +using complex_float_to_complex_byte_sptr = boost::shared_ptr; complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); diff --git a/src/algorithms/libs/conjugate_cc.h b/src/algorithms/libs/conjugate_cc.h index a04cd2410..56a3ece78 100644 --- a/src/algorithms/libs/conjugate_cc.h +++ b/src/algorithms/libs/conjugate_cc.h @@ -36,7 +36,7 @@ class conjugate_cc; -typedef boost::shared_ptr conjugate_cc_sptr; +using conjugate_cc_sptr = boost::shared_ptr; conjugate_cc_sptr make_conjugate_cc(); diff --git a/src/algorithms/libs/conjugate_ic.h b/src/algorithms/libs/conjugate_ic.h index 4b51f86da..4acc7af3a 100644 --- a/src/algorithms/libs/conjugate_ic.h +++ b/src/algorithms/libs/conjugate_ic.h @@ -36,7 +36,7 @@ class conjugate_ic; -typedef boost::shared_ptr conjugate_ic_sptr; +using conjugate_ic_sptr = boost::shared_ptr; conjugate_ic_sptr make_conjugate_ic(); diff --git a/src/algorithms/libs/conjugate_sc.h b/src/algorithms/libs/conjugate_sc.h index 019d16dcb..a26b39ad7 100644 --- a/src/algorithms/libs/conjugate_sc.h +++ b/src/algorithms/libs/conjugate_sc.h @@ -36,7 +36,7 @@ class conjugate_sc; -typedef boost::shared_ptr conjugate_sc_sptr; +using conjugate_sc_sptr = boost::shared_ptr; conjugate_sc_sptr make_conjugate_sc(); diff --git a/src/algorithms/libs/cshort_to_float_x2.h b/src/algorithms/libs/cshort_to_float_x2.h index 7a235e68a..87a5d89a7 100644 --- a/src/algorithms/libs/cshort_to_float_x2.h +++ b/src/algorithms/libs/cshort_to_float_x2.h @@ -37,7 +37,7 @@ class cshort_to_float_x2; -typedef boost::shared_ptr cshort_to_float_x2_sptr; +using cshort_to_float_x2_sptr = boost::shared_ptr; cshort_to_float_x2_sptr make_cshort_to_float_x2(); diff --git a/src/algorithms/libs/galileo_e1_signal_processing.cc b/src/algorithms/libs/galileo_e1_signal_processing.cc index 23a8d9a94..d3e92c804 100644 --- a/src/algorithms/libs/galileo_e1_signal_processing.cc +++ b/src/algorithms/libs/galileo_e1_signal_processing.cc @@ -51,7 +51,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn) if (_galileo_signal.rfind("1B") != std::string::npos && _galileo_signal.length() >= 2) { - for (char i : Galileo_E1_B_PRIMARY_CODE[prn]) + for (char i : GALILEO_E1_B_PRIMARY_CODE[prn]) { hex_to_binary_converter(&_dest[index], i); index += 4; @@ -59,7 +59,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn) } else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2) { - for (char i : Galileo_E1_C_PRIMARY_CODE[prn]) + for (char i : GALILEO_E1_C_PRIMARY_CODE[prn]) { hex_to_binary_converter(&_dest[index], i); index += 4; @@ -70,7 +70,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], int32_t _prn) void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { - const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; + const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); for (uint32_t i = 0; i < _length_in; i++) { @@ -88,7 +88,7 @@ void galileo_e1_sinboc_11_gen_int(int* _dest, const int* _prn, uint32_t _length_ void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_out) { - const uint32_t _length_in = Galileo_E1_B_CODE_LENGTH_CHIPS; + const uint32_t _length_in = GALILEO_E1_B_CODE_LENGTH_CHIPS; auto _period = static_cast(_length_out / _length_in); for (uint32_t i = 0; i < _length_in; i++) @@ -108,7 +108,7 @@ void galileo_e1_sinboc_61_gen_int(int* _dest, const int* _prn, uint32_t _length_ void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], uint32_t _prn) { std::string _galileo_signal = _Signal; - const auto _codeLength = static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS); + const auto _codeLength = static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS); int32_t primary_code_E1_chips[4092]; // _codeLength not accepted by Clang galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip for (uint32_t i = 0; i < _codeLength; i++) @@ -122,7 +122,7 @@ void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], uint32_t void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3]) { std::string _galileo_signal = _Signal; - const uint32_t _codeLength = 12 * Galileo_E1_B_CODE_LENGTH_CHIPS; + const uint32_t _codeLength = 12 * GALILEO_E1_B_CODE_LENGTH_CHIPS; const float alpha = sqrt(10.0 / 11.0); const float beta = sqrt(1.0 / 11.0); @@ -158,20 +158,20 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], // This function is based on the GNU software GPS for MATLAB in Kay Borre's book std::string _galileo_signal = _Signal; uint32_t _samplesPerCode; - const int32_t _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; // Hz - auto _codeLength = static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS); - auto* primary_code_E1_chips = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(int32_t), volk_gnsssdr_get_alignment())); + const int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_HZ; // Hz + auto _codeLength = static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS); + auto* primary_code_E1_chips = static_cast(volk_gnsssdr_malloc(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * sizeof(int32_t), volk_gnsssdr_get_alignment())); _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(_codeFreqBasis) / static_cast(_codeLength))); const int32_t _samplesPerChip = (_cboc == true) ? 12 : 2; - const uint32_t delay = ((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / Galileo_E1_B_CODE_LENGTH_CHIPS; + const uint32_t delay = ((static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) - _chip_shift) % static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * _samplesPerCode / GALILEO_E1_B_CODE_LENGTH_CHIPS; galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); // generate Galileo E1 code, 1 sample per chip float* _signal_E1; - _codeLength = _samplesPerChip * Galileo_E1_B_CODE_LENGTH_CHIPS; + _codeLength = _samplesPerChip * GALILEO_E1_B_CODE_LENGTH_CHIPS; _signal_E1 = new float[_codeLength]; if (_cboc == true) @@ -203,17 +203,17 @@ void galileo_e1_code_gen_float_sampled(float* _dest, char _Signal[3], if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag) { - auto* _signal_E1C_secondary = new float[static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode]; + auto* _signal_E1C_secondary = new float[static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH) * _samplesPerCode]; - for (uint32_t i = 0; i < static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); i++) + for (uint32_t i = 0; i < static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH); i++) { for (unsigned k = 0; k < _samplesPerCode; k++) { - _signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (Galileo_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f); + _signal_E1C_secondary[i * _samplesPerCode + k] = _signal_E1[k] * (GALILEO_E1_C_SECONDARY_CODE.at(i) == '0' ? 1.0f : -1.0f); } } - _samplesPerCode *= static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); + _samplesPerCode *= static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH); delete[] _signal_E1; _signal_E1 = _signal_E1C_secondary; @@ -234,13 +234,13 @@ void galileo_e1_code_gen_complex_sampled(std::complex* _dest, char _Signa bool _secondary_flag) { std::string _galileo_signal = _Signal; - const int32_t _codeFreqBasis = Galileo_E1_CODE_CHIP_RATE_HZ; // Hz + const int32_t _codeFreqBasis = GALILEO_E1_CODE_CHIP_RATE_HZ; // Hz auto _samplesPerCode = static_cast(static_cast(_fs) / - (static_cast(_codeFreqBasis) / static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS))); + (static_cast(_codeFreqBasis) / static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS))); if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2 && _secondary_flag) { - _samplesPerCode *= static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); + _samplesPerCode *= static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH); } auto* real_code = static_cast(volk_gnsssdr_malloc(_samplesPerCode * sizeof(float), volk_gnsssdr_get_alignment())); diff --git a/src/algorithms/libs/galileo_e5_signal_processing.cc b/src/algorithms/libs/galileo_e5_signal_processing.cc index baa91706f..dab7e1d77 100644 --- a/src/algorithms/libs/galileo_e5_signal_processing.cc +++ b/src/algorithms/libs/galileo_e5_signal_processing.cc @@ -48,9 +48,9 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _ } if (_Signal[0] == '5' && _Signal[1] == 'Q') { - for (size_t i = 0; i < Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1; i++) + for (size_t i = 0; i < GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1; i++) { - hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i)); + hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(i)); _dest[index] = std::complex(0.0, float(a[0])); _dest[index + 1] = std::complex(0.0, float(a[1])); _dest[index + 2] = std::complex(0.0, float(a[2])); @@ -58,15 +58,15 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _ index = index + 4; } // last 2 bits are filled up zeros - hex_to_binary_converter(a, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1)); + hex_to_binary_converter(a, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1)); _dest[index] = std::complex(float(0.0), a[0]); _dest[index + 1] = std::complex(float(0.0), a[1]); } else if (_Signal[0] == '5' && _Signal[1] == 'I') { - for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++) + for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1; i++) { - hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i)); + hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(i)); _dest[index] = std::complex(float(a[0]), 0.0); _dest[index + 1] = std::complex(float(a[1]), 0.0); _dest[index + 2] = std::complex(float(a[2]), 0.0); @@ -74,17 +74,17 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _ index = index + 4; } // last 2 bits are filled up zeros - hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1)); + hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1)); _dest[index] = std::complex(float(a[0]), 0.0); _dest[index + 1] = std::complex(float(a[1]), 0.0); } else if (_Signal[0] == '5' && _Signal[1] == 'X') { int32_t b[4]; - for (size_t i = 0; i < Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1; i++) + for (size_t i = 0; i < GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1; i++) { - hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(i)); - hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(i)); + hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(i)); + hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(i)); _dest[index] = std::complex(float(a[0]), float(b[0])); _dest[index + 1] = std::complex(float(a[1]), float(b[1])); _dest[index + 2] = std::complex(float(a[2]), float(b[2])); @@ -92,8 +92,8 @@ void galileo_e5_a_code_gen_complex_primary(std::complex* _dest, int32_t _ index = index + 4; } // last 2 bits are filled up zeros - hex_to_binary_converter(a, Galileo_E5a_I_PRIMARY_CODE[prn].at(Galileo_E5a_I_PRIMARY_CODE[prn].length() - 1)); - hex_to_binary_converter(b, Galileo_E5a_Q_PRIMARY_CODE[prn].at(Galileo_E5a_Q_PRIMARY_CODE[prn].length() - 1)); + hex_to_binary_converter(a, GALILEO_E5A_I_PRIMARY_CODE[prn].at(GALILEO_E5A_I_PRIMARY_CODE[prn].length() - 1)); + hex_to_binary_converter(b, GALILEO_E5A_Q_PRIMARY_CODE[prn].at(GALILEO_E5A_Q_PRIMARY_CODE[prn].length() - 1)); _dest[index] = std::complex(float(a[0]), float(b[0])); _dest[index + 1] = std::complex(float(a[1]), float(b[1])); } @@ -105,8 +105,8 @@ void galileo_e5_a_code_gen_complex_sampled(std::complex* _dest, char _Sig { uint32_t _samplesPerCode; uint32_t delay; - const uint32_t _codeLength = Galileo_E5a_CODE_LENGTH_CHIPS; - const int32_t _codeFreqBasis = Galileo_E5a_CODE_CHIP_RATE_HZ; + const uint32_t _codeLength = GALILEO_E5A_CODE_LENGTH_CHIPS; + const int32_t _codeFreqBasis = GALILEO_E5A_CODE_CHIP_RATE_HZ; auto* _code = new std::complex[_codeLength](); diff --git a/src/algorithms/libs/geofunctions.cc b/src/algorithms/libs/geofunctions.cc index bf67e07f8..48137050b 100644 --- a/src/algorithms/libs/geofunctions.cc +++ b/src/algorithms/libs/geofunctions.cc @@ -304,8 +304,14 @@ arma::vec CTM_to_Euler(const arma::mat &C) arma::mat CTM(C); arma::vec eul = arma::zeros(3, 1); eul(0) = atan2(CTM(1, 2), CTM(2, 2)); // roll - if (CTM(0, 2) < -1.0) CTM(0, 2) = -1.0; - if (CTM(0, 2) > 1.0) CTM(0, 2) = 1.0; + if (CTM(0, 2) < -1.0) + { + CTM(0, 2) = -1.0; + } + if (CTM(0, 2) > 1.0) + { + CTM(0, 2) = 1.0; + } eul(1) = -asin(CTM(0, 2)); // pitch eul(2) = atan2(CTM(0, 1), CTM(0, 0)); // yaw return eul; @@ -614,7 +620,10 @@ void cart2utm(const arma::vec &r_eb_e, int zone, arma::vec &r_enu) // Ellipsoidal latitude, longitude to spherical latitude, longitude bool neg_geo = false; - if (B < 0.0) neg_geo = true; + if (B < 0.0) + { + neg_geo = true; + } double Bg_r = fabs(B); double res_clensin = clsin(bg, 4, 2.0 * Bg_r); @@ -732,10 +741,14 @@ int findUtmZone(double latitude_deg, double longitude_deg) // Check value bounds if ((longitude_deg > 180.0) || (longitude_deg < -180.0)) - std::cout << "Longitude value exceeds limits (-180:180).\n"; + { + std::cout << "Longitude value exceeds limits (-180:180).\n"; + } if ((latitude_deg > 84.0) || (latitude_deg < -80.0)) - std::cout << "Latitude value exceeds limits (-80:84).\n"; + { + std::cout << "Latitude value exceeds limits (-80:84).\n"; + } // // Find zone @@ -769,7 +782,9 @@ int findUtmZone(double latitude_deg, double longitude_deg) { // Correction for zone 32 if ((longitude_deg >= 3.0) && (longitude_deg < 12.0)) - utmZone = 32; + { + utmZone = 32; + } } return utmZone; } diff --git a/src/algorithms/libs/geofunctions.h b/src/algorithms/libs/geofunctions.h index 677dc4a1d..6ab773504 100644 --- a/src/algorithms/libs/geofunctions.h +++ b/src/algorithms/libs/geofunctions.h @@ -102,7 +102,7 @@ double radtodeg(double angleInRadians); double mstoknotsh(double MetersPerSeconds); -double mstokph(double Kph); +double mstokph(double MetersPerSeconds); arma::vec CTM_to_Euler(const arma::mat &C); diff --git a/src/algorithms/libs/gnss_sdr_flags.cc b/src/algorithms/libs/gnss_sdr_flags.cc index 3eba67822..e44812281 100644 --- a/src/algorithms/libs/gnss_sdr_flags.cc +++ b/src/algorithms/libs/gnss_sdr_flags.cc @@ -69,8 +69,10 @@ DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, static bool ValidateC(const char* flagname, const std::string& value) { - if (boost::filesystem::exists(value) or value == "-") // value is ok - return true; + if (boost::filesystem::exists(value) or value == "-") + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -78,8 +80,10 @@ static bool ValidateC(const char* flagname, const std::string& value) static bool ValidateConfigFile(const char* flagname, const std::string& value) { - if (boost::filesystem::exists(value) or value == std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) // value is ok - return true; + if (boost::filesystem::exists(value) or value == std::string(GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/default.conf")) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -87,8 +91,10 @@ static bool ValidateConfigFile(const char* flagname, const std::string& value) static bool ValidateS(const char* flagname, const std::string& value) { - if (boost::filesystem::exists(value) or value == "-") // value is ok - return true; + if (boost::filesystem::exists(value) or value == "-") + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -96,8 +102,10 @@ static bool ValidateS(const char* flagname, const std::string& value) static bool ValidateSignalSource(const char* flagname, const std::string& value) { - if (boost::filesystem::exists(value) or value == "-") // value is ok - return true; + if (boost::filesystem::exists(value) or value == "-") + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ". The file '" << value << "' does not exist." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -106,8 +114,10 @@ static bool ValidateSignalSource(const char* flagname, const std::string& value) static bool ValidateDopplerMax(const char* flagname, int32_t value) { const int32_t max_value = 1000000; - if (value >= 0 && value < max_value) // value is ok - return true; + if (value >= 0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -116,8 +126,10 @@ static bool ValidateDopplerMax(const char* flagname, int32_t value) static bool ValidateDopplerStep(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value >= 0 && value < max_value) // value is ok - return true; + if (value >= 0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -126,8 +138,10 @@ static bool ValidateDopplerStep(const char* flagname, int32_t value) static bool ValidateCn0Samples(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value > 0 && value < max_value) // value is ok - return true; + if (value > 0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " samples." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -136,8 +150,10 @@ static bool ValidateCn0Samples(const char* flagname, int32_t value) static bool ValidateCn0Min(const char* flagname, int32_t value) { const int32_t max_value = 100; - if (value > 0 && value < max_value) // value is ok - return true; + if (value > 0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " dB-Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -146,8 +162,10 @@ static bool ValidateCn0Min(const char* flagname, int32_t value) static bool ValidateMaxLockFail(const char* flagname, int32_t value) { const int32_t max_value = 10000; - if (value > 0 && value < max_value) // value is ok - return true; + if (value > 0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " fails." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -156,8 +174,10 @@ static bool ValidateMaxLockFail(const char* flagname, int32_t value) static bool ValidateCarrierLockTh(const char* flagname, double value) { const double max_value = 1.508; - if (value > 0.0 && value < max_value) // value is ok - return true; + if (value > 0.0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " rad." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -166,8 +186,10 @@ static bool ValidateCarrierLockTh(const char* flagname, double value) static bool ValidateDllBw(const char* flagname, double value) { const double max_value = 10000.0; - if (value >= 0.0 && value < max_value) // value is ok - return true; + if (value >= 0.0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; @@ -176,8 +198,10 @@ static bool ValidateDllBw(const char* flagname, double value) static bool ValidatePllBw(const char* flagname, double value) { const double max_value = 10000.0; - if (value >= 0.0 && value < max_value) // value is ok - return true; + if (value >= 0.0 && value < max_value) + { // value is ok + return true; + } std::cout << "Invalid value for flag -" << flagname << ": " << value << ". Allowed range is 0 < " << flagname << " < " << max_value << " Hz." << std::endl; std::cout << "GNSS-SDR program ended." << std::endl; return false; diff --git a/src/algorithms/libs/gnss_sdr_sample_counter.h b/src/algorithms/libs/gnss_sdr_sample_counter.h index 8a645d9f3..ed065b193 100644 --- a/src/algorithms/libs/gnss_sdr_sample_counter.h +++ b/src/algorithms/libs/gnss_sdr_sample_counter.h @@ -38,7 +38,7 @@ class gnss_sdr_sample_counter; -typedef boost::shared_ptr gnss_sdr_sample_counter_sptr; +using gnss_sdr_sample_counter_sptr = boost::shared_ptr; gnss_sdr_sample_counter_sptr gnss_sdr_make_sample_counter( double _fs, diff --git a/src/algorithms/libs/gps_l2c_signal.cc b/src/algorithms/libs/gps_l2c_signal.cc index b3b20be20..d8995a1f2 100644 --- a/src/algorithms/libs/gps_l2c_signal.cc +++ b/src/algorithms/libs/gps_l2c_signal.cc @@ -119,7 +119,7 @@ void gps_l2c_m_code_gen_complex_sampled(std::complex* _dest, uint32_t _pr //--- Make index array to read L2C code values ------------------------- //TODO: Check this formula! Seems to start with an extra sample - _codeValueIndex = ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; + _codeValueIndex = std::ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; //aux = (_ts * (i + 1)) / _tc; //_codeValueIndex = static_cast(static_cast(aux)) - 1; diff --git a/src/algorithms/libs/gps_l5_signal.cc b/src/algorithms/libs/gps_l5_signal.cc index 198aa27af..c1f234506 100644 --- a/src/algorithms/libs/gps_l5_signal.cc +++ b/src/algorithms/libs/gps_l5_signal.cc @@ -81,9 +81,9 @@ std::deque l5q_xb_shift(std::deque xb) std::deque make_l5i_xa() { std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); + std::deque y(GPS_L5I_CODE_LENGTH_CHIPS, false); - for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++) { y[i] = xa[12]; xa = l5i_xa_shift(xa); @@ -95,9 +95,9 @@ std::deque make_l5i_xa() std::deque make_l5i_xb() { std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; - std::deque y(GPS_L5i_CODE_LENGTH_CHIPS, false); + std::deque y(GPS_L5I_CODE_LENGTH_CHIPS, false); - for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++) { y[i] = xb[12]; xb = l5i_xb_shift(xb); @@ -109,9 +109,9 @@ std::deque make_l5i_xb() std::deque make_l5q_xa() { std::deque xa = {true, true, true, true, true, true, true, true, true, true, true, true, true}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); + std::deque y(GPS_L5Q_CODE_LENGTH_CHIPS, false); - for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++) { y[i] = xa[12]; xa = l5q_xa_shift(xa); @@ -123,9 +123,9 @@ std::deque make_l5q_xa() std::deque make_l5q_xb() { std::deque xb = {true, true, true, true, true, true, true, true, true, true, true, true, true}; - std::deque y(GPS_L5q_CODE_LENGTH_CHIPS, false); + std::deque y(GPS_L5Q_CODE_LENGTH_CHIPS, false); - for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++) { y[i] = xb[12]; xb = l5q_xb_shift(xb); @@ -136,18 +136,18 @@ std::deque make_l5q_xb() void make_l5i(int32_t* _dest, int32_t prn) { - int32_t xb_offset = GPS_L5i_INIT_REG[prn]; + int32_t xb_offset = GPS_L5I_INIT_REG[prn]; std::deque xb = make_l5i_xb(); std::deque xa = make_l5i_xa(); - std::deque xb_shift(GPS_L5i_CODE_LENGTH_CHIPS, false); + std::deque xb_shift(GPS_L5I_CODE_LENGTH_CHIPS, false); - for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) + for (int32_t n = 0; n < GPS_L5I_CODE_LENGTH_CHIPS; n++) { - xb_shift[n] = xb[(xb_offset + n) % GPS_L5i_CODE_LENGTH_CHIPS]; + xb_shift[n] = xb[(xb_offset + n) % GPS_L5I_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5i_CODE_LENGTH_CHIPS, false); - for (int32_t n = 0; n < GPS_L5i_CODE_LENGTH_CHIPS; n++) + std::deque out_code(GPS_L5I_CODE_LENGTH_CHIPS, false); + for (int32_t n = 0; n < GPS_L5I_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; } @@ -156,18 +156,18 @@ void make_l5i(int32_t* _dest, int32_t prn) void make_l5q(int32_t* _dest, int32_t prn) { - int32_t xb_offset = GPS_L5q_INIT_REG[prn]; + int32_t xb_offset = GPS_L5Q_INIT_REG[prn]; std::deque xb = make_l5q_xb(); std::deque xa = make_l5q_xa(); - std::deque xb_shift(GPS_L5q_CODE_LENGTH_CHIPS, false); + std::deque xb_shift(GPS_L5Q_CODE_LENGTH_CHIPS, false); - for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) + for (int32_t n = 0; n < GPS_L5Q_CODE_LENGTH_CHIPS; n++) { - xb_shift[n] = xb[(xb_offset + n) % GPS_L5q_CODE_LENGTH_CHIPS]; + xb_shift[n] = xb[(xb_offset + n) % GPS_L5Q_CODE_LENGTH_CHIPS]; } - std::deque out_code(GPS_L5q_CODE_LENGTH_CHIPS, false); - for (int32_t n = 0; n < GPS_L5q_CODE_LENGTH_CHIPS; n++) + std::deque out_code(GPS_L5Q_CODE_LENGTH_CHIPS, false); + for (int32_t n = 0; n < GPS_L5Q_CODE_LENGTH_CHIPS; n++) { _dest[n] = xa[n] xor xb_shift[n]; } @@ -176,14 +176,14 @@ void make_l5q(int32_t* _dest, int32_t prn) void gps_l5i_code_gen_complex(std::complex* _dest, uint32_t _prn) { - auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5i(_code, _prn - 1); } - for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++) { _dest[i] = std::complex(1.0 - 2.0 * _code[i], 0.0); } @@ -194,14 +194,14 @@ void gps_l5i_code_gen_complex(std::complex* _dest, uint32_t _prn) void gps_l5i_code_gen_float(float* _dest, uint32_t _prn) { - auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5i(_code, _prn - 1); } - for (int32_t i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5I_CODE_LENGTH_CHIPS; i++) { _dest[i] = 1.0 - 2.0 * static_cast(_code[i]); } @@ -215,7 +215,7 @@ void gps_l5i_code_gen_float(float* _dest, uint32_t _prn) */ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _fs) { - auto* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5I_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5i(_code, _prn - 1); @@ -224,14 +224,14 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _samplesPerCode, _codeValueIndex; float _ts; float _tc; - const int32_t _codeLength = GPS_L5i_CODE_LENGTH_CHIPS; + const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS; //--- Find number of samples per spreading code ---------------------------- - _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(_codeLength))); + _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5I_CODE_RATE_HZ) / static_cast(_codeLength))); //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(GPS_L5i_CODE_RATE_HZ); // C/A chip period in sec + _tc = 1.0 / static_cast(GPS_L5I_CODE_RATE_HZ); // C/A chip period in sec //float aux; for (int32_t i = 0; i < _samplesPerCode; i++) @@ -240,7 +240,7 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, //--- Make index array to read L5 code values ------------------------- //TODO: Check this formula! Seems to start with an extra sample - _codeValueIndex = ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; + _codeValueIndex = std::ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; //aux = (_ts * (i + 1)) / _tc; //_codeValueIndex = static_cast (static_cast(aux)) - 1; @@ -261,14 +261,14 @@ void gps_l5i_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, void gps_l5q_code_gen_complex(std::complex* _dest, uint32_t _prn) { - auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5q(_code, _prn - 1); } - for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++) { _dest[i] = std::complex(1.0 - 2.0 * _code[i], 0.0); } @@ -279,14 +279,14 @@ void gps_l5q_code_gen_complex(std::complex* _dest, uint32_t _prn) void gps_l5q_code_gen_float(float* _dest, uint32_t _prn) { - auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5q(_code, _prn - 1); } - for (int32_t i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++) + for (int32_t i = 0; i < GPS_L5Q_CODE_LENGTH_CHIPS; i++) { _dest[i] = 1.0 - 2.0 * static_cast(_code[i]); } @@ -300,7 +300,7 @@ void gps_l5q_code_gen_float(float* _dest, uint32_t _prn) */ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _fs) { - auto* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS]; + auto* _code = new int32_t[GPS_L5Q_CODE_LENGTH_CHIPS]; if (_prn > 0 and _prn < 51) { make_l5q(_code, _prn - 1); @@ -309,14 +309,14 @@ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, int32_t _samplesPerCode, _codeValueIndex; float _ts; float _tc; - const int32_t _codeLength = GPS_L5q_CODE_LENGTH_CHIPS; + const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS; //--- Find number of samples per spreading code ---------------------------- - _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5q_CODE_RATE_HZ) / static_cast(_codeLength))); + _samplesPerCode = static_cast(static_cast(_fs) / (static_cast(GPS_L5Q_CODE_RATE_HZ) / static_cast(_codeLength))); //--- Find time constants -------------------------------------------------- _ts = 1.0 / static_cast(_fs); // Sampling period in sec - _tc = 1.0 / static_cast(GPS_L5q_CODE_RATE_HZ); // C/A chip period in sec + _tc = 1.0 / static_cast(GPS_L5Q_CODE_RATE_HZ); // C/A chip period in sec //float aux; for (int32_t i = 0; i < _samplesPerCode; i++) @@ -325,7 +325,7 @@ void gps_l5q_code_gen_complex_sampled(std::complex* _dest, uint32_t _prn, //--- Make index array to read L5 code values ------------------------- //TODO: Check this formula! Seems to start with an extra sample - _codeValueIndex = ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; + _codeValueIndex = std::ceil((_ts * (static_cast(i) + 1)) / _tc) - 1; //aux = (_ts * (i + 1)) / _tc; //_codeValueIndex = static_cast (static_cast(aux)) - 1; diff --git a/src/algorithms/libs/gps_sdr_signal_processing.cc b/src/algorithms/libs/gps_sdr_signal_processing.cc index e87593f6e..945be5607 100644 --- a/src/algorithms/libs/gps_sdr_signal_processing.cc +++ b/src/algorithms/libs/gps_sdr_signal_processing.cc @@ -64,7 +64,9 @@ void gps_l1_ca_code_gen_int(int32_t* _dest, int32_t _prn, uint32_t _chip_shift) /* A simple error check */ if ((prn_idx < 0) || (prn_idx > 51)) - return; + { + return; + } for (lcv = 0; lcv < 10; lcv++) { diff --git a/src/core/system_parameters/rtcm.cc b/src/algorithms/libs/rtcm.cc similarity index 93% rename from src/core/system_parameters/rtcm.cc rename to src/algorithms/libs/rtcm.cc index 31640ce0a..43915ee3b 100644 --- a/src/core/system_parameters/rtcm.cc +++ b/src/algorithms/libs/rtcm.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include // for std::reverse #include // std::chrono::seconds #include // for std::fmod @@ -51,7 +50,7 @@ Rtcm::Rtcm(uint16_t port) RTCM_port = port; preamble = std::bitset<8>("11010011"); reserved_field = std::bitset<6>("000000"); - rtcm_message_queue = std::make_shared >(); + rtcm_message_queue = std::make_shared >(); boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), RTCM_port); servers.emplace_back(io_context, endpoint); server_is_running = false; @@ -186,7 +185,7 @@ bool Rtcm::check_CRC(const std::string& message) const std::string Rtcm::bin_to_binary_data(const std::string& s) const { std::string s_aux; - int32_t remainder = static_cast(std::fmod(s.length(), 8)); + auto remainder = static_cast(std::fmod(s.length(), 8)); std::vector c; c.reserve(s.length()); @@ -239,7 +238,7 @@ std::string Rtcm::bin_to_hex(const std::string& s) const { std::string s_aux; std::stringstream ss; - int32_t remainder = static_cast(std::fmod(s.length(), 4)); + auto remainder = static_cast(std::fmod(s.length(), 4)); if (remainder != 0) { @@ -345,8 +344,14 @@ int32_t Rtcm::bin_to_sint(const std::string& s) const // Find the sign for glonass data fields (neg = 1, pos = 0) static inline uint64_t glo_sgn(double val) { - if (val < 0) return 1; // If value is negative return 1 - if (val == 0) return 0; // Positive or equal to zero return 0 + if (val < 0) + { + return 1; // If value is negative return 1 + } + if (val == 0) + { + return 0; // Positive or equal to zero return 0 + } return 0; } @@ -439,7 +444,7 @@ std::bitset<64> Rtcm::get_MT1001_4_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -501,7 +506,7 @@ std::string Rtcm::print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -550,7 +555,7 @@ std::string Rtcm::print_MT1002(const Gps_Ephemeris& gps_eph, double obs_time, co { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -623,11 +628,11 @@ std::string Rtcm::print_MT1003(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -732,11 +737,11 @@ std::string Rtcm::print_MT1004(const Gps_Ephemeris& ephL1, const Gps_CNAV_Epheme { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("G") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "G") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("G") == 0) && (sig_.compare("2S") == 0)) + if ((system_ == "G") && (sig_ == "2S")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1066,9 +1071,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF029 = std::bitset<8>(len); std::string DF030_str_; - for (auto it = ant_descriptor.cbegin(); it != ant_descriptor.cend(); it++) + for (char c : ant_descriptor) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF030_str_ += character.to_string(); } @@ -1085,9 +1089,8 @@ std::string Rtcm::print_MT1008(uint32_t ref_id, const std::string& antenna_descr DF032 = std::bitset<8>(len2); std::string DF033_str_; - for (auto it = ant_sn.cbegin(); it != ant_sn.cend(); it++) + for (char c : ant_sn) { - char c = *it; std::bitset<8> character = std::bitset<8>(c); DF033_str_ += character.to_string(); } @@ -1118,7 +1121,7 @@ std::bitset<61> Rtcm::get_MT1009_12_header(uint32_t msg_number, double obs_time, uint32_t ref_id, uint32_t smooth_int, bool sync_flag, bool divergence_free) { uint32_t reference_station_id = ref_id; // Max: 4095 - const std::map observables_ = observables; + const std::map& observables_ = observables; bool synchronous_GNSS_flag = sync_flag; bool divergence_free_smoothing_indicator = divergence_free; uint32_t smoothing_interval = smooth_int; @@ -1182,7 +1185,7 @@ std::string Rtcm::print_MT1009(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1231,7 +1234,7 @@ std::string Rtcm::print_MT1010(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, d { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1308,11 +1311,11 @@ std::string Rtcm::print_MT1011(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -1419,11 +1422,11 @@ std::string Rtcm::print_MT1012(const Glonass_Gnav_Ephemeris& ephL1, const Glonas { std::string system_(&observables_iter->second.System, 1); std::string sig_(observables_iter->second.Signal); - if ((system_.compare("R") == 0) && (sig_.compare("1C") == 0)) + if ((system_ == "R") && (sig_ == "1C")) { observablesL1.insert(std::pair(observables_iter->first, observables_iter->second)); } - if ((system_.compare("R") == 0) && (sig_.compare("2C") == 0)) + if ((system_ == "R") && (sig_ == "2C")) { observablesL2.insert(std::pair(observables_iter->first, observables_iter->second)); } @@ -2013,9 +2016,8 @@ std::string Rtcm::print_MT1029(uint32_t ref_id, const Gps_Ephemeris& gps_eph, do uint32_t i = 0; bool first = true; std::string text_binary; - for (auto it = message.cbegin(); it != message.cend(); it++) + for (char c : message) { - char c = *it; if (isgraph(c)) { i++; @@ -2195,64 +2197,64 @@ int32_t Rtcm::read_MT1045(const std::string& message, Galileo_Ephemeris& gal_eph gal_eph.SISA_3 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 8))); index += 8; - gal_eph.iDot_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 14))) * iDot_2_LSB; + gal_eph.iDot_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 14))) * I_DOT_2_LSB; index += 14; - gal_eph.t0c_4 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * t0c_4_LSB; + gal_eph.t0c_4 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0C_4_LSB; index += 14; - gal_eph.af2_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 6))) * af2_4_LSB; + gal_eph.af2_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 6))) * AF2_4_LSB; index += 6; - gal_eph.af1_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 21))) * af1_4_LSB; + gal_eph.af1_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 21))) * AF1_4_LSB; index += 21; - gal_eph.af0_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 31))) * af0_4_LSB; + gal_eph.af0_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 31))) * AF0_4_LSB; index += 31; - gal_eph.C_rs_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_rs_3_LSB; + gal_eph.C_rs_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RS_3_LSB; index += 16; - gal_eph.delta_n_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * delta_n_3_LSB; + gal_eph.delta_n_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * DELTA_N_3_LSB; index += 16; gal_eph.M0_1 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * M0_1_LSB; index += 32; - gal_eph.C_uc_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_uc_3_LSB; + gal_eph.C_uc_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_UC_3_LSB; index += 16; - gal_eph.e_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * e_1_LSB; + gal_eph.e_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * E_1_LSB; index += 32; - gal_eph.C_us_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_us_3_LSB; + gal_eph.C_us_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_US_3_LSB; index += 16; - gal_eph.A_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_gal; + gal_eph.A_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 32))) * A_1_LSB_GAL; index += 32; - gal_eph.t0e_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * t0e_1_LSB; + gal_eph.t0e_1 = static_cast(Rtcm::bin_to_uint(message_bin.substr(index, 14))) * T0E_1_LSB; index += 14; - gal_eph.C_ic_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_ic_4_LSB; + gal_eph.C_ic_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IC_4_LSB; index += 16; gal_eph.OMEGA_0_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_0_2_LSB; index += 32; - gal_eph.C_is_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_is_4_LSB; + gal_eph.C_is_4 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_IS_4_LSB; index += 16; - gal_eph.i_0_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * i_0_2_LSB; + gal_eph.i_0_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * I_0_2_LSB; index += 32; - gal_eph.C_rc_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_rc_3_LSB; + gal_eph.C_rc_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 16))) * C_RC_3_LSB; index += 16; - gal_eph.omega_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * omega_2_LSB; + gal_eph.omega_2 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 32))) * OMEGA_2_LSB; index += 32; - gal_eph.OMEGA_dot_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_dot_3_LSB; + gal_eph.OMEGA_dot_3 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 24))) * OMEGA_DOT_3_LSB; index += 24; gal_eph.BGD_E1E5a_5 = static_cast(Rtcm::bin_to_int(message_bin.substr(index, 10))); @@ -2287,10 +2289,22 @@ std::string Rtcm::print_MSM_1(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1071; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1071; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1081; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1091; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1071; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1071; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1081; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1091; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -2337,7 +2351,7 @@ std::string Rtcm::get_MSM_header(uint32_t msg_number, bool more_messages) { // Find first element in observables block and define type of message - std::map::const_iterator observables_iter = observables.begin(); + auto observables_iter = observables.begin(); std::string sys(observables_iter->second.System, 1); Rtcm::set_DF002(msg_number); @@ -2470,10 +2484,22 @@ std::string Rtcm::print_MSM_2(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1072; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1072; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1082; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1092; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1072; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1072; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1082; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1092; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -2571,10 +2597,22 @@ std::string Rtcm::print_MSM_3(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1073; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1073; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1083; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1093; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1073; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1073; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1083; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1093; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -2675,10 +2713,22 @@ std::string Rtcm::print_MSM_4(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1074; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1074; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1084; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1094; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1074; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1074; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1084; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1094; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -2822,10 +2872,22 @@ std::string Rtcm::print_MSM_5(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1075; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1075; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1085; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1095; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1075; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1075; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1085; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1095; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -2978,10 +3040,22 @@ std::string Rtcm::print_MSM_6(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1076; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1076; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1086; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1096; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1076; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1076; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1086; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1096; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (gal_eph.i_satellite_PRN != 0) && (glo_gnav_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -3085,10 +3159,22 @@ std::string Rtcm::print_MSM_7(const Gps_Ephemeris& gps_eph, bool more_messages) { uint32_t msg_number = 0; - if (gps_eph.i_satellite_PRN != 0) msg_number = 1077; - if (gps_cnav_eph.i_satellite_PRN != 0) msg_number = 1077; - if (glo_gnav_eph.i_satellite_PRN != 0) msg_number = 1087; - if (gal_eph.i_satellite_PRN != 0) msg_number = 1097; + if (gps_eph.i_satellite_PRN != 0) + { + msg_number = 1077; + } + if (gps_cnav_eph.i_satellite_PRN != 0) + { + msg_number = 1077; + } + if (glo_gnav_eph.i_satellite_PRN != 0) + { + msg_number = 1087; + } + if (gal_eph.i_satellite_PRN != 0) + { + msg_number = 1097; + } if (((gps_eph.i_satellite_PRN != 0) || (gps_cnav_eph.i_satellite_PRN != 0)) && (glo_gnav_eph.i_satellite_PRN != 0) && (gal_eph.i_satellite_PRN != 0)) { LOG(WARNING) << "MSM messages for observables from different systems are not defined"; //print two messages? @@ -3313,7 +3399,7 @@ std::map Rtcm::galileo_signal_map = [] { boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris& eph, double obs_time) const { const double gps_t = obs_time; - boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); + boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); // NOLINT(google-runtime-int) boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); return p_time; } @@ -3322,7 +3408,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_Ephemeris& eph, double boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, double obs_time) const { const double gps_t = obs_time; - boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); + boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((gps_t + 604800 * static_cast(eph.i_GPS_week % 1024)) * 1000)); // NOLINT(google-runtime-int) boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); return p_time; } @@ -3331,7 +3417,7 @@ boost::posix_time::ptime Rtcm::compute_GPS_time(const Gps_CNAV_Ephemeris& eph, d boost::posix_time::ptime Rtcm::compute_Galileo_time(const Galileo_Ephemeris& eph, double obs_time) const { double galileo_t = obs_time; - boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((galileo_t + 604800 * static_cast(eph.WN_5)) * 1000)); + boost::posix_time::time_duration t = boost::posix_time::milliseconds(static_cast((galileo_t + 604800 * static_cast(eph.WN_5)) * 1000)); // NOLINT(google-runtime-int) boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t); return p_time; } @@ -3383,33 +3469,33 @@ uint32_t Rtcm::lock_time(const Galileo_Ephemeris& eph, double obs_time, const Gn boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { last_lock_time = Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { last_lock_time = Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1B") == 0) + if (sig_ == "1B") { lock_duration = current_time - Rtcm::gal_E1_last_lock_time[65 - gnss_synchro.PRN]; } - if ((sig_.compare("5X") == 0) || (sig_.compare("8X") == 0) || (sig_.compare("7X") == 0)) + if ((sig_ == "5X") || (sig_ == "8X") || (sig_ == "7X")) { lock_duration = current_time - Rtcm::gal_E5_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3426,33 +3512,33 @@ uint32_t Rtcm::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, con boost::posix_time::ptime last_lock_time; std::string sig_(gnss_synchro.Signal); - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { last_lock_time = Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { last_lock_time = Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } if (last_lock_time.is_not_a_date_time()) // || CHECK LLI!!......) { - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN] = current_time; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN] = current_time; } } boost::posix_time::time_duration lock_duration = current_time - current_time; - if (sig_.compare("1C") == 0) + if (sig_ == "1C") { lock_duration = current_time - Rtcm::glo_L1_last_lock_time[65 - gnss_synchro.PRN]; } - if (sig_.compare("2C") == 0) + if (sig_ == "2C") { lock_duration = current_time - Rtcm::glo_L2_last_lock_time[65 - gnss_synchro.PRN]; } @@ -3465,13 +3551,34 @@ uint32_t Rtcm::lock_time(const Glonass_Gnav_Ephemeris& eph, double obs_time, con uint32_t Rtcm::lock_time_indicator(uint32_t lock_time_period_s) { // Table 3.4-2 - if (lock_time_period_s <= 0) return 0; - if (lock_time_period_s < 24) return lock_time_period_s; - if (lock_time_period_s < 72) return (lock_time_period_s + 24) / 2; - if (lock_time_period_s < 168) return (lock_time_period_s + 120) / 4; - if (lock_time_period_s < 360) return (lock_time_period_s + 408) / 8; - if (lock_time_period_s < 744) return (lock_time_period_s + 1176) / 16; - if (lock_time_period_s < 937) return (lock_time_period_s + 3096) / 32; + if (lock_time_period_s <= 0) + { + return 0; + } + if (lock_time_period_s < 24) + { + return lock_time_period_s; + } + if (lock_time_period_s < 72) + { + return (lock_time_period_s + 24) / 2; + } + if (lock_time_period_s < 168) + { + return (lock_time_period_s + 120) / 4; + } + if (lock_time_period_s < 360) + { + return (lock_time_period_s + 408) / 8; + } + if (lock_time_period_s < 744) + { + return (lock_time_period_s + 1176) / 16; + } + if (lock_time_period_s < 937) + { + return (lock_time_period_s + 3096) / 32; + } return 127; } @@ -3479,21 +3586,66 @@ uint32_t Rtcm::lock_time_indicator(uint32_t lock_time_period_s) uint32_t Rtcm::msm_lock_time_indicator(uint32_t lock_time_period_s) { // Table 3.5-74 - if (lock_time_period_s < 32) return 0; - if (lock_time_period_s < 64) return 1; - if (lock_time_period_s < 128) return 2; - if (lock_time_period_s < 256) return 3; - if (lock_time_period_s < 512) return 4; - if (lock_time_period_s < 1024) return 5; - if (lock_time_period_s < 2048) return 6; - if (lock_time_period_s < 4096) return 7; - if (lock_time_period_s < 8192) return 8; - if (lock_time_period_s < 16384) return 9; - if (lock_time_period_s < 32768) return 10; - if (lock_time_period_s < 65536) return 11; - if (lock_time_period_s < 131072) return 12; - if (lock_time_period_s < 262144) return 13; - if (lock_time_period_s < 524288) return 14; + if (lock_time_period_s < 32) + { + return 0; + } + if (lock_time_period_s < 64) + { + return 1; + } + if (lock_time_period_s < 128) + { + return 2; + } + if (lock_time_period_s < 256) + { + return 3; + } + if (lock_time_period_s < 512) + { + return 4; + } + if (lock_time_period_s < 1024) + { + return 5; + } + if (lock_time_period_s < 2048) + { + return 6; + } + if (lock_time_period_s < 4096) + { + return 7; + } + if (lock_time_period_s < 8192) + { + return 8; + } + if (lock_time_period_s < 16384) + { + return 9; + } + if (lock_time_period_s < 32768) + { + return 10; + } + if (lock_time_period_s < 65536) + { + return 11; + } + if (lock_time_period_s < 131072) + { + return 12; + } + if (lock_time_period_s < 262144) + { + return 13; + } + if (lock_time_period_s < 524288) + { + return 14; + } return 15; } @@ -3524,8 +3676,8 @@ uint32_t Rtcm::msm_extended_lock_time_indicator(uint32_t lock_time_period_s) if( 16777216 <= lock_time_period_s && lock_time_period_s < 33554432 ) return (640 + (lock_time_period_s - 16777216) / 524288 ); if( 33554432 <= lock_time_period_s && lock_time_period_s < 67108864 ) return (672 + (lock_time_period_s - 33554432) / 1048576); if( 67108864 <= lock_time_period_s ) return (704 ); - return 1023; // will never happen -} + return 1023; // will never happen + } // clang-format on // ***************************************************************************************************** @@ -3659,7 +3811,7 @@ int32_t Rtcm::set_DF011(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF012(const Gnss_Synchro& gnss_synchro) { - const double lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; + const double lambda = GPS_C_M_S / GPS_L1_FREQ_HZ; double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 299792.458); double gps_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02); double gps_L1_pseudorange_c = gps_L1_pseudorange * 0.02 + ambiguity * 299792.458; @@ -3721,7 +3873,7 @@ int32_t Rtcm::set_DF017(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& int32_t Rtcm::set_DF018(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - const double lambda2 = GPS_C_m_s / GPS_L2_FREQ_HZ; + const double lambda2 = GPS_C_M_S / GPS_L2_FREQ_HZ; int32_t l2_phaserange_minus_l1_pseudorange = 0xFFF80000; double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 299792.458); double gps_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 299792.458) / 0.02); @@ -3951,7 +4103,7 @@ int32_t Rtcm::set_DF041(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF042(const Gnss_Synchro& gnss_synchro) { - const double lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + const double lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); double ambiguity = std::floor(gnss_synchro.Pseudorange_m / 599584.92); double glonass_L1_pseudorange = std::round((gnss_synchro.Pseudorange_m - ambiguity * 599584.92) / 0.02); double glonass_L1_pseudorange_c = glonass_L1_pseudorange * 0.02 + ambiguity * 299792.458; @@ -4014,7 +4166,7 @@ int32_t Rtcm::set_DF047(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& //TODO Need to consider frequency channel in this fields int32_t Rtcm::set_DF048(const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2) { - const double lambda2 = GLONASS_C_m_s / GLONASS_L2_CA_FREQ_HZ; + const double lambda2 = GLONASS_C_M_S / GLONASS_L2_CA_FREQ_HZ; int32_t l2_phaserange_minus_l1_pseudorange = 0xFFF80000; double ambiguity = std::floor(gnss_synchroL1.Pseudorange_m / 599584.92); double glonass_L1_pseudorange = std::round((gnss_synchroL1.Pseudorange_m - ambiguity * 599584.92) / 0.02); @@ -4548,7 +4700,7 @@ int32_t Rtcm::set_DF126(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) int32_t Rtcm::set_DF127(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); + auto P4 = static_cast(std::round(glonass_gnav_eph.d_P_4)); DF127 = std::bitset<1>(P4); return 0; } @@ -4620,7 +4772,7 @@ int32_t Rtcm::set_DF135(const Glonass_Gnav_Utc_Model& glonass_gnav_utc_model) int32_t Rtcm::set_DF136(const Glonass_Gnav_Ephemeris& glonass_gnav_eph) { - uint32_t l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); + auto l_n = static_cast(std::round(glonass_gnav_eph.d_l5th_n)); DF136 = std::bitset<1>(l_n); return 0; } @@ -4694,7 +4846,7 @@ int32_t Rtcm::set_DF291(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF292(const Galileo_Ephemeris& gal_eph) { - auto idot = static_cast(std::round(gal_eph.iDot_2 / FNAV_idot_2_LSB)); + auto idot = static_cast(std::round(gal_eph.iDot_2 / FNAV_IDOT_2_LSB)); DF292 = std::bitset<14>(idot); return 0; } @@ -4714,7 +4866,7 @@ int32_t Rtcm::set_DF293(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph) { - auto af2 = static_cast(std::round(gal_eph.af2_4 / FNAV_af2_1_LSB)); + auto af2 = static_cast(std::round(gal_eph.af2_4 / FNAV_AF2_1_LSB)); DF294 = std::bitset<6>(af2); return 0; } @@ -4722,7 +4874,7 @@ int32_t Rtcm::set_DF294(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph) { - auto af1 = static_cast(std::round(gal_eph.af1_4 / FNAV_af1_1_LSB)); + auto af1 = static_cast(std::round(gal_eph.af1_4 / FNAV_AF1_1_LSB)); DF295 = std::bitset<21>(af1); return 0; } @@ -4730,7 +4882,7 @@ int32_t Rtcm::set_DF295(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph) { - int64_t af0 = static_cast(std::round(gal_eph.af0_4 / FNAV_af0_1_LSB)); + int64_t af0 = static_cast(std::round(gal_eph.af0_4 / FNAV_AF0_1_LSB)); DF296 = std::bitset<31>(af0); return 0; } @@ -4738,7 +4890,7 @@ int32_t Rtcm::set_DF296(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph) { - auto crs = static_cast(std::round(gal_eph.C_rs_3 / FNAV_Crs_3_LSB)); + auto crs = static_cast(std::round(gal_eph.C_rs_3 / FNAV_CRS_3_LSB)); DF297 = std::bitset<16>(crs); return 0; } @@ -4746,7 +4898,7 @@ int32_t Rtcm::set_DF297(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF298(const Galileo_Ephemeris& gal_eph) { - auto delta_n = static_cast(std::round(gal_eph.delta_n_3 / FNAV_deltan_3_LSB)); + auto delta_n = static_cast(std::round(gal_eph.delta_n_3 / FNAV_DELTAN_3_LSB)); DF298 = std::bitset<16>(delta_n); return 0; } @@ -4762,7 +4914,7 @@ int32_t Rtcm::set_DF299(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph) { - int32_t cuc = static_cast(std::round(gal_eph.C_uc_3 / FNAV_Cuc_3_LSB)); + int32_t cuc = static_cast(std::round(gal_eph.C_uc_3 / FNAV_CUC_3_LSB)); DF300 = std::bitset<16>(cuc); return 0; } @@ -4770,7 +4922,7 @@ int32_t Rtcm::set_DF300(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph) { - auto ecc = static_cast(std::round(gal_eph.e_1 / FNAV_e_2_LSB)); + auto ecc = static_cast(std::round(gal_eph.e_1 / FNAV_E_2_LSB)); DF301 = std::bitset<32>(ecc); return 0; } @@ -4778,7 +4930,7 @@ int32_t Rtcm::set_DF301(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph) { - auto cus = static_cast(std::round(gal_eph.C_us_3 / FNAV_Cus_3_LSB)); + auto cus = static_cast(std::round(gal_eph.C_us_3 / FNAV_CUS_3_LSB)); DF302 = std::bitset<16>(cus); return 0; } @@ -4786,7 +4938,7 @@ int32_t Rtcm::set_DF302(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph) { - auto sqr_a = static_cast(std::round(gal_eph.A_1 / FNAV_a12_2_LSB)); + auto sqr_a = static_cast(std::round(gal_eph.A_1 / FNAV_A12_2_LSB)); DF303 = std::bitset<32>(sqr_a); return 0; } @@ -4794,7 +4946,7 @@ int32_t Rtcm::set_DF303(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph) { - auto toe = static_cast(std::round(gal_eph.t0e_1 / FNAV_t0e_3_LSB)); + auto toe = static_cast(std::round(gal_eph.t0e_1 / FNAV_T0E_3_LSB)); DF304 = std::bitset<14>(toe); return 0; } @@ -4802,7 +4954,7 @@ int32_t Rtcm::set_DF304(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph) { - auto cic = static_cast(std::round(gal_eph.C_ic_4 / FNAV_Cic_4_LSB)); + auto cic = static_cast(std::round(gal_eph.C_ic_4 / FNAV_CIC_4_LSB)); DF305 = std::bitset<16>(cic); return 0; } @@ -4810,7 +4962,7 @@ int32_t Rtcm::set_DF305(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph) { - auto Omega0 = static_cast(std::round(gal_eph.OMEGA_0_2 / FNAV_omega0_2_LSB)); + auto Omega0 = static_cast(std::round(gal_eph.OMEGA_0_2 / FNAV_OMEGA0_2_LSB)); DF306 = std::bitset<32>(Omega0); return 0; } @@ -4818,7 +4970,7 @@ int32_t Rtcm::set_DF306(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph) { - auto cis = static_cast(std::round(gal_eph.C_is_4 / FNAV_Cis_4_LSB)); + auto cis = static_cast(std::round(gal_eph.C_is_4 / FNAV_CIS_4_LSB)); DF307 = std::bitset<16>(cis); return 0; } @@ -4826,7 +4978,7 @@ int32_t Rtcm::set_DF307(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph) { - auto i0 = static_cast(std::round(gal_eph.i_0_2 / FNAV_i0_3_LSB)); + auto i0 = static_cast(std::round(gal_eph.i_0_2 / FNAV_I0_3_LSB)); DF308 = std::bitset<32>(i0); return 0; } @@ -4834,7 +4986,7 @@ int32_t Rtcm::set_DF308(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph) { - int32_t crc = static_cast(std::round(gal_eph.C_rc_3 / FNAV_Crc_3_LSB)); + int32_t crc = static_cast(std::round(gal_eph.C_rc_3 / FNAV_CRC_3_LSB)); DF309 = std::bitset<16>(crc); return 0; } @@ -4842,7 +4994,7 @@ int32_t Rtcm::set_DF309(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph) { - auto omega = static_cast(std::round(gal_eph.omega_2 / FNAV_omega0_2_LSB)); + auto omega = static_cast(std::round(gal_eph.omega_2 / FNAV_OMEGA0_2_LSB)); DF310 = std::bitset<32>(omega); return 0; } @@ -4850,7 +5002,7 @@ int32_t Rtcm::set_DF310(const Galileo_Ephemeris& gal_eph) int32_t Rtcm::set_DF311(const Galileo_Ephemeris& gal_eph) { - auto Omegadot = static_cast(std::round(gal_eph.OMEGA_dot_3 / FNAV_omegadot_2_LSB)); + auto Omegadot = static_cast(std::round(gal_eph.OMEGA_dot_3 / FNAV_OMEGADOT_2_LSB)); DF311 = std::bitset<24>(Omegadot); return 0; } @@ -4913,7 +5065,7 @@ int32_t Rtcm::set_DF394(const std::map& gnss_synchro) int32_t Rtcm::set_DF395(const std::map& gnss_synchro) { DF395.reset(); - if (gnss_synchro.size() == 0) + if (gnss_synchro.empty()) { return 1; } @@ -4929,44 +5081,44 @@ int32_t Rtcm::set_DF395(const std::map& gnss_synchro) std::string sys(&gnss_synchro_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { mask_position = 32 - 15; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { mask_position = 32 - 4; DF395.set(mask_position, true); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { mask_position = 32 - 24; DF395.set(mask_position, true); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { mask_position = 32 - 16; DF395.set(mask_position, true); } - if ((sig.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig == "1C") && (sys == "R")) { mask_position = 32 - 2; DF395.set(mask_position, true); } - if ((sig.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig == "2C") && (sys == "R")) { mask_position = 32 - 8; DF395.set(mask_position, true); @@ -5008,29 +5160,29 @@ std::string Rtcm::set_DF396(const std::map& observables) std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig == "1C") && (sys == "G")) { list_of_signals.push_back(32 - 2); } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig == "2S") && (sys == "G")) { list_of_signals.push_back(32 - 15); } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0)) + if ((sig == "5X") && (sys == "G")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0)) + if ((sig == "1B") && (sys == "E")) { list_of_signals.push_back(32 - 4); } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0)) + if ((sig == "5X") && (sys == "E")) { list_of_signals.push_back(32 - 24); } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0)) + if ((sig == "7X") && (sys == "E")) { list_of_signals.push_back(32 - 16); } @@ -5059,32 +5211,32 @@ std::string Rtcm::set_DF396(const std::map& observables) sig = sig_.substr(0, 2); std::string sys(&observables_iter->second.System, 1); - if ((sig.compare("1C") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1C") && (sys == "G") && (list_of_signals.at(row) == 32 - 2) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("2S") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "2S") && (sys == "G") && (list_of_signals.at(row) == 32 - 15) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("G") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "G") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("1B") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "1B") && (sys == "E") && (list_of_signals.at(row) == 32 - 4) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("5X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "5X") && (sys == "E") && (list_of_signals.at(row) == 32 - 24) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } - if ((sig.compare("7X") == 0) && (sys.compare("E") == 0) && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) + if ((sig == "7X") && (sys == "E") && (list_of_signals.at(row) == 32 - 16) && (observables_iter->second.PRN == list_of_sats.at(sat))) { value = true; } @@ -5117,7 +5269,7 @@ std::string Rtcm::set_DF396(const std::map& observables) int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro) { - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_s = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; uint32_t int_ms = 0; @@ -5142,7 +5294,7 @@ int32_t Rtcm::set_DF397(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF398(const Gnss_Synchro& gnss_synchro) { - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; uint32_t rr_mod_ms; if ((rough_range_m <= 0.0) || (rough_range_m > meters_to_miliseconds * 255.0)) @@ -5166,28 +5318,34 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro) if (sig == "1C") { - lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L1_FREQ_HZ; } if (sig == "2S") { - lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L2_FREQ_HZ; } if (sig == "5X") { - lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ; } if (sig == "1B") { - lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ; } if (sig == "7X") { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; } double rough_phase_range_rate_ms = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); - if (rough_phase_range_rate_ms < -8191) rough_phase_range_rate_ms = -8192; - if (rough_phase_range_rate_ms > 8191) rough_phase_range_rate_ms = -8192; + if (rough_phase_range_rate_ms < -8191) + { + rough_phase_range_rate_ms = -8192; + } + if (rough_phase_range_rate_ms > 8191) + { + rough_phase_range_rate_ms = -8192; + } DF399 = std::bitset<14>(static_cast(rough_phase_range_rate_ms)); return 0; @@ -5196,7 +5354,7 @@ int32_t Rtcm::set_DF399(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro) { - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double psrng_s; int32_t fine_pseudorange; @@ -5223,7 +5381,7 @@ int32_t Rtcm::set_DF400(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro) { - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double phrng_m; int64_t fine_phaserange; @@ -5235,32 +5393,32 @@ int32_t Rtcm::set_DF401(const Gnss_Synchro& gnss_synchro) if ((sig == "1C") && (sys == "G")) { - lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L1_FREQ_HZ; } - if ((sig.compare("2S")) == 0 && (sys == "G")) + if ((sig == "2S") && (sys == "G")) { - lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L2_FREQ_HZ; } - if ((sig.compare("5X")) == 0 && (sys == "E")) + if ((sig == "5X") && (sys == "E")) { - lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ; } - if ((sig.compare("1B")) == 0 && (sys == "E")) + if ((sig == "1B") && (sys == "E")) { - lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ; } - if ((sig.compare("7X")) == 0 && (sys == "E")) + if ((sig == "7X") && (sys == "E")) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; } if ((sig == "1C") && (sys == "R")) { - lambda = GLONASS_C_m_s / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)))); + lambda = GLONASS_C_M_S / ((GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN)))); } if ((sig == "2C") && (sys == "R")) { // TODO Need to add slot number and freq number to gnss_syncro - lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); + lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ); } phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m; @@ -5298,24 +5456,24 @@ int32_t Rtcm::set_DF402(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e uint32_t lock_time_indicator; std::string sig_(gnss_synchro.Signal); std::string sys(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "1C") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S") == 0) && (sys.compare("G") == 0)) + if ((sig_ == "2S") && (sys == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } // TODO Should add system for galileo satellites - if (sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) + if ((sig_ == "1B") || (sig_ == "5X") || (sig_ == "7X") || (sig_ == "8X")) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "1C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys.compare("R") == 0)) + if ((sig_ == "2C") && (sys == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } @@ -5342,34 +5500,34 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) int32_t fine_phaserange_rate; std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { - lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { - lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { - lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { - lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { - lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro - lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); + lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ); } double rough_phase_range_rate = std::round(-gnss_synchro.Carrier_Doppler_hz * lambda); double phrr = (-gnss_synchro.Carrier_Doppler_hz * lambda - rough_phase_range_rate); @@ -5394,7 +5552,7 @@ int32_t Rtcm::set_DF404(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro) { - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double psrng_s; int64_t fine_pseudorange; @@ -5421,7 +5579,7 @@ int32_t Rtcm::set_DF405(const Gnss_Synchro& gnss_synchro) int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) { int64_t fine_phaserange_ex; - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; double rough_range_m = std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10; double phrng_m; double lambda = 0.0; @@ -5429,34 +5587,34 @@ int32_t Rtcm::set_DF406(const Gnss_Synchro& gnss_synchro) sig_ = sig_.substr(0, 2); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { - lambda = GPS_C_m_s / GPS_L1_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L1_FREQ_HZ; } - if ((sig_.compare("2S") == 0) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { - lambda = GPS_C_m_s / GPS_L2_FREQ_HZ; + lambda = GPS_C_M_S / GPS_L2_FREQ_HZ; } - if ((sig_.compare("5X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "5X") && (sys_ == "E")) { - lambda = GPS_C_m_s / Galileo_E5a_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E5A_FREQ_HZ; } - if ((sig_.compare("1B") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "1B") && (sys_ == "E")) { - lambda = GPS_C_m_s / Galileo_E1_FREQ_HZ; + lambda = GPS_C_M_S / GALILEO_E1_FREQ_HZ; } - if ((sig_.compare("7X") == 0) && (sys_.compare("E") == 0)) + if ((sig_ == "7X") && (sys_ == "E")) { - lambda = GPS_C_m_s / 1.207140e9; // Galileo_E1b_FREQ_HZ; + lambda = GPS_C_M_S / 1.207140e9; // Galileo_E1b_FREQ_HZ; } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { - lambda = GLONASS_C_m_s / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); + lambda = GLONASS_C_M_S / (GLONASS_L1_CA_FREQ_HZ + (GLONASS_L1_CA_DFREQ_HZ * GLONASS_PRN.at(gnss_synchro.PRN))); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { //TODO Need to add slot number and freq number to gnss syncro - lambda = GLONASS_C_m_s / (GLONASS_L2_CA_FREQ_HZ); + lambda = GLONASS_C_M_S / (GLONASS_L2_CA_FREQ_HZ); } phrng_m = (gnss_synchro.Carrier_phase_rads / GPS_TWO_PI) * lambda - rough_range_m; @@ -5494,23 +5652,23 @@ int32_t Rtcm::set_DF407(const Gps_Ephemeris& ephNAV, const Gps_CNAV_Ephemeris& e std::string sig_(gnss_synchro.Signal); std::string sys_(&gnss_synchro.System, 1); - if ((sig_.compare("1C")) && (sys_.compare("G") == 0)) + if ((sig_ == "1C") && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2S")) && (sys_.compare("G") == 0)) + if ((sig_ == "2S") && (sys_ == "G")) { lock_time_period_s = Rtcm::lock_time(ephCNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1B") || sig_.compare("5X") || sig_.compare("7X") || sig_.compare("8X")) && (sys_.compare("E") == 0)) + if (((sig_ == "1B") || (sig_ == "5X") || (sig_ == "7X") || (sig_ == "8X")) && (sys_ == "E")) { lock_time_period_s = Rtcm::lock_time(ephFNAV, obs_time, gnss_synchro); } - if ((sig_.compare("1C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "1C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } - if ((sig_.compare("2C") == 0) && (sys_.compare("R") == 0)) + if ((sig_ == "2C") && (sys_ == "R")) { lock_time_period_s = Rtcm::lock_time(ephGNAV, obs_time, gnss_synchro); } diff --git a/src/core/system_parameters/rtcm.h b/src/algorithms/libs/rtcm.h similarity index 96% rename from src/core/system_parameters/rtcm.h rename to src/algorithms/libs/rtcm.h index 77696cf88..9196a0968 100644 --- a/src/core/system_parameters/rtcm.h +++ b/src/algorithms/libs/rtcm.h @@ -368,8 +368,8 @@ public: void run_server(); // get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); + std::bitset<107> get_MT1011_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); /*! * \brief Get the contents of the satellite specific portion of a type 1012 Message (GLONASS Extended RTK, L1 & L2) * \details Contents generated for each satellite. See table 3.5-14 @@ -452,7 +452,7 @@ private: * \param gnss_synchroL2 Information generated by channels while processing the GLONASS GNAV L2 satellite * \return Returns the message content as set of bits */ - std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephGNAVL1, const Glonass_Gnav_Ephemeris& ephGNAVL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); + std::bitset<130> get_MT1012_sat_content(const Glonass_Gnav_Ephemeris& ephL1, const Glonass_Gnav_Ephemeris& ephL2, double obs_time, const Gnss_Synchro& gnss_synchroL1, const Gnss_Synchro& gnss_synchroL2); std::string get_MSM_header(uint32_t msg_number, double obs_time, @@ -553,7 +553,9 @@ private: { body_length_ = new_length; if (body_length_ > max_body_length) - body_length_ = max_body_length; + { + body_length_ = max_body_length; + } } inline bool decode_header() @@ -594,10 +596,10 @@ private: }; - class Rtcm_Listener + class RtcmListener { public: - virtual ~Rtcm_Listener() = default; + virtual ~RtcmListener() = default; virtual void deliver(const Rtcm_Message& msg) = 0; }; @@ -605,14 +607,16 @@ private: class Rtcm_Listener_Room { public: - inline void join(std::shared_ptr participant) + inline void join(const std::shared_ptr& participant) { participants_.insert(participant); for (auto msg : recent_msgs_) - participant->deliver(msg); + { + participant->deliver(msg); + } } - inline void leave(std::shared_ptr participant) + inline void leave(const std::shared_ptr& participant) { participants_.erase(participant); } @@ -621,14 +625,18 @@ private: { recent_msgs_.push_back(msg); while (recent_msgs_.size() > max_recent_msgs) - recent_msgs_.pop_front(); + { + recent_msgs_.pop_front(); + } - for (auto participant : participants_) - participant->deliver(msg); + for (const auto& participant : participants_) + { + participant->deliver(msg); + } } private: - std::set > participants_; + std::set > participants_; enum { max_recent_msgs = 1 @@ -638,7 +646,7 @@ private: class Rtcm_Session - : public Rtcm_Listener, + : public RtcmListener, public std::enable_shared_from_this { public: @@ -754,7 +762,7 @@ private: boost::asio::ip::tcp::resolver::iterator endpoint_iterator) : io_context_(io_context), socket_(io_context) { - do_connect(endpoint_iterator); + do_connect(std::move(endpoint_iterator)); } inline void close() @@ -778,7 +786,7 @@ private: private: inline void do_connect(boost::asio::ip::tcp::resolver::iterator endpoint_iterator) { - boost::asio::async_connect(socket_, endpoint_iterator, + boost::asio::async_connect(socket_, std::move(endpoint_iterator), [this](boost::system::error_code ec, boost::asio::ip::tcp::resolver::iterator) { if (!ec) { @@ -838,7 +846,7 @@ private: class Queue_Reader { public: - Queue_Reader(boost::asio::io_service& io_context, std::shared_ptr >& queue, int32_t port) : queue_(queue) + Queue_Reader(boost::asio::io_service& io_context, std::shared_ptr >& queue, int32_t port) : queue_(queue) { boost::asio::ip::tcp::resolver resolver(io_context); std::string host("localhost"); @@ -854,7 +862,11 @@ private: std::string message; Rtcm_Message msg; queue_->wait_and_pop(message); //message += '\n'; - if (message == "Goodbye") break; + if (message == "Goodbye") + { + break; + } + const char* char_msg = message.c_str(); msg.body_length(message.length()); std::memcpy(msg.body(), char_msg, msg.body_length()); @@ -865,7 +877,7 @@ private: private: std::shared_ptr c; - std::shared_ptr >& queue_; + std::shared_ptr >& queue_; }; @@ -918,7 +930,10 @@ private: LOG(INFO) << "Serving client from " << remote_addr; } } - if (start_session) std::make_shared(std::move(socket_), room_)->start(); + if (start_session) + { + std::make_shared(std::move(socket_), room_)->start(); + } } else { @@ -937,7 +952,7 @@ private: }; boost::asio::io_service io_context; - std::shared_ptr > rtcm_message_queue; + std::shared_ptr > rtcm_message_queue; std::thread t; std::thread tq; std::list servers; @@ -1398,10 +1413,10 @@ private: int32_t set_DF393(bool more_messages); //1 indicates that more MSMs follow for given physical time and reference station ID std::bitset<64> DF394; - int32_t set_DF394(const std::map& observables); + int32_t set_DF394(const std::map& gnss_synchro); std::bitset<32> DF395; - int32_t set_DF395(const std::map& observables); + int32_t set_DF395(const std::map& gnss_synchro); std::string set_DF396(const std::map& observables); diff --git a/src/algorithms/libs/rtklib/CMakeLists.txt b/src/algorithms/libs/rtklib/CMakeLists.txt index 882cd4a81..6a85ff21b 100644 --- a/src/algorithms/libs/rtklib/CMakeLists.txt +++ b/src/algorithms/libs/rtklib/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,7 +16,6 @@ # along with GNSS-SDR. If not, see . # -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") set(RTKLIB_LIB_SOURCES rtklib_rtkcmn.cc @@ -59,33 +58,28 @@ set(RTKLIB_LIB_HEADERS rtklib.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} -) - list(SORT RTKLIB_LIB_HEADERS) list(SORT RTKLIB_LIB_SOURCES) -add_library(rtklib_lib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) source_group(Headers FILES ${RTKLIB_LIB_HEADERS}) -add_dependencies(rtklib_lib glog-${glog_RELEASE}) + +add_library(algorithms_libs_rtklib ${RTKLIB_LIB_SOURCES} ${RTKLIB_LIB_HEADERS}) + +target_link_libraries(algorithms_libs_rtklib + PUBLIC + core_system_parameters + PRIVATE + Gflags::gflags + Glog::glog +) if(OS_IS_MACOSX) - set(MAC_LIBRARIES "-framework Accelerate") + target_link_libraries(algorithms_libs_rtklib PRIVATE "-framework Accelerate") +else() + target_link_libraries(algorithms_libs_rtklib PRIVATE ${LAPACK} ${BLAS}) endif() -target_link_libraries( - rtklib_lib - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${BLAS} - ${LAPACK} - ${MAC_LIBRARIES} +set_property(TARGET algorithms_libs_rtklib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/libs/rtklib/rtklib.h b/src/algorithms/libs/rtklib/rtklib.h index da2644a3a..55ba3ac03 100644 --- a/src/algorithms/libs/rtklib/rtklib.h +++ b/src/algorithms/libs/rtklib/rtklib.h @@ -221,10 +221,12 @@ const int NSATQZS = 0; const int NSYSQZS = 0; #endif +#ifndef __APPLE__ #define ENABDS +#endif #ifdef ENABDS const int MINPRNBDS = 1; //!< min satellite sat number of BeiDou -const int MAXPRNBDS = 35; //!< max satellite sat number of BeiDou +const int MAXPRNBDS = 37; //!< max satellite sat number of BeiDou const int NSATBDS = (MAXPRNBDS - MINPRNBDS + 1); //!< number of BeiDou satellites const int NSYSBDS = 1; #else @@ -343,7 +345,7 @@ const int POSOPT_RINEX = 3; //!< pos option: rinex header pos const int MAXSTRPATH = 1024; //!< max length of stream path const int MAXSTRMSG = 1024; //!< max length of stream message -typedef void fatalfunc_t(const char *); //!< fatal callback function type +using fatalfunc_t = void(const char *); //!< fatal callback function type #define STR_MODE_R 0x1 /* stream mode: read */ #define STR_MODE_W 0x2 /* stream mode: write */ @@ -1306,7 +1308,7 @@ typedef struct } msm_h_t; -const double chisqr[100] = {/* chi-sqr(n) (alpha=0.001) */ +const double CHISQR[100] = {/* chi-sqr(n) (alpha=0.001) */ 10.8, 13.8, 16.3, 18.5, 20.5, 22.5, 24.3, 26.1, 27.9, 29.6, 31.3, 32.9, 34.5, 36.1, 37.7, 39.3, 40.8, 42.3, 43.8, 45.3, 46.8, 48.3, 49.7, 51.2, 52.6, 54.1, 55.5, 56.9, 58.3, 59.7, @@ -1319,7 +1321,7 @@ const double chisqr[100] = {/* chi-sqr(n) (alpha=0.001) */ 138, 139, 140, 142, 143, 144, 145, 147, 148, 149}; -const double lam_carr[MAXFREQ] = {/* carrier wave length (m) */ +const double LAM_CARR[MAXFREQ] = {/* carrier wave length (m) */ SPEED_OF_LIGHT / FREQ1, SPEED_OF_LIGHT / FREQ2, SPEED_OF_LIGHT / FREQ5, SPEED_OF_LIGHT / FREQ6, SPEED_OF_LIGHT / FREQ7, SPEED_OF_LIGHT / FREQ8, SPEED_OF_LIGHT / FREQ9}; diff --git a/src/algorithms/libs/rtklib/rtklib_conversions.cc b/src/algorithms/libs/rtklib/rtklib_conversions.cc index 0f732e3cd..6008fdfd4 100644 --- a/src/algorithms/libs/rtklib/rtklib_conversions.cc +++ b/src/algorithms/libs/rtklib/rtklib_conversions.cc @@ -49,8 +49,14 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro break; } double CN0_dB_Hz_est = gnss_synchro.CN0_dB_hz; - if (CN0_dB_Hz_est > 63.75) CN0_dB_Hz_est = 63.75; - if (CN0_dB_Hz_est < 0.0) CN0_dB_Hz_est = 0.0; + if (CN0_dB_Hz_est > 63.75) + { + CN0_dB_Hz_est = 63.75; + } + if (CN0_dB_Hz_est < 0.0) + { + CN0_dB_Hz_est = 0.0; + } auto CN0_dB_Hz = static_cast(std::round(CN0_dB_Hz_est / 0.25)); rtklib_obs.SNR[band] = CN0_dB_Hz; //Galileo is the third satellite system for RTKLIB, so, add the required offset to discriminate Galileo ephemeris @@ -382,6 +388,7 @@ alm_t alm_to_rtklib(const Gps_Almanac& gps_alm) rtklib_alm.week = gps_alm.i_WNa; gtime_t toa; toa.time = gps_alm.i_Toa; + toa.sec = 0.0; rtklib_alm.toa = toa; rtklib_alm.A = gps_alm.d_sqrt_A * gps_alm.d_sqrt_A; rtklib_alm.e = gps_alm.d_e_eccentricity; @@ -410,6 +417,7 @@ alm_t alm_to_rtklib(const Galileo_Almanac& gal_alm) rtklib_alm.week = gal_alm.i_WNa; gtime_t toa; toa.time = gal_alm.i_Toa; + toa.sec = 0.0; rtklib_alm.toa = toa; rtklib_alm.A = 5440.588203494 + gal_alm.d_Delta_sqrt_A; rtklib_alm.A = rtklib_alm.A * rtklib_alm.A; diff --git a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc index c942c0d2c..bd72b7f9f 100644 --- a/src/algorithms/libs/rtklib/rtklib_ephemeris.cc +++ b/src/algorithms/libs/rtklib/rtklib_ephemeris.cc @@ -99,8 +99,14 @@ double var_uraeph(int ura) double var_urassr(int ura) { double std_; - if (ura <= 0) return std::pow(DEFURASSR, 2.0); - if (ura >= 63) return std::pow(5.4665, 2.0); + if (ura <= 0) + { + return std::pow(DEFURASSR, 2.0); + } + if (ura >= 63) + { + return std::pow(5.4665, 2.0); + } std_ = (std::pow((ura >> 3) & 7, 2.0) * (1.0 + (ura & 7) / 4.0) - 1.0) * 1e-3; return std::pow(std_, 2.0); } @@ -323,13 +329,25 @@ void glorbit(double t, double *x, const double *acc) int i; deq(x, k1, acc); - for (i = 0; i < 6; i++) w[i] = x[i] + k1[i] * t / 2.0; + for (i = 0; i < 6; i++) + { + w[i] = x[i] + k1[i] * t / 2.0; + } deq(w, k2, acc); - for (i = 0; i < 6; i++) w[i] = x[i] + k2[i] * t / 2.0; + for (i = 0; i < 6; i++) + { + w[i] = x[i] + k2[i] * t / 2.0; + } deq(w, k3, acc); - for (i = 0; i < 6; i++) w[i] = x[i] + k3[i] * t; + for (i = 0; i < 6; i++) + { + w[i] = x[i] + k3[i] * t; + } deq(w, k4, acc); - for (i = 0; i < 6; i++) x[i] += (k1[i] + 2.0 * k2[i] + 2.0 * k3[i] + k4[i]) * t / 6.0; + for (i = 0; i < 6; i++) + { + x[i] += (k1[i] + 2.0 * k2[i] + 2.0 * k3[i] + k4[i]) * t / 6.0; + } } @@ -386,10 +404,16 @@ void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts, } for (tt = t < 0.0 ? -TSTEP : TSTEP; fabs(t) > 1e-9; t -= tt) { - if (fabs(t) < TSTEP) tt = t; + if (fabs(t) < TSTEP) + { + tt = t; + } glorbit(tt, x, geph->acc); } - for (i = 0; i < 3; i++) rs[i] = x[i]; + for (i = 0; i < 3; i++) + { + rs[i] = x[i]; + } *var = std::pow(ERREPH_GLO, 2.0); } @@ -476,10 +500,22 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav) for (i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; - if (iode >= 0 && nav->eph[i].iode != iode) continue; - if ((t = fabs(timediff(nav->eph[i].toe, time))) > tmax) continue; - if (iode >= 0) return nav->eph + i; + if (nav->eph[i].sat != sat) + { + continue; + } + if (iode >= 0 && nav->eph[i].iode != iode) + { + continue; + } + if ((t = fabs(timediff(nav->eph[i].toe, time))) > tmax) + { + continue; + } + if (iode >= 0) + { + return nav->eph + i; + } if (t <= tmin) { j = i; @@ -506,10 +542,22 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav) for (i = 0; i < nav->ng; i++) { - if (nav->geph[i].sat != sat) continue; - if (iode >= 0 && nav->geph[i].iode != iode) continue; - if ((t = fabs(timediff(nav->geph[i].toe, time))) > tmax) continue; - if (iode >= 0) return nav->geph + i; + if (nav->geph[i].sat != sat) + { + continue; + } + if (iode >= 0 && nav->geph[i].iode != iode) + { + continue; + } + if ((t = fabs(timediff(nav->geph[i].toe, time))) > tmax) + { + continue; + } + if (iode >= 0) + { + return nav->geph + i; + } if (t <= tmin) { j = i; @@ -536,8 +584,14 @@ seph_t *selseph(gtime_t time, int sat, const nav_t *nav) for (i = 0; i < nav->ns; i++) { - if (nav->seph[i].sat != sat) continue; - if ((t = fabs(timediff(nav->seph[i].t0, time))) > tmax) continue; + if (nav->seph[i].sat != sat) + { + continue; + } + if ((t = fabs(timediff(nav->seph[i].t0, time))) > tmax) + { + continue; + } if (t <= tmin) { j = i; @@ -568,21 +622,32 @@ int ephclk(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS || sys == SYS_BDS) { - if (!(eph = seleph(teph, sat, -1, nav))) return 0; + if (!(eph = seleph(teph, sat, -1, nav))) + { + return 0; + } *dts = eph2clk(time, eph); } else if (sys == SYS_GLO) { - if (!(geph = selgeph(teph, sat, -1, nav))) return 0; + if (!(geph = selgeph(teph, sat, -1, nav))) + { + return 0; + } *dts = geph2clk(time, geph); } else if (sys == SYS_SBS) { - if (!(seph = selseph(teph, sat, nav))) return 0; + if (!(seph = selseph(teph, sat, nav))) + { + return 0; + } *dts = seph2clk(time, seph); } else - return 0; + { + return 0; + } return 1; } @@ -606,7 +671,10 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS || sys == SYS_BDS) { - if (!(eph = seleph(teph, sat, iode, nav))) return 0; + if (!(eph = seleph(teph, sat, iode, nav))) + { + return 0; + } eph2pos(time, eph, rs, dts, var); time = timeadd(time, tt); @@ -615,7 +683,10 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, } else if (sys == SYS_GLO) { - if (!(geph = selgeph(teph, sat, iode, nav))) return 0; + if (!(geph = selgeph(teph, sat, iode, nav))) + { + return 0; + } geph2pos(time, geph, rs, dts, var); time = timeadd(time, tt); geph2pos(time, geph, rst, dtst, var); @@ -623,7 +694,10 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, } else if (sys == SYS_SBS) { - if (!(seph = selseph(teph, sat, nav))) return 0; + if (!(seph = selseph(teph, sat, nav))) + { + return 0; + } seph2pos(time, seph, rs, dts, var); time = timeadd(time, tt); @@ -631,10 +705,15 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav, *svh = seph->svh; } else - return 0; + { + return 0; + } /* satellite velocity and clock drift by differential approx */ - for (i = 0; i < 3; i++) rs[i + 3] = (rst[i] - rs[i]) / tt; + for (i = 0; i < 3; i++) + { + rs[i + 3] = (rst[i] - rs[i]) / tt; + } dts[1] = (dtst[0] - dts[0]) / tt; return 1; @@ -654,7 +733,10 @@ int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav, for (i = 0; i < nav->sbssat.nsat; i++) { sbs = nav->sbssat.sat + i; - if (sbs->sat == sat) break; + if (sbs->sat == sat) + { + break; + } } if (i >= nav->sbssat.nsat) { @@ -664,10 +746,16 @@ int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav, return 0; } /* satellite position and clock by broadcast ephemeris */ - if (!ephpos(time, teph, sat, nav, sbs->lcorr.iode, rs, dts, var, svh)) return 0; + if (!ephpos(time, teph, sat, nav, sbs->lcorr.iode, rs, dts, var, svh)) + { + return 0; + } /* sbas satellite correction (long term and fast) */ - if (sbssatcorr(time, sat, nav, rs, dts, var)) return 1; + if (sbssatcorr(time, sat, nav, rs, dts, var)) + { + return 1; + } *svh = -1; return 0; } @@ -716,10 +804,19 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, *svh = -1; return 0; } - if (ssr->udi[0] >= 1.0) t1 -= ssr->udi[0] / 2.0; - if (ssr->udi[1] >= 1.0) t2 -= ssr->udi[0] / 2.0; + if (ssr->udi[0] >= 1.0) + { + t1 -= ssr->udi[0] / 2.0; + } + if (ssr->udi[1] >= 1.0) + { + t2 -= ssr->udi[0] / 2.0; + } - for (i = 0; i < 3; i++) deph[i] = ssr->deph[i] + ssr->ddeph[i] * t1; + for (i = 0; i < 3; i++) + { + deph[i] = ssr->deph[i] + ssr->ddeph[i] * t1; + } dclk = ssr->dclk[0] + ssr->dclk[1] * t2 + ssr->dclk[2] * t2 * t2; /* ssr highrate clock correction (ref [4]) */ @@ -735,13 +832,19 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, return 0; } /* satellite position and clock by broadcast ephemeris */ - if (!ephpos(time, teph, sat, nav, ssr->iode, rs, dts, var, svh)) return 0; + if (!ephpos(time, teph, sat, nav, ssr->iode, rs, dts, var, svh)) + { + return 0; + } /* satellite clock for gps, galileo and qzss */ sys = satsys(sat, nullptr); if (sys == SYS_GPS || sys == SYS_GAL || sys == SYS_QZS || sys == SYS_BDS) { - if (!(eph = seleph(teph, sat, ssr->iode, nav))) return 0; + if (!(eph = seleph(teph, sat, ssr->iode, nav))) + { + return 0; + } /* satellite clock by clock parameters */ tk = timediff(time, eph->toc); @@ -752,7 +855,10 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav, dts[0] -= 2.0 * dot(rs, rs + 3, 3) / SPEED_OF_LIGHT / SPEED_OF_LIGHT; } /* radial-along-cross directions in ecef */ - if (!normv3(rs + 3, ea)) return 0; + if (!normv3(rs + 3, ea)) + { + return 0; + } cross3(rs, rs + 3, rc); if (!normv3(rc, ec)) { @@ -819,9 +925,13 @@ int satpos(gtime_t time, gtime_t teph, int sat, int ephopt, return satpos_ssr(time, teph, sat, nav, 1, rs, dts, var, svh); case EPHOPT_PREC: if (!peph2pos(time, sat, nav, 1, rs, dts, var)) - break; + { + break; + } else - return 1; + { + return 1; + } //TODO: enable lex //case EPHOPT_LEX : // if (!lexeph2pos(time, sat, nav, rs, dts, var)) break; else return 1; @@ -866,14 +976,25 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav, for (i = 0; i < n && i < MAXOBS; i++) { - for (j = 0; j < 6; j++) rs[j + i * 6] = 0.0; - for (j = 0; j < 2; j++) dts[j + i * 2] = 0.0; + for (j = 0; j < 6; j++) + { + rs[j + i * 6] = 0.0; + } + for (j = 0; j < 2; j++) + { + dts[j + i * 2] = 0.0; + } var[i] = 0.0; svh[i] = 0; /* search any pseudorange */ for (j = 0, pr = 0.0; j < NFREQ; j++) - if ((pr = obs[i].P[j]) != 0.0) break; + { + if ((pr = obs[i].P[j]) != 0.0) + { + break; + } + } if (j >= NFREQ) { @@ -901,7 +1022,10 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav, /* if no precise clock available, use broadcast clock instead */ if (dts[i * 2] == 0.0) { - if (!ephclk(time[i], teph, obs[i].sat, nav, dts + i * 2)) continue; + if (!ephclk(time[i], teph, obs[i].sat, nav, dts + i * 2)) + { + continue; + } dts[1 + i * 2] = 0.0; *var = std::pow(STD_BRDCCLK, 2.0); } diff --git a/src/algorithms/libs/rtklib/rtklib_ionex.cc b/src/algorithms/libs/rtklib/rtklib_ionex.cc index 162778f9a..8ba2bb950 100644 --- a/src/algorithms/libs/rtklib/rtklib_ionex.cc +++ b/src/algorithms/libs/rtklib/rtklib_ionex.cc @@ -59,13 +59,23 @@ #include "rtklib_ionex.h" #include "rtklib_rtkcmn.h" +#include /* get index -----------------------------------------------------------------*/ int getindex(double value, const double *range) { - if (range[2] == 0.0) return 0; - if (range[1] > 0.0 && (value < range[0] || range[1] < value)) return -1; - if (range[1] < 0.0 && (value < range[1] || range[0] < value)) return -1; + if (range[2] == 0.0) + { + return 0; + } + if (range[1] > 0.0 && (value < range[0] || range[1] < value)) + { + return -1; + } + if (range[1] < 0.0 && (value < range[1] || range[0] < value)) + { + return -1; + } return static_cast(floor((value - range[0]) / range[2] + 0.5)); } @@ -80,7 +90,10 @@ int nitem(const double *range) /* data index (i:lat,j:lon,k:hgt) --------------------------------------------*/ int dataindex(int i, int j, int k, const int *ndata) { - if (i < 0 || ndata[0] <= i || j < 0 || ndata[1] <= j || k < 0 || ndata[2] <= k) return -1; + if (i < 0 || ndata[0] <= i || j < 0 || ndata[1] <= j || k < 0 || ndata[2] <= k) + { + return -1; + } return i + ndata[0] * (j + ndata[1] * k); } @@ -98,7 +111,10 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts, ndata[0] = nitem(lats); ndata[1] = nitem(lons); ndata[2] = nitem(hgts); - if (ndata[0] <= 1 || ndata[1] <= 1 || ndata[2] <= 0) return nullptr; + if (ndata[0] <= 1 || ndata[1] <= 1 || ndata[2] <= 0) + { + return nullptr; + } if (nav->nt >= nav->ntmax) { @@ -148,11 +164,17 @@ void readionexdcb(FILE *fp, double *dcb, double *rms) trace(3, "readionexdcb:\n"); - for (i = 0; i < MAXSAT; i++) dcb[i] = rms[i] = 0.0; + for (i = 0; i < MAXSAT; i++) + { + dcb[i] = rms[i] = 0.0; + } while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) < 60) continue; + if (strlen(buff) < 60) + { + continue; + } label = buff + 60; if (strstr(label, "PRN / BIAS / RMS") == label) @@ -169,7 +191,9 @@ void readionexdcb(FILE *fp, double *dcb, double *rms) rms[sat - 1] = str2num(buff, 16, 10); } else if (strstr(label, "END OF AUX DATA") == label) - break; + { + break; + } } } @@ -185,12 +209,18 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts, while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) < 60) continue; + if (strlen(buff) < 60) + { + continue; + } label = buff + 60; if (strstr(label, "IONEX VERSION / TYPE") == label) { - if (buff[20] == 'I') ver = str2num(buff, 0, 8); + if (buff[20] == 'I') + { + ver = str2num(buff, 0, 8); + } } else if (strstr(label, "BASE RADIUS") == label) { @@ -246,11 +276,17 @@ int readionexb(FILE *fp, const double *lats, const double *lons, while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) < 60) continue; + if (strlen(buff) < 60) + { + continue; + } if (strstr(label, "START OF TEC MAP") == label) { - if ((p = addtec(lats, lons, hgts, rb, nav))) type = 1; + if ((p = addtec(lats, lons, hgts, rb, nav))) + { + type = 1; + } } else if (strstr(label, "END OF TEC MAP") == label) { @@ -278,13 +314,18 @@ int readionexb(FILE *fp, const double *lats, const double *lons, { for (i = nav->nt - 1; i >= 0; i--) { - if (fabs(timediff(time, nav->tec[i].time)) >= 1.0) continue; + if (fabs(timediff(time, nav->tec[i].time)) >= 1.0) + { + continue; + } p = nav->tec + i; break; } } else if (p) - p->time = time; + { + p->time = time; + } } else if (strstr(label, "LAT/LON1/LON2/DLON/H") == label && p) { @@ -300,17 +341,30 @@ int readionexb(FILE *fp, const double *lats, const double *lons, for (m = 0; m < n; m++) { - if (m % 16 == 0 && !fgets(buff, sizeof(buff), fp)) break; + if (m % 16 == 0 && !fgets(buff, sizeof(buff), fp)) + { + break; + } j = getindex(lon[0] + lon[2] * m, p->lons); - if ((index = dataindex(i, j, k, p->ndata)) < 0) continue; + if ((index = dataindex(i, j, k, p->ndata)) < 0) + { + continue; + } - if ((x = str2num(buff, m % 16 * 5, 5)) == 9999.0) continue; + if ((x = str2num(buff, m % 16 * 5, 5)) == 9999.0) + { + continue; + } if (type == 1) - p->data[index] = x * std::pow(10.0, nexp); + { + p->data[index] = x * std::pow(10.0, nexp); + } else - p->rms[index] = static_cast(x * std::pow(10.0, nexp)); + { + p->rms[index] = static_cast(x * std::pow(10.0, nexp)); + } } } } @@ -386,7 +440,10 @@ void readtec(const char *file, nav_t *nav, int opt) { if (!(efiles[i] = static_cast(malloc(1024)))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) + { + free(efiles[i]); + } return; } } @@ -413,10 +470,16 @@ void readtec(const char *file, nav_t *nav, int opt) readionexb(fp, lats, lons, hgts, rb, nexp, nav); fclose(fp); } - for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) + { + free(efiles[i]); + } /* combine tec grid data */ - if (nav->nt > 0) combtec(nav); + if (nav->nt > 0) + { + combtec(nav); + } /* P1-P2 dcb */ for (i = 0; i < MAXSAT; i++) @@ -436,14 +499,21 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, trace(3, "interptec: k=%d posp=%.2f %.2f\n", k, posp[0] * R2D, posp[1] * R2D); *value = *rms = 0.0; - if (tec->lats[2] == 0.0 || tec->lons[2] == 0.0) return 0; + if (tec->lats[2] == 0.0 || tec->lons[2] == 0.0) + { + return 0; + } dlat = posp[0] * R2D - tec->lats[0]; dlon = posp[1] * R2D - tec->lons[0]; if (tec->lons[2] > 0.0) - dlon -= floor(dlon / 360) * 360.0; /* 0 <= dlon<360 */ + { + dlon -= floor(dlon / 360) * 360.0; /* 0 <= dlon<360 */ + } else - dlon += floor(-dlon / 360) * 360.0; /* -360lats[2]; b = dlon / tec->lons[2]; @@ -455,7 +525,10 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, /* get gridded tec data */ for (n = 0; n < 4; n++) { - if ((index = dataindex(i + (n % 2), j + (n < 2 ? 0 : 1), k, tec->ndata)) < 0) continue; + if ((index = dataindex(i + (n % 2), j + (n < 2 ? 0 : 1), k, tec->ndata)) < 0) + { + continue; + } d[n] = tec->data[index]; r[n] = tec->rms[index]; } @@ -490,13 +563,18 @@ int interptec(const tec_t *tec, int k, const double *posp, double *value, { i = 0; for (n = 0; n < 4; n++) - if (d[n] > 0.0) - { - i++; - *value += d[n]; - *rms += r[n]; - } - if (i == 0) return 0; + { + if (d[n] > 0.0) + { + i++; + *value += d[n]; + *rms += r[n]; + } + } + if (i == 0) + { + return 0; + } *value /= i; *rms /= i; } @@ -536,7 +614,10 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos, posp[1] += 2.0 * PI * timediff(time, tec->time) / 86400.0; } /* interpolate tec grid data */ - if (!interptec(tec, i, posp, &vtec, &rms)) return 0; + if (!interptec(tec, i, posp, &vtec, &rms)) + { + return 0; + } *delay += fact * fs * vtec; *var += fact * fact * fs * fs * rms * rms; @@ -579,7 +660,10 @@ int iontec(gtime_t time, const nav_t *nav, const double *pos, } for (i = 0; i < nav->nt; i++) { - if (timediff(nav->tec[i].time, time) > 0.0) break; + if (timediff(nav->tec[i].time, time) > 0.0) + { + break; + } } if (i == 0 || i >= nav->nt) { diff --git a/src/algorithms/libs/rtklib/rtklib_lambda.cc b/src/algorithms/libs/rtklib/rtklib_lambda.cc index e96efb39a..8aaba735f 100644 --- a/src/algorithms/libs/rtklib/rtklib_lambda.cc +++ b/src/algorithms/libs/rtklib/rtklib_lambda.cc @@ -52,6 +52,7 @@ #include "rtklib_lambda.h" #include "rtklib_rtkcmn.h" +#include /* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/ int LD(int n, const double *Q, double *L, double *D) @@ -68,13 +69,27 @@ int LD(int n, const double *Q, double *L, double *D) break; } a = sqrt(D[i]); - for (j = 0; j <= i; j++) L[i + j * n] = A[i + j * n] / a; + for (j = 0; j <= i; j++) + { + L[i + j * n] = A[i + j * n] / a; + } for (j = 0; j <= i - 1; j++) - for (k = 0; k <= j; k++) A[j + k * n] -= L[i + k * n] * L[i + j * n]; - for (j = 0; j <= i; j++) L[i + j * n] /= L[i + i * n]; + { + for (k = 0; k <= j; k++) + { + A[j + k * n] -= L[i + k * n] * L[i + j * n]; + } + } + for (j = 0; j <= i; j++) + { + L[i + j * n] /= L[i + i * n]; + } } free(A); - if (info) fprintf(stderr, "%s : LD factorization error\n", __FILE__); + if (info) + { + fprintf(stderr, "%s : LD factorization error\n", __FILE__); + } return info; } @@ -86,8 +101,14 @@ void gauss(int n, double *L, double *Z, int i, int j) if ((mu = static_cast ROUND_LAMBDA(L[i + j * n])) != 0) { - for (k = i; k < n; k++) L[k + n * j] -= static_cast(mu) * L[k + i * n]; - for (k = 0; k < n; k++) Z[k + n * j] -= static_cast(mu) * Z[k + i * n]; + for (k = i; k < n; k++) + { + L[k + n * j] -= static_cast(mu) * L[k + i * n]; + } + for (k = 0; k < n; k++) + { + Z[k + n * j] -= static_cast(mu) * Z[k + i * n]; + } } } @@ -110,8 +131,14 @@ void perm(int n, double *L, double *D, int j, double del, double *Z) L[j + 1 + k * n] = eta * a0 + lam * a1; } L[j + 1 + j * n] = lam; - for (k = j + 2; k < n; k++) SWAP_LAMBDA(L[k + j * n], L[k + (j + 1) * n]); - for (k = 0; k < n; k++) SWAP_LAMBDA(Z[k + j * n], Z[k + (j + 1) * n]); + for (k = j + 2; k < n; k++) + { + SWAP_LAMBDA(L[k + j * n], L[k + (j + 1) * n]); + } + for (k = 0; k < n; k++) + { + SWAP_LAMBDA(Z[k + j * n], Z[k + (j + 1) * n]); + } } @@ -126,7 +153,12 @@ void reduction(int n, double *L, double *D, double *Z) while (j >= 0) { if (j <= k) - for (i = j + 1; i < n; i++) gauss(n, L, Z, i, j); + { + for (i = j + 1; i < n; i++) + { + gauss(n, L, Z, i, j); + } + } del = D[j] + L[j + 1 + j * n] * L[j + 1 + j * n] * D[j + 1]; if (del + 1E-6 < D[j + 1]) { /* compared considering numerical error */ @@ -135,7 +167,9 @@ void reduction(int n, double *L, double *D, double *Z) j = n - 2; } else - j--; + { + j--; + } } } @@ -163,7 +197,9 @@ int search(int n, int m, const double *L, const double *D, { dist[--k] = newdist; for (i = 0; i <= k; i++) - S[k + i * n] = S[k + 1 + i * n] + (z[k + 1] - zb[k + 1]) * L[k + 1 + i * n]; + { + S[k + i * n] = S[k + 1 + i * n] + (z[k + 1] - zb[k + 1]) * L[k + 1 + i * n]; + } zb[k] = zs[k] + S[k + k * n]; z[k] = ROUND_LAMBDA(zb[k]); y = zb[k] - z[k]; @@ -173,18 +209,32 @@ int search(int n, int m, const double *L, const double *D, { if (nn < m) { - if (nn == 0 || newdist > s[imax]) imax = nn; - for (i = 0; i < n; i++) zn[i + nn * n] = z[i]; + if (nn == 0 || newdist > s[imax]) + { + imax = nn; + } + for (i = 0; i < n; i++) + { + zn[i + nn * n] = z[i]; + } s[nn++] = newdist; } else { if (newdist < s[imax]) { - for (i = 0; i < n; i++) zn[i + imax * n] = z[i]; + for (i = 0; i < n; i++) + { + zn[i + imax * n] = z[i]; + } s[imax] = newdist; for (i = imax = 0; i < m; i++) - if (s[imax] < s[i]) imax = i; + { + if (s[imax] < s[i]) + { + imax = i; + } + } } maxdist = s[imax]; } @@ -196,7 +246,9 @@ int search(int n, int m, const double *L, const double *D, else { if (k == n - 1) - break; + { + break; + } k++; z[k] += step[k]; @@ -208,9 +260,15 @@ int search(int n, int m, const double *L, const double *D, { /* sort by s */ for (j = i + 1; j < m; j++) { - if (s[i] < s[j]) continue; + if (s[i] < s[j]) + { + continue; + } SWAP_LAMBDA(s[i], s[j]); - for (k = 0; k < n; k++) SWAP_LAMBDA(zn[k + i * n], zn[k + j * n]); + for (k = 0; k < n; k++) + { + SWAP_LAMBDA(zn[k + i * n], zn[k + j * n]); + } } } free(S); @@ -246,7 +304,10 @@ int lambda(int n, int m, const double *a, const double *Q, double *F, int info; double *L, *D, *Z, *z, *E; - if (n <= 0 || m <= 0) return -1; + if (n <= 0 || m <= 0) + { + return -1; + } L = zeros(n, n); D = mat(n, 1); Z = eye(n); @@ -287,16 +348,21 @@ int lambda_reduction(int n, const double *Q, double *Z) double *L, *D; int i, j, info; - if (n <= 0) return -1; + if (n <= 0) + { + return -1; + } L = zeros(n, n); D = mat(n, 1); for (i = 0; i < n; i++) - for (j = 0; j < n; j++) - { - Z[i + j * n] = i == j ? 1.0 : 0.0; - } + { + for (j = 0; j < n; j++) + { + Z[i + j * n] = i == j ? 1.0 : 0.0; + } + } /* LD factorization */ if ((info = LD(n, Q, L, D))) { @@ -329,7 +395,10 @@ int lambda_search(int n, int m, const double *a, const double *Q, double *L, *D; int info; - if (n <= 0 || m <= 0) return -1; + if (n <= 0 || m <= 0) + { + return -1; + } L = zeros(n, n); D = mat(n, 1); diff --git a/src/algorithms/libs/rtklib/rtklib_pntpos.cc b/src/algorithms/libs/rtklib/rtklib_pntpos.cc index 016037f77..19cb48d46 100644 --- a/src/algorithms/libs/rtklib/rtklib_pntpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_pntpos.cc @@ -54,6 +54,7 @@ #include "rtklib_ephemeris.h" #include "rtklib_ionex.h" #include "rtklib_sbas.h" +#include /* pseudorange measurement error variance ------------------------------------*/ double varerr(const prcopt_t *opt, double el, int sys) @@ -61,7 +62,10 @@ double varerr(const prcopt_t *opt, double el, int sys) double fact, varr; fact = sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); varr = std::pow(opt->err[0], 2.0) * (std::pow(opt->err[1], 2.0) + std::pow(opt->err[2], 2.0) / sin(el)); - if (opt->ionoopt == IONOOPT_IFLC) varr *= std::pow(2, 3.0); /* iono-free */ + if (opt->ionoopt == IONOOPT_IFLC) + { + varr *= std::pow(2, 3.0); /* iono-free */ + } return std::pow(fact, 2.0) * varr; } @@ -72,7 +76,10 @@ double gettgd(int sat, const nav_t *nav) int i; for (i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].tgd[0]; } return 0.0; @@ -83,7 +90,10 @@ double getiscl1(int sat, const nav_t *nav) { for (int i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].isc[0]; } return 0.0; @@ -93,7 +103,10 @@ double getiscl2(int sat, const nav_t *nav) { for (int i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].isc[1]; } return 0.0; @@ -103,7 +116,10 @@ double getiscl5i(int sat, const nav_t *nav) { for (int i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].isc[2]; } return 0.0; @@ -113,7 +129,10 @@ double getiscl5q(int sat, const nav_t *nav) { for (int i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].isc[3]; } return 0.0; @@ -406,7 +425,10 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, trace(3, "resprng : n=%d\n", n); - for (i = 0; i < 3; i++) rr[i] = x[i]; + for (i = 0; i < 3; i++) + { + rr[i] = x[i]; + } dtr = x[3]; ecef2pos(rr, pos); @@ -416,7 +438,10 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, vsat[i] = 0; azel[i * 2] = azel[1 + i * 2] = resp[i] = 0.0; - if (!(sys = satsys(obs[i].sat, nullptr))) continue; + if (!(sys = satsys(obs[i].sat, nullptr))) + { + continue; + } /* reject duplicated observation data */ if (i < n - 1 && i < MAXOBS - 1 && obs[i].sat == obs[i + 1].sat) @@ -463,7 +488,7 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, /* GPS-L1 -> L1/B1 */ if ((lam_L1 = nav->lam[obs[i].sat - 1][0]) > 0.0) { - dion *= std::pow(lam_L1 / lam_carr[0], 2.0); + dion *= std::pow(lam_L1 / LAM_CARR[0], 2.0); } /* tropospheric corrections */ if (!tropcorr(obs[i].time, nav, pos, azel + i * 2, @@ -476,7 +501,10 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, v[nv] = P - (r + dtr - SPEED_OF_LIGHT * dts[i * 2] + dion + dtrp); /* design matrix */ - for (j = 0; j < NX; j++) H[j + nv * NX] = j < 3 ? -e[j] : (j == 3 ? 1.0 : 0.0); + for (j = 0; j < NX; j++) + { + H[j + nv * NX] = j < 3 ? -e[j] : (j == 3 ? 1.0 : 0.0); + } /* time system and receiver bias offset correction */ if (sys == SYS_GLO) @@ -498,7 +526,9 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, mask[3] = 1; } else - mask[0] = 1; + { + mask[0] = 1; + } vsat[i] = 1; resp[i] = v[nv]; @@ -513,9 +543,15 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs, /* constraint to avoid rank-deficient */ for (i = 0; i < 4; i++) { - if (mask[i]) continue; + if (mask[i]) + { + continue; + } v[nv] = 0.0; - for (j = 0; j < NX; j++) H[j + nv * NX] = j == i + 3 ? 1.0 : 0.0; + for (j = 0; j < NX; j++) + { + H[j + nv * NX] = j == i + 3 ? 1.0 : 0.0; + } var[nv++] = 0.01; } return nv; @@ -535,15 +571,18 @@ int valsol(const double *azel, const int *vsat, int n, /* chi-square validation of residuals */ vv = dot(v, v, nv); - if (nv > nx && vv > chisqr[nv - nx - 1]) + if (nv > nx && vv > CHISQR[nv - nx - 1]) { - sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, chisqr[nv - nx - 1]); + sprintf(msg, "chi-square error nv=%d vv=%.1f cs=%.1f", nv, vv, CHISQR[nv - nx - 1]); return 0; } /* large gdop check */ for (i = ns = 0; i < n; i++) { - if (!vsat[i]) continue; + if (!vsat[i]) + { + continue; + } azels[ns * 2] = azel[i * 2]; azels[1 + ns * 2] = azel[1 + i * 2]; ns++; @@ -573,7 +612,10 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, H = mat(NX, n + 4); var = mat(n + 4, 1); - for (i = 0; i < 3; i++) x[i] = sol->rr[i]; + for (i = 0; i < 3; i++) + { + x[i] = sol->rr[i]; + } for (i = 0; i < MAXITR; i++) { @@ -590,7 +632,10 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, { sig = sqrt(var[j]); v[j] /= sig; - for (k = 0; k < NX; k++) H[k + j * NX] /= sig; + for (k = 0; k < NX; k++) + { + H[k + j * NX] /= sig; + } } /* least square estimation */ if ((info = lsq(H, v, NX, nv, dx, Q))) @@ -598,7 +643,10 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, sprintf(msg, "lsq error info=%d", info); break; } - for (j = 0; j < NX; j++) x[j] += dx[j]; + for (j = 0; j < NX; j++) + { + x[j] += dx[j]; + } if (norm_rtk(dx, NX) < 1e-4) { @@ -608,8 +656,14 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, sol->dtr[1] = x[4] / SPEED_OF_LIGHT; /* glo-gps time offset (s) */ sol->dtr[2] = x[5] / SPEED_OF_LIGHT; /* gal-gps time offset (s) */ sol->dtr[3] = x[6] / SPEED_OF_LIGHT; /* bds-gps time offset (s) */ - for (j = 0; j < 6; j++) sol->rr[j] = j < 3 ? x[j] : 0.0; - for (j = 0; j < 3; j++) sol->qr[j] = static_cast(Q[j + j * NX]); + for (j = 0; j < 6; j++) + { + sol->rr[j] = j < 3 ? x[j] : 0.0; + } + for (j = 0; j < 3; j++) + { + sol->qr[j] = static_cast(Q[j + j * NX]); + } sol->qr[3] = static_cast(Q[1]); /* cov xy */ sol->qr[4] = static_cast(Q[2 + NX]); /* cov yz */ sol->qr[5] = static_cast(Q[2]); /* cov zx */ @@ -628,7 +682,10 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts, return stat; } } - if (i >= MAXITR) sprintf(msg, "iteration divergent i=%d", i); + if (i >= MAXITR) + { + sprintf(msg, "iteration divergent i=%d", i); + } free(v); free(H); @@ -652,7 +709,10 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, trace(3, "raim_fde: %s n=%2d\n", time_str(obs[0].time, 0), n); - if (!(obs_e = static_cast(malloc(sizeof(obsd_t) * n)))) return 0; + if (!(obs_e = static_cast(malloc(sizeof(obsd_t) * n)))) + { + return 0; + } rs_e = mat(6, n); dts_e = mat(2, n); vare_e = mat(1, n); @@ -666,7 +726,10 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, /* satellite exclution */ for (j = k = 0; j < n; j++) { - if (j == i) continue; + if (j == i) + { + continue; + } obs_e[k] = obs[j]; matcpy(rs_e + 6 * k, rs + 6 * j, 6, 1); matcpy(dts_e + 2 * k, dts + 2 * j, 2, 1); @@ -682,7 +745,10 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, } for (j = nvsat = 0, rms_e = 0.0; j < n - 1; j++) { - if (!vsat_e[j]) continue; + if (!vsat_e[j]) + { + continue; + } rms_e += std::pow(resp_e[j], 2.0); nvsat++; } @@ -696,12 +762,18 @@ int raim_fde(const obsd_t *obs, int n, const double *rs, trace(3, "raim_fde: exsat=%2d rms=%8.3f\n", obs[i].sat, rms_e); - if (rms_e > rms) continue; + if (rms_e > rms) + { + continue; + } /* save result */ for (j = k = 0; j < n; j++) { - if (j == i) continue; + if (j == i) + { + continue; + } matcpy(azel + 2 * j, azel_e + 2 * k, 2, 1); vsat[j] = vsat_e[k]; resp[j] = resp_e[k++]; @@ -748,9 +820,18 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts, for (i = 0; i < n && i < MAXOBS; i++) { - if (obs[i].code[0] != CODE_NONE) band = 0; - if (obs[i].code[1] != CODE_NONE) band = 1; - if (obs[i].code[2] != CODE_NONE) band = 2; + if (obs[i].code[0] != CODE_NONE) + { + band = 0; + } + if (obs[i].code[1] != CODE_NONE) + { + band = 1; + } + if (obs[i].code[2] != CODE_NONE) + { + band = 2; + } lam = nav->lam[obs[i].sat - 1][band]; if (obs[i].D[band] == 0.0 || lam == 0.0 || !vsat[i] || norm_rtk(rs + 3 + i * 6, 3) <= 0.0) @@ -765,7 +846,10 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts, matmul("TN", 3, 1, 3, 1.0, E, a, 0.0, e); /* satellite velocity relative to receiver in ecef */ - for (j = 0; j < 3; j++) vs[j] = rs[j + 3 + i * 6] - x[j]; + for (j = 0; j < 3; j++) + { + vs[j] = rs[j + 3 + i * 6] - x[j]; + } /* range rate with earth rotation correction */ rate = dot(vs, e, 3) + DEFAULT_OMEGA_EARTH_DOT / SPEED_OF_LIGHT * (rs[4 + i * 6] * rr[0] + rs[1 + i * 6] * x[0] - rs[3 + i * 6] * rr[1] - rs[i * 6] * x[1]); @@ -774,7 +858,10 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts, v[nv] = -lam * obs[i].D[band] - (rate + x[3] - SPEED_OF_LIGHT * dts[1 + i * 2]); /* design matrix */ - for (j = 0; j < 4; j++) H[j + nv * 4] = j < 3 ? -e[j] : 1.0; + for (j = 0; j < 4; j++) + { + H[j + nv * 4] = j < 3 ? -e[j] : 1.0; + } nv++; } @@ -803,13 +890,22 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts, break; } /* least square estimation */ - if (lsq(H, v, 4, nv, dx, Q)) break; + if (lsq(H, v, 4, nv, dx, Q)) + { + break; + } - for (j = 0; j < 4; j++) x[j] += dx[j]; + for (j = 0; j < 4; j++) + { + x[j] += dx[j]; + } if (norm_rtk(dx, 4) < 1e-6) { - for (i = 0; i < 3; i++) sol->rr[i + 3] = x[i]; + for (i = 0; i < 3; i++) + { + sol->rr[i + 3] = x[i]; + } break; } } @@ -881,11 +977,17 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav, stat = raim_fde(obs, n, rs, dts, var, svh, nav, &opt_, sol, azel_, vsat, resp, msg); } /* estimate receiver velocity with doppler */ - if (stat) estvel(obs, n, rs, dts, nav, &opt_, sol, azel_, vsat); + if (stat) + { + estvel(obs, n, rs, dts, nav, &opt_, sol, azel_, vsat); + } if (azel) { - for (i = 0; i < n * 2; i++) azel[i] = azel_[i]; + for (i = 0; i < n * 2; i++) + { + azel[i] = azel_[i]; + } } if (ssat) { @@ -901,7 +1003,10 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav, ssat[obs[i].sat - 1].azel[0] = azel_[i * 2]; ssat[obs[i].sat - 1].azel[1] = azel_[1 + i * 2]; ssat[obs[i].sat - 1].snr[0] = obs[i].SNR[0]; - if (!vsat[i]) continue; + if (!vsat[i]) + { + continue; + } ssat[obs[i].sat - 1].vs = 1; ssat[obs[i].sat - 1].resp[0] = resp[i]; } diff --git a/src/algorithms/libs/rtklib/rtklib_ppp.cc b/src/algorithms/libs/rtklib/rtklib_ppp.cc index 3589ab522..83329ca48 100644 --- a/src/algorithms/libs/rtklib/rtklib_ppp.cc +++ b/src/algorithms/libs/rtklib/rtklib_ppp.cc @@ -57,6 +57,7 @@ #include "rtklib_rtkcmn.h" #include "rtklib_sbas.h" #include "rtklib_tides.h" +#include /* wave length of LC (m) -----------------------------------------------------*/ double lam_LC(int i, int j, int k) @@ -116,8 +117,14 @@ double p_gamma(double a, double x, double log_gamma_a) double y, w; int i; - if (x == 0.0) return 0.0; - if (x >= a + 1.0) return 1.0 - q_gamma(a, x, log_gamma_a); + if (x == 0.0) + { + return 0.0; + } + if (x >= a + 1.0) + { + return 1.0 - q_gamma(a, x, log_gamma_a); + } y = w = exp(a * log(x) - x - log_gamma_a) / a; @@ -125,7 +132,10 @@ double p_gamma(double a, double x, double log_gamma_a) { w *= x / (a + i); y += w; - if (fabs(w) < 1E-15) break; + if (fabs(w) < 1E-15) + { + break; + } } return y; } @@ -136,7 +146,10 @@ double q_gamma(double a, double x, double log_gamma_a) double y, w, la = 1.0, lb = x + 1.0 - a, lc; int i; - if (x < a + 1.0) return 1.0 - p_gamma(a, x, log_gamma_a); + if (x < a + 1.0) + { + return 1.0 - p_gamma(a, x, log_gamma_a); + } w = exp(-x + a * log(x) - log_gamma_a); y = w / lb; for (i = 2; i < 100; i++) @@ -146,7 +159,10 @@ double q_gamma(double a, double x, double log_gamma_a) lb = lc; w *= (i - 1 - a) / i; y += w / la / lb; - if (fabs(w / la / lb) < 1E-15) break; + if (fabs(w / la / lb) < 1E-15) + { + break; + } } return y; } @@ -185,9 +201,15 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu { sat = obs[i].sat; - if (azel[1 + 2 * i] < rtk->opt.elmin) continue; + if (azel[1 + 2 * i] < rtk->opt.elmin) + { + continue; + } - if (satsys(sat, nullptr) != SYS_GPS) continue; + if (satsys(sat, nullptr) != SYS_GPS) + { + continue; + } /* triple-freq carrier and code LC (m) */ LC1 = L_LC(1, -1, 0, obs[i].L) - P_LC(1, 1, 0, obs[i].P); @@ -211,7 +233,10 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu amb->LC[0] = amb->LC[1] = amb->LC[2] = 0.0; amb->LCv[0] = amb->LCv[1] = amb->LCv[2] = 0.0; amb->fixcnt = 0; - for (j = 0; j < MAXSAT; j++) amb->flags[j] = 0; + for (j = 0; j < MAXSAT; j++) + { + amb->flags[j] = 0; + } } /* averaging */ if (LC1) @@ -245,7 +270,10 @@ int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW) amb1 = rtk->ambc + sat1 - 1; amb2 = rtk->ambc + sat2 - 1; - if (!amb1->n[0] || !amb2->n[0]) return 0; + if (!amb1->n[0] || !amb2->n[0]) + { + return 0; + } /* wide-lane ambiguity */ #ifndef REV_WL_FCB @@ -284,15 +312,27 @@ int is_depend(int sat1, int sat2, int *flgs, int *max_flg) else if (flgs[sat1 - 1] > flgs[sat2 - 1]) { for (i = 0; i < MAXSAT; i++) - if (flgs[i] == flgs[sat2 - 1]) flgs[i] = flgs[sat1 - 1]; + { + if (flgs[i] == flgs[sat2 - 1]) + { + flgs[i] = flgs[sat1 - 1]; + } + } } else if (flgs[sat1 - 1] < flgs[sat2 - 1]) { for (i = 0; i < MAXSAT; i++) - if (flgs[i] == flgs[sat1 - 1]) flgs[i] = flgs[sat2 - 1]; + { + if (flgs[i] == flgs[sat1 - 1]) + { + flgs[i] = flgs[sat2 - 1]; + } + } } else - return 0; /* linear depenent */ + { + return 0; /* linear depenent */ + } return 1; } @@ -304,18 +344,26 @@ int sel_amb(int *sat1, int *sat2, double *N, double *var, int n) /* sort by variance */ for (i = 0; i < n; i++) - for (j = 1; j < n - i; j++) - { - if (var[j] >= var[j - 1]) continue; - SWAP_I(sat1[j], sat1[j - 1]); - SWAP_I(sat2[j], sat2[j - 1]); - SWAP_D(N[j], N[j - 1]); - SWAP_D(var[j], var[j - 1]); - } + { + for (j = 1; j < n - i; j++) + { + if (var[j] >= var[j - 1]) + { + continue; + } + SWAP_I(sat1[j], sat1[j - 1]); + SWAP_I(sat2[j], sat2[j - 1]); + SWAP_D(N[j], N[j - 1]); + SWAP_D(var[j], var[j - 1]); + } + } /* select linearly independent satellite pair */ for (i = j = 0; i < n; i++) { - if (!is_depend(sat1[i], sat2[i], flgs, &max_flg)) continue; + if (!is_depend(sat1[i], sat2[i], flgs, &max_flg)) + { + continue; + } sat1[j] = sat1[i]; sat2[j] = sat2[i]; N[j] = N[i]; @@ -332,7 +380,10 @@ int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2, double *v, *H, *R; int i, j, k, info; - if (n <= 0) return 0; + if (n <= 0) + { + return 0; + } v = zeros(n, 1); H = zeros(rtk->nx, n); @@ -385,8 +436,8 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n) double C1, C2, B1, v1, BC, v, vc, *NC, *var, lam_NL = lam_LC(1, 1, 0), lam1, lam2; int i, j, k, m = 0, N1, stat; - lam1 = lam_carr[0]; - lam2 = lam_carr[1]; + lam1 = LAM_CARR[0]; + lam2 = LAM_CARR[1]; C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); @@ -419,7 +470,10 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n) /* check residuals */ v = rtk->ssat[sat1[i] - 1].resc[0] - rtk->ssat[sat2[i] - 1].resc[0]; vc = v + (BC - (rtk->x[j] - rtk->x[k])); - if (fabs(vc) > THRES_RES) continue; + if (fabs(vc) > THRES_RES) + { + continue; + } sat1[m] = sat1[i]; sat2[m] = sat2[i]; @@ -444,8 +498,8 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n) double C1, C2, *B1, *N1, *NC, *D, *E, *Q, s[2], lam_NL = lam_LC(1, 1, 0), lam1, lam2; int i, j, k, m = 0, info, stat, flgs[MAXSAT] = {0}, max_flg = 0; - lam1 = lam_carr[0]; - lam2 = lam_carr[1]; + lam1 = LAM_CARR[0]; + lam2 = LAM_CARR[1]; C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); @@ -460,7 +514,10 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n) for (i = 0; i < n; i++) { /* check linear independency */ - if (!is_depend(sat1[i], sat2[i], flgs, &max_flg)) continue; + if (!is_depend(sat1[i], sat2[i], flgs, &max_flg)) + { + continue; + } j = IB_PPP(sat1[i], &rtk->opt); k = IB_PPP(sat2[i], &rtk->opt); @@ -470,7 +527,10 @@ int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n) N1[m] = ROUND_PPP(B1[m]); /* validation of narrow-lane ambiguity */ - if (fabs(N1[m] - B1[m]) > rtk->opt.thresar[2]) continue; + if (fabs(N1[m] - B1[m]) > rtk->opt.thresar[2]) + { + continue; + } /* narrow-lane ambiguity transformation matrix */ D[j + m * rtk->nx] = 1.0 / lam_NL; @@ -561,7 +621,10 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, double elmask; int i, j, m = 0, stat = 0, *NW, *sat1, *sat2; - if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2) return 0; + if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2) + { + return 0; + } trace(3, "pppamb: time=%s n=%d\n", time_str(obs[0].time, 0), n); @@ -576,20 +639,28 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav, /* fix wide-lane ambiguity */ for (i = 0; i < n - 1; i++) - for (j = i + 1; j < n; j++) - { - if (!rtk->ssat[obs[i].sat - 1].vsat[0] || - !rtk->ssat[obs[j].sat - 1].vsat[0] || - azel[1 + i * 2] < elmask || azel[1 + j * 2] < elmask) continue; + { + for (j = i + 1; j < n; j++) + { + if (!rtk->ssat[obs[i].sat - 1].vsat[0] || + !rtk->ssat[obs[j].sat - 1].vsat[0] || + azel[1 + i * 2] < elmask || azel[1 + j * 2] < elmask) + { + continue; + } #if 0 /* test already fixed */ if (rtk->ambc[obs[i].sat-1].flags[obs[j].sat-1] && rtk->ambc[obs[j].sat-1].flags[obs[i].sat-1]) continue; #endif - sat1[m] = obs[i].sat; - sat2[m] = obs[j].sat; - if (fix_amb_WL(rtk, nav, sat1[m], sat2[m], NW + m)) m++; - } + sat1[m] = obs[i].sat; + sat2[m] = obs[j].sat; + if (fix_amb_WL(rtk, nav, sat1[m], sat2[m], NW + m)) + { + m++; + } + } + } /* fix narrow-lane ambiguity */ if (rtk->opt.modear == ARMODE_PPPAR) { @@ -614,7 +685,10 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp) int i, j, week, nfreq = 1; char id[32]; - if (level <= 0 || !fp) return; + if (level <= 0 || !fp) + { + return; + } trace(3, "pppoutsolstat:\n"); @@ -653,13 +727,19 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp) fprintf(fp, "$TRPG,%d,%.3f,%d,%d,%.5f,%.5f,%.5f,%.5f\n", week, tow, rtk->sol.stat, 1, rtk->x[i + 1], rtk->x[i + 2], 0.0, 0.0); } - if (rtk->sol.stat == SOLQ_NONE || level <= 1) return; + if (rtk->sol.stat == SOLQ_NONE || level <= 1) + { + return; + } /* residuals and status */ for (i = 0; i < MAXSAT; i++) { ssat = rtk->ssat + i; - if (!ssat->vs) continue; + if (!ssat->vs) + { + continue; + } satno2id(i + 1, id); for (j = 0; j < nfreq; j++) { @@ -684,16 +764,25 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs) /* unit vector of sun direction (ecef) */ sunmoonpos(gpst2utc(obs[0].time), erpv, rsun, nullptr, nullptr); - if (normv3(rsun, esun) == 0) trace(1, "Error computing the norm"); + if (normv3(rsun, esun) == 0) + { + trace(1, "Error computing the norm"); + } for (i = 0; i < n; i++) { type = nav->pcvs[obs[i].sat - 1].type; - if ((r = norm_rtk(rs + i * 6, 3)) <= 0.0) continue; + if ((r = norm_rtk(rs + i * 6, 3)) <= 0.0) + { + continue; + } #if 1 /* only block IIA */ - if (*type && !strstr(type, "BLOCK IIA")) continue; + if (*type && !strstr(type, "BLOCK IIA")) + { + continue; + } #endif /* sun-earth-satellite angle */ cosa = dot(rs + i * 6, esun, 3) / r; @@ -701,12 +790,18 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs) ang = acos(cosa); /* test eclipse */ - if (ang < PI / 2.0 || r * sin(ang) > RE_WGS84) continue; + if (ang < PI / 2.0 || r * sin(ang) > RE_WGS84) + { + continue; + } trace(2, "eclipsing sat excluded %s sat=%2d\n", time_str(obs[0].time, 0), obs[i].sat); - for (j = 0; j < 3; j++) rs[j + i * 6] = 0.0; + for (j = 0; j < 3; j++) + { + rs[j + i * 6] = 0.0; + } } } @@ -745,9 +840,15 @@ double varerr(int sat __attribute__((unused)), int sys, double el, int type, con } else { /* normal error model */ - if (type == 1) fact *= opt->eratio[0]; + if (type == 1) + { + fact *= opt->eratio[0]; + } fact *= sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); - if (opt->ionoopt == IONOOPT_IFLC) fact *= 3.0; + if (opt->ionoopt == IONOOPT_IFLC) + { + fact *= 3.0; + } a = fact * opt->err[1]; b = fact * opt->err[2]; } @@ -779,9 +880,15 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, trace(4, "ifmeas :\n"); /* L1-L2 for GPS/GLO/QZS, L1-L5 for GAL/SBS */ - if (NFREQ >= 3 && (satsys(obs->sat, nullptr) & (SYS_GAL | SYS_SBS))) j = 2; + if (NFREQ >= 3 && (satsys(obs->sat, nullptr) & (SYS_GAL | SYS_SBS))) + { + j = 2; + } - if (NFREQ < 2 || lam[i] == 0.0 || lam[j] == 0.0) return 0; + if (NFREQ < 2 || lam[i] == 0.0 || lam[j] == 0.0) + { + return 0; + } /* test snr mask */ if (testsnr(0, i, azel[1], obs->SNR[i] * 0.25, &opt->snrmask) || @@ -803,18 +910,30 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, { P1_C1 = nav->lexeph[obs->sat - 1].isc[0] * SPEED_OF_LIGHT; /* ISC_L1C/A */ } - if (L1 == 0.0 || L2 == 0.0 || P1 == 0.0 || P2 == 0.0) return 0; + if (L1 == 0.0 || L2 == 0.0 || P1 == 0.0 || P2 == 0.0) + { + return 0; + } /* iono-free phase with windup correction */ meas[0] = c1 * L1 + c2 * L2 - (c1 * lam[i] + c2 * lam[j]) * phw; /* iono-free code with dcb correction */ - if (obs->code[i] == CODE_L1C) P1 += P1_C1; /* C1->P1 */ - if (obs->code[j] == CODE_L2C) P2 += P2_C2; /* C2->P2 */ + if (obs->code[i] == CODE_L1C) + { + P1 += P1_C1; /* C1->P1 */ + } + if (obs->code[j] == CODE_L2C) + { + P2 += P2_C2; /* C2->P2 */ + } meas[1] = c1 * P1 + c2 * P2; var[1] = std::pow(ERR_CBIAS, 2.0); - if (opt->sateph == EPHOPT_SBAS) meas[1] -= P1_C1; /* sbas clock based C1 */ + if (opt->sateph == EPHOPT_SBAS) + { + meas[1] -= P1_C1; /* sbas clock based C1 */ + } /* gps-glonass h/w bias correction for code */ if (opt->exterr.ena[3] && satsys(obs->sat, nullptr) == SYS_GLO) @@ -824,8 +943,14 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel, /* antenna phase center variation correction */ for (k = 0; k < 2; k++) { - if (dants) meas[k] -= c1 * dants[i] + c2 * dants[j]; - if (dantr) meas[k] -= c1 * dantr[i] + c2 * dantr[j]; + if (dants) + { + meas[k] -= c1 * dants[i] + c2 * dants[j]; + } + if (dantr) + { + meas[k] -= c1 * dantr[i] + c2 * dantr[j]; + } } return 1; } @@ -837,7 +962,10 @@ double gettgd_ppp(int sat, const nav_t *nav) int i; for (i = 0; i < nav->n; i++) { - if (nav->eph[i].sat != sat) continue; + if (nav->eph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT * nav->eph[i].tgd[0]; } return 0.0; @@ -902,9 +1030,15 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, { return ifmeas(obs, nav, azel, opt, dantr, dants, phw, meas, var); } - if (lam[0] == 0.0 || obs->L[0] == 0.0 || obs->P[0] == 0.0) return 0; + if (lam[0] == 0.0 || obs->L[0] == 0.0 || obs->P[0] == 0.0) + { + return 0; + } - if (testsnr(0, 0, azel[1], obs->SNR[0] * 0.25, &opt->snrmask)) return 0; + if (testsnr(0, 0, azel[1], obs->SNR[0] * 0.25, &opt->snrmask)) + { + return 0; + } L1 = obs->L[0] * lam[0]; P1 = obs->P[0]; @@ -917,8 +1051,11 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, { P1_P2 = (1.0 - gamma) * gettgd_ppp(obs->sat, nav); } - if (obs->code[0] == CODE_L1C) P1 += P1_C1; /* C1->P1 */ - PC = P1 - P1_P2 / (1.0 - gamma); /* P1->PC */ + if (obs->code[0] == CODE_L1C) + { + P1 += P1_C1; /* C1->P1 */ + } + PC = P1 - P1_P2 / (1.0 - gamma); /* P1->PC */ /* slant ionospheric delay L1 (m) */ if (!corr_ion(obs->time, nav, obs->sat, pos, azel, opt->ionoopt, &ion, &vari, brk)) @@ -937,8 +1074,14 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos, /* antenna phase center variation correction */ for (i = 0; i < 2; i++) { - if (dants) meas[i] -= dants[0]; - if (dantr) meas[i] -= dantr[0]; + if (dants) + { + meas[i] -= dants[0]; + } + if (dantr) + { + meas[i] -= dantr[0]; + } } return 1; } @@ -949,7 +1092,10 @@ double gfmeas(const obsd_t *obs, const nav_t *nav) { const double *lam = nav->lam[obs->sat - 1]; - if (lam[0] == 0.0 || lam[1] == 0.0 || obs->L[0] == 0.0 || obs->L[1] == 0.0) return 0.0; + if (lam[0] == 0.0 || lam[1] == 0.0 || obs->L[0] == 0.0 || obs->L[1] == 0.0) + { + return 0.0; + } return lam[0] * obs->L[0] - lam[1] * obs->L[1]; } @@ -965,16 +1111,25 @@ void udpos_ppp(rtk_t *rtk) /* fixed mode */ if (rtk->opt.mode == PMODE_PPP_FIXED) { - for (i = 0; i < 3; i++) initx(rtk, rtk->opt.ru[i], 1E-8, i); + for (i = 0; i < 3; i++) + { + initx(rtk, rtk->opt.ru[i], 1E-8, i); + } return; } /* initialize position for first epoch */ if (norm_rtk(rtk->x, 3) <= 0.0) { - for (i = 0; i < 3; i++) initx(rtk, rtk->sol.rr[i], VAR_POS_PPP, i); + for (i = 0; i < 3; i++) + { + initx(rtk, rtk->sol.rr[i], VAR_POS_PPP, i); + } } /* static ppp mode */ - if (rtk->opt.mode == PMODE_PPP_STATIC) return; + if (rtk->opt.mode == PMODE_PPP_STATIC) + { + return; + } /* kinmatic mode without dynamics */ for (i = 0; i < 3; i++) @@ -1026,7 +1181,10 @@ void udtrop_ppp(rtk_t *rtk) if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (j = 0; j < 2; j++) initx(rtk, 1E-6, VAR_GRA_PPP, ++i); + for (j = 0; j < 2; j++) + { + initx(rtk, 1E-6, VAR_GRA_PPP, ++i); + } } } else @@ -1052,14 +1210,19 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n) trace(3, "detslp_ll: n=%d\n", n); for (i = 0; i < n && i < MAXOBS; i++) - for (j = 0; j < rtk->opt.nf; j++) - { - if (obs[i].L[j] == 0.0 || !(obs[i].LLI[j] & 3)) continue; + { + for (j = 0; j < rtk->opt.nf; j++) + { + if (obs[i].L[j] == 0.0 || !(obs[i].LLI[j] & 3)) + { + continue; + } - trace(3, "detslp_ll: slip detected sat=%2d f=%d\n", obs[i].sat, j + 1); + trace(3, "detslp_ll: slip detected sat=%2d f=%d\n", obs[i].sat, j + 1); - rtk->ssat[obs[i].sat - 1].slip[j] = 1; - } + rtk->ssat[obs[i].sat - 1].slip[j] = 1; + } + } } @@ -1073,7 +1236,10 @@ void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) for (i = 0; i < n && i < MAXOBS; i++) { - if ((g1 = gfmeas(obs + i, nav)) == 0.0) continue; + if ((g1 = gfmeas(obs + i, nav)) == 0.0) + { + continue; + } g0 = rtk->ssat[obs[i].sat - 1].gf; rtk->ssat[obs[i].sat - 1].gf = g1; @@ -1085,7 +1251,10 @@ void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) trace(3, "detslip_gf: slip detected sat=%2d gf=%8.3f->%8.3f\n", obs[i].sat, g0, g1); - for (j = 0; j < rtk->opt.nf; j++) rtk->ssat[obs[i].sat - 1].slip[j] |= 1; + for (j = 0; j < rtk->opt.nf; j++) + { + rtk->ssat[obs[i].sat - 1].slip[j] |= 1; + } } } } @@ -1100,10 +1269,12 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) trace(3, "udbias : n=%d\n", n); for (i = 0; i < MAXSAT; i++) - for (j = 0; j < rtk->opt.nf; j++) - { - rtk->ssat[i].slip[j] = 0; - } + { + for (j = 0; j < rtk->opt.nf; j++) + { + rtk->ssat[i].slip[j] = 0; + } + } /* detect cycle slip by LLI */ detslp_ll(rtk, obs, n); @@ -1125,7 +1296,10 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) sat = obs[i].sat; j = IB_PPP(sat, &rtk->opt); if (!corrmeas(obs + i, nav, pos, rtk->ssat[sat - 1].azel, &rtk->opt, nullptr, nullptr, - 0.0, meas, var, &brk)) continue; + 0.0, meas, var, &brk)) + { + continue; + } if (brk) { @@ -1134,7 +1308,10 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) } bias[i] = meas[0] - meas[1]; if (rtk->x[j] == 0.0 || - rtk->ssat[sat - 1].slip[0] || rtk->ssat[sat - 1].slip[1]) continue; + rtk->ssat[sat - 1].slip[0] || rtk->ssat[sat - 1].slip[1]) + { + continue; + } offset += bias[i] - rtk->x[j]; k++; } @@ -1144,7 +1321,10 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) for (i = 0; i < MAXSAT; i++) { j = IB_PPP(i + 1, &rtk->opt); - if (rtk->x[j] != 0.0) rtk->x[j] += offset / k; + if (rtk->x[j] != 0.0) + { + rtk->x[j] += offset / k; + } } trace(2, "phase-code jump corrected: %s n=%2d dt=%12.9fs\n", time_str(rtk->sol.time, 0), k, offset / k / SPEED_OF_LIGHT); @@ -1157,9 +1337,15 @@ void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) rtk->P[j + j * rtk->nx] += std::pow(rtk->opt.prn[0], 2.0) * fabs(rtk->tt); if (rtk->x[j] != 0.0 && - !rtk->ssat[sat - 1].slip[0] && !rtk->ssat[sat - 1].slip[1]) continue; + !rtk->ssat[sat - 1].slip[0] && !rtk->ssat[sat - 1].slip[1]) + { + continue; + } - if (bias[i] == 0.0) continue; + if (bias[i] == 0.0) + { + continue; + } /* reinitialize phase-bias if detecting cycle slip */ initx(rtk, bias[i], VAR_BIAS, IB_PPP(sat, &rtk->opt)); @@ -1202,7 +1388,10 @@ void satantpcv(const double *rs, const double *rr, const pcv_t *pcv, ru[i] = rr[i] - rs[i]; rz[i] = -rs[i]; } - if (!normv3(ru, eu) || !normv3(rz, ez)) return; + if (!normv3(ru, eu) || !normv3(rz, ez)) + { + return; + } cosa = dot(eu, ez, 3); cosa = cosa < -1.0 ? -1.0 : (cosa > 1.0 ? 1.0 : cosa); @@ -1255,9 +1444,15 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do trace(3, "res_ppp : n=%d nx=%d\n", n, nx); - for (i = 0; i < MAXSAT; i++) rtk->ssat[i].vsat[0] = 0; + for (i = 0; i < MAXSAT; i++) + { + rtk->ssat[i].vsat[0] = 0; + } - for (i = 0; i < 3; i++) rr[i] = x[i]; + for (i = 0; i < 3; i++) + { + rr[i] = x[i]; + } /* earth tides correction */ if (opt->tidecorr) @@ -1266,21 +1461,33 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do tidedisp(gpst2utc(obs[0].time), rr, tideopt, &nav->erp, opt->odisp[0], disp); - for (i = 0; i < 3; i++) rr[i] += disp[i]; + for (i = 0; i < 3; i++) + { + rr[i] += disp[i]; + } } ecef2pos(rr, pos); for (i = 0; i < n && i < MAXOBS; i++) { sat = obs[i].sat; - if (!(sys = satsys(sat, nullptr)) || !rtk->ssat[sat - 1].vs) continue; + if (!(sys = satsys(sat, nullptr)) || !rtk->ssat[sat - 1].vs) + { + continue; + } /* geometric distance/azimuth/elevation angle */ if ((r = geodist(rs + i * 6, rr, e)) <= 0.0 || - satazel(pos, e, azel + i * 2) < opt->elmin) continue; + satazel(pos, e, azel + i * 2) < opt->elmin) + { + continue; + } /* excluded satellite? */ - if (satexclude(obs[i].sat, svh[i], opt)) continue; + if (satexclude(obs[i].sat, svh[i], opt)) + { + continue; + } /* tropospheric delay correction */ if (opt->tropopt == TROPOPT_SAAS) @@ -1329,13 +1536,22 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do for (j = 0; j < 2; j++) { /* for phase and code */ - if (meas[j] == 0.0) continue; + if (meas[j] == 0.0) + { + continue; + } - for (k = 0; k < nx; k++) H[k + nx * nv] = 0.0; + for (k = 0; k < nx; k++) + { + H[k + nx * nv] = 0.0; + } v[nv] = meas[j] - r; - for (k = 0; k < 3; k++) H[k + nx * nv] = -e[k]; + for (k = 0; k < 3; k++) + { + H[k + nx * nv] = -e[k]; + } if (sys != SYS_GLO) { @@ -1362,9 +1578,13 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do var[nv] = varerr(obs[i].sat, sys, azel[1 + i * 2], j, opt) + varm[j] + vare[i] + vart; if (j == 0) - rtk->ssat[sat - 1].resc[0] = v[nv]; + { + rtk->ssat[sat - 1].resc[0] = v[nv]; + } else - rtk->ssat[sat - 1].resp[0] = v[nv]; + { + rtk->ssat[sat - 1].resp[0] = v[nv]; + } /* test innovation */ #if 0 @@ -1379,15 +1599,20 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do rtk->ssat[sat - 1].rejc[0]++; continue; } - if (j == 0) rtk->ssat[sat - 1].vsat[0] = 1; + if (j == 0) + { + rtk->ssat[sat - 1].vsat[0] = 1; + } nv++; } } for (i = 0; i < nv; i++) - for (j = 0; j < nv; j++) - { - R[i + j * nv] = i == j ? var[i] : 0.0; - } + { + for (j = 0; j < nv; j++) + { + R[i + j * nv] = i == j ? var[i] : 0.0; + } + } trace(5, "x=\n"); tracemat(5, x, 1, nx, 8, 3); trace(5, "v=\n"); @@ -1421,7 +1646,10 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) var = mat(1, n); azel = zeros(2, n); - for (i = 0; i < MAXSAT; i++) rtk->ssat[i].fix[0] = 0; + for (i = 0; i < MAXSAT; i++) + { + rtk->ssat[i].fix[0] = 0; + } /* temporal update of states */ udstate_ppp(rtk, obs, n, nav); @@ -1448,7 +1676,10 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) for (i = 0; i < rtk->opt.niter; i++) { /* phase and code residuals */ - if ((nv = res_ppp(i, obs, n, rs, dts, var, svh, nav, xp, rtk, v, H, R, azel)) <= 0) break; + if ((nv = res_ppp(i, obs, n, rs, dts, var, svh, nav, xp, rtk, v, H, R, azel)) <= 0) + { + break; + } /* measurement update */ matcpy(Pp, rtk->P, rtk->nx, rtk->nx); @@ -1475,13 +1706,19 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) /* ambiguity resolution in ppp */ if (opt->modear == ARMODE_PPPAR || opt->modear == ARMODE_PPPAR_ILS) { - if (pppamb(rtk, obs, n, nav, azel)) stat = SOLQ_FIX; + if (pppamb(rtk, obs, n, nav, azel)) + { + stat = SOLQ_FIX; + } } /* update solution status */ rtk->sol.ns = 0; for (i = 0; i < n && i < MAXOBS; i++) { - if (!rtk->ssat[obs[i].sat - 1].vsat[0]) continue; + if (!rtk->ssat[obs[i].sat - 1].vsat[0]) + { + continue; + } rtk->ssat[obs[i].sat - 1].lock[0]++; rtk->ssat[obs[i].sat - 1].outc[0] = 0; rtk->ssat[obs[i].sat - 1].fix[0] = 4; @@ -1505,7 +1742,10 @@ void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) } for (i = 0; i < MAXSAT; i++) { - if (rtk->ssat[i].slip[0] & 3) rtk->ssat[i].slipc[0]++; + if (rtk->ssat[i].slip[0] & 3) + { + rtk->ssat[i].slipc[0]++; + } } } free(rs); diff --git a/src/algorithms/libs/rtklib/rtklib_preceph.cc b/src/algorithms/libs/rtklib/rtklib_preceph.cc index 72c62fbf1..61217a8ae 100644 --- a/src/algorithms/libs/rtklib/rtklib_preceph.cc +++ b/src/algorithms/libs/rtklib/rtklib_preceph.cc @@ -62,16 +62,35 @@ #include "rtklib_preceph.h" #include "rtklib_rtkcmn.h" +#include /* satellite code to satellite system ----------------------------------------*/ int code2sys(char code) { - if (code == 'G' || code == ' ') return SYS_GPS; - if (code == 'R') return SYS_GLO; - if (code == 'E') return SYS_GAL; /* extension to sp3-c */ - if (code == 'J') return SYS_QZS; /* extension to sp3-c */ - if (code == 'C') return SYS_BDS; /* extension to sp3-c */ - if (code == 'L') return SYS_LEO; /* extension to sp3-c */ + if (code == 'G' || code == ' ') + { + return SYS_GPS; + } + if (code == 'R') + { + return SYS_GLO; + } + if (code == 'E') + { + return SYS_GAL; /* extension to sp3-c */ + } + if (code == 'J') + { + return SYS_QZS; /* extension to sp3-c */ + } + if (code == 'C') + { + return SYS_BDS; /* extension to sp3-c */ + } + if (code == 'L') + { + return SYS_LEO; /* extension to sp3-c */ + } return SYS_NONE; } @@ -87,12 +106,18 @@ int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, for (i = 0; i < 22; i++) { - if (!fgets(buff, sizeof(buff), fp)) break; + if (!fgets(buff, sizeof(buff), fp)) + { + break; + } if (i == 0) { *type = buff[2]; - if (str2time(buff, 3, 28, time)) return 0; + if (str2time(buff, 3, 28, time)) + { + return 0; + } } else if (2 <= i && i <= 6) { @@ -104,7 +129,10 @@ int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats, { sys = code2sys(buff[9 + 3 * j]); prn = static_cast(str2num(buff, 10 + 3 * j, 2)); - if (k < MAXSAT) sats[k++] = satno(sys, prn); + if (k < MAXSAT) + { + sats[k++] = satno(sys, prn); + } } } else if (i == 12) @@ -159,14 +187,20 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co while (fgets(buff, sizeof(buff), fp)) { - if (!strncmp(buff, "EOF", 3)) break; + if (!strncmp(buff, "EOF", 3)) + { + break; + } if (buff[0] != '*' || str2time(buff, 3, 28, &time)) { trace(2, "sp3 invalid epoch %31.31s\n", buff); continue; } - if (!strcmp(tsys, "UTC")) time = utc2gpst(time); /* utc->gpst */ + if (!strcmp(tsys, "UTC")) + { + time = utc2gpst(time); /* utc->gpst */ + } peph.time = time; peph.index = index; @@ -187,16 +221,26 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co } for (i = pred_o = pred_c = v = 0; i < n && fgets(buff, sizeof(buff), fp); i++) { - if (strlen(buff) < 4 || (buff[0] != 'P' && buff[0] != 'V')) continue; + if (strlen(buff) < 4 || (buff[0] != 'P' && buff[0] != 'V')) + { + continue; + } sys = buff[1] == ' ' ? SYS_GPS : code2sys(buff[1]); prn = static_cast(str2num(buff, 2, 2)); if (sys == SYS_SBS) - prn += 100; + { + prn += 100; + } else if (sys == SYS_QZS) - prn += 192; /* extension to sp3-c */ + { + prn += 192; /* extension to sp3-c */ + } - if (!(sat = satno(sys, prn))) continue; + if (!(sat = satno(sys, prn))) + { + continue; + } if (buff[0] == 'P') { @@ -206,10 +250,22 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co for (j = 0; j < 4; j++) { /* read option for predicted value */ - if (j < 3 && (opt & 1) && pred_o) continue; - if (j < 3 && (opt & 2) && !pred_o) continue; - if (j == 3 && (opt & 1) && pred_c) continue; - if (j == 3 && (opt & 2) && !pred_c) continue; + if (j < 3 && (opt & 1) && pred_o) + { + continue; + } + if (j < 3 && (opt & 2) && !pred_o) + { + continue; + } + if (j == 3 && (opt & 1) && pred_c) + { + continue; + } + if (j == 3 && (opt & 2) && !pred_c) + { + continue; + } val = str2num(buff, 4 + j * 14, 14); std = str2num(buff, 61 + j * 3, j < 3 ? 2 : 3); @@ -241,7 +297,10 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co } if (v) { - if (!addpeph(nav, &peph)) return; + if (!addpeph(nav, &peph)) + { + return; + } } } } @@ -265,7 +324,10 @@ void combpeph(nav_t *nav, int opt) qsort(nav->peph, nav->ne, sizeof(peph_t), cmppeph); - if (opt & 4) return; + if (opt & 4) + { + return; + } for (i = 0, j = 1; j < nav->ne; j++) { @@ -273,15 +335,32 @@ void combpeph(nav_t *nav, int opt) { for (k = 0; k < MAXSAT; k++) { - if (norm_rtk(nav->peph[j].pos[k], 4) <= 0.0) continue; - for (m = 0; m < 4; m++) nav->peph[i].pos[k][m] = nav->peph[j].pos[k][m]; - for (m = 0; m < 4; m++) nav->peph[i].std[k][m] = nav->peph[j].std[k][m]; - for (m = 0; m < 4; m++) nav->peph[i].vel[k][m] = nav->peph[j].vel[k][m]; - for (m = 0; m < 4; m++) nav->peph[i].vst[k][m] = nav->peph[j].vst[k][m]; + if (norm_rtk(nav->peph[j].pos[k], 4) <= 0.0) + { + continue; + } + for (m = 0; m < 4; m++) + { + nav->peph[i].pos[k][m] = nav->peph[j].pos[k][m]; + } + for (m = 0; m < 4; m++) + { + nav->peph[i].std[k][m] = nav->peph[j].std[k][m]; + } + for (m = 0; m < 4; m++) + { + nav->peph[i].vel[k][m] = nav->peph[j].vel[k][m]; + } + for (m = 0; m < 4; m++) + { + nav->peph[i].vst[k][m] = nav->peph[j].vst[k][m]; + } } } else if (++i < j) - nav->peph[i] = nav->peph[j]; + { + nav->peph[i] = nav->peph[j]; + } } nav->ne = i + 1; @@ -317,7 +396,10 @@ void readsp3(const char *file, nav_t *nav, int opt) { if (!(efiles[i] = static_cast(malloc(1024)))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) + { + free(efiles[i]); + } return; } } @@ -326,10 +408,16 @@ void readsp3(const char *file, nav_t *nav, int opt) for (i = j = 0; i < n; i++) { - if (!(ext = strrchr(efiles[i], '.'))) continue; + if (!(ext = strrchr(efiles[i], '.'))) + { + continue; + } if (!strstr(ext + 1, "sp3") && !strstr(ext + 1, ".SP3") && - !strstr(ext + 1, "eph") && !strstr(ext + 1, ".EPH")) continue; + !strstr(ext + 1, "eph") && !strstr(ext + 1, ".EPH")) + { + continue; + } if (!(fp = fopen(efiles[i], "re"))) { @@ -344,10 +432,16 @@ void readsp3(const char *file, nav_t *nav, int opt) fclose(fp); } - for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) + { + free(efiles[i]); + } /* combine precise ephemeris */ - if (nav->ne > 0) combpeph(nav, opt); + if (nav->ne > 0) + { + combpeph(nav, opt); + } } @@ -367,7 +461,10 @@ int readsap(const char *file, gtime_t time, nav_t *nav) trace(3, "readsap : file=%s time=%s\n", file, time_str(time, 0)); - if (!readpcv(file, &pcvs)) return 0; + if (!readpcv(file, &pcvs)) + { + return 0; + } for (i = 0; i < MAXSAT; i++) { @@ -397,21 +494,36 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta) while (fgets(buff, sizeof(buff), fp)) { if (strstr(buff, "DIFFERENTIAL (P1-P2) CODE BIASES")) - type = 1; + { + type = 1; + } else if (strstr(buff, "DIFFERENTIAL (P1-C1) CODE BIASES")) - type = 2; + { + type = 2; + } else if (strstr(buff, "DIFFERENTIAL (P2-C2) CODE BIASES")) - type = 3; + { + type = 3; + } - if (!type || sscanf(buff, "%s %s", str1, str2) < 1) continue; + if (!type || sscanf(buff, "%s %s", str1, str2) < 1) + { + continue; + } - if ((cbias = str2num(buff, 26, 9)) == 0.0) continue; + if ((cbias = str2num(buff, 26, 9)) == 0.0) + { + continue; + } if (sta && (!strcmp(str1, "G") || !strcmp(str1, "R"))) { /* receiver dcb */ for (i = 0; i < MAXRCV; i++) { - if (!strcmp(sta[i].name, str2)) break; + if (!strcmp(sta[i].name, str2)) + { + break; + } } if (i < MAXRCV) { @@ -447,15 +559,20 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta) trace(3, "readdcb : file=%s\n", file); for (i = 0; i < MAXSAT; i++) - for (j = 0; j < 3; j++) - { - nav->cbias[i][j] = 0.0; - } + { + for (j = 0; j < 3; j++) + { + nav->cbias[i][j] = 0.0; + } + } for (i = 0; i < MAXEXFILE; i++) { if (!(efiles[i] = static_cast(malloc(1024)))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) + { + free(efiles[i]); + } return 0; } } @@ -465,7 +582,10 @@ int readdcb(const char *file, nav_t *nav, const sta_t *sta) { readdcbf(efiles[i], nav, sta); } - for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) + { + free(efiles[i]); + } return 1; } @@ -499,10 +619,12 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat, nav->fcb = nav_fcb; } for (i = 0; i < MAXSAT; i++) - for (j = 0; j < 3; j++) - { - nav->fcb[nav->nf].bias[i][j] = nav->fcb[nav->nf].std[i][j] = 0.0; - } + { + for (j = 0; j < 3; j++) + { + nav->fcb[nav->nf].bias[i][j] = nav->fcb[nav->nf].std[i][j] = 0.0; + } + } for (i = 0; i < 3; i++) { nav->fcb[nav->nf].bias[sat - 1][i] = bias[i]; @@ -532,14 +654,23 @@ int readfcbf(const char *file, nav_t *nav) } while (fgets(buff, sizeof(buff), fp)) { - if ((p = strchr(buff, '#'))) *p = '\0'; + if ((p = strchr(buff, '#'))) + { + *p = '\0'; + } if (sscanf(buff, "%lf/%lf/%lf %lf:%lf:%lf %lf/%lf/%lf %lf:%lf:%lf %s" "%lf %lf %lf %lf %lf %lf", ep1, ep1 + 1, ep1 + 2, ep1 + 3, ep1 + 4, ep1 + 5, ep2, ep2 + 1, ep2 + 2, ep2 + 3, ep2 + 4, ep2 + 5, str, bias, std, bias + 1, std + 1, - bias + 2, std + 2) < 17) continue; - if (!(sat = satid2no(str))) continue; + bias + 2, std + 2) < 17) + { + continue; + } + if (!(sat = satid2no(str))) + { + continue; + } ts = epoch2time(ep1); te = epoch2time(ep2); if (!addfcb(nav, ts, te, sat, bias, std)) @@ -580,7 +711,10 @@ int readfcb(const char *file, nav_t *nav) { if (!(efiles[i] = static_cast(malloc(1024)))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) + { + free(efiles[i]); + } return 0; } } @@ -590,7 +724,10 @@ int readfcb(const char *file, nav_t *nav) { readfcbf(efiles[i], nav); } - for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) + { + free(efiles[i]); + } if (nav->nf > 1) { @@ -639,18 +776,26 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, { k = (i + j) / 2; if (timediff(nav->peph[k].time, time) < 0.0) - i = k + 1; + { + i = k + 1; + } else - j = k; + { + j = k; + } } index = i <= 0 ? 0 : i - 1; /* polynomial interpolation for orbit */ i = index - (NMAX + 1) / 2; if (i < 0) - i = 0; + { + i = 0; + } else if (i + NMAX >= nav->ne) - i = nav->ne - NMAX - 1; + { + i = nav->ne - NMAX - 1; + } for (j = 0; j <= NMAX; j++) { @@ -682,14 +827,21 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, } if (vare) { - for (i = 0; i < 3; i++) s[i] = nav->peph[index].std[sat - 1][i]; + for (i = 0; i < 3; i++) + { + s[i] = nav->peph[index].std[sat - 1][i]; + } std = norm_rtk(s, 3); /* extrapolation error for orbit */ if (t[0] > 0.0) - std += EXTERR_EPH * std::pow(t[0], 2.0) / 2.0; + { + std += EXTERR_EPH * std::pow(t[0], 2.0) / 2.0; + } else if (t[NMAX] < 0.0) - std += EXTERR_EPH * std::pow(t[NMAX], 2.0) / 2.0; + { + std += EXTERR_EPH * std::pow(t[NMAX], 2.0) / 2.0; + } *vare = std::pow(std, 2.0); } /* linear interpolation for clock */ @@ -722,7 +874,10 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs, { dts[0] = 0.0; } - if (varc) *varc = std::pow(std, 2.0); + if (varc) + { + *varc = std::pow(std, 2.0); + } return 1; } @@ -748,9 +903,13 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, { k = (i + j) / 2; if (timediff(nav->pclk[k].time, time) < 0.0) - i = k + 1; + { + i = k + 1; + } else - j = k; + { + j = k; + } } index = i <= 0 ? 0 : i - 1; @@ -762,12 +921,18 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, if (t[0] <= 0.0) { - if ((dts[0] = c[0]) == 0.0) return 0; + if ((dts[0] = c[0]) == 0.0) + { + return 0; + } std = nav->pclk[index].std[sat - 1][0] * SPEED_OF_LIGHT - EXTERR_CLK * t[0]; } else if (t[1] >= 0.0) { - if ((dts[0] = c[1]) == 0.0) return 0; + if ((dts[0] = c[1]) == 0.0) + { + return 0; + } std = nav->pclk[index + 1].std[sat - 1][0] * SPEED_OF_LIGHT + EXTERR_CLK * t[1]; } else if (c[0] != 0.0 && c[1] != 0.0) @@ -781,7 +946,10 @@ int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts, trace(3, "prec clock outage %s sat=%2d\n", time_str(time, 0), sat); return 0; } - if (varc) *varc = std::pow(std, 2.0); + if (varc) + { + *varc = std::pow(std, 2.0); + } return 1; } @@ -812,17 +980,38 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav, sunmoonpos(gpst2utc(time), erpv, rsun, nullptr, &gmst); /* unit vectors of satellite fixed coordinates */ - for (i = 0; i < 3; i++) r[i] = -rs[i]; - if (!normv3(r, ez)) return; - for (i = 0; i < 3; i++) r[i] = rsun[i] - rs[i]; - if (!normv3(r, es)) return; + for (i = 0; i < 3; i++) + { + r[i] = -rs[i]; + } + if (!normv3(r, ez)) + { + return; + } + for (i = 0; i < 3; i++) + { + r[i] = rsun[i] - rs[i]; + } + if (!normv3(r, es)) + { + return; + } cross3(ez, es, r); - if (!normv3(r, ey)) return; + if (!normv3(r, ey)) + { + return; + } cross3(ey, ez, ex); - if (NFREQ >= 3 && (satsys(sat, nullptr) & (SYS_GAL | SYS_SBS))) k = 2; + if (NFREQ >= 3 && (satsys(sat, nullptr) & (SYS_GAL | SYS_SBS))) + { + k = 2; + } - if (NFREQ < 2 || lam[j] == 0.0 || lam[k] == 0.0) return; + if (NFREQ < 2 || lam[j] == 0.0 || lam[k] == 0.0) + { + return; + } gamma = std::pow(lam[k], 2.0) / std::pow(lam[j], 2.0); C1 = gamma / (gamma - 1.0); @@ -864,15 +1053,24 @@ int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt, trace(4, "peph2pos: time=%s sat=%2d opt=%d\n", time_str(time, 3), sat, opt); - if (sat <= 0 || MAXSAT < sat) return 0; + if (sat <= 0 || MAXSAT < sat) + { + return 0; + } /* satellite position and clock bias */ if (!pephpos(time, sat, nav, rss, dtss, &vare, &varc) || - !pephclk(time, sat, nav, dtss, &varc)) return 0; + !pephclk(time, sat, nav, dtss, &varc)) + { + return 0; + } time = timeadd(time, tt); if (!pephpos(time, sat, nav, rst, dtst, nullptr, nullptr) || - !pephclk(time, sat, nav, dtst, nullptr)) return 0; + !pephclk(time, sat, nav, dtst, nullptr)) + { + return 0; + } /* satellite antenna offset correction */ if (opt) @@ -894,7 +1092,10 @@ int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt, { /* no precise clock */ dts[0] = dts[1] = 0.0; } - if (var) *var = vare + varc; + if (var) + { + *var = vare + varc; + } return 1; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm.cc b/src/algorithms/libs/rtklib/rtklib_rtcm.cc index c82065d2c..53c34663d 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm.cc @@ -94,19 +94,30 @@ int init_rtcm(rtcm_t *rtcm) rtcm->ssr[i] = ssr0; } rtcm->msg[0] = rtcm->msgtype[0] = rtcm->opt[0] = '\0'; - for (i = 0; i < 6; i++) rtcm->msmtype[i][0] = '\0'; + for (i = 0; i < 6; i++) + { + rtcm->msmtype[i][0] = '\0'; + } rtcm->obsflag = rtcm->ephsat = 0; for (i = 0; i < MAXSAT; i++) - for (j = 0; j < NFREQ + NEXOBS; j++) - { - rtcm->cp[i][j] = 0.0; - rtcm->lock[i][j] = rtcm->loss[i][j] = 0; - rtcm->lltime[i][j] = time0; - } + { + for (j = 0; j < NFREQ + NEXOBS; j++) + { + rtcm->cp[i][j] = 0.0; + rtcm->lock[i][j] = rtcm->loss[i][j] = 0; + rtcm->lltime[i][j] = time0; + } + } rtcm->nbyte = rtcm->nbit = rtcm->len = 0; rtcm->word = 0; - for (i = 0; i < 100; i++) rtcm->nmsg2[i] = 0; - for (i = 0; i < 300; i++) rtcm->nmsg3[i] = 0; + for (i = 0; i < 100; i++) + { + rtcm->nmsg2[i] = 0; + } + for (i = 0; i < 300; i++) + { + rtcm->nmsg3[i] = 0; + } rtcm->obs.data = nullptr; rtcm->nav.eph = nullptr; @@ -123,9 +134,18 @@ int init_rtcm(rtcm_t *rtcm) rtcm->obs.n = 0; rtcm->nav.n = MAXSAT; rtcm->nav.ng = MAXPRNGLO; - for (i = 0; i < MAXOBS; i++) rtcm->obs.data[i] = data0; - for (i = 0; i < MAXSAT; i++) rtcm->nav.eph[i] = eph0; - for (i = 0; i < MAXPRNGLO; i++) rtcm->nav.geph[i] = geph0; + for (i = 0; i < MAXOBS; i++) + { + rtcm->obs.data[i] = data0; + } + for (i = 0; i < MAXSAT; i++) + { + rtcm->nav.eph[i] = eph0; + } + for (i = 0; i < MAXPRNGLO; i++) + { + rtcm->nav.geph[i] = geph0; + } return 1; } @@ -173,7 +193,10 @@ int input_rtcm2(rtcm_t *rtcm, unsigned char data) trace(5, "input_rtcm2: data=%02x\n", data); - if ((data & 0xC0) != 0x40) return 0; /* ignore if upper 2bit != 01 */ + if ((data & 0xC0) != 0x40) + { + return 0; /* ignore if upper 2bit != 01 */ + } for (i = 0; i < 6; i++, data >>= 1) { /* decode 6-of-8 form */ @@ -183,17 +206,28 @@ int input_rtcm2(rtcm_t *rtcm, unsigned char data) if (rtcm->nbyte == 0) { preamb = static_cast(rtcm->word >> 22); - if (rtcm->word & 0x40000000) preamb ^= 0xFF; /* decode preamble */ - if (preamb != RTCM2PREAMB) continue; + if (rtcm->word & 0x40000000) + { + preamb ^= 0xFF; /* decode preamble */ + } + if (preamb != RTCM2PREAMB) + { + continue; + } /* check parity */ - if (!decode_word(rtcm->word, rtcm->buff)) continue; + if (!decode_word(rtcm->word, rtcm->buff)) + { + continue; + } rtcm->nbyte = 3; rtcm->nbit = 0; continue; } if (++rtcm->nbit < 30) - continue; + { + continue; + } rtcm->nbit = 0; @@ -206,8 +240,14 @@ int input_rtcm2(rtcm_t *rtcm, unsigned char data) continue; } rtcm->nbyte += 3; - if (rtcm->nbyte == 6) rtcm->len = (rtcm->buff[5] >> 3) * 3 + 6; - if (rtcm->nbyte < rtcm->len) continue; + if (rtcm->nbyte == 6) + { + rtcm->len = (rtcm->buff[5] >> 3) * 3 + 6; + } + if (rtcm->nbyte < rtcm->len) + { + continue; + } rtcm->nbyte = 0; rtcm->word &= 0x3; @@ -290,7 +330,10 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data) /* synchronize frame */ if (rtcm->nbyte == 0) { - if (data != RTCM3PREAMB) return 0; + if (data != RTCM3PREAMB) + { + return 0; + } rtcm->buff[rtcm->nbyte++] = data; return 0; } @@ -300,7 +343,10 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data) { rtcm->len = getbitu(rtcm->buff, 14, 10) + 3; /* length without parity */ } - if (rtcm->nbyte < 3 || rtcm->nbyte < rtcm->len + 3) return 0; + if (rtcm->nbyte < 3 || rtcm->nbyte < rtcm->len + 3) + { + return 0; + } rtcm->nbyte = 0; /* check parity */ @@ -329,8 +375,14 @@ int input_rtcm2f(rtcm_t *rtcm, FILE *fp) for (i = 0; i < 4096; i++) { - if ((data = fgetc(fp)) == EOF) return -2; - if ((ret = input_rtcm2(rtcm, static_cast(data)))) return ret; + if ((data = fgetc(fp)) == EOF) + { + return -2; + } + if ((ret = input_rtcm2(rtcm, static_cast(data)))) + { + return ret; + } } return 0; /* return at every 4k bytes */ } @@ -351,8 +403,14 @@ int input_rtcm3f(rtcm_t *rtcm, FILE *fp) for (i = 0; i < 4096; i++) { - if ((data = fgetc(fp)) == EOF) return -2; - if ((ret = input_rtcm3(rtcm, static_cast(data)))) return ret; + if ((data = fgetc(fp)) == EOF) + { + return -2; + } + if ((ret = input_rtcm3(rtcm, static_cast(data)))) + { + return ret; + } } return 0; /* return at every 4k bytes */ } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm2.cc b/src/algorithms/libs/rtklib/rtklib_rtcm2.cc index c7af88ccd..24528c762 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm2.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm2.cc @@ -63,14 +63,21 @@ void adjhour(rtcm_t *rtcm, double zcnt) int week; /* if no time, get cpu time */ - if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); + if (rtcm->time.time == 0) + { + rtcm->time = utc2gpst(timeget()); + } tow = time2gpst(rtcm->time, &week); hour = floor(tow / 3600.0); sec = tow - hour * 3600.0; if (zcnt < sec - 1800.0) - zcnt += 3600.0; + { + zcnt += 3600.0; + } else if (zcnt > sec + 1800.0) - zcnt -= 3600.0; + { + zcnt -= 3600.0; + } rtcm->time = gpst2time(week, hour * 3600 + zcnt); } @@ -82,9 +89,15 @@ int obsindex(obs_t *obs, gtime_t time, int sat) for (i = 0; i < obs->n; i++) { - if (obs->data[i].sat == sat) return i; /* field already exists */ + if (obs->data[i].sat == sat) + { + return i; /* field already exists */ + } + } + if (i >= MAXOBS) + { + return -1; /* overflow */ } - if (i >= MAXOBS) return -1; /* overflow */ /* add new field */ obs->data[i].time = time; @@ -122,7 +135,10 @@ int decode_type1(rtcm_t *rtcm) i += 8; iod = getbits(rtcm->buff, i, 8); i += 8; - if (prn == 0) prn = 32; + if (prn == 0) + { + prn = 32; + } if (prc == 0x80000000 || rrc == 0xFFFF8000) { trace(2, "rtcm2 1 prc/rrc indicates satellite problem: prn=%d\n", prn); @@ -290,7 +306,10 @@ int decode_type17(rtcm_t *rtcm) trace(2, "rtcm2 17 length error: len=%d\n", rtcm->len); return -1; } - if (prn == 0) prn = 32; + if (prn == 0) + { + prn = 32; + } sat = satno(SYS_GPS, prn); eph.sat = sat; eph.week = adjgpsweek(week); @@ -346,14 +365,20 @@ int decode_type18(rtcm_t *rtcm) i += 5; cp = getbits(rtcm->buff, i, 32); i += 32; - if (prn == 0) prn = 32; + if (prn == 0) + { + prn = 32; + } if (!(sat = satno(sys ? SYS_GLO : SYS_GPS, prn))) { trace(2, "rtcm2 18 satellite number error: sys=%d prn=%d\n", sys, prn); continue; } time = timeadd(rtcm->time, usec * 1E-6); - if (sys) time = utc2gpst(time); /* convert glonass time to gpst */ + if (sys) + { + time = utc2gpst(time); /* convert glonass time to gpst */ + } tt = timediff(rtcm->obs.data[0].time, time); if (rtcm->obsflag || fabs(tt) > 1E-9) @@ -414,14 +439,20 @@ int decode_type19(rtcm_t *rtcm) i += 5 + 8; pr = getbitu(rtcm->buff, i, 32); i += 32; - if (prn == 0) prn = 32; + if (prn == 0) + { + prn = 32; + } if (!(sat = satno(sys ? SYS_GLO : SYS_GPS, prn))) { trace(2, "rtcm2 19 satellite number error: sys=%d prn=%d\n", sys, prn); continue; } time = timeadd(rtcm->time, usec * 1E-6); - if (sys) time = utc2gpst(time); /* convert glonass time to gpst */ + if (sys) + { + time = utc2gpst(time); /* convert glonass time to gpst */ + } tt = timediff(rtcm->obs.data[0].time, time); if (rtcm->obsflag || fabs(tt) > 1E-9) @@ -479,7 +510,10 @@ int decode_type22(rtcm_t *rtcm) del[1][2] = getbits(rtcm->buff, i, 8) / 1600.0; } rtcm->sta.deltype = 1; /* xyz */ - for (j = 0; j < 3; j++) rtcm->sta.del[j] = del[0][j]; + for (j = 0; j < 3; j++) + { + rtcm->sta.del[j] = del[0][j]; + } rtcm->sta.hgt = hgt; return 5; } @@ -640,9 +674,13 @@ int decode_rtcm2(rtcm_t *rtcm) if (ret >= 0) { if (1 <= type && type <= 99) - rtcm->nmsg2[type]++; + { + rtcm->nmsg2[type]++; + } else - rtcm->nmsg2[0]++; + { + rtcm->nmsg2[0]++; + } } return ret; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc index ef11206a5..46dbedb4d 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.cc @@ -54,6 +54,7 @@ #include "rtklib_rtcm3.h" #include "rtklib_rtkcmn.h" +#include /* msm signal id table -------------------------------------------------------*/ @@ -114,12 +115,19 @@ void adjweek(rtcm_t *rtcm, double tow) int week; /* if no time, get cpu time */ - if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); + if (rtcm->time.time == 0) + { + rtcm->time = utc2gpst(timeget()); + } tow_p = time2gpst(rtcm->time, &week); if (tow < tow_p - 302400.0) - tow += 604800.0; + { + tow += 604800.0; + } else if (tow > tow_p + 302400.0) - tow -= 604800.0; + { + tow -= 604800.0; + } rtcm->time = gpst2time(week, tow); } @@ -129,7 +137,10 @@ int adjbdtweek(int week) { int w; (void)time2bdt(gpst2bdt(utc2gpst(timeget())), &w); - if (w < 1) w = 1; /* use 2006/1/1 if time is earlier than 2006/1/1 */ + if (w < 1) + { + w = 1; /* use 2006/1/1 if time is earlier than 2006/1/1 */ + } return week + (w - week + 512) / 1024 * 1024; } @@ -141,15 +152,22 @@ void adjday_glot(rtcm_t *rtcm, double tod) double tow, tod_p; int week; - if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); + if (rtcm->time.time == 0) + { + rtcm->time = utc2gpst(timeget()); + } time = timeadd(gpst2utc(rtcm->time), 10800.0); /* glonass time */ tow = time2gpst(time, &week); tod_p = fmod(tow, 86400.0); tow -= tod_p; if (tod < tod_p - 43200.0) - tod += 86400.0; + { + tod += 86400.0; + } else if (tod > tod_p + 43200.0) - tod -= 86400.0; + { + tod -= 86400.0; + } time = gpst2time(week, tow + tod); rtcm->time = utc2gpst(timeadd(time, -10800.0)); } @@ -159,11 +177,17 @@ void adjday_glot(rtcm_t *rtcm, double tod) double adjcp(rtcm_t *rtcm, int sat, int freq, double cp) { if (rtcm->cp[sat - 1][freq] == 0.0) - ; + { + ; + } else if (cp < rtcm->cp[sat - 1][freq] - 750.0) - cp += 1500.0; + { + cp += 1500.0; + } else if (cp > rtcm->cp[sat - 1][freq] + 750.0) - cp -= 1500.0; + { + cp -= 1500.0; + } rtcm->cp[sat - 1][freq] = cp; return cp; } @@ -192,9 +216,15 @@ int obsindex3(obs_t *obs, gtime_t time, int sat) for (i = 0; i < obs->n; i++) { - if (obs->data[i].sat == sat) return i; /* field already exists */ + if (obs->data[i].sat == sat) + { + return i; /* field already exists */ + } + } + if (i >= MAXOBS) + { + return -1; /* overflow */ } - if (i >= MAXOBS) return -1; /* overflow */ /* add new field */ obs->data[i].time = time; @@ -219,7 +249,10 @@ int test_staid(rtcm_t *rtcm, int staid) /* test station id option */ if ((p = strstr(rtcm->opt, "-STA=")) && sscanf(p, "-STA=%d", &id) == 1) { - if (staid != id) return 0; + if (staid != id) + { + return 0; + } } /* save station id */ if (rtcm->staid == 0 || rtcm->obsflag) @@ -265,7 +298,10 @@ int decode_head1001(rtcm_t *rtcm, int *sync) return -1; } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } adjweek(rtcm, tow); @@ -286,7 +322,10 @@ int decode_head1001(rtcm_t *rtcm, int *sync) int decode_type1001(rtcm_t *rtcm) { int sync; - if (decode_head1001(rtcm, &sync) < 0) return -1; + if (decode_head1001(rtcm, &sync) < 0) + { + return -1; + } rtcm->obsflag = !sync; return sync ? 0 : 1; } @@ -298,7 +337,10 @@ int decode_type1002(rtcm_t *rtcm) double pr1, cnr1, tt, cp1; int i = 24 + 64, j, index, nsat, sync, prn, code, sat, ppr1, lock1, amb, sys; - if ((nsat = decode_head1001(rtcm, &sync)) < 0) return -1; + if ((nsat = decode_head1001(rtcm, &sync)) < 0) + { + return -1; + } for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 74 <= rtcm->len * 8; j++) { @@ -335,13 +377,16 @@ int decode_type1002(rtcm_t *rtcm) { rtcm->obs.n = rtcm->obsflag = 0; } - if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; + if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) + { + continue; + } pr1 = pr1 * 0.02 + amb * PRUNIT_GPS; if (ppr1 != static_cast(0xFFF80000)) { rtcm->obs.data[index].P[0] = pr1; - cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]); - rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1; + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / LAM_CARR[0]); + rtcm->obs.data[index].L[0] = pr1 / LAM_CARR[0] + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); @@ -355,7 +400,10 @@ int decode_type1002(rtcm_t *rtcm) int decode_type1003(rtcm_t *rtcm) { int sync; - if (decode_head1001(rtcm, &sync) < 0) return -1; + if (decode_head1001(rtcm, &sync) < 0) + { + return -1; + } rtcm->obsflag = !sync; return sync ? 0 : 1; } @@ -369,7 +417,10 @@ int decode_type1004(rtcm_t *rtcm) int i = 24 + 64, j, index, nsat, sync, prn, sat, code1, code2, pr21, ppr1, ppr2; int lock1, lock2, amb, sys; - if ((nsat = decode_head1001(rtcm, &sync)) < 0) return -1; + if ((nsat = decode_head1001(rtcm, &sync)) < 0) + { + return -1; + } for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 125 <= rtcm->len * 8; j++) { @@ -416,13 +467,16 @@ int decode_type1004(rtcm_t *rtcm) { rtcm->obs.n = rtcm->obsflag = 0; } - if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; + if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) + { + continue; + } pr1 = pr1 * 0.02 + amb * PRUNIT_GPS; if (ppr1 != static_cast(0xFFF80000)) { rtcm->obs.data[index].P[0] = pr1; - cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / lam_carr[0]); - rtcm->obs.data[index].L[0] = pr1 / lam_carr[0] + cp1; + cp1 = adjcp(rtcm, sat, 0, ppr1 * 0.0005 / LAM_CARR[0]); + rtcm->obs.data[index].L[0] = pr1 / LAM_CARR[0] + cp1; } rtcm->obs.data[index].LLI[0] = lossoflock(rtcm, sat, 0, lock1); rtcm->obs.data[index].SNR[0] = snratio(cnr1 * 0.25); @@ -434,8 +488,8 @@ int decode_type1004(rtcm_t *rtcm) } if (ppr2 != static_cast(0xFFF80000)) { - cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / lam_carr[1]); - rtcm->obs.data[index].L[1] = pr1 / lam_carr[1] + cp2; + cp2 = adjcp(rtcm, sat, 1, ppr2 * 0.0005 / LAM_CARR[1]); + rtcm->obs.data[index].L[1] = pr1 / LAM_CARR[1] + cp2; } rtcm->obs.data[index].LLI[1] = lossoflock(rtcm, sat, 1, lock2); rtcm->obs.data[index].SNR[1] = snratio(cnr2 * 0.25); @@ -480,13 +534,19 @@ int decode_type1005(rtcm_t *rtcm) if (rtcm->outtype) { msg = rtcm->msgtype + strlen(rtcm->msgtype); - for (j = 0; j < 3; j++) re[j] = rr[j] * 0.0001; + for (j = 0; j < 3; j++) + { + re[j] = rr[j] * 0.0001; + } ecef2pos(re, pos); sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f", staid, pos[0] * R2D, pos[1] * R2D, pos[2]); } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } rtcm->sta.deltype = 0; /* xyz */ for (j = 0; j < 3; j++) @@ -529,13 +589,19 @@ int decode_type1006(rtcm_t *rtcm) if (rtcm->outtype) { msg = rtcm->msgtype + strlen(rtcm->msgtype); - for (j = 0; j < 3; j++) re[j] = rr[j] * 0.0001; + for (j = 0; j < 3; j++) + { + re[j] = rr[j] * 0.0001; + } ecef2pos(re, pos); sprintf(msg, " staid=%4d pos=%.8f %.8f %.3f anth=%.3f", staid, pos[0] * R2D, pos[1] * R2D, pos[2], anth); } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } rtcm->sta.deltype = 1; /* xyz */ for (j = 0; j < 3; j++) @@ -580,7 +646,10 @@ int decode_type1007(rtcm_t *rtcm) sprintf(msg, " staid=%4d", staid); } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } strncpy(rtcm->sta.antdes, des, n); rtcm->sta.antdes[n] = '\0'; @@ -628,7 +697,10 @@ int decode_type1008(rtcm_t *rtcm) sprintf(msg, " staid=%4d", staid); } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } strncpy(rtcm->sta.antdes, des, n); rtcm->sta.antdes[n] = '\0'; @@ -665,7 +737,10 @@ int decode_head1009(rtcm_t *rtcm, int *sync) return -1; } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } adjday_glot(rtcm, tod); @@ -686,7 +761,10 @@ int decode_head1009(rtcm_t *rtcm, int *sync) int decode_type1009(rtcm_t *rtcm) { int sync; - if (decode_head1009(rtcm, &sync) < 0) return -1; + if (decode_head1009(rtcm, &sync) < 0) + { + return -1; + } rtcm->obsflag = !sync; return sync ? 0 : 1; } @@ -698,7 +776,10 @@ int decode_type1010(rtcm_t *rtcm) double pr1, cnr1, tt, cp1, lam1; int i = 24 + 61, j, index, nsat, sync, prn, sat, code, freq, ppr1, lock1, amb, sys = SYS_GLO; - if ((nsat = decode_head1009(rtcm, &sync)) < 0) return -1; + if ((nsat = decode_head1009(rtcm, &sync)) < 0) + { + return -1; + } for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 79 <= rtcm->len * 8; j++) { @@ -728,7 +809,10 @@ int decode_type1010(rtcm_t *rtcm) { rtcm->obs.n = rtcm->obsflag = 0; } - if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; + if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) + { + continue; + } pr1 = pr1 * 0.02 + amb * PRUNIT_GLO; if (ppr1 != static_cast(0xFFF80000)) { @@ -749,7 +833,10 @@ int decode_type1010(rtcm_t *rtcm) int decode_type1011(rtcm_t *rtcm) { int sync; - if (decode_head1009(rtcm, &sync) < 0) return -1; + if (decode_head1009(rtcm, &sync) < 0) + { + return -1; + } rtcm->obsflag = !sync; return sync ? 0 : 1; } @@ -762,7 +849,10 @@ int decode_type1012(rtcm_t *rtcm) int i = 24 + 61, j, index, nsat, sync, prn, sat, freq, code1, code2, pr21, ppr1, ppr2; int lock1, lock2, amb, sys = SYS_GLO; - if ((nsat = decode_head1009(rtcm, &sync)) < 0) return -1; + if ((nsat = decode_head1009(rtcm, &sync)) < 0) + { + return -1; + } for (j = 0; j < nsat && rtcm->obs.n < MAXOBS && i + 130 <= rtcm->len * 8; j++) { @@ -802,7 +892,10 @@ int decode_type1012(rtcm_t *rtcm) { rtcm->obs.n = rtcm->obsflag = 0; } - if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) continue; + if ((index = obsindex3(&rtcm->obs, rtcm->time, sat)) < 0) + { + continue; + } pr1 = pr1 * 0.02 + amb * PRUNIT_GLO; if (ppr1 != static_cast(0xFFF80000)) { @@ -944,7 +1037,10 @@ int decode_type1019(rtcm_t *rtcm) eph.A = sqrtA * sqrtA; if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1020,27 +1116,41 @@ int decode_type1020(rtcm_t *rtcm) geph.sat = sat; geph.svh = bn; geph.iode = tb & 0x7F; - if (rtcm->time.time == 0) rtcm->time = utc2gpst(timeget()); + if (rtcm->time.time == 0) + { + rtcm->time = utc2gpst(timeget()); + } tow = time2gpst(gpst2utc(rtcm->time), &week); tod = fmod(tow, 86400.0); tow -= tod; tof = tk_h * 3600.0 + tk_m * 60.0 + tk_s - 10800.0; /* lt->utc */ if (tof < tod - 43200.0) - tof += 86400.0; + { + tof += 86400.0; + } else if (tof > tod + 43200.0) - tof -= 86400.0; + { + tof -= 86400.0; + } geph.tof = utc2gpst(gpst2time(week, tow + tof)); toe = tb * 900.0 - 10800.0; /* lt->utc */ if (toe < tod - 43200.0) - toe += 86400.0; + { + toe += 86400.0; + } else if (toe > tod + 43200.0) - toe -= 86400.0; + { + toe -= 86400.0; + } geph.toe = utc2gpst(gpst2time(week, tow + toe)); /* utc->gpst */ if (!strstr(rtcm->opt, "-EPHALL")) { if (fabs(timediff(geph.toe, rtcm->nav.geph[prn - 1].toe)) < 1.0 && - geph.svh == rtcm->nav.geph[prn - 1].svh) return 0; /* unchanged */ + geph.svh == rtcm->nav.geph[prn - 1].svh) + { + return 0; /* unchanged */ + } } rtcm->nav.geph[prn - 1] = geph; rtcm->ephsat = sat; @@ -1229,7 +1339,10 @@ int decode_type1033(rtcm_t *rtcm) sprintf(msg, " staid=%4d", staid); } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } strncpy(rtcm->sta.antdes, des, n); rtcm->sta.antdes[n] = '\0'; @@ -1385,7 +1498,10 @@ int decode_type1044(rtcm_t *rtcm) if (!strstr(rtcm->opt, "-EPHALL")) { if (eph.iode == rtcm->nav.eph[sat - 1].iode && - eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ + eph.iodc == rtcm->nav.eph[sat - 1].iodc) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1489,7 +1605,10 @@ int decode_type1045(rtcm_t *rtcm) eph.code = 2; /* data source = f/nav e5a */ if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1593,7 +1712,10 @@ int decode_type1046(rtcm_t *rtcm) eph.code = 2; /* data source = f/nav e5a */ if (!strstr(rtcm->opt, "-EPHALL")) { - if (eph.iode == rtcm->nav.eph[sat - 1].iode) return 0; /* unchanged */ + if (eph.iode == rtcm->nav.eph[sat - 1].iode) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1703,7 +1825,10 @@ int decode_type1047(rtcm_t *rtcm) { if (timediff(eph.toe, rtcm->nav.eph[sat - 1].toe) == 0.0 && eph.iode == rtcm->nav.eph[sat - 1].iode && - eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ + eph.iodc == rtcm->nav.eph[sat - 1].iodc) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1808,7 +1933,10 @@ int decode_type63(rtcm_t *rtcm) { if (timediff(eph.toe, rtcm->nav.eph[sat - 1].toe) == 0.0 && eph.iode == rtcm->nav.eph[sat - 1].iode && - eph.iodc == rtcm->nav.eph[sat - 1].iodc) return 0; /* unchanged */ + eph.iodc == rtcm->nav.eph[sat - 1].iodc) + { + return 0; /* unchanged */ + } } rtcm->nav.eph[sat - 1] = eph; rtcm->ephsat = sat; @@ -1827,7 +1955,10 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod, #ifndef SSR_QZSS_DRAFT_V05 ns = sys == SYS_QZS ? 4 : 6; #endif - if (i + (sys == SYS_GLO ? 53 : 50 + ns) > rtcm->len * 8) return -1; + if (i + (sys == SYS_GLO ? 53 : 50 + ns) > rtcm->len * 8) + { + return -1; + } if (sys == SYS_GLO) { @@ -1855,7 +1986,7 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod, i += 4; /* solution id */ nsat = getbitu(rtcm->buff, i, ns); i += ns; - *udint = ssrudint[udi]; + *udint = SSRUDINT[udi]; trace(4, "decode_ssr1_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); @@ -1882,7 +2013,10 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, #ifndef SSR_QZSS_DRAFT_V05 ns = sys == SYS_QZS ? 4 : 6; #endif - if (i + (sys == SYS_GLO ? 52 : 49 + ns) > rtcm->len * 8) return -1; + if (i + (sys == SYS_GLO ? 52 : 49 + ns) > rtcm->len * 8) + { + return -1; + } if (sys == SYS_GLO) { @@ -1908,7 +2042,7 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod, i += 4; /* solution id */ nsat = getbitu(rtcm->buff, i, ns); i += ns; - *udint = ssrudint[udi]; + *udint = SSRUDINT[udi]; trace(4, "decode_ssr2_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); @@ -1935,7 +2069,10 @@ int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod, #ifndef SSR_QZSS_DRAFT_V05 ns = sys == SYS_QZS ? 4 : 6; #endif - if (i + (sys == SYS_GLO ? 54 : 51 + ns) > rtcm->len * 8) return -1; + if (i + (sys == SYS_GLO ? 54 : 51 + ns) > rtcm->len * 8) + { + return -1; + } if (sys == SYS_GLO) { @@ -1965,7 +2102,7 @@ int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod, i += 1; /* MW consistency indicator */ nsat = getbitu(rtcm->buff, i, ns); i += ns; - *udint = ssrudint[udi]; + *udint = SSRUDINT[udi]; trace(4, "decode_ssr7_head: time=%s sys=%d nsat=%d sync=%d iod=%d provid=%d solid=%d\n", time_str(rtcm->time, 2), sys, nsat, *sync, *iod, provid, solid); @@ -2170,37 +2307,37 @@ int decode_ssr3(rtcm_t *rtcm, int sys) case SYS_GPS: np = 6; offp = 0; - codes = codes_gps; + codes = CODES_GPS; ncode = 17; break; case SYS_GLO: np = 5; offp = 0; - codes = codes_glo; + codes = CODES_GLO; ncode = 4; break; case SYS_GAL: np = 6; offp = 0; - codes = codes_gal; + codes = CODES_GAL; ncode = 19; break; case SYS_QZS: np = 4; offp = 192; - codes = codes_qzs; + codes = CODES_QZS; ncode = 13; break; case SYS_BDS: np = 6; offp = 1; - codes = codes_bds; + codes = CODES_BDS; ncode = 9; break; case SYS_SBS: np = 6; offp = 120; - codes = codes_sbs; + codes = CODES_SBS; ncode = 4; break; default: @@ -2213,7 +2350,10 @@ int decode_ssr3(rtcm_t *rtcm, int sys) nbias = getbitu(rtcm->buff, i, 5); i += 5; - for (k = 0; k < MAXCODE; k++) cbias[k] = 0.0; + for (k = 0; k < MAXCODE; k++) + { + cbias[k] = 0.0; + } for (k = 0; k < nbias && i + 19 <= rtcm->len * 8; k++) { mode = getbitu(rtcm->buff, i, 5); @@ -2502,31 +2642,31 @@ int decode_ssr7(rtcm_t *rtcm, int sys) case SYS_GPS: np = 6; offp = 0; - codes = codes_gps; + codes = CODES_GPS; ncode = 17; break; case SYS_GLO: np = 5; offp = 0; - codes = codes_glo; + codes = CODES_GLO; ncode = 4; break; case SYS_GAL: np = 6; offp = 0; - codes = codes_gal; + codes = CODES_GAL; ncode = 19; break; case SYS_QZS: np = 4; offp = 192; - codes = codes_qzs; + codes = CODES_QZS; ncode = 13; break; case SYS_BDS: np = 6; offp = 1; - codes = codes_bds; + codes = CODES_BDS; ncode = 9; break; default: @@ -2543,7 +2683,10 @@ int decode_ssr7(rtcm_t *rtcm, int sys) yaw_rate = getbits(rtcm->buff, i, 8); i += 8; - for (k = 0; k < MAXCODE; k++) pbias[k] = stdpb[k] = 0.0; + for (k = 0; k < MAXCODE; k++) + { + pbias[k] = stdpb[k] = 0.0; + } for (k = 0; k < nbias && i + 49 <= rtcm->len * 8; k++) { mode = getbitu(rtcm->buff, i, 5); @@ -2595,7 +2738,10 @@ void sigindex(int sys, const unsigned char *code, const int *freq, int n, /* test code priority */ for (i = 0; i < n; i++) { - if (!code[i]) continue; + if (!code[i]) + { + continue; + } if (freq[i] > NFREQ) { /* save as extended signal if freq > NFREQ */ @@ -2608,20 +2754,29 @@ void sigindex(int sys, const unsigned char *code, const int *freq, int n, /* select highest priority signal */ if (pri > pri_h[freq[i] - 1]) { - if (index[freq[i] - 1]) ex[index[freq[i] - 1] - 1] = 1; + if (index[freq[i] - 1]) + { + ex[index[freq[i] - 1] - 1] = 1; + } pri_h[freq[i] - 1] = pri; index[freq[i] - 1] = i + 1; } else - ex[i] = 1; + { + ex[i] = 1; + } } /* signal index in obs data */ for (i = nex = 0; i < n; i++) { if (ex[i] == 0) - ind[i] = freq[i] - 1; + { + ind[i] = freq[i] - 1; + } else if (nex < NEXOBS) - ind[i] = NFREQ + nex++; + { + ind[i] = NFREQ + nex++; + } else { /* no space in obs data */ trace(2, "rtcm msm: no space in obs data sys=%d code=%d\n", sys, code[i]); @@ -2703,17 +2858,27 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, if (sys == SYS_BDS) { if (freq[i] == 5) - freq[i] = 2; /* B2 */ + { + freq[i] = 2; /* B2 */ + } else if (freq[i] == 4) - freq[i] = 3; /* B3 */ + { + freq[i] = 3; /* B3 */ + } } if (code[i] != CODE_NONE) { - if (q) q += sprintf(q, "L%s%s", sig[i], i < h->nsig - 1 ? ", " : ""); + if (q) + { + q += sprintf(q, "L%s%s", sig[i], i < h->nsig - 1 ? ", " : ""); + } } else { - if (q) q += sprintf(q, "(%d)%s", h->sigs[i], i < h->nsig - 1 ? ", " : ""); + if (q) + { + q += sprintf(q, "(%d)%s", h->sigs[i], i < h->nsig - 1 ? ", " : ""); + } trace(2, "rtcm3 %d: unknown signal id=%2d\n", type, h->sigs[i]); } @@ -2727,9 +2892,13 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, { prn = h->sats[i]; if (sys == SYS_QZS) - prn += MINPRNQZS - 1; + { + prn += MINPRNQZS - 1; + } else if (sys == SYS_SBS) - prn += MINPRNSBS - 1; + { + prn += MINPRNSBS - 1; + } if ((sat = satno(sys, prn))) { @@ -2746,7 +2915,10 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r, } for (k = 0; k < h->nsig; k++) { - if (!h->cellmask[k + i * h->nsig]) continue; + if (!h->cellmask[k + i * h->nsig]) + { + continue; + } if (sat && index >= 0 && ind[k] >= 0) { @@ -2842,13 +3014,19 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod, { mask = getbitu(rtcm->buff, i, 1); i += 1; - if (mask) h->sats[h->nsat++] = j; + if (mask) + { + h->sats[h->nsat++] = j; + } } for (j = 1; j <= 32; j++) { mask = getbitu(rtcm->buff, i, 1); i += 1; - if (mask) h->sigs[h->nsig++] = j; + if (mask) + { + h->sigs[h->nsig++] = j; + } } } else @@ -2857,7 +3035,10 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod, return -1; } /* test station id */ - if (!test_staid(rtcm, staid)) return -1; + if (!test_staid(rtcm, staid)) + { + return -1; + } if (h->nsat * h->nsig > 64) { @@ -2875,7 +3056,10 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod, { h->cellmask[j] = getbitu(rtcm->buff, i, 1); i += 1; - if (h->cellmask[j]) ncell++; + if (h->cellmask[j]) + { + ncell++; + } } *hsize = i; @@ -2897,7 +3081,10 @@ int decode_msm0(rtcm_t *rtcm, int sys) { msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}}; int i, sync, iod; - if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0) return -1; + if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0) + { + return -1; + } rtcm->obsflag = !sync; return sync ? 0 : 1; } @@ -2913,7 +3100,10 @@ int decode_msm4(rtcm_t *rtcm, int sys) type = getbitu(rtcm->buff, 24, 12); /* decode msm header */ - if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; + if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) + { + return -1; + } if (i + h.nsat * 18 + ncell * 48 > rtcm->len * 8) { @@ -2921,34 +3111,52 @@ int decode_msm4(rtcm_t *rtcm, int sys) ncell, rtcm->len); return -1; } - for (j = 0; j < h.nsat; j++) r[j] = 0.0; - for (j = 0; j < ncell; j++) pr[j] = cp[j] = -1E16; + for (j = 0; j < h.nsat; j++) + { + r[j] = 0.0; + } + for (j = 0; j < ncell; j++) + { + pr[j] = cp[j] = -1E16; + } /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng * RANGE_MS; + if (rng != 255) + { + r[j] = rng * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; + if (r[j] != 0.0) + { + r[j] += rng_m * TWO_N10 * RANGE_MS; + } } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ prv = getbits(rtcm->buff, i, 15); i += 15; - if (prv != -16384) pr[j] = prv * TWO_N24 * RANGE_MS; + if (prv != -16384) + { + pr[j] = prv * TWO_N24 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* phaserange */ cpv = getbits(rtcm->buff, i, 22); i += 22; - if (cpv != -2097152) cp[j] = cpv * TWO_N29 * RANGE_MS; + if (cpv != -2097152) + { + cp[j] = cpv * TWO_N29 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* lock time */ @@ -2984,7 +3192,10 @@ int decode_msm5(rtcm_t *rtcm, int sys) type = getbitu(rtcm->buff, 24, 12); /* decode msm header */ - if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; + if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) + { + return -1; + } if (i + h.nsat * 36 + ncell * 63 > rtcm->len * 8) { @@ -2997,14 +3208,20 @@ int decode_msm5(rtcm_t *rtcm, int sys) r[j] = rr[j] = 0.0; ex[j] = 15; } - for (j = 0; j < ncell; j++) pr[j] = cp[j] = rrf[j] = -1E16; + for (j = 0; j < ncell; j++) + { + pr[j] = cp[j] = rrf[j] = -1E16; + } /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng * RANGE_MS; + if (rng != 255) + { + r[j] = rng * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { /* extended info */ @@ -3015,26 +3232,38 @@ int decode_msm5(rtcm_t *rtcm, int sys) { rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; + if (r[j] != 0.0) + { + r[j] += rng_m * TWO_N10 * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { /* phaserangerate */ rate = getbits(rtcm->buff, i, 14); i += 14; - if (rate != -8192) rr[j] = rate * 1.0; + if (rate != -8192) + { + rr[j] = rate * 1.0; + } } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ prv = getbits(rtcm->buff, i, 15); i += 15; - if (prv != -16384) pr[j] = prv * TWO_N24 * RANGE_MS; + if (prv != -16384) + { + pr[j] = prv * TWO_N24 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* phaserange */ cpv = getbits(rtcm->buff, i, 22); i += 22; - if (cpv != -2097152) cp[j] = cpv * TWO_N29 * RANGE_MS; + if (cpv != -2097152) + { + cp[j] = cpv * TWO_N29 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* lock time */ @@ -3055,7 +3284,10 @@ int decode_msm5(rtcm_t *rtcm, int sys) { /* phaserangerate */ rrv = getbits(rtcm->buff, i, 15); i += 15; - if (rrv != -16384) rrf[j] = rrv * 0.0001; + if (rrv != -16384) + { + rrf[j] = rrv * 0.0001; + } } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, rr, rrf, cnr, lock, ex, half); @@ -3075,7 +3307,10 @@ int decode_msm6(rtcm_t *rtcm, int sys) type = getbitu(rtcm->buff, 24, 12); /* decode msm header */ - if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; + if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) + { + return -1; + } if (i + h.nsat * 18 + ncell * 65 > rtcm->len * 8) { @@ -3083,34 +3318,52 @@ int decode_msm6(rtcm_t *rtcm, int sys) ncell, rtcm->len); return -1; } - for (j = 0; j < h.nsat; j++) r[j] = 0.0; - for (j = 0; j < ncell; j++) pr[j] = cp[j] = -1E16; + for (j = 0; j < h.nsat; j++) + { + r[j] = 0.0; + } + for (j = 0; j < ncell; j++) + { + pr[j] = cp[j] = -1E16; + } /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng * RANGE_MS; + if (rng != 255) + { + r[j] = rng * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; + if (r[j] != 0.0) + { + r[j] += rng_m * TWO_N10 * RANGE_MS; + } } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ prv = getbits(rtcm->buff, i, 20); i += 20; - if (prv != -524288) pr[j] = prv * TWO_N29 * RANGE_MS; + if (prv != -524288) + { + pr[j] = prv * TWO_N29 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* phaserange */ cpv = getbits(rtcm->buff, i, 24); i += 24; - if (cpv != -8388608) cp[j] = cpv * TWO_N31 * RANGE_MS; + if (cpv != -8388608) + { + cp[j] = cpv * TWO_N31 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* lock time */ @@ -3146,7 +3399,10 @@ int decode_msm7(rtcm_t *rtcm, int sys) type = getbitu(rtcm->buff, 24, 12); /* decode msm header */ - if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) return -1; + if ((ncell = decode_msm_head(rtcm, sys, &sync, &iod, &h, &i)) < 0) + { + return -1; + } if (i + h.nsat * 36 + ncell * 80 > rtcm->len * 8) { @@ -3159,14 +3415,20 @@ int decode_msm7(rtcm_t *rtcm, int sys) r[j] = rr[j] = 0.0; ex[j] = 15; } - for (j = 0; j < ncell; j++) pr[j] = cp[j] = rrf[j] = -1E16; + for (j = 0; j < ncell; j++) + { + pr[j] = cp[j] = rrf[j] = -1E16; + } /* decode satellite data */ for (j = 0; j < h.nsat; j++) { /* range */ rng = getbitu(rtcm->buff, i, 8); i += 8; - if (rng != 255) r[j] = rng * RANGE_MS; + if (rng != 255) + { + r[j] = rng * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { /* extended info */ @@ -3177,26 +3439,38 @@ int decode_msm7(rtcm_t *rtcm, int sys) { rng_m = getbitu(rtcm->buff, i, 10); i += 10; - if (r[j] != 0.0) r[j] += rng_m * TWO_N10 * RANGE_MS; + if (r[j] != 0.0) + { + r[j] += rng_m * TWO_N10 * RANGE_MS; + } } for (j = 0; j < h.nsat; j++) { /* phaserangerate */ rate = getbits(rtcm->buff, i, 14); i += 14; - if (rate != -8192) rr[j] = rate * 1.0; + if (rate != -8192) + { + rr[j] = rate * 1.0; + } } /* decode signal data */ for (j = 0; j < ncell; j++) { /* pseudorange */ prv = getbits(rtcm->buff, i, 20); i += 20; - if (prv != -524288) pr[j] = prv * TWO_N29 * RANGE_MS; + if (prv != -524288) + { + pr[j] = prv * TWO_N29 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* phaserange */ cpv = getbits(rtcm->buff, i, 24); i += 24; - if (cpv != -8388608) cp[j] = cpv * TWO_N31 * RANGE_MS; + if (cpv != -8388608) + { + cp[j] = cpv * TWO_N31 * RANGE_MS; + } } for (j = 0; j < ncell; j++) { /* lock time */ @@ -3217,7 +3491,10 @@ int decode_msm7(rtcm_t *rtcm, int sys) { /* phaserangerate */ rrv = getbits(rtcm->buff, i, 15); i += 15; - if (rrv != -16384) rrf[j] = rrv * 0.0001; + if (rrv != -16384) + { + rrf[j] = rrv * 0.0001; + } } /* save obs data in msm message */ save_msm_obs(rtcm, sys, &h, r, pr, cp, rr, rrf, cnr, lock, ex, half); @@ -3623,11 +3900,17 @@ int decode_rtcm3(rtcm_t *rtcm) { type -= 1000; if (1 <= type && type <= 299) - rtcm->nmsg3[type]++; /* 1001-1299 */ + { + rtcm->nmsg3[type]++; /* 1001-1299 */ + } else if (1000 <= type && type <= 1099) - rtcm->nmsg3[type - 700]++; /* 2000-2099 */ + { + rtcm->nmsg3[type - 700]++; /* 2000-2099 */ + } else - rtcm->nmsg3[0]++; + { + rtcm->nmsg3[0]++; + } } return ret; } diff --git a/src/algorithms/libs/rtklib/rtklib_rtcm3.h b/src/algorithms/libs/rtklib/rtklib_rtcm3.h index b907f223d..847bae424 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtcm3.h +++ b/src/algorithms/libs/rtklib/rtklib_rtcm3.h @@ -64,38 +64,38 @@ const double RANGE_MS = SPEED_OF_LIGHT * 0.001; /* range in 1 ms */ /* ssr update intervals ------------------------------------------------------*/ -const double ssrudint[16] = { +const double SSRUDINT[16] = { 1, 2, 5, 10, 15, 30, 60, 120, 240, 300, 600, 900, 1800, 3600, 7200, 10800}; /* ssr 3 and 7 signal and tracking mode ids ----------------------------------*/ -const int codes_gps[] = { +const int CODES_GPS[] = { CODE_L1C, CODE_L1P, CODE_L1W, CODE_L1Y, CODE_L1M, CODE_L2C, CODE_L2D, CODE_L2S, CODE_L2L, CODE_L2X, CODE_L2P, CODE_L2W, CODE_L2Y, CODE_L2M, CODE_L5I, CODE_L5Q, CODE_L5X}; -const int codes_glo[] = { +const int CODES_GLO[] = { CODE_L1C, CODE_L1P, CODE_L2C, CODE_L2P}; -const int codes_gal[] = { +const int CODES_GAL[] = { CODE_L1A, CODE_L1B, CODE_L1C, CODE_L1X, CODE_L1Z, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L8I, CODE_L8Q, CODE_L8X, CODE_L6A, CODE_L6B, CODE_L6C, CODE_L6X, CODE_L6Z}; -const int codes_qzs[] = { +const int CODES_QZS[] = { CODE_L1C, CODE_L1S, CODE_L1L, CODE_L2S, CODE_L2L, CODE_L2X, CODE_L5I, CODE_L5Q, CODE_L5X, CODE_L6S, CODE_L6L, CODE_L6X, CODE_L1X}; -const int codes_bds[] = { +const int CODES_BDS[] = { CODE_L1I, CODE_L1Q, CODE_L1X, CODE_L7I, CODE_L7Q, CODE_L7X, CODE_L6I, CODE_L6Q, CODE_L6X}; -const int codes_sbs[] = { +const int CODES_SBS[] = { CODE_L1C, CODE_L5I, CODE_L5Q, CODE_L5X}; diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc index 9eea3a0b2..35c7b3939 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.cc @@ -52,6 +52,7 @@ #include "rtklib_rtkcmn.h" //#include +#include #include #include #include @@ -61,9 +62,9 @@ #include -const double gpst0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */ -const double gst0[] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */ -const double bdt0[] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */ +const double GPST0[] = {1980, 1, 6, 0, 0, 0}; /* gps time reference */ +const double GST0[] = {1999, 8, 22, 0, 0, 0}; /* galileo system time reference */ +const double BDT0[] = {2006, 1, 1, 0, 0, 0}; /* beidou time reference */ static double timeoffset_ = 0.0; @@ -153,7 +154,7 @@ char codepris[7][MAXFREQ][16] = { fatalfunc_t *fatalfunc = nullptr; /* fatal callback function */ /* crc tables generated by util/gencrc ---------------------------------------*/ -const uint16_t tbl_CRC16[] = { +const uint16_t TBL_CR_C16[] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, @@ -188,7 +189,7 @@ const uint16_t tbl_CRC16[] = { 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0}; -const unsigned int tbl_CRC24Q[] = { +const unsigned int TBL_CR_C24_Q[] = { 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, @@ -262,33 +263,60 @@ void fatalerr(const char *format, ...) *-----------------------------------------------------------------------------*/ int satno(int sys, int prn) { - if (prn <= 0) return 0; + if (prn <= 0) + { + return 0; + } switch (sys) { case SYS_GPS: - if (prn < MINPRNGPS || MAXPRNGPS < prn) return 0; + if (prn < MINPRNGPS || MAXPRNGPS < prn) + { + return 0; + } return prn - MINPRNGPS + 1; case SYS_GLO: - if (prn < MINPRNGLO || MAXPRNGLO < prn) return 0; + if (prn < MINPRNGLO || MAXPRNGLO < prn) + { + return 0; + } return NSATGPS + prn - MINPRNGLO + 1; case SYS_GAL: - if (prn < MINPRNGAL || MAXPRNGAL < prn) return 0; + if (prn < MINPRNGAL || MAXPRNGAL < prn) + { + return 0; + } return NSATGPS + NSATGLO + prn - MINPRNGAL + 1; case SYS_QZS: - if (prn < MINPRNQZS || MAXPRNQZS < prn) return 0; + if (prn < MINPRNQZS || MAXPRNQZS < prn) + { + return 0; + } return NSATGPS + NSATGLO + NSATGAL + prn - MINPRNQZS + 1; case SYS_BDS: - if (prn < MINPRNBDS || MAXPRNBDS < prn) return 0; + if (prn < MINPRNBDS || MAXPRNBDS < prn) + { + return 0; + } return NSATGPS + NSATGLO + NSATGAL + NSATQZS + prn - MINPRNBDS + 1; case SYS_IRN: - if (prn < MINPRNIRN || MAXPRNIRN < prn) return 0; + if (prn < MINPRNIRN || MAXPRNIRN < prn) + { + return 0; + } return NSATGPS + NSATGLO + NSATGAL + NSATQZS + NSATBDS + prn - MINPRNIRN + 1; case SYS_LEO: - if (prn < MINPRNLEO || MAXPRNLEO < prn) return 0; + if (prn < MINPRNLEO || MAXPRNLEO < prn) + { + return 0; + } return NSATGPS + NSATGLO + NSATGAL + NSATQZS + NSATBDS + NSATIRN + prn - MINPRNLEO + 1; case SYS_SBS: - if (prn < MINPRNSBS || MAXPRNSBS < prn) return 0; + if (prn < MINPRNSBS || MAXPRNSBS < prn) + { + return 0; + } return NSATGPS + NSATGLO + NSATGAL + NSATQZS + NSATBDS + NSATIRN + NSATLEO + prn - MINPRNSBS + 1; } @@ -306,7 +334,9 @@ int satsys(int sat, int *prn) { int sys = SYS_NONE; if (sat <= 0 || MAXSAT < sat) - sat = 0; + { + sat = 0; + } else if (sat <= NSATGPS) { sys = SYS_GPS; @@ -348,8 +378,13 @@ int satsys(int sat, int *prn) sat += MINPRNSBS - 1; } else - sat = 0; - if (prn) *prn = sat; + { + sat = 0; + } + if (prn) + { + *prn = sat; + } return sys; } @@ -368,16 +403,27 @@ int satid2no(const char *id) if (sscanf(id, "%d", &prn) == 1) { if (MINPRNGPS <= prn && prn <= MAXPRNGPS) - sys = SYS_GPS; + { + sys = SYS_GPS; + } else if (MINPRNSBS <= prn && prn <= MAXPRNSBS) - sys = SYS_SBS; + { + sys = SYS_SBS; + } else if (MINPRNQZS <= prn && prn <= MAXPRNQZS) - sys = SYS_QZS; + { + sys = SYS_QZS; + } else - return 0; + { + return 0; + } return satno(sys, prn); } - if (sscanf(id, "%c%d", &code, &prn) < 2) return 0; + if (sscanf(id, "%c%d", &code, &prn) < 2) + { + return 0; + } switch (code) { @@ -484,14 +530,20 @@ int satexclude(int sat, int svh, const prcopt_t *opt) trace(3, "excluded satellite: sat=%3d svh=%02X\n", sat, svh); return 1; /* excluded satellite */ } - if (opt->exsats[sat - 1] == 2) return 0; /* included satellite */ + if (opt->exsats[sat - 1] == 2) + { + return 0; /* included satellite */ + } if (!(sys & opt->navsys)) { trace(3, "unselected sat sys: sat=%3d svh=%02X\n", sat, svh); return 1; /* unselected sat sys */ } } - if (sys == SYS_QZS) svh &= 0xFE; /* mask QZSS LEX health */ + if (sys == SYS_QZS) + { + svh &= 0xFE; /* mask QZSS LEX health */ + } if (svh) { trace(3, "unhealthy satellite: sat=%3d svh=%02X\n", sat, svh); @@ -516,17 +568,26 @@ int testsnr(int base, int freq, double el, double snr, double minsnr, a; int i; - if (!mask->ena[base] || freq < 0 || freq >= NFREQ) return 0; + if (!mask->ena[base] || freq < 0 || freq >= NFREQ) + { + return 0; + } a = (el * R2D + 5.0) / 10.0; i = static_cast(floor(a)); a -= i; if (i < 1) - minsnr = mask->mask[freq][0]; + { + minsnr = mask->mask[freq][0]; + } else if (i > 8) - minsnr = mask->mask[freq][8]; + { + minsnr = mask->mask[freq][8]; + } else - minsnr = (1.0 - a) * mask->mask[freq][i - 1] + a * mask->mask[freq][i]; + { + minsnr = (1.0 - a) * mask->mask[freq][i - 1] + a * mask->mask[freq][i]; + } return snr < minsnr; } @@ -543,11 +604,20 @@ int testsnr(int base, int freq, double el, double snr, unsigned char obs2code(const char *obs, int *freq) { int i; - if (freq) *freq = 0; + if (freq) + { + *freq = 0; + } for (i = 1; *obscodes[i]; i++) { - if (strcmp(obscodes[i], obs) != 0) continue; - if (freq) *freq = obsfreqs[i]; + if (strcmp(obscodes[i], obs) != 0) + { + continue; + } + if (freq) + { + *freq = obsfreqs[i]; + } return static_cast(i); } return CODE_NONE; @@ -565,9 +635,18 @@ unsigned char obs2code(const char *obs, int *freq) *-----------------------------------------------------------------------------*/ char *code2obs(unsigned char code, int *freq) { - if (freq) *freq = 0; - if (code <= CODE_NONE || MAXCODE < code) return (char *)""; - if (freq) *freq = obsfreqs[code]; + if (freq) + { + *freq = 0; + } + if (code <= CODE_NONE || MAXCODE < code) + { + return (char *)""; + } + if (freq) + { + *freq = obsfreqs[code]; + } return obscodes[code]; } @@ -584,16 +663,40 @@ void setcodepri(int sys, int freq, const char *pri) { trace(3, "setcodepri : sys=%d freq=%d pri=%s\n", sys, freq, pri); - if (freq <= 0 || MAXFREQ < freq) return; + if (freq <= 0 || MAXFREQ < freq) + { + return; + } if (strlen(pri) < 17) { - if (sys & SYS_GPS) strcpy(codepris[0][freq - 1], pri); - if (sys & SYS_GLO) strcpy(codepris[1][freq - 1], pri); - if (sys & SYS_GAL) strcpy(codepris[2][freq - 1], pri); - if (sys & SYS_QZS) strcpy(codepris[3][freq - 1], pri); - if (sys & SYS_SBS) strcpy(codepris[4][freq - 1], pri); - if (sys & SYS_BDS) strcpy(codepris[5][freq - 1], pri); - if (sys & SYS_IRN) strcpy(codepris[6][freq - 1], pri); + if (sys & SYS_GPS) + { + strcpy(codepris[0][freq - 1], pri); + } + if (sys & SYS_GLO) + { + strcpy(codepris[1][freq - 1], pri); + } + if (sys & SYS_GAL) + { + strcpy(codepris[2][freq - 1], pri); + } + if (sys & SYS_QZS) + { + strcpy(codepris[3][freq - 1], pri); + } + if (sys & SYS_SBS) + { + strcpy(codepris[4][freq - 1], pri); + } + if (sys & SYS_BDS) + { + strcpy(codepris[5][freq - 1], pri); + } + if (sys & SYS_IRN) + { + strcpy(codepris[6][freq - 1], pri); + } } else { @@ -653,7 +756,10 @@ int getcodepri(int sys, unsigned char code, const char *opt) /* parse code options */ for (p = opt; p && (p = strchr(p, '-')); p++) { - if (sscanf(p, optstr, str) < 1 || str[0] != obs[0]) continue; + if (sscanf(p, optstr, str) < 1 || str[0] != obs[0]) + { + continue; + } return str[1] == obs[1] ? 15 : 0; } /* search code priority */ @@ -672,7 +778,10 @@ unsigned int getbitu(const unsigned char *buff, int pos, int len) { unsigned int bits = 0; int i; - for (i = pos; i < pos + len; i++) bits = (bits << 1) + ((buff[i / 8] >> (7 - i % 8)) & 1u); + for (i = pos; i < pos + len; i++) + { + bits = (bits << 1) + ((buff[i / 8] >> (7 - i % 8)) & 1u); + } return bits; } @@ -680,7 +789,10 @@ unsigned int getbitu(const unsigned char *buff, int pos, int len) int getbits(const unsigned char *buff, int pos, int len) { unsigned int bits = getbitu(buff, pos, len); - if (len <= 0 || 32 <= len || !(bits & (1u << (len - 1)))) return static_cast(bits); + if (len <= 0 || 32 <= len || !(bits & (1u << (len - 1)))) + { + return static_cast(bits); + } return static_cast(bits | (~0u << len)); /* extend sign */ } @@ -697,13 +809,20 @@ void setbitu(unsigned char *buff, int pos, int len, unsigned int data) { unsigned int mask = 1u << (len - 1); int i; - if (len <= 0 || 32 < len) return; + if (len <= 0 || 32 < len) + { + return; + } for (i = pos; i < pos + len; i++, mask >>= 1) { if (data & mask) - buff[i / 8] |= 1u << (7 - i % 8); + { + buff[i / 8] |= 1u << (7 - i % 8); + } else - buff[i / 8] &= ~(1u << (7 - i % 8)); + { + buff[i / 8] &= ~(1u << (7 - i % 8)); + } } } @@ -711,9 +830,13 @@ void setbitu(unsigned char *buff, int pos, int len, unsigned int data) void setbits(unsigned char *buff, int pos, int len, int data) { if (data < 0) - data |= 1 << (len - 1); + { + data |= 1 << (len - 1); + } else - data &= ~(1 << (len - 1)); /* set sign bit */ + { + data &= ~(1 << (len - 1)); /* set sign bit */ + } setbitu(buff, pos, len, static_cast(data)); } @@ -738,9 +861,13 @@ unsigned int rtk_crc32(const unsigned char *buff, int len) for (j = 0; j < 8; j++) { if (crc & 1) - crc = (crc >> 1) ^ POLYCRC32; + { + crc = (crc >> 1) ^ POLYCRC32; + } else - crc >>= 1; + { + crc >>= 1; + } } } return crc; @@ -761,7 +888,10 @@ unsigned int rtk_crc24q(const unsigned char *buff, int len) trace(4, "rtk_crc24q: len=%d\n", len); - for (i = 0; i < len; i++) crc = ((crc << 8) & 0xFFFFFF) ^ tbl_CRC24Q[(crc >> 16) ^ buff[i]]; + for (i = 0; i < len; i++) + { + crc = ((crc << 8) & 0xFFFFFF) ^ TBL_CR_C24_Q[(crc >> 16) ^ buff[i]]; + } return crc; } @@ -782,7 +912,7 @@ uint16_t rtk_crc16(const unsigned char *buff, int len) for (i = 0; i < len; i++) { - crc = (crc << 8) ^ tbl_CRC16[((crc >> 8) ^ buff[i]) & 0xFF]; + crc = (crc << 8) ^ TBL_CR_C16[((crc >> 8) ^ buff[i]) & 0xFF]; } return crc; } @@ -806,16 +936,28 @@ int decode_word(unsigned int word, unsigned char *data) trace(5, "decodeword: word=%08x\n", word); - if (word & 0x40000000) word ^= 0x3FFFFFC0; + if (word & 0x40000000) + { + word ^= 0x3FFFFFC0; + } for (i = 0; i < 6; i++) { parity <<= 1; - for (w = (word & hamming[i]) >> 6; w; w >>= 1) parity ^= w & 1; + for (w = (word & hamming[i]) >> 6; w; w >>= 1) + { + parity ^= w & 1; + } + } + if (parity != (word & 0x3F)) + { + return 0; } - if (parity != (word & 0x3F)) return 0; - for (i = 0; i < 3; i++) data[i] = static_cast(word >> (22 - i * 8)); + for (i = 0; i < 3; i++) + { + data[i] = static_cast(word >> (22 - i * 8)); + } return 1; } @@ -829,7 +971,10 @@ double *mat(int n, int m) { double *p; - if (n <= 0 || m <= 0) return nullptr; + if (n <= 0 || m <= 0) + { + return nullptr; + } if (!(p = static_cast(malloc(sizeof(double) * n * m)))) { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -847,7 +992,10 @@ int *imat(int n, int m) { int *p; - if (n <= 0 || m <= 0) return nullptr; + if (n <= 0 || m <= 0) + { + return nullptr; + } if (!(p = static_cast(malloc(sizeof(int) * n * m)))) { fatalerr("integer matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -869,7 +1017,10 @@ double *zeros(int n, int m) if ((p = mat(n, m))) for (n = n * m - 1; n >= 0; n--) p[n] = 0.0; #else - if (n <= 0 || m <= 0) return nullptr; + if (n <= 0 || m <= 0) + { + return nullptr; + } if (!(p = static_cast(calloc(sizeof(double), n * m)))) { fatalerr("matrix memory allocation error: n=%d,m=%d\n", n, m); @@ -890,7 +1041,12 @@ double *eye(int n) int i; if ((p = zeros(n, n))) - for (i = 0; i < n; i++) p[i + i * n] = 1.0; + { + for (i = 0; i < n; i++) + { + p[i + i * n] = 1.0; + } + } return p; } @@ -905,7 +1061,10 @@ double dot(const double *a, const double *b, int n) { double c = 0.0; - while (--n >= 0) c += a[n] * b[n]; + while (--n >= 0) + { + c += a[n] * b[n]; + } return c; } @@ -945,7 +1104,10 @@ void cross3(const double *a, const double *b, double *c) int normv3(const double *a, double *b) { double r; - if ((r = norm_rtk(a, 3)) <= 0.0) return 0; + if ((r = norm_rtk(a, 3)) <= 0.0) + { + return 0; + } b[0] = a[0] / r; b[1] = a[1] / r; b[2] = a[2] / r; @@ -1001,7 +1163,10 @@ int matinv(double *A, int n) work = mat(lwork, 1); dgetrf_(&n, &n, A, &n, ipiv, &info); - if (!info) dgetri_(&n, A, &n, ipiv, work, &lwork, &info); + if (!info) + { + dgetri_(&n, A, &n, ipiv, work, &lwork, &info); + } free(ipiv); free(work); return info; @@ -1028,7 +1193,10 @@ int solve(const char *tr, const double *A, const double *Y, int n, matcpy(B, A, n, n); matcpy(X, Y, n, m); dgetrf_(&n, &n, B, &n, ipiv, &info); - if (!info) dgetrs_(const_cast(tr), &n, &m, B, &n, ipiv, X, &n, &info); + if (!info) + { + dgetrs_(const_cast(tr), &n, &m, B, &n, ipiv, X, &n, &info); + } free(ipiv); free(B); return info; @@ -1054,11 +1222,17 @@ int lsq(const double *A, const double *y, int n, int m, double *x, double *Ay; int info; - if (m < n) return -1; + if (m < n) + { + return -1; + } Ay = mat(n, 1); - matmul("NN", n, 1, m, 1.0, A, y, 0.0, Ay); /* Ay=A*y */ - matmul("NT", n, n, m, 1.0, A, A, 0.0, Q); /* Q=A*A' */ - if (!(info = matinv(Q, n))) matmul("NN", n, 1, n, 1.0, Q, Ay, 0.0, x); /* x=Q^-1*Ay */ + matmul("NN", n, 1, m, 1.0, A, y, 0.0, Ay); /* Ay=A*y */ + matmul("NT", n, n, m, 1.0, A, A, 0.0, Q); /* Q=A*A' */ + if (!(info = matinv(Q, n))) + { + matmul("NN", n, 1, n, 1.0, Q, Ay, 0.0, x); /* x=Q^-1*Ay */ + } free(Ay); return info; } @@ -1115,7 +1289,12 @@ int filter(double *x, double *P, const double *H, const double *v, ix = imat(n, 1); for (i = k = 0; i < n; i++) - if (x[i] != 0.0 && P[i + i * n] > 0.0) ix[k++] = i; + { + if (x[i] != 0.0 && P[i + i * n] > 0.0) + { + ix[k++] = i; + } + } x_ = mat(k, 1); xp_ = mat(k, 1); P_ = mat(k, k); @@ -1124,14 +1303,23 @@ int filter(double *x, double *P, const double *H, const double *v, for (i = 0; i < k; i++) { x_[i] = x[ix[i]]; - for (j = 0; j < k; j++) P_[i + j * k] = P[ix[i] + ix[j] * n]; - for (j = 0; j < m; j++) H_[i + j * k] = H[ix[i] + j * n]; + for (j = 0; j < k; j++) + { + P_[i + j * k] = P[ix[i] + ix[j] * n]; + } + for (j = 0; j < m; j++) + { + H_[i + j * k] = H[ix[i] + j * n]; + } } info = filter_(x_, P_, H_, v, R, k, m, xp_, Pp_); for (i = 0; i < k; i++) { x[ix[i]] = xp_[i]; - for (j = 0; j < k; j++) P[ix[i] + ix[j] * n] = Pp_[i + j * k]; + for (j = 0; j < k; j++) + { + P[ix[i] + ix[j] * n] = Pp_[i + j * k]; + } } free(ix); free(x_); @@ -1169,7 +1357,10 @@ int smoother(const double *xf, const double *Qf, const double *xb, matcpy(invQb, Qb, n, n); if (!matinv(invQf, n) && !matinv(invQb, n)) { - for (i = 0; i < n * n; i++) Qs[i] = invQf[i] + invQb[i]; + for (i = 0; i < n * n; i++) + { + Qs[i] = invQf[i] + invQb[i]; + } if (!(info = matinv(Qs, n))) { matmul("NN", n, 1, n, 1.0, invQf, xf, 0.0, xx); @@ -1199,7 +1390,10 @@ void matfprint(const double A[], int n, int m, int p, int q, FILE *fp) for (i = 0; i < n; i++) { - for (j = 0; j < m; j++) fprintf(fp, " %*.*f", p, q, A[i + j * n]); + for (j = 0; j < m; j++) + { + fprintf(fp, " %*.*f", p, q, A[i + j * n]); + } fprintf(fp, "\n"); } } @@ -1239,7 +1433,10 @@ double str2num(const char *s, int i, int n) double value; char str[256], *p = str; - if (i < 0 || static_cast(strlen(s)) < i || static_cast(sizeof(str)) - 1 < n) return 0.0; + if (i < 0 || static_cast(strlen(s)) < i || static_cast(sizeof(str)) - 1 < n) + { + return 0.0; + } for (s += i; *s && --n >= 0; s++) { *p++ = *s == 'd' || *s == 'D' ? 'E' : *s; @@ -1261,15 +1458,23 @@ int str2time(const char *s, int i, int n, gtime_t *t) double ep[6]; char str[256], *p = str; - if (i < 0 || static_cast(strlen(s)) < i || static_cast(sizeof(str)) - 1 < i) return -1; + if (i < 0 || static_cast(strlen(s)) < i || static_cast(sizeof(str)) - 1 < i) + { + return -1; + } for (s += i; *s && --n >= 0;) { *p++ = *s++; } *p = '\0'; if (sscanf(str, "%lf %lf %lf %lf %lf %lf", ep, ep + 1, ep + 2, ep + 3, ep + 4, ep + 5) < 6) - return -1; - if (ep[0] < 100.0) ep[0] += ep[0] < 80.0 ? 2000.0 : 1900.0; + { + return -1; + } + if (ep[0] < 100.0) + { + ep[0] += ep[0] < 80.0 ? 2000.0 : 1900.0; + } *t = epoch2time(ep); return 0; } @@ -1287,7 +1492,10 @@ gtime_t epoch2time(const double *ep) gtime_t time = {0, 0}; int days, sec, year = static_cast(ep[0]), mon = static_cast(ep[1]), day = static_cast(ep[2]); - if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) return time; + if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) + { + return time; + } /* leap year if year%4==0 in 1901-2099 */ days = (year - 1970) * 365 + (year - 1969) / 4 + doy[mon - 1] + day - 2 + (year % 4 == 0 && mon >= 3 ? 1 : 0); @@ -1318,9 +1526,13 @@ void time2epoch(gtime_t t, double *ep) for (day = days % 1461, mon = 0; mon < 48; mon++) { if (day >= mday[mon]) - day -= mday[mon]; + { + day -= mday[mon]; + } else - break; + { + break; + } } ep[0] = 1970 + days / 1461 * 4 + mon / 12; ep[1] = mon % 12 + 1; @@ -1339,9 +1551,12 @@ void time2epoch(gtime_t t, double *ep) *-----------------------------------------------------------------------------*/ gtime_t gpst2time(int week, double sec) { - gtime_t t = epoch2time(gpst0); + gtime_t t = epoch2time(GPST0); - if (sec < -1e9 || 1e9 < sec) sec = 0.0; + if (sec < -1e9 || 1e9 < sec) + { + sec = 0.0; + } t.time += static_cast(86400) * 7 * week + static_cast(sec); t.sec = sec - static_cast(sec); return t; @@ -1356,11 +1571,14 @@ gtime_t gpst2time(int week, double sec) *-----------------------------------------------------------------------------*/ double time2gpst(gtime_t t, int *week) { - gtime_t t0 = epoch2time(gpst0); + gtime_t t0 = epoch2time(GPST0); time_t sec = t.time - t0.time; int w = static_cast(sec / 604800); - if (week) *week = w; + if (week) + { + *week = w; + } return (static_cast(sec - static_cast(w * 604800)) + t.sec); } @@ -1373,9 +1591,12 @@ double time2gpst(gtime_t t, int *week) *-----------------------------------------------------------------------------*/ gtime_t gst2time(int week, double sec) { - gtime_t t = epoch2time(gst0); + gtime_t t = epoch2time(GST0); - if (sec < -1e9 || 1e9 < sec) sec = 0.0; + if (sec < -1e9 || 1e9 < sec) + { + sec = 0.0; + } t.time += static_cast(86400) * 7 * week + static_cast(sec); t.sec = sec - static_cast(sec); return t; @@ -1390,11 +1611,14 @@ gtime_t gst2time(int week, double sec) *-----------------------------------------------------------------------------*/ double time2gst(gtime_t t, int *week) { - gtime_t t0 = epoch2time(gst0); + gtime_t t0 = epoch2time(GST0); time_t sec = t.time - t0.time; int w = static_cast(sec / (86400 * 7)); - if (week) *week = w; + if (week) + { + *week = w; + } return (sec - static_cast(w) * 86400 * 7) + t.sec; } @@ -1407,9 +1631,12 @@ double time2gst(gtime_t t, int *week) *-----------------------------------------------------------------------------*/ gtime_t bdt2time(int week, double sec) { - gtime_t t = epoch2time(bdt0); + gtime_t t = epoch2time(BDT0); - if (sec < -1e9 || 1e9 < sec) sec = 0.0; + if (sec < -1e9 || 1e9 < sec) + { + sec = 0.0; + } t.time += static_cast(86400) * 7 * week + static_cast(sec); t.sec = sec - static_cast(sec); return t; @@ -1424,11 +1651,14 @@ gtime_t bdt2time(int week, double sec) *-----------------------------------------------------------------------------*/ double time2bdt(gtime_t t, int *week) { - gtime_t t0 = epoch2time(bdt0); + gtime_t t0 = epoch2time(BDT0); time_t sec = t.time - t0.time; int w = static_cast(sec / (86400 * 7)); - if (week) *week = w; + if (week) + { + *week = w; + } return (sec - static_cast(w) * 86400 * 7) + t.sec; } @@ -1517,10 +1747,19 @@ int read_leaps_text(FILE *fp) while (fgets(buff, sizeof(buff), fp) && n < MAXLEAPS) { - if ((p = strchr(buff, '#'))) *p = '\0'; + if ((p = strchr(buff, '#'))) + { + *p = '\0'; + } if (sscanf(buff, "%d %d %d %d %d %d %d", ep, ep + 1, ep + 2, ep + 3, ep + 4, ep + 5, - &ls) < 7) continue; - for (i = 0; i < 6; i++) leaps[n][i] = ep[i]; + &ls) < 7) + { + continue; + } + for (i = 0; i < 6; i++) + { + leaps[n][i] = ep[i]; + } leaps[n++][6] = ls; } return n; @@ -1541,21 +1780,37 @@ int read_leaps_usno(FILE *fp) while (fgets(buff, sizeof(buff), fp) && n < MAXLEAPS) { if (sscanf(buff, "%d %s %d =JD %lf TAI-UTC= %lf", &y, month, &d, &jd, - &tai_utc) < 5) continue; - if (y < 1980) continue; + &tai_utc) < 5) + { + continue; + } + if (y < 1980) + { + continue; + } for (m = 1; m <= 12; m++) - if (!strcmp(months[m - 1], month)) break; - if (m >= 13) continue; + { + if (!strcmp(months[m - 1], month)) + { + break; + } + } + if (m >= 13) + { + continue; + } ls[n][0] = y; ls[n][1] = m; ls[n][2] = d; ls[n++][6] = static_cast(19.0 - tai_utc); } for (i = 0; i < n; i++) - for (j = 0; j < 7; j++) - { - leaps[i][j] = ls[n - i - 1][j]; - } + { + for (j = 0; j < 7; j++) + { + leaps[i][j] = ls[n - i - 1][j]; + } + } return n; } @@ -1576,7 +1831,10 @@ int read_leaps(const char *file) FILE *fp; int i, n; - if (!(fp = fopen(file, "re"))) return 0; + if (!(fp = fopen(file, "re"))) + { + return 0; + } /* read leap seconds table by text or usno */ if (!(n = read_leaps_text(fp)) && !(n = read_leaps_usno(fp))) @@ -1584,7 +1842,10 @@ int read_leaps(const char *file) fclose(fp); return 0; } - for (i = 0; i < 7; i++) leaps[n][i] = 0.0; + for (i = 0; i < 7; i++) + { + leaps[n][i] = 0.0; + } fclose(fp); return 1; } @@ -1604,7 +1865,10 @@ gtime_t gpst2utc(gtime_t t) for (i = 0; leaps[i][0] > 0; i++) { tu = timeadd(t, leaps[i][6]); - if (timediff(tu, epoch2time(leaps[i])) >= 0.0) return tu; + if (timediff(tu, epoch2time(leaps[i])) >= 0.0) + { + return tu; + } } return t; } @@ -1622,7 +1886,10 @@ gtime_t utc2gpst(gtime_t t) for (i = 0; leaps[i][0] > 0; i++) { - if (timediff(t, epoch2time(leaps[i])) >= 0.0) return timeadd(t, -leaps[i][6]); + if (timediff(t, epoch2time(leaps[i])) >= 0.0) + { + return timeadd(t, -leaps[i][6]); + } } return t; } @@ -1702,9 +1969,13 @@ void time2str(gtime_t t, char *s, int n) double ep[6]; if (n < 0) - n = 0; + { + n = 0; + } else if (n > 12) - n = 12; + { + n = 12; + } if (1.0 - t.sec < 0.5 / pow(10.0, n)) { t.time++; @@ -1756,7 +2027,10 @@ int adjgpsweek(int week) { int w; (void)time2gpst(utc2gpst(timeget()), &w); - if (w < 1560) w = 1560; /* use 2009/12/1 if time is earlier than 2009/12/1 */ + if (w < 1560) + { + w = 1560; /* use 2009/12/1 if time is earlier than 2009/12/1 */ + } return week + (w - week + 512) / 1024 * 1024; } @@ -1795,7 +2069,10 @@ unsigned int tickget(void) void sleepms(int ms) { struct timespec ts = {0, 0}; - if (ms <= 0) return; + if (ms <= 0) + { + return; + } ts.tv_sec = static_cast(ms / 1000); ts.tv_nsec = static_cast(ms % 1000 * 1000000); nanosleep(&ts, nullptr); @@ -1997,11 +2274,17 @@ void ast_args(double t, double *f) double tt[4]; int i, j; - for (tt[0] = t, i = 1; i < 4; i++) tt[i] = tt[i - 1] * t; + for (tt[0] = t, i = 1; i < 4; i++) + { + tt[i] = tt[i - 1] * t; + } for (i = 0; i < 5; i++) { f[i] = fc[i][0] * 3600.0; - for (j = 0; j < 4; j++) f[i] += fc[i][j + 1] * tt[j]; + for (j = 0; j < 4; j++) + { + f[i] += fc[i][j + 1] * tt[j]; + } f[i] = fmod(f[i] * AS2R, 2.0 * PI); } } @@ -2125,7 +2408,10 @@ void nut_iau1980(double t, const double *f, double *dpsi, double *deps) for (i = 0; i < 106; i++) { ang = 0.0; - for (j = 0; j < 5; j++) ang += nut[i][j] * f[j]; + for (j = 0; j < 5; j++) + { + ang += nut[i][j] * f[j]; + } *dpsi += (nut[i][6] + nut[i][7] * t) * sin(ang); *deps += (nut[i][8] + nut[i][9] * t) * cos(ang); } @@ -2159,8 +2445,14 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst) if (fabs(timediff(tutc, tutc_)) < 0.01) { /* read cache */ - for (i = 0; i < 9; i++) U[i] = U_[i]; - if (gmst) *gmst = gmst_; + for (i = 0; i < 9; i++) + { + U[i] = U_[i]; + } + if (gmst) + { + *gmst = gmst_; + } return; } tutc_ = tutc; @@ -2207,8 +2499,14 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst) matmul("NN", 3, 3, 3, 1.0, N, P, 0.0, NP); matmul("NN", 3, 3, 3, 1.0, R, NP, 0.0, U_); /* U=W*Rz(gast)*N*P */ - for (i = 0; i < 9; i++) U[i] = U_[i]; - if (gmst) *gmst = gmst_; + for (i = 0; i < 9; i++) + { + U[i] = U_[i]; + } + if (gmst) + { + *gmst = gmst_; + } trace(5, "gmst=%.12f gast=%.12f\n", gmst_, gast); trace(5, "P=\n"); @@ -2227,7 +2525,10 @@ int decodef(char *p, int n, double *v) { int i; - for (i = 0; i < n; i++) v[i] = 0.0; + for (i = 0; i < n; i++) + { + v[i] = 0.0; + } for (i = 0, p = strtok(p, " "); p && i < n; p = strtok(nullptr, " ")) { v[i++] = atof(p) * 1e-3; @@ -2275,9 +2576,15 @@ int readngspcv(const char *file, pcvs_t *pcvs) } while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) >= 62 && buff[61] == '|') continue; + if (strlen(buff) >= 62 && buff[61] == '|') + { + continue; + } - if (buff[0] != ' ') n = 0; /* start line */ + if (buff[0] != ' ') + { + n = 0; /* start line */ + } if (++n == 1) { pcv = pcv0; @@ -2286,25 +2593,36 @@ int readngspcv(const char *file, pcvs_t *pcvs) } else if (n == 2) { - if (decodef(buff, 3, neu) < 3) continue; + if (decodef(buff, 3, neu) < 3) + { + continue; + } pcv.off[0][0] = neu[1]; pcv.off[0][1] = neu[0]; pcv.off[0][2] = neu[2]; } else if (n == 3) - decodef(buff, 10, pcv.var[0]); + { + decodef(buff, 10, pcv.var[0]); + } else if (n == 4) - decodef(buff, 9, pcv.var[0] + 10); + { + decodef(buff, 9, pcv.var[0] + 10); + } else if (n == 5) { - if (decodef(buff, 3, neu) < 3) continue; - ; + if (decodef(buff, 3, neu) < 3) + { + continue; + }; pcv.off[1][0] = neu[1]; pcv.off[1][1] = neu[0]; pcv.off[1][2] = neu[2]; } else if (n == 6) - decodef(buff, 10, pcv.var[1]); + { + decodef(buff, 10, pcv.var[1]); + } else if (n == 7) { decodef(buff, 9, pcv.var[1] + 10); @@ -2336,7 +2654,10 @@ int readantex(const char *file, pcvs_t *pcvs) } while (fgets(buff, sizeof(buff), fp)) { - if (strlen(buff) < 60 || strstr(buff + 60, "COMMENT")) continue; + if (strlen(buff) < 60 || strstr(buff + 60, "COMMENT")) + { + continue; + } if (strstr(buff + 60, "START OF ANTENNA")) { @@ -2348,7 +2669,10 @@ int readantex(const char *file, pcvs_t *pcvs) addpcv(&pcv, pcvs); state = 0; } - if (!state) continue; + if (!state) + { + continue; + } if (strstr(buff + 60, "TYPE / SERIAL NO")) { @@ -2363,18 +2687,35 @@ int readantex(const char *file, pcvs_t *pcvs) } else if (strstr(buff + 60, "VALID FROM")) { - if (!str2time(buff, 0, 43, &pcv.ts)) continue; + if (!str2time(buff, 0, 43, &pcv.ts)) + { + continue; + } } else if (strstr(buff + 60, "VALID UNTIL")) { - if (!str2time(buff, 0, 43, &pcv.te)) continue; + if (!str2time(buff, 0, 43, &pcv.te)) + { + continue; + } } else if (strstr(buff + 60, "START OF FREQUENCY")) { - if (sscanf(buff + 4, "%d", &f) < 1) continue; + if (sscanf(buff + 4, "%d", &f) < 1) + { + continue; + } for (i = 0; i < NFREQ; i++) - if (freqs[i] == f) break; - if (i < NFREQ) freq = i + 1; + { + if (freqs[i] == f) + { + break; + } + } + if (i < NFREQ) + { + freq = i + 1; + } } else if (strstr(buff + 60, "END OF FREQUENCY")) { @@ -2382,17 +2723,32 @@ int readantex(const char *file, pcvs_t *pcvs) } else if (strstr(buff + 60, "NORTH / EAST / UP")) { - if (freq < 1 || NFREQ < freq) continue; - if (decodef(buff, 3, neu) < 3) continue; + if (freq < 1 || NFREQ < freq) + { + continue; + } + if (decodef(buff, 3, neu) < 3) + { + continue; + } pcv.off[freq - 1][0] = neu[pcv.sat ? 0 : 1]; /* x or e */ pcv.off[freq - 1][1] = neu[pcv.sat ? 1 : 0]; /* y or n */ pcv.off[freq - 1][2] = neu[2]; /* z or u */ } else if (strstr(buff, "NOAZI")) { - if (freq < 1 || NFREQ < freq) continue; - if ((i = decodef(buff + 8, 19, pcv.var[freq - 1])) <= 0) continue; - for (; i < 19; i++) pcv.var[freq - 1][i] = pcv.var[freq - 1][i - 1]; + if (freq < 1 || NFREQ < freq) + { + continue; + } + if ((i = decodef(buff + 8, 19, pcv.var[freq - 1])) <= 0) + { + continue; + } + for (; i < 19; i++) + { + pcv.var[freq - 1][i] = pcv.var[freq - 1][i - 1]; + } } } fclose(fp); @@ -2465,36 +2821,64 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time, for (i = 0; i < pcvs->n; i++) { pcv = pcvs->pcv + i; - if (pcv->sat != sat) continue; - if (pcv->ts.time != 0 && timediff(pcv->ts, time) > 0.0) continue; - if (pcv->te.time != 0 && timediff(pcv->te, time) < 0.0) continue; + if (pcv->sat != sat) + { + continue; + } + if (pcv->ts.time != 0 && timediff(pcv->ts, time) > 0.0) + { + continue; + } + if (pcv->te.time != 0 && timediff(pcv->te, time) < 0.0) + { + continue; + } return pcv; } } else { if (strlen(type) < MAXANT + 1) - strcpy(buff, type); + { + strcpy(buff, type); + } else { trace(1, "type array is too long"); } - for (p = strtok(buff, " "); p && n < 2; p = strtok(nullptr, " ")) types[n++] = p; - if (n <= 0) return nullptr; + for (p = strtok(buff, " "); p && n < 2; p = strtok(nullptr, " ")) + { + types[n++] = p; + } + if (n <= 0) + { + return nullptr; + } /* search receiver antenna with radome at first */ for (i = 0; i < pcvs->n; i++) { pcv = pcvs->pcv + i; for (j = 0; j < n; j++) - if (!strstr(pcv->type, types[j])) break; - if (j >= n) return pcv; + { + if (!strstr(pcv->type, types[j])) + { + break; + } + } + if (j >= n) + { + return pcv; + } } /* search receiver antenna without radome */ for (i = 0; i < pcvs->n; i++) { pcv = pcvs->pcv + i; - if (strstr(pcv->type, types[0]) != pcv->type) continue; + if (strstr(pcv->type, types[0]) != pcv->type) + { + continue; + } trace(2, "pcv without radome is used type=%s\n", type); return pcv; @@ -2530,9 +2914,15 @@ void readpos(const char *file, const char *rcv, double *pos) } while (np < 2048 && fgets(buff, sizeof(buff), fp)) { - if (buff[0] == '%' || buff[0] == '#') continue; + if (buff[0] == '%' || buff[0] == '#') + { + continue; + } if (sscanf(buff, "%lf %lf %lf %s", &poss[np][0], &poss[np][1], &poss[np][2], - str) < 4) continue; + str) < 4) + { + continue; + } // strncpy(stas[np], str, 15); This line triggers a warning. Replaced by: memcpy(stas[np], str, 15 * sizeof(stas[np][0])); stas[np++][15] = '\0'; @@ -2541,8 +2931,14 @@ void readpos(const char *file, const char *rcv, double *pos) len = static_cast(strlen(rcv)); for (i = 0; i < np; i++) { - if (strncmp(stas[i], rcv, len) != 0) continue; - for (j = 0; j < 3; j++) pos[j] = poss[i][j]; + if (strncmp(stas[i], rcv, len) != 0) + { + continue; + } + for (j = 0; j < 3; j++) + { + pos[j] = poss[i][j]; + } pos[0] *= D2R; pos[1] *= D2R; return; @@ -2560,11 +2956,23 @@ int readblqrecord(FILE *fp, double *odisp) while (fgets(buff, sizeof(buff), fp)) { - if (!strncmp(buff, "$$", 2)) continue; + if (!strncmp(buff, "$$", 2)) + { + continue; + } if (sscanf(buff, "%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf", - v, v + 1, v + 2, v + 3, v + 4, v + 5, v + 6, v + 7, v + 8, v + 9, v + 10) < 11) continue; - for (i = 0; i < 11; i++) odisp[n + i * 6] = v[i]; - if (++n == 6) return 1; + v, v + 1, v + 2, v + 3, v + 4, v + 5, v + 6, v + 7, v + 8, v + 9, v + 10) < 11) + { + continue; + } + for (i = 0; i < 11; i++) + { + odisp[n + i * 6] = v[i]; + } + if (++n == 6) + { + return 1; + } } return 0; } @@ -2585,7 +2993,9 @@ int readblq(const char *file, const char *sta, double *odisp) /* station name to upper case */ sscanf(sta, "%16s", staname); for (p = staname; (*p = static_cast(toupper(static_cast(*p)))); p++) - ; + { + ; + } if (!(fp = fopen(file, "re"))) { @@ -2594,12 +3004,23 @@ int readblq(const char *file, const char *sta, double *odisp) } while (fgets(buff, sizeof(buff), fp)) { - if (!strncmp(buff, "$$", 2) || strlen(buff) < 2) continue; + if (!strncmp(buff, "$$", 2) || strlen(buff) < 2) + { + continue; + } - if (sscanf(buff + 2, "%16s", name) < 1) continue; + if (sscanf(buff + 2, "%16s", name) < 1) + { + continue; + } for (p = name; (*p = static_cast(toupper(static_cast(*p)))); p++) - ; - if (strcmp(name, staname) != 0) continue; + { + ; + } + if (strcmp(name, staname) != 0) + { + continue; + } /* read blq record */ if (readblqrecord(fp, odisp)) @@ -2683,7 +3104,10 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv) trace(4, "geterp:\n"); - if (erp->n <= 0) return 0; + if (erp->n <= 0) + { + return 0; + } mjd = 51544.5 + (timediff(gpst2utc(time), epoch2time(ep))) / 86400.0; @@ -2709,9 +3133,13 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv) { i = (j + k) / 2; if (mjd < erp->data[i].mjd) - k = i; + { + k = i; + } else - j = i; + { + j = i; + } } if (erp->data[j].mjd == erp->data[j + 1].mjd) { @@ -2744,7 +3172,10 @@ void uniqeph(nav_t *nav) trace(3, "uniqeph: n=%d\n", nav->n); - if (nav->n <= 0) return; + if (nav->n <= 0) + { + return; + } qsort(nav->eph, nav->n, sizeof(eph_t), cmpeph); @@ -2789,7 +3220,10 @@ void uniqgeph(nav_t *nav) trace(3, "uniqgeph: ng=%d\n", nav->ng); - if (nav->ng <= 0) return; + if (nav->ng <= 0) + { + return; + } qsort(nav->geph, nav->ng, sizeof(geph_t), cmpgeph); @@ -2835,7 +3269,10 @@ void uniqseph(nav_t *nav) trace(3, "uniqseph: ns=%d\n", nav->ns); - if (nav->ns <= 0) return; + if (nav->ns <= 0) + { + return; + } qsort(nav->seph, nav->ns, sizeof(seph_t), cmpseph); @@ -2882,10 +3319,12 @@ void uniqnav(nav_t *nav) /* update carrier wave length */ for (i = 0; i < MAXSAT; i++) - for (j = 0; j < NFREQ; j++) - { - nav->lam[i][j] = satwavelen(i + 1, j, nav); - } + { + for (j = 0; j < NFREQ; j++) + { + nav->lam[i][j] = satwavelen(i + 1, j, nav); + } + } } @@ -2894,8 +3333,14 @@ int cmpobs(const void *p1, const void *p2) { auto *q1 = (obsd_t *)p1, *q2 = (obsd_t *)p2; double tt = timediff(q1->time, q2->time); - if (fabs(tt) > DTTOL) return tt < 0 ? -1 : 1; - if (q1->rcv != q2->rcv) return static_cast(q1->rcv) - static_cast(q2->rcv); + if (fabs(tt) > DTTOL) + { + return tt < 0 ? -1 : 1; + } + if (q1->rcv != q2->rcv) + { + return static_cast(q1->rcv) - static_cast(q2->rcv); + } return static_cast(q1->sat) - static_cast(q2->sat); } @@ -2911,7 +3356,10 @@ int sortobs(obs_t *obs) trace(3, "sortobs: nobs=%d\n", obs->n); - if (obs->n <= 0) return 0; + if (obs->n <= 0) + { + return 0; + } qsort(obs->data, obs->n, sizeof(obsd_t), cmpobs); @@ -2931,7 +3379,10 @@ int sortobs(obs_t *obs) { for (j = i + 1; j < obs->n; j++) { - if (timediff(obs->data[j].time, obs->data[i].time) > DTTOL) break; + if (timediff(obs->data[j].time, obs->data[i].time) > DTTOL) + { + break; + } } } return n; @@ -2972,14 +3423,23 @@ int readnav(const char *file, nav_t *nav) trace(3, "loadnav: file=%s\n", file); - if (!(fp = fopen(file, "re"))) return 0; + if (!(fp = fopen(file, "re"))) + { + return 0; + } while (fgets(buff, sizeof(buff), fp)) { if (!strncmp(buff, "IONUTC", 6)) { - for (i = 0; i < 8; i++) nav->ion_gps[i] = 0.0; - for (i = 0; i < 4; i++) nav->utc_gps[i] = 0.0; + for (i = 0; i < 8; i++) + { + nav->ion_gps[i] = 0.0; + } + for (i = 0; i < 4; i++) + { + nav->utc_gps[i] = 0.0; + } nav->leaps = 0; sscanf(buff, "IONUTC,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d", &nav->ion_gps[0], &nav->ion_gps[1], &nav->ion_gps[2], &nav->ion_gps[3], @@ -2989,10 +3449,17 @@ int readnav(const char *file, nav_t *nav) continue; } if ((p = strchr(buff, ','))) - *p = '\0'; + { + *p = '\0'; + } else - continue; - if (!(sat = satid2no(buff))) continue; + { + continue; + } + if (!(sat = satid2no(buff))) + { + continue; + } if (satsys(sat, &prn) == SYS_GLO) { nav->geph[prn - 1] = geph0; @@ -3048,11 +3515,17 @@ int savenav(const char *file, const nav_t *nav) trace(3, "savenav: file=%s\n", file); - if (!(fp = fopen(file, "we"))) return 0; + if (!(fp = fopen(file, "we"))) + { + return 0; + } for (i = 0; i < MAXSAT; i++) { - if (nav->eph[i].ttr.time == 0) continue; + if (nav->eph[i].ttr.time == 0) + { + continue; + } satno2id(nav->eph[i].sat, id); fprintf(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," @@ -3070,7 +3543,10 @@ int savenav(const char *file, const nav_t *nav) } for (i = 0; i < MAXPRNGLO; i++) { - if (nav->geph[i].tof.time == 0) continue; + if (nav->geph[i].tof.time == 0) + { + continue; + } satno2id(nav->geph[i].sat, id); fprintf(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%.14E,%.14E,%.14E,%.14E,%.14E,%.14E," @@ -3202,7 +3678,10 @@ void traceswap(void) rtk_unlock(&lock_trace); return; } - if (fp_trace) fclose(fp_trace); + if (fp_trace) + { + fclose(fp_trace); + } if (!(fp_trace = fopen(path, "we"))) { @@ -3218,11 +3697,18 @@ void traceopen(const char *file) char path[1024]; reppath(file, path, time, "", ""); - if (!*path || !(fp_trace = fopen(path, "we"))) fp_trace = stderr; + if (!*path || !(fp_trace = fopen(path, "we"))) + { + fp_trace = stderr; + } if (strlen(file) < 1025) - strcpy(file_trace, file); + { + strcpy(file_trace, file); + } else - trace(1, "file array is too long"); + { + trace(1, "file array is too long"); + } tick_trace = tickget(); time_trace = time; initlock(&lock_trace); @@ -3231,7 +3717,10 @@ void traceopen(const char *file) void traceclose(void) { - if (fp_trace && fp_trace != stderr) fclose(fp_trace); + if (fp_trace && fp_trace != stderr) + { + fclose(fp_trace); + } fp_trace = nullptr; file_trace[0] = '\0'; } @@ -3259,7 +3748,10 @@ void tracelevel(int level) void tracet(int level, const char *format, ...) { va_list ap; - if (!fp_trace || level > level_trace) return; + if (!fp_trace || level > level_trace) + { + return; + } traceswap(); fprintf(fp_trace, "%d %9.3f: ", level, (tickget() - tick_trace) / 1000.0); va_start(ap, format); @@ -3436,13 +3928,23 @@ void createdir(const char *path) //tracet(3, "createdir: path=%s\n", path); if (strlen(path) < 1025) - strcpy(buff, path); + { + strcpy(buff, path); + } else - trace(1, "path is too long"); - if (!(p = strrchr(buff, FILEPATHSEP))) return; + { + trace(1, "path is too long"); + } + if (!(p = strrchr(buff, FILEPATHSEP))) + { + return; + } *p = '\0'; - if (mkdir(buff, 0777) != 0) trace(1, "Error creating folder"); + if (mkdir(buff, 0777) != 0) + { + trace(1, "Error creating folder"); + } } @@ -3454,17 +3956,27 @@ int repstr(char *str, const char *pat, const char *rep) for (p = str, r = buff; *p; p = q + len) { - if (!(q = strstr(p, pat))) break; + if (!(q = strstr(p, pat))) + { + break; + } strncpy(r, p, q - p); r += q - p; r += sprintf(r, "%s", rep); } - if (p <= str) return 0; + if (p <= str) + { + return 0; + } if (strlen(p) < 1025) - strcpy(r, p); + { + strcpy(r, p); + } else - trace(1, "pat array is too long"); + { + trace(1, "pat array is too long"); + } strcpy(str, buff); return 1; } @@ -3507,9 +4019,18 @@ int reppath(const char *path, char *rpath, gtime_t time, const char *rov, strcpy(rpath, path); - if (!strstr(rpath, "%")) return 0; - if (*rov) stat |= repstr(rpath, "%r", rov); - if (*base) stat |= repstr(rpath, "%b", base); + if (!strstr(rpath, "%")) + { + return 0; + } + if (*rov) + { + stat |= repstr(rpath, "%r", rov); + } + if (*base) + { + stat |= repstr(rpath, "%b", base); + } if (time.time != 0) { time2epoch(time, ep); @@ -3582,12 +4103,19 @@ int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts, trace(3, "reppaths: path =%s nmax=%d rov=%s base=%s\n", path, nmax, rov, base); - if (ts.time == 0 || te.time == 0 || timediff(ts, te) > 0.0) return 0; + if (ts.time == 0 || te.time == 0 || timediff(ts, te) > 0.0) + { + return 0; + } if (strstr(path, "%S") || strstr(path, "%M") || strstr(path, "%t")) - tint = 900.0; + { + tint = 900.0; + } else if (strstr(path, "%h") || strstr(path, "%H")) - tint = 3600.0; + { + tint = 3600.0; + } tow = time2gpst(ts, &week); time = gpst2time(week, floor(tow / tint) * tint); @@ -3595,10 +4123,16 @@ int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts, while (timediff(time, te) <= 0.0 && n < nmax) { reppath(path, rpath[n], time, rov, base); - if (n == 0 || strcmp(rpath[n], rpath[n - 1]) != 0) n++; + if (n == 0 || strcmp(rpath[n], rpath[n - 1]) != 0) + { + n++; + } time = timeadd(time, tint); } - for (i = 0; i < n; i++) trace(3, "reppaths: rpath=%s\n", rpath[i]); + for (i = 0; i < n; i++) + { + trace(3, "reppaths: rpath=%s\n", rpath[i]); + } return n; } @@ -3622,7 +4156,10 @@ double satwavelen(int sat, int frq, const nav_t *nav) { for (i = 0; i < nav->ng; i++) { - if (nav->geph[i].sat != sat) continue; + if (nav->geph[i].sat != sat) + { + continue; + } return SPEED_OF_LIGHT / (freq_glo[frq] + dfrq_glo[frq] * nav->geph[i].frq); } } @@ -3634,28 +4171,48 @@ double satwavelen(int sat, int frq, const nav_t *nav) else if (sys == SYS_BDS) { if (frq == 0) - return SPEED_OF_LIGHT / FREQ1_BDS; /* B1 */ + { + return SPEED_OF_LIGHT / FREQ1_BDS; /* B1 */ + } if (frq == 1) - return SPEED_OF_LIGHT / FREQ2_BDS; /* B2 */ + { + return SPEED_OF_LIGHT / FREQ2_BDS; /* B2 */ + } if (frq == 2) - return SPEED_OF_LIGHT / FREQ3_BDS; /* B3 */ + { + return SPEED_OF_LIGHT / FREQ3_BDS; /* B3 */ + } } else { if (frq == 0) - return SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ + { + return SPEED_OF_LIGHT / FREQ1; /* L1/E1 */ + } if (frq == 1) - return SPEED_OF_LIGHT / FREQ2; /* L2 */ + { + return SPEED_OF_LIGHT / FREQ2; /* L2 */ + } if (frq == 2) - return SPEED_OF_LIGHT / FREQ5; /* L5/E5a */ + { + return SPEED_OF_LIGHT / FREQ5; /* L5/E5a */ + } if (frq == 3) - return SPEED_OF_LIGHT / FREQ6; /* L6/LEX */ + { + return SPEED_OF_LIGHT / FREQ6; /* L6/LEX */ + } if (frq == 4) - return SPEED_OF_LIGHT / FREQ7; /* E5b */ - else if (frq == 5) - return SPEED_OF_LIGHT / FREQ8; /* E5a+b */ + { + return SPEED_OF_LIGHT / FREQ7; /* E5b */ + } + if (frq == 5) + { + return SPEED_OF_LIGHT / FREQ8; /* E5a+b */ + } else if (frq == 6) - return SPEED_OF_LIGHT / FREQ9; /* S */ + { + return SPEED_OF_LIGHT / FREQ9; /* S */ + } } return 0.0; } @@ -3674,10 +4231,19 @@ double geodist(const double *rs, const double *rr, double *e) double r; int i; - if (norm_rtk(rs, 3) < RE_WGS84) return -1.0; - for (i = 0; i < 3; i++) e[i] = rs[i] - rr[i]; + if (norm_rtk(rs, 3) < RE_WGS84) + { + return -1.0; + } + for (i = 0; i < 3; i++) + { + e[i] = rs[i] - rr[i]; + } r = norm_rtk(e, 3); - for (i = 0; i < 3; i++) e[i] /= r; + for (i = 0; i < 3; i++) + { + e[i] /= r; + } return r + DEFAULT_OMEGA_EARTH_DOT * (rs[0] * rr[1] - rs[1] * rr[0]) / SPEED_OF_LIGHT; } @@ -3698,7 +4264,10 @@ double satazel(const double *pos, const double *e, double *azel) { ecef2enu(pos, e, enu); az = dot(enu, enu, 2) < 1e-12 ? 0.0 : atan2(enu[0], enu[1]); - if (az < 0.0) az += 2 * PI; + if (az < 0.0) + { + az += 2 * PI; + } el = asin(enu[2]); } if (azel) @@ -3724,10 +4293,16 @@ void dops(int ns, const double *azel, double elmin, double *dop) double H[4 * MAXSAT], Q[16], cosel, sinel; int i, n; - for (i = 0; i < 4; i++) dop[i] = 0.0; + for (i = 0; i < 4; i++) + { + dop[i] = 0.0; + } for (i = n = 0; i < ns && i < MAXSAT; i++) { - if (azel[1 + i * 2] < elmin || azel[1 + i * 2] <= 0.0) continue; + if (azel[1 + i * 2] < elmin || azel[1 + i * 2] <= 0.0) + { + continue; + } cosel = cos(azel[1 + i * 2]); sinel = sin(azel[1 + i * 2]); H[4 * n] = cosel * sin(azel[i * 2]); @@ -3735,7 +4310,10 @@ void dops(int ns, const double *azel, double elmin, double *dop) H[2 + 4 * n] = sinel; H[3 + 4 * n++] = 1.0; } - if (n < 4) return; + if (n < 4) + { + return; + } matmul("NT", 4, 4, n, 1.0, H, H, 0.0, Q); if (!matinv(Q, 4)) @@ -3765,8 +4343,14 @@ double ionmodel(gtime_t t, const double *ion, const double *pos, double tt, f, psi, phi, lam, amp, per, x; int week; - if (pos[2] < -1e3 || azel[1] <= 0) return 0.0; - if (norm_rtk(ion, 8) <= 0.0) ion = ion_default; + if (pos[2] < -1e3 || azel[1] <= 0) + { + return 0.0; + } + if (norm_rtk(ion, 8) <= 0.0) + { + ion = ion_default; + } /* earth centered angle (semi-circle) */ psi = 0.0137 / (azel[1] / PI + 0.11) - 0.022; @@ -3774,9 +4358,13 @@ double ionmodel(gtime_t t, const double *ion, const double *pos, /* subionospheric latitude/longitude (semi-circle) */ phi = pos[0] / PI + psi * cos(azel[0]); if (phi > 0.416) - phi = 0.416; + { + phi = 0.416; + } else if (phi < -0.416) - phi = -0.416; + { + phi = -0.416; + } lam = pos[1] / PI + psi * sin(azel[0]) / cos(phi * PI); /* geomagnetic latitude (semi-circle) */ @@ -3808,7 +4396,10 @@ double ionmodel(gtime_t t, const double *ion, const double *pos, *-----------------------------------------------------------------------------*/ double ionmapf(const double *pos, const double *azel) { - if (pos[2] >= HION) return 1.0; + if (pos[2] >= HION) + { + return 1.0; + } return 1.0 / cos(asin((RE_WGS84 + pos[2]) / (RE_WGS84 + HION) * sin(PI / 2.0 - azel[1]))); } @@ -3863,7 +4454,10 @@ double tropmodel(gtime_t time __attribute__((unused)), const double *pos, const const double temp0 = 15.0; /* temparature at sea level */ double hgt, pres, temp, e, z, trph, trpw; - if (pos[2] < -100.0 || 1e4 < pos[2] || azel[1] <= 0) return 0.0; + if (pos[2] < -100.0 || 1e4 < pos[2] || azel[1] <= 0) + { + return 0.0; + } /* standard atmosphere */ hgt = pos[2] < 0.0 ? 0.0 : pos[2]; @@ -3885,9 +4479,13 @@ double interpc(const double coef[], double lat) { int i = static_cast(lat / 15.0); if (i < 1) - return coef[0]; + { + return coef[0]; + } if (i > 4) - return coef[4]; + { + return coef[4]; + } return coef[i - 1] * (1.0 - lat / 15.0 + i) + coef[i] * (lat / 15.0 - i); } @@ -3923,7 +4521,10 @@ double nmf(gtime_t time, const double pos[], const double azel[], if (el <= 0.0) { - if (mapfw) *mapfw = 0.0; + if (mapfw) + { + *mapfw = 0.0; + } return 0.0; } /* year from doy 28, added half a year for southern latitudes */ @@ -3940,7 +4541,10 @@ double nmf(gtime_t time, const double pos[], const double azel[], /* ellipsoidal height is used instead of height above sea level */ dm = (1.0 / sin(el) - mapf(el, aht[0], aht[1], aht[2])) * hgt / 1e3; - if (mapfw) *mapfw = mapf(el, aw[0], aw[1], aw[2]); + if (mapfw) + { + *mapfw = mapf(el, aw[0], aw[1], aw[2]); + } return mapf(el, ah[0], ah[1], ah[2]) + dm; } @@ -3971,7 +4575,10 @@ double tropmapf(gtime_t time, const double pos[], const double azel[], if (pos[2] < -1000.0 || pos[2] > 20000.0) { - if (mapfw) *mapfw = 0.0; + if (mapfw) + { + *mapfw = 0.0; + } return 0.0; } #ifdef IERS_MODEL @@ -3998,9 +4605,13 @@ double interpvar(double ang, const double *var) double a = ang / 5.0; /* ang=0-90 */ int i = static_cast(a); if (i < 0) - return var[0]; + { + return var[0]; + } if (i >= 18) - return var[18]; + { + return var[18]; + } return var[i] * (1.0 - a + i) + var[i + 1] * (a - i); } @@ -4028,7 +4639,10 @@ void antmodel(const pcv_t *pcv, const double *del, const double *azel, for (i = 0; i < NFREQ; i++) { - for (j = 0; j < 3; j++) off[j] = pcv->off[i][j] + del[j]; + for (j = 0; j < 3; j++) + { + off[j] = pcv->off[i][j] + del[j]; + } dant[i] = -dot(off, e, 3) + (opt ? interpvar(90.0 - azel[1] * R2D, pcv->var[i]) : 0.0); } @@ -4138,9 +4752,18 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun, eci2ecef(tutc, erpv, U, &gmst_); /* sun and moon position in ecef */ - if (rsun) matmul("NN", 3, 1, 3, 1.0, U, rs, 0.0, rsun); - if (rmoon) matmul("NN", 3, 1, 3, 1.0, U, rm, 0.0, rmoon); - if (gmst) *gmst = gmst_; + if (rsun) + { + matmul("NN", 3, 1, 3, 1.0, U, rs, 0.0, rsun); + } + if (rmoon) + { + matmul("NN", 3, 1, 3, 1.0, U, rm, 0.0, rmoon); + } + if (gmst) + { + *gmst = gmst_; + } } @@ -4165,20 +4788,35 @@ void csmooth(obs_t *obs, int ns) r = p->rcv; for (j = 0; j < NFREQ; j++) { - if (s <= 0 || MAXSAT < s || r <= 0 || 2 < r) continue; - if (p->P[j] == 0.0 || p->L[j] == 0.0) continue; - if (p->LLI[j]) n[r - 1][s - 1][j] = 0; + if (s <= 0 || MAXSAT < s || r <= 0 || 2 < r) + { + continue; + } + if (p->P[j] == 0.0 || p->L[j] == 0.0) + { + continue; + } + if (p->LLI[j]) + { + n[r - 1][s - 1][j] = 0; + } if (n[r - 1][s - 1][j] == 0) - Ps[r - 1][s - 1][j] = p->P[j]; + { + Ps[r - 1][s - 1][j] = p->P[j]; + } else { - dcp = lam_carr[j] * (p->L[j] - Lp[r - 1][s - 1][j]); + dcp = LAM_CARR[j] * (p->L[j] - Lp[r - 1][s - 1][j]); Ps[r - 1][s - 1][j] = p->P[j] / ns + (Ps[r - 1][s - 1][j] + dcp) * (ns - 1) / ns; } if (++n[r - 1][s - 1][j] < ns) - p->P[j] = 0.0; + { + p->P[j] = 0.0; + } else - p->P[j] = Ps[r - 1][s - 1][j]; + { + p->P[j] = Ps[r - 1][s - 1][j]; + } Lp[r - 1][s - 1][j] = p->L[j]; } } @@ -4201,10 +4839,17 @@ int rtk_uncompress(const char *file, char *uncfile) trace(3, "rtk_uncompress: file=%s\n", file); if (strlen(file) < 1025) - strcpy(tmpfile, file); + { + strcpy(tmpfile, file); + } else - trace(1, "file array is too long"); - if (!(p = strrchr(tmpfile, '.'))) return 0; + { + trace(1, "file array is too long"); + } + if (!(p = strrchr(tmpfile, '.'))) + { + return 0; + } /* uncompress by gzip */ if (!strcmp(p, ".z") || !strcmp(p, ".Z") || @@ -4217,10 +4862,16 @@ int rtk_uncompress(const char *file, char *uncfile) if (execcmd(cmd)) { - if (remove(uncfile) != 0) trace(1, "Error removing file"); + if (remove(uncfile) != 0) + { + trace(1, "Error removing file"); + } return -1; } - if (strlen(uncfile) < 1025) strcpy(tmpfile, uncfile); + if (strlen(uncfile) < 1025) + { + strcpy(tmpfile, uncfile); + } stat = 1; } /* extract tar file */ @@ -4245,16 +4896,31 @@ int rtk_uncompress(const char *file, char *uncfile) std::string s_aux = temp.str(); int n = s_aux.length(); if (n < 2048) - for (int i = 0; i < n; i++) cmd[i] = s_aux[i]; + { + for (int i = 0; i < n; i++) + { + cmd[i] = s_aux[i]; + } + } if (execcmd(cmd)) { if (stat) - if (remove(tmpfile) != 0) trace(1, "Error removing file"); + { + if (remove(tmpfile) != 0) + { + trace(1, "Error removing file"); + } + } return -1; } if (stat) - if (remove(tmpfile) != 0) trace(1, "Error removing file"); + { + if (remove(tmpfile) != 0) + { + trace(1, "Error removing file"); + } + } stat = 1; } /* extract hatanaka-compressed file by cnx2rnx */ @@ -4266,13 +4932,26 @@ int rtk_uncompress(const char *file, char *uncfile) if (execcmd(cmd)) { - if (remove(uncfile) != 0) trace(1, "Error removing file"); + if (remove(uncfile) != 0) + { + trace(1, "Error removing file"); + } if (stat) - if (remove(tmpfile) != 0) trace(1, "Error removing file"); + { + if (remove(tmpfile) != 0) + { + trace(1, "Error removing file"); + } + } return -1; } if (stat) - if (remove(tmpfile) != 0) trace(1, "Error removing file"); + { + if (remove(tmpfile) != 0) + { + trace(1, "Error removing file"); + } + } stat = 1; } trace(3, "rtk_uncompress: stat=%d\n", stat); @@ -4303,23 +4982,42 @@ int expath(const char *path, char *paths[], int nmax) //if ((p=strrchr(path,'/')) || (p=strrchr(path,'\\'))) { // file=p+1; strncpy(dir,path,p-path+1); dir[p-path+1]='\0'; //} - if (!(dp = opendir(*dir ? dir : "."))) return 0; + if (!(dp = opendir(*dir ? dir : "."))) + { + return 0; + } while ((d = readdir(dp))) { - if (*(d->d_name) == '.') continue; + if (*(d->d_name) == '.') + { + continue; + } sprintf(s1, "^%s$", d->d_name); sprintf(s2, "^%s$", file); - for (p = s1; *p; p++) *p = static_cast(tolower(static_cast(*p))); - for (p = s2; *p; p++) *p = static_cast(tolower(static_cast(*p))); + for (p = s1; *p; p++) + { + *p = static_cast(tolower(static_cast(*p))); + } + for (p = s2; *p; p++) + { + *p = static_cast(tolower(static_cast(*p))); + } for (p = s1, q = strtok_r(s2, "*", &r); q; q = strtok_r(nullptr, "*", &r)) { if ((p = strstr(p, q))) - p += strlen(q); + { + p += strlen(q); + } else - break; + { + break; + } + } + if (p && n < nmax) + { + sprintf(paths[n++], "%s%s", dir, d->d_name); } - if (p && n < nmax) sprintf(paths[n++], "%s%s", dir, d->d_name); } closedir(dp); /* sort paths in alphabetical order */ @@ -4330,7 +5028,9 @@ int expath(const char *path, char *paths[], int nmax) if (strcmp(paths[i], paths[j]) > 0) { if (strlen(paths[i]) < 1025) - strcpy(tmp, paths[i]); + { + strcpy(tmp, paths[i]); + } else { trace(1, "Path is too long"); @@ -4340,7 +5040,10 @@ int expath(const char *path, char *paths[], int nmax) } } } - for (i = 0; i < n; i++) trace(3, "expath : file=%s\n", paths[i]); + for (i = 0; i < n; i++) + { + trace(3, "expath : file=%s\n", paths[i]); + } return n; } @@ -4358,16 +5061,37 @@ void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw) sunmoonpos(gpst2utc(time), erpv, rsun, nullptr, nullptr); /* unit vector satellite to receiver */ - for (i = 0; i < 3; i++) r[i] = rr[i] - rs[i]; - if (!normv3(r, ek)) return; + for (i = 0; i < 3; i++) + { + r[i] = rr[i] - rs[i]; + } + if (!normv3(r, ek)) + { + return; + } /* unit vectors of satellite antenna */ - for (i = 0; i < 3; i++) r[i] = -rs[i]; - if (!normv3(r, ezs)) return; - for (i = 0; i < 3; i++) r[i] = rsun[i] - rs[i]; - if (!normv3(r, ess)) return; + for (i = 0; i < 3; i++) + { + r[i] = -rs[i]; + } + if (!normv3(r, ezs)) + { + return; + } + for (i = 0; i < 3; i++) + { + r[i] = rsun[i] - rs[i]; + } + if (!normv3(r, ess)) + { + return; + } cross3(ezs, ess, r); - if (!normv3(r, eys)) return; + if (!normv3(r, eys)) + { + return; + } cross3(eys, ezs, exs); /* unit vectors of receiver antenna */ @@ -4390,12 +5114,19 @@ void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw) } cosp = dot(ds, dr, 3) / norm_rtk(ds, 3) / norm_rtk(dr, 3); if (cosp < -1.0) - cosp = -1.0; + { + cosp = -1.0; + } else if (cosp > 1.0) - cosp = 1.0; + { + cosp = 1.0; + } ph = acos(cosp) / 2.0 / PI; cross3(ds, dr, drs); - if (dot(ek, drs, 3) < 0.0) ph = -ph; + if (dot(ek, drs, 3) < 0.0) + { + ph = -ph; + } *phw = ph + floor(*phw - ph + 0.5); /* in cycle */ } diff --git a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h index f58e95193..8fbde5a88 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkcmn.h +++ b/src/algorithms/libs/rtklib/rtklib_rtkcmn.h @@ -79,7 +79,7 @@ #define GNSS_SDR_RTKLIB_RTKCMN_H_ #include "rtklib.h" -#include +//#include /* coordinate rotation matrix ------------------------------------------------*/ #define Rx(t, X) \ diff --git a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc index 1634b8fcb..e59327680 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtkpos.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtkpos.cc @@ -57,6 +57,8 @@ #include "rtklib_pntpos.h" #include "rtklib_ppp.h" #include "rtklib_tides.h" +#include +#include static int resamb_WLNL(rtk_t *rtk __attribute((unused)), const obsd_t *obs __attribute((unused)), const int *sat __attribute((unused)), const int *iu __attribute((unused)), const int *ir __attribute((unused)), int ns __attribute__((unused)), const nav_t *nav __attribute((unused)), @@ -147,7 +149,10 @@ int rtkopenstat(const char *file, int level) trace(3, "rtkopenstat: file=%s level=%d\n", file, level); - if (level <= 0) return 0; + if (level <= 0) + { + return 0; + } reppath(file, path, time, "", ""); @@ -157,9 +162,13 @@ int rtkopenstat(const char *file, int level) return 0; } if (strlen(file) < 1025) - strcpy(file_stat, file); + { + strcpy(file_stat, file); + } else - trace(1, "File name is too long"); + { + trace(1, "File name is too long"); + } time_stat = time; statlevel = level; return 1; @@ -175,7 +184,10 @@ void rtkclosestat(void) { trace(3, "rtkclosestat:\n"); - if (fp_stat) fclose(fp_stat); + if (fp_stat) + { + fclose(fp_stat); + } fp_stat = nullptr; file_stat[0] = '\0'; statlevel = 0; @@ -190,7 +202,10 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt); char id[32]; - if (statlevel <= 0 || !fp_stat) return; + if (statlevel <= 0 || !fp_stat) + { + return; + } trace(3, "outsolstat:\n"); @@ -204,7 +219,10 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) /* receiver position */ if (est) { - for (i = 0; i < 3; i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + for (i = 0; i < 3; i++) + { + xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + } fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); } @@ -220,8 +238,14 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) ecef2pos(rtk->sol.rr, pos); ecef2enu(pos, rtk->x + 3, vel); ecef2enu(pos, rtk->x + 6, acc); - if (rtk->na >= 6) ecef2enu(pos, rtk->xa + 3, vela); - if (rtk->na >= 9) ecef2enu(pos, rtk->xa + 6, acca); + if (rtk->na >= 6) + { + ecef2enu(pos, rtk->xa + 3, vela); + } + if (rtk->na >= 9) + { + ecef2enu(pos, rtk->xa + 6, acca); + } fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); @@ -245,7 +269,10 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) for (i = 0; i < MAXSAT; i++) { ssat = rtk->ssat + i; - if (!ssat->vs) continue; + if (!ssat->vs) + { + continue; + } satno2id(i + 1, id); j = II_RTK(i + 1, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; @@ -275,13 +302,19 @@ void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused))) i + 1, rtk->x[j], xa[0]); } } - if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) return; + if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) + { + return; + } /* residuals and status */ for (i = 0; i < MAXSAT; i++) { ssat = rtk->ssat + i; - if (!ssat->vs) continue; + if (!ssat->vs) + { + continue; + } satno2id(i + 1, id); for (j = 0; j < nfreq; j++) { @@ -312,7 +345,10 @@ void swapsolstat(void) { return; } - if (fp_stat) fclose(fp_stat); + if (fp_stat) + { + fclose(fp_stat); + } if (!(fp_stat = fopen(path, "we"))) { @@ -331,7 +367,10 @@ void outsolstat(rtk_t *rtk) int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt); char id[32]; - if (statlevel <= 0 || !fp_stat) return; + if (statlevel <= 0 || !fp_stat) + { + return; + } trace(3, "outsolstat:\n"); @@ -345,7 +384,10 @@ void outsolstat(rtk_t *rtk) /* receiver position */ if (est) { - for (i = 0; i < 3; i++) xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + for (i = 0; i < 3; i++) + { + xa[i] = i < rtk->na ? rtk->xa[i] : 0.0; + } fprintf(fp_stat, "$POS,%d,%.3f,%d,%.4f,%.4f,%.4f,%.4f,%.4f,%.4f\n", week, tow, rtk->sol.stat, rtk->x[0], rtk->x[1], rtk->x[2], xa[0], xa[1], xa[2]); } @@ -361,8 +403,14 @@ void outsolstat(rtk_t *rtk) ecef2pos(rtk->sol.rr, pos); ecef2enu(pos, rtk->x + 3, vel); ecef2enu(pos, rtk->x + 6, acc); - if (rtk->na >= 6) ecef2enu(pos, rtk->xa + 3, vela); - if (rtk->na >= 9) ecef2enu(pos, rtk->xa + 6, acca); + if (rtk->na >= 6) + { + ecef2enu(pos, rtk->xa + 3, vela); + } + if (rtk->na >= 9) + { + ecef2enu(pos, rtk->xa + 6, acca); + } fprintf(fp_stat, "$VELACC,%d,%.3f,%d,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f,%.4f,%.4f,%.4f,%.5f,%.5f,%.5f\n", week, tow, rtk->sol.stat, vel[0], vel[1], vel[2], acc[0], acc[1], acc[2], vela[0], vela[1], vela[2], acca[0], acca[1], acca[2]); @@ -386,7 +434,10 @@ void outsolstat(rtk_t *rtk) for (i = 0; i < MAXSAT; i++) { ssat = rtk->ssat + i; - if (!ssat->vs) continue; + if (!ssat->vs) + { + continue; + } satno2id(i + 1, id); j = II_RTK(i + 1, &rtk->opt); xa[0] = j < rtk->na ? rtk->xa[j] : 0.0; @@ -416,13 +467,19 @@ void outsolstat(rtk_t *rtk) i + 1, rtk->x[j], xa[0]); } } - if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) return; + if (rtk->sol.stat == SOLQ_NONE || statlevel <= 1) + { + return; + } /* residuals and status */ for (i = 0; i < MAXSAT; i++) { ssat = rtk->ssat + i; - if (!ssat->vs) continue; + if (!ssat->vs) + { + continue; + } satno2id(i + 1, id); for (j = 0; j < nfreq; j++) { @@ -509,8 +566,14 @@ double varerr(int sat __attribute((unused)), int sys, double el, double bl, doub } else { /* normal error model */ - if (f >= nf) fact = opt->eratio[f - nf]; - if (fact <= 0.0) fact = opt->eratio[0]; + if (f >= nf) + { + fact = opt->eratio[f - nf]; + } + if (fact <= 0.0) + { + fact = opt->eratio[0]; + } fact *= sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS); a = fact * opt->err[1]; b = fact * opt->err[2]; @@ -523,7 +586,10 @@ double varerr(int sat __attribute((unused)), int sys, double el, double bl, doub double baseline(const double *ru, const double *rb, double *dr) { int i; - for (i = 0; i < 3; i++) dr[i] = ru[i] - rb[i]; + for (i = 0; i < 3; i++) + { + dr[i] = ru[i] - rb[i]; + } return norm_rtk(dr, 3); } @@ -551,9 +617,13 @@ int selsat(const obsd_t *obs, const double *azel, int nu, int nr, for (i = 0, j = nu; i < nu && j < nu + nr; i++, j++) { if (obs[i].sat < obs[j].sat) - j--; + { + j--; + } else if (obs[i].sat > obs[j].sat) - i--; + { + i--; + } else if (azel[1 + j * 2] >= opt->elmin) { /* elevation at base station */ sat[k] = obs[i].sat; @@ -577,26 +647,44 @@ void udpos(rtk_t *rtk, double tt) /* fixed mode */ if (rtk->opt.mode == PMODE_FIXED) { - for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->opt.ru[i], 1E-8, i); + for (i = 0; i < 3; i++) + { + initx_rtk(rtk, rtk->opt.ru[i], 1E-8, i); + } return; } /* initialize position for first epoch */ if (norm_rtk(rtk->x, 3) <= 0.0) { - for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + for (i = 0; i < 3; i++) + { + initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + } if (rtk->opt.dynamics) { - for (i = 3; i < 6; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); - for (i = 6; i < 9; i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); + for (i = 3; i < 6; i++) + { + initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); + } + for (i = 6; i < 9; i++) + { + initx_rtk(rtk, 1E-6, VAR_ACC, i); + } } } /* static mode */ - if (rtk->opt.mode == PMODE_STATIC) return; + if (rtk->opt.mode == PMODE_STATIC) + { + return; + } /* kinmatic mode without dynamics */ if (!rtk->opt.dynamics) { - for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + for (i = 0; i < 3; i++) + { + initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + } return; } /* check variance of estimated position */ @@ -609,9 +697,18 @@ void udpos(rtk_t *rtk, double tt) if (var > VAR_POS) { /* reset position with large variance */ - for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); - for (i = 3; i < 6; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); - for (i = 6; i < 9; i++) initx_rtk(rtk, 1E-6, VAR_ACC, i); + for (i = 0; i < 3; i++) + { + initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i); + } + for (i = 3; i < 6; i++) + { + initx_rtk(rtk, rtk->sol.rr[i], VAR_VEL, i); + } + for (i = 6; i < 9; i++) + { + initx_rtk(rtk, 1E-6, VAR_ACC, i); + } trace(2, "reset rtk position due to large variance: var=%.3f\n", var); return; } @@ -636,10 +733,12 @@ void udpos(rtk_t *rtk, double tt) ecef2pos(rtk->x, pos); covecef(pos, Q, Qv); for (i = 0; i < 3; i++) - for (j = 0; j < 3; j++) - { - rtk->P[i + 6 + (j + 6) * rtk->nx] += Qv[i + j * 3]; - } + { + for (j = 0; j < 3; j++) + { + rtk->P[i + 6 + (j + 6) * rtk->nx] += Qv[i + j * 3]; + } + } free(F); free(FP); free(xp); @@ -659,7 +758,9 @@ void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns) j = II_RTK(i, &rtk->opt); if (rtk->x[j] != 0.0 && rtk->ssat[i - 1].outc[0] > GAP_RESION && rtk->ssat[i - 1].outc[1] > GAP_RESION) - rtk->x[j] = 0.0; + { + rtk->x[j] = 0.0; + } } for (i = 0; i < ns; i++) { @@ -697,7 +798,10 @@ void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused))) if (rtk->opt.tropopt >= TROPOPT_ESTG) { - for (k = 0; k < 2; k++) initx_rtk(rtk, 1e-6, VAR_GRA, ++j); + for (k = 0; k < 2; k++) + { + initx_rtk(rtk, 1e-6, VAR_GRA, ++j); + } } } else @@ -754,13 +858,20 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv) for (f = 0; f < rtk->opt.nf; f++) { - if (obs[i].L[f] == 0.0) continue; + if (obs[i].L[f] == 0.0) + { + continue; + } /* restore previous LLI */ if (rcv == 1) - LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 0, 2); /* rover */ + { + LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 0, 2); /* rover */ + } else - LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 2, 2); /* base */ + { + LLI = getbitu(&rtk->ssat[sat - 1].slip[f], 2, 2); /* base */ + } /* detect slip by cycle slip flag in LLI */ if (rtk->tt >= 0.0) @@ -790,9 +901,13 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv) } /* save current LLI */ if (rcv == 1) - setbitu(&rtk->ssat[sat - 1].slip[f], 0, 2, obs[i].LLI[f]); + { + setbitu(&rtk->ssat[sat - 1].slip[f], 0, 2, obs[i].LLI[f]); + } else - setbitu(&rtk->ssat[sat - 1].slip[f], 2, 2, obs[i].LLI[f]); + { + setbitu(&rtk->ssat[sat - 1].slip[f], 2, 2, obs[i].LLI[f]); + } /* save slip and half-cycle valid flag */ rtk->ssat[sat - 1].slip[f] |= static_cast(slip); @@ -810,7 +925,10 @@ void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j, trace(3, "detslp_gf_L1L2: i=%d j=%d\n", i, j); - if (rtk->opt.nf <= 1 || (g1 = gfobs_L1L2(obs, i, j, nav->lam[sat - 1])) == 0.0) return; + if (rtk->opt.nf <= 1 || (g1 = gfobs_L1L2(obs, i, j, nav->lam[sat - 1])) == 0.0) + { + return; + } g0 = rtk->ssat[sat - 1].gf; rtk->ssat[sat - 1].gf = g1; @@ -834,7 +952,10 @@ void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j, trace(3, "detslp_gf_L1L5: i=%d j=%d\n", i, j); - if (rtk->opt.nf <= 2 || (g1 = gfobs_L1L5(obs, i, j, nav->lam[sat - 1])) == 0.0) return; + if (rtk->opt.nf <= 2 || (g1 = gfobs_L1L5(obs, i, j, nav->lam[sat - 1])) == 0.0) + { + return; + } g0 = rtk->ssat[sat - 1].gf2; rtk->ssat[sat - 1].gf2 = g1; @@ -899,7 +1020,10 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, for (i = 0; i < ns; i++) { /* detect cycle slip by LLI */ - for (f = 0; f < rtk->opt.nf; f++) rtk->ssat[sat[i] - 1].slip[f] &= 0xFC; + for (f = 0; f < rtk->opt.nf; f++) + { + rtk->ssat[sat[i] - 1].slip[f] &= 0xFC; + } detslp_ll(rtk, obs, iu[i], 1); detslp_ll(rtk, obs, ir[i], 2); @@ -946,8 +1070,14 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, j = IB_RTK(sat[i], f, &rtk->opt); rtk->P[j + j * rtk->nx] += rtk->opt.prn[0] * rtk->opt.prn[0] * tt; slip = rtk->ssat[sat[i] - 1].slip[f]; - if (rtk->opt.ionoopt == IONOOPT_IFLC) slip |= rtk->ssat[sat[i] - 1].slip[1]; - if (rtk->opt.modear == ARMODE_INST || !(slip & 1)) continue; + if (rtk->opt.ionoopt == IONOOPT_IFLC) + { + slip |= rtk->ssat[sat[i] - 1].slip[1]; + } + if (rtk->opt.modear == ARMODE_INST || !(slip & 1)) + { + continue; + } rtk->x[j] = 0.0; rtk->ssat[sat[i] - 1].lock[f] = -rtk->opt.minlock; } @@ -961,7 +1091,10 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, cp = sdobs(obs, iu[i], ir[i], f); /* cycle */ pr = sdobs(obs, iu[i], ir[i], f + NFREQ); lami = nav->lam[sat[i] - 1][f]; - if (cp == 0.0 || pr == 0.0 || lami <= 0.0) continue; + if (cp == 0.0 || pr == 0.0 || lami <= 0.0) + { + continue; + } bias[i] = cp - pr / lami; } @@ -973,7 +1106,10 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, pr2 = sdobs(obs, iu[i], ir[i], NFREQ + 1); lam1 = nav->lam[sat[i] - 1][0]; lam2 = nav->lam[sat[i] - 1][1]; - if (cp1 == 0.0 || cp2 == 0.0 || pr1 == 0.0 || pr2 == 0.0 || lam1 <= 0.0 || lam2 <= 0.0) continue; + if (cp1 == 0.0 || cp2 == 0.0 || pr1 == 0.0 || pr2 == 0.0 || lam1 <= 0.0 || lam2 <= 0.0) + { + continue; + } C1 = std::pow(lam2, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); C2 = -std::pow(lam1, 2.0) / (std::pow(lam2, 2.0) - std::pow(lam1, 2.0)); @@ -990,13 +1126,19 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat, { for (i = 1; i <= MAXSAT; i++) { - if (rtk->x[IB_RTK(i, f, &rtk->opt)] != 0.0) rtk->x[IB_RTK(i, f, &rtk->opt)] += offset / j; + if (rtk->x[IB_RTK(i, f, &rtk->opt)] != 0.0) + { + rtk->x[IB_RTK(i, f, &rtk->opt)] += offset / j; + } } } /* set initial states of phase-bias */ for (i = 0; i < ns; i++) { - if (bias[i] == 0.0 || rtk->x[IB_RTK(sat[i], f, &rtk->opt)] != 0.0) continue; + if (bias[i] == 0.0 || rtk->x[IB_RTK(sat[i], f, &rtk->opt)] != 0.0) + { + continue; + } initx_rtk(rtk, bias[i], std::pow(rtk->opt.std[0], 2.0), IB_RTK(sat[i], f, &rtk->opt)); } free(bias); @@ -1050,10 +1192,16 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, if (opt->ionoopt == IONOOPT_IFLC) { /* iono-free linear combination */ - if (lam[0] == 0.0 || lam[1] == 0.0) return; + if (lam[0] == 0.0 || lam[1] == 0.0) + { + return; + } if (testsnr(base, 0, azel[1], obs->SNR[0] * 0.25, &opt->snrmask) || - testsnr(base, 1, azel[1], obs->SNR[1] * 0.25, &opt->snrmask)) return; + testsnr(base, 1, azel[1], obs->SNR[1] * 0.25, &opt->snrmask)) + { + return; + } f1 = SPEED_OF_LIGHT / lam[0]; f2 = SPEED_OF_LIGHT / lam[1]; @@ -1074,7 +1222,10 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, { for (i = 0; i < nf; i++) { - if (lam[i] == 0.0) continue; + if (lam[i] == 0.0) + { + continue; + } /* check snr mask */ if (testsnr(base, i, azel[1], obs->SNR[i] * 0.25, &opt->snrmask)) @@ -1082,8 +1233,14 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav, continue; } /* residuals = observable - pseudorange */ - if (obs->L[i] != 0.0) y[i] = obs->L[i] * lam[i] - r - dant[i]; - if (obs->P[i] != 0.0) y[i + nf] = obs->P[i] - r - dant[i]; + if (obs->L[i] != 0.0) + { + y[i] = obs->L[i] * lam[i] - r - dant[i]; + } + if (obs->P[i] != 0.0) + { + y[i + nf] = obs->P[i] - r - dant[i]; + } } } } @@ -1101,29 +1258,50 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs, trace(3, "zdres : n=%d\n", n); - for (i = 0; i < n * nf * 2; i++) y[i] = 0.0; + for (i = 0; i < n * nf * 2; i++) + { + y[i] = 0.0; + } - if (norm_rtk(rr, 3) <= 0.0) return 0; /* no receiver position */ + if (norm_rtk(rr, 3) <= 0.0) + { + return 0; /* no receiver position */ + } - for (i = 0; i < 3; i++) rr_[i] = rr[i]; + for (i = 0; i < 3; i++) + { + rr_[i] = rr[i]; + } /* earth tide correction */ if (opt->tidecorr) { tidedisp(gpst2utc(obs[0].time), rr_, opt->tidecorr, &nav->erp, opt->odisp[base], disp); - for (i = 0; i < 3; i++) rr_[i] += disp[i]; + for (i = 0; i < 3; i++) + { + rr_[i] += disp[i]; + } } ecef2pos(rr_, pos); for (i = 0; i < n; i++) { /* compute geometric-range and azimuth/elevation angle */ - if ((r = geodist(rs + i * 6, rr_, e + i * 3)) <= 0.0) continue; - if (satazel(pos, e + i * 3, azel + i * 2) < opt->elmin) continue; + if ((r = geodist(rs + i * 6, rr_, e + i * 3)) <= 0.0) + { + continue; + } + if (satazel(pos, e + i * 3, azel + i * 2) < opt->elmin) + { + continue; + } /* excluded satellite? */ - if (satexclude(obs[i].sat, svh[i], opt)) continue; + if (satexclude(obs[i].sat, svh[i], opt)) + { + continue; + } /* satellite clock-bias */ r += -SPEED_OF_LIGHT * dts[i * 2]; @@ -1171,14 +1349,19 @@ void ddcov(const int *nb, int n, const double *Ri, const double *Rj, trace(3, "ddcov : n=%d\n", n); - for (i = 0; i < nv * nv; i++) R[i] = 0.0; + for (i = 0; i < nv * nv; i++) + { + R[i] = 0.0; + } for (b = 0; b < n; k += nb[b++]) { for (i = 0; i < nb[b]; i++) - for (j = 0; j < nb[b]; j++) - { - R[k + i + (k + j) * nv] = Ri[k + i] + (i == j ? Rj[k + i] : 0.0); - } + { + for (j = 0; j < nb[b]; j++) + { + R[k + i + (k + j) * nv] = Ri[k + i] + (i == j ? Rj[k + i] : 0.0); + } + } } trace(5, "R=\n"); tracemat(5, R, nv, nv, 8, 6); @@ -1196,7 +1379,10 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v, trace(3, "constbl : \n"); /* no constraint */ - if (rtk->opt.baseline[0] <= 0.0) return 0; + if (rtk->opt.baseline[0] <= 0.0) + { + return 0; + } /* time-adjusted baseline vector and length */ for (i = 0; i < 3; i++) @@ -1225,7 +1411,10 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v, v[index] = rtk->opt.baseline[0] - bb; if (H) { - for (i = 0; i < 3; i++) H[i + index * rtk->nx] = b[i] / bb; + for (i = 0; i < 3; i++) + { + H[i + index * rtk->nx] = b[i] / bb; + } } Ri[index] = 0.0; Rj[index] = std::pow(rtk->opt.baseline[1], 2.0); @@ -1258,7 +1447,9 @@ double prectrop(gtime_t time, const double *pos, int r, dtdx[2] = grad_e * x[i]; } else - dtdx[1] = dtdx[2] = 0.0; + { + dtdx[1] = dtdx[2] = 0.0; + } dtdx[0] = m_w; return m_w * x[i]; } @@ -1270,7 +1461,10 @@ double gloicbcorr(int sat1 __attribute((unused)), int sat2 __attribute((unused)) { double dfreq; - if (f >= NFREQGLO || f >= opt->nf || !opt->exterr.ena[2]) return 0.0; + if (f >= NFREQGLO || f >= opt->nf || !opt->exterr.ena[2]) + { + return 0.0; + } dfreq = (SPEED_OF_LIGHT / lam1 - SPEED_OF_LIGHT / lam2) / (f == 0 ? DFRQ1_GLO : DFRQ2_GLO); @@ -1326,10 +1520,12 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, dtdxr = mat(ns, 3); for (i = 0; i < MAXSAT; i++) - for (j = 0; j < NFREQ; j++) - { - rtk->ssat[i].resp[j] = rtk->ssat[i].resc[j] = 0.0; - } + { + for (j = 0; j < NFREQ; j++) + { + rtk->ssat[i].resp[j] = rtk->ssat[i].resc[j] = 0.0; + } + } /* compute factors of ionospheric and tropospheric delay */ for (i = 0; i < ns; i++) { @@ -1343,145 +1539,186 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x, tropr[i] = prectrop(rtk->sol.time, posr, 1, azel + ir[i] * 2, opt, x, dtdxr + i * 3); } } - for (m = 0; m < 4; m++) /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ + for (m = 0; m < 4; m++) + { /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ - for (f = opt->mode > PMODE_DGPS ? 0 : nf; f < nf * 2; f++) - { - /* search reference satellite with highest elevation */ - for (i = -1, j = 0; j < ns; j++) - { - sysi = rtk->ssat[sat[j] - 1].sys; - if (!test_sys(sysi, m)) continue; - if (!validobs(iu[j], ir[j], f, nf, y)) continue; - if (i < 0 || azel[1 + iu[j] * 2] >= azel[1 + iu[i] * 2]) i = j; - } - if (i < 0) continue; + for (f = opt->mode > PMODE_DGPS ? 0 : nf; f < nf * 2; f++) + { + /* search reference satellite with highest elevation */ + for (i = -1, j = 0; j < ns; j++) + { + sysi = rtk->ssat[sat[j] - 1].sys; + if (!test_sys(sysi, m)) + { + continue; + } + if (!validobs(iu[j], ir[j], f, nf, y)) + { + continue; + } + if (i < 0 || azel[1 + iu[j] * 2] >= azel[1 + iu[i] * 2]) + { + i = j; + } + } + if (i < 0) + { + continue; + } - /* make double difference */ - for (j = 0; j < ns; j++) - { - if (i == j) continue; - sysi = rtk->ssat[sat[i] - 1].sys; - sysj = rtk->ssat[sat[j] - 1].sys; - if (!test_sys(sysj, m)) continue; - if (!validobs(iu[j], ir[j], f, nf, y)) continue; + /* make double difference */ + for (j = 0; j < ns; j++) + { + if (i == j) + { + continue; + } + sysi = rtk->ssat[sat[i] - 1].sys; + sysj = rtk->ssat[sat[j] - 1].sys; + if (!test_sys(sysj, m)) + { + continue; + } + if (!validobs(iu[j], ir[j], f, nf, y)) + { + continue; + } - ff = f % nf; - lami = nav->lam[sat[i] - 1][ff]; - lamj = nav->lam[sat[j] - 1][ff]; - if (lami <= 0.0 || lamj <= 0.0) continue; - if (H) - { - Hi = H + nv * rtk->nx; - for (k = 0; k < rtk->nx; k++) Hi[k] = 0.0; - } - /* double-differenced residual */ - v[nv] = (y[f + iu[i] * nf * 2] - y[f + ir[i] * nf * 2]) - - (y[f + iu[j] * nf * 2] - y[f + ir[j] * nf * 2]); + ff = f % nf; + lami = nav->lam[sat[i] - 1][ff]; + lamj = nav->lam[sat[j] - 1][ff]; + if (lami <= 0.0 || lamj <= 0.0) + { + continue; + } + if (H) + { + Hi = H + nv * rtk->nx; + for (k = 0; k < rtk->nx; k++) + { + Hi[k] = 0.0; + } + } + /* double-differenced residual */ + v[nv] = (y[f + iu[i] * nf * 2] - y[f + ir[i] * nf * 2]) - + (y[f + iu[j] * nf * 2] - y[f + ir[j] * nf * 2]); - /* partial derivatives by rover position */ - if (H) - { - for (k = 0; k < 3; k++) - { - Hi[k] = -e[k + iu[i] * 3] + e[k + iu[j] * 3]; - } - } - /* double-differenced ionospheric delay term */ - if (opt->ionoopt == IONOOPT_EST) - { - fi = lami / lam_carr[0]; - fj = lamj / lam_carr[0]; - didxi = (f < nf ? -1.0 : 1.0) * fi * fi * im[i]; - didxj = (f < nf ? -1.0 : 1.0) * fj * fj * im[j]; - v[nv] -= didxi * x[II_RTK(sat[i], opt)] - didxj * x[II_RTK(sat[j], opt)]; - if (H) - { - Hi[II_RTK(sat[i], opt)] = didxi; - Hi[II_RTK(sat[j], opt)] = -didxj; - } - } - /* double-differenced tropospheric delay term */ - if (opt->tropopt == TROPOPT_EST || opt->tropopt == TROPOPT_ESTG) - { - v[nv] -= (tropu[i] - tropu[j]) - (tropr[i] - tropr[j]); - for (k = 0; k < (opt->tropopt < TROPOPT_ESTG ? 1 : 3); k++) - { - if (!H) continue; - Hi[IT_RTK(0, opt) + k] = (dtdxu[k + i * 3] - dtdxu[k + j * 3]); - Hi[IT_RTK(1, opt) + k] = -(dtdxr[k + i * 3] - dtdxr[k + j * 3]); - } - } - /* double-differenced phase-bias term */ - if (f < nf) - { - if (opt->ionoopt != IONOOPT_IFLC) - { - v[nv] -= lami * x[IB_RTK(sat[i], f, opt)] - lamj * x[IB_RTK(sat[j], f, opt)]; - if (H) - { - Hi[IB_RTK(sat[i], f, opt)] = lami; - Hi[IB_RTK(sat[j], f, opt)] = -lamj; - } - } - else - { - v[nv] -= x[IB_RTK(sat[i], f, opt)] - x[IB_RTK(sat[j], f, opt)]; - if (H) - { - Hi[IB_RTK(sat[i], f, opt)] = 1.0; - Hi[IB_RTK(sat[j], f, opt)] = -1.0; - } - } - } - /* glonass receiver h/w bias term */ - if (rtk->opt.glomodear == 2 && sysi == SYS_GLO && sysj == SYS_GLO && ff < NFREQGLO) - { - df = (SPEED_OF_LIGHT / lami - SPEED_OF_LIGHT / lamj) / 1E6; /* freq-difference (MHz) */ - v[nv] -= df * x[IL_RTK(ff, opt)]; - if (H) Hi[IL_RTK(ff, opt)] = df; - } - /* glonass interchannel bias correction */ - else if (sysi == SYS_GLO && sysj == SYS_GLO) - { - v[nv] -= gloicbcorr(sat[i], sat[j], &rtk->opt, lami, lamj, f); - } - if (f < nf) - rtk->ssat[sat[j] - 1].resc[f] = v[nv]; - else - rtk->ssat[sat[j] - 1].resp[f - nf] = v[nv]; + /* partial derivatives by rover position */ + if (H) + { + for (k = 0; k < 3; k++) + { + Hi[k] = -e[k + iu[i] * 3] + e[k + iu[j] * 3]; + } + } + /* double-differenced ionospheric delay term */ + if (opt->ionoopt == IONOOPT_EST) + { + fi = lami / LAM_CARR[0]; + fj = lamj / LAM_CARR[0]; + didxi = (f < nf ? -1.0 : 1.0) * fi * fi * im[i]; + didxj = (f < nf ? -1.0 : 1.0) * fj * fj * im[j]; + v[nv] -= didxi * x[II_RTK(sat[i], opt)] - didxj * x[II_RTK(sat[j], opt)]; + if (H) + { + Hi[II_RTK(sat[i], opt)] = didxi; + Hi[II_RTK(sat[j], opt)] = -didxj; + } + } + /* double-differenced tropospheric delay term */ + if (opt->tropopt == TROPOPT_EST || opt->tropopt == TROPOPT_ESTG) + { + v[nv] -= (tropu[i] - tropu[j]) - (tropr[i] - tropr[j]); + for (k = 0; k < (opt->tropopt < TROPOPT_ESTG ? 1 : 3); k++) + { + if (!H) + { + continue; + } + Hi[IT_RTK(0, opt) + k] = (dtdxu[k + i * 3] - dtdxu[k + j * 3]); + Hi[IT_RTK(1, opt) + k] = -(dtdxr[k + i * 3] - dtdxr[k + j * 3]); + } + } + /* double-differenced phase-bias term */ + if (f < nf) + { + if (opt->ionoopt != IONOOPT_IFLC) + { + v[nv] -= lami * x[IB_RTK(sat[i], f, opt)] - lamj * x[IB_RTK(sat[j], f, opt)]; + if (H) + { + Hi[IB_RTK(sat[i], f, opt)] = lami; + Hi[IB_RTK(sat[j], f, opt)] = -lamj; + } + } + else + { + v[nv] -= x[IB_RTK(sat[i], f, opt)] - x[IB_RTK(sat[j], f, opt)]; + if (H) + { + Hi[IB_RTK(sat[i], f, opt)] = 1.0; + Hi[IB_RTK(sat[j], f, opt)] = -1.0; + } + } + } + /* glonass receiver h/w bias term */ + if (rtk->opt.glomodear == 2 && sysi == SYS_GLO && sysj == SYS_GLO && ff < NFREQGLO) + { + df = (SPEED_OF_LIGHT / lami - SPEED_OF_LIGHT / lamj) / 1E6; /* freq-difference (MHz) */ + v[nv] -= df * x[IL_RTK(ff, opt)]; + if (H) + { + Hi[IL_RTK(ff, opt)] = df; + } + } + /* glonass interchannel bias correction */ + else if (sysi == SYS_GLO && sysj == SYS_GLO) + { + v[nv] -= gloicbcorr(sat[i], sat[j], &rtk->opt, lami, lamj, f); + } + if (f < nf) + { + rtk->ssat[sat[j] - 1].resc[f] = v[nv]; + } + else + { + rtk->ssat[sat[j] - 1].resp[f - nf] = v[nv]; + } - /* test innovation */ - if (opt->maxinno > 0.0 && fabs(v[nv]) > opt->maxinno) - { - if (f < nf) - { - rtk->ssat[sat[i] - 1].rejc[f]++; - rtk->ssat[sat[j] - 1].rejc[f]++; - } - errmsg(rtk, "outlier rejected (sat=%3d-%3d %s%d v=%.3f)\n", - sat[i], sat[j], f < nf ? "L" : "P", f % nf + 1, v[nv]); - continue; - } - /* single-differenced measurement error variances */ - Ri[nv] = varerr(sat[i], sysi, azel[1 + iu[i] * 2], bl, dt, f, opt); - Rj[nv] = varerr(sat[j], sysj, azel[1 + iu[j] * 2], bl, dt, f, opt); + /* test innovation */ + if (opt->maxinno > 0.0 && fabs(v[nv]) > opt->maxinno) + { + if (f < nf) + { + rtk->ssat[sat[i] - 1].rejc[f]++; + rtk->ssat[sat[j] - 1].rejc[f]++; + } + errmsg(rtk, "outlier rejected (sat=%3d-%3d %s%d v=%.3f)\n", + sat[i], sat[j], f < nf ? "L" : "P", f % nf + 1, v[nv]); + continue; + } + /* single-differenced measurement error variances */ + Ri[nv] = varerr(sat[i], sysi, azel[1 + iu[i] * 2], bl, dt, f, opt); + Rj[nv] = varerr(sat[j], sysj, azel[1 + iu[j] * 2], bl, dt, f, opt); - /* set valid data flags */ - if (opt->mode > PMODE_DGPS) - { - if (f < nf) rtk->ssat[sat[i] - 1].vsat[f] = rtk->ssat[sat[j] - 1].vsat[f] = 1; - } - else - { - rtk->ssat[sat[i] - 1].vsat[f - nf] = rtk->ssat[sat[j] - 1].vsat[f - nf] = 1; - } - trace(4, "sat=%3d-%3d %s%d v=%13.3f R=%8.6f %8.6f\n", sat[i], - sat[j], f < nf ? "L" : "P", f % nf + 1, v[nv], Ri[nv], Rj[nv]); + /* set valid data flags */ + if (opt->mode > PMODE_DGPS) + { + if (f < nf) + { + rtk->ssat[sat[i] - 1].vsat[f] = rtk->ssat[sat[j] - 1].vsat[f] = 1; + } + } + else + { + rtk->ssat[sat[i] - 1].vsat[f - nf] = rtk->ssat[sat[j] - 1].vsat[f - nf] = 1; + } + trace(4, "sat=%3d-%3d %s%d v=%13.3f R=%8.6f %8.6f\n", sat[i], + sat[j], f < nf ? "L" : "P", f % nf + 1, v[nv], Ri[nv], Rj[nv]); - vflg[nv++] = (sat[i] << 16) | (sat[j] << 8) | ((f < nf ? 0 : 1) << 4) | (f % nf); - nb[b]++; - } + vflg[nv++] = (sat[i] << 16) | (sat[j] << 8) | ((f < nf ? 0 : 1) << 4) | (f % nf); + nb[b]++; + } #if 0 /* residuals referenced to reference satellite (2.4.2 p11) */ /* restore single-differenced residuals assuming sum equal zero */ if (f opt->maxtdiff * 2.0 || ttb == tt) return tt; + if (fabs(ttb) > opt->maxtdiff * 2.0 || ttb == tt) + { + return tt; + } satposs(time, obsb, nb, nav, opt->sateph, rs, dts, var, svh); @@ -1567,14 +1811,26 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav, for (i = 0; i < n; i++) { for (j = 0; j < nb; j++) - if (obsb[j].sat == obs[i].sat) break; - if (j >= nb) continue; + { + if (obsb[j].sat == obs[i].sat) + { + break; + } + } + if (j >= nb) + { + continue; + } for (k = 0, p = y + i * nf * 2, q = yb + j * nf * 2; k < nf * 2; k++, p++, q++) { if (*p == 0.0 || *q == 0.0) - *p = 0.0; + { + *p = 0.0; + } else - *p = (ttb * (*p) - tt * (*q)) / (ttb - tt); + { + *p = (ttb * (*p) - tt * (*q)) / (ttb - tt); + } } } return fabs(ttb) > fabs(tt) ? ttb : tt; @@ -1589,11 +1845,16 @@ int ddmat(rtk_t *rtk, double *D) trace(3, "ddmat :\n"); for (i = 0; i < MAXSAT; i++) - for (j = 0; j < NFREQ; j++) - { - rtk->ssat[i].fix[j] = 0; - } - for (i = 0; i < na; i++) D[i + i * nx] = 1.0; + { + for (j = 0; j < NFREQ; j++) + { + rtk->ssat[i].fix[j] = 0; + } + } + for (i = 0; i < na; i++) + { + D[i + i * nx] = 1.0; + } for (m = 0; m < 4; m++) { /* m=0:gps/qzs/sbs, 1:glo, 2:gal, 3:bds */ @@ -1635,7 +1896,9 @@ int ddmat(rtk_t *rtk, double *D) rtk->ssat[j - k].fix[f] = 2; /* fix */ } else - rtk->ssat[j - k].fix[f] = 1; + { + rtk->ssat[j - k].fix[f] = 1; + } } } } @@ -1653,29 +1916,40 @@ void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), doubl trace(3, "restamb :\n"); - for (i = 0; i < rtk->nx; i++) xa[i] = rtk->x[i]; - for (i = 0; i < rtk->na; i++) xa[i] = rtk->xa[i]; + for (i = 0; i < rtk->nx; i++) + { + xa[i] = rtk->x[i]; + } + for (i = 0; i < rtk->na; i++) + { + xa[i] = rtk->xa[i]; + } for (m = 0; m < 4; m++) - for (f = 0; f < nf; f++) - { - for (n = i = 0; i < MAXSAT; i++) - { - if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2) - { - continue; - } - index[n++] = IB_RTK(i + 1, f, &rtk->opt); - } - if (n < 2) continue; + { + for (f = 0; f < nf; f++) + { + for (n = i = 0; i < MAXSAT; i++) + { + if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2) + { + continue; + } + index[n++] = IB_RTK(i + 1, f, &rtk->opt); + } + if (n < 2) + { + continue; + } - xa[index[0]] = rtk->x[index[0]]; + xa[index[0]] = rtk->x[index[0]]; - for (i = 1; i < n; i++) - { - xa[index[i]] = xa[index[0]] - bias[nv++]; - } - } + for (i = 1; i < n; i++) + { + xa[index[i]] = xa[index[0]] - bias[nv++]; + } + } + } } @@ -1691,32 +1965,37 @@ void holdamb(rtk_t *rtk, const double *xa) H = zeros(nb, rtk->nx); for (m = 0; m < 4; m++) - for (f = 0; f < nf; f++) - { - for (n = i = 0; i < MAXSAT; i++) - { - if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2 || - rtk->ssat[i].azel[1] < rtk->opt.elmaskhold) - { - continue; - } - index[n++] = IB_RTK(i + 1, f, &rtk->opt); - rtk->ssat[i].fix[f] = 3; /* hold */ - } - /* constraint to fixed ambiguity */ - for (i = 1; i < n; i++) - { - v[nv] = (xa[index[0]] - xa[index[i]]) - (rtk->x[index[0]] - rtk->x[index[i]]); + { + for (f = 0; f < nf; f++) + { + for (n = i = 0; i < MAXSAT; i++) + { + if (!test_sys(rtk->ssat[i].sys, m) || rtk->ssat[i].fix[f] != 2 || + rtk->ssat[i].azel[1] < rtk->opt.elmaskhold) + { + continue; + } + index[n++] = IB_RTK(i + 1, f, &rtk->opt); + rtk->ssat[i].fix[f] = 3; /* hold */ + } + /* constraint to fixed ambiguity */ + for (i = 1; i < n; i++) + { + v[nv] = (xa[index[0]] - xa[index[i]]) - (rtk->x[index[0]] - rtk->x[index[i]]); - H[index[0] + nv * rtk->nx] = 1.0; - H[index[i] + nv * rtk->nx] = -1.0; - nv++; - } - } + H[index[0] + nv * rtk->nx] = 1.0; + H[index[i] + nv * rtk->nx] = -1.0; + nv++; + } + } + } if (nv > 0) { R = zeros(nv, nv); - for (i = 0; i < nv; i++) R[i + i * nv] = VAR_HOLDAMB; + for (i = 0; i < nv; i++) + { + R[i + i * nv] = VAR_HOLDAMB; + } /* update states with constraints */ if ((info = filter(rtk->x, rtk->P, H, v, R, rtk->nx, nv))) @@ -1771,9 +2050,19 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) /* phase-bias covariance (Qb) and real-parameters to bias covariance (Qab) */ for (i = 0; i < nb; i++) - for (j = 0; j < nb; j++) Qb[i + j * nb] = Qy[na + i + (na + j) * ny]; + { + for (j = 0; j < nb; j++) + { + Qb[i + j * nb] = Qy[na + i + (na + j) * ny]; + } + } for (i = 0; i < na; i++) - for (j = 0; j < nb; j++) Qab[i + j * na] = Qy[i + (na + j) * ny]; + { + for (j = 0; j < nb; j++) + { + Qab[i + j * na] = Qy[i + (na + j) * ny]; + } + } trace(4, "N(0)="); tracemat(4, y + na, 1, nb, 10, 3); @@ -1787,7 +2076,10 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) tracemat(4, b + nb, 1, nb, 10, 3); rtk->sol.ratio = s[0] > 0 ? static_cast(s[1] / s[0]) : 0.0f; - if (rtk->sol.ratio > 999.9) rtk->sol.ratio = 999.9f; + if (rtk->sol.ratio > 999.9) + { + rtk->sol.ratio = 999.9f; + } /* validation by popular ratio-test */ if (s[0] <= 0.0 || s[1] / s[0] >= opt->thresar[0]) @@ -1796,7 +2088,10 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) for (i = 0; i < na; i++) { rtk->xa[i] = rtk->x[i]; - for (j = 0; j < na; j++) rtk->Pa[i + j * na] = rtk->P[i + j * nx]; + for (j = 0; j < na; j++) + { + rtk->Pa[i + j * na] = rtk->P[i + j * nx]; + } } for (i = 0; i < nb; i++) { @@ -1819,7 +2114,9 @@ int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa) restamb(rtk, bias, nb, xa); } else - nb = 0; + { + nb = 0; + } } else { /* validation failed */ @@ -1863,7 +2160,10 @@ int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg, /* post-fit residual test */ for (i = 0; i < nv; i++) { - if (v[i] * v[i] <= fact * R[i + i * nv]) continue; + if (v[i] * v[i] <= fact * R[i + i * nv]) + { + continue; + } sat1 = (vflg[i] >> 16) & 0xFF; sat2 = (vflg[i] >> 8) & 0xFF; type = (vflg[i] >> 4) & 0xF; @@ -1921,7 +2221,10 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, for (i = 0; i < MAXSAT; i++) { rtk->ssat[i].sys = satsys(i + 1, nullptr); - for (j = 0; j < NFREQ; j++) rtk->ssat[i].vsat[j] = rtk->ssat[i].snr[j] = 0; + for (j = 0; j < NFREQ; j++) + { + rtk->ssat[i].vsat[j] = rtk->ssat[i].snr[j] = 0; + } } /* satellite positions/clocks */ satposs(time, obs, n, nav, opt->sateph, rs, dts, var, svh); @@ -2020,18 +2323,31 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, /* update ambiguity control struct */ rtk->sol.ns = 0; for (i = 0; i < ns; i++) - for (f = 0; f < nf; f++) - { - if (!rtk->ssat[sat[i] - 1].vsat[f]) continue; - rtk->ssat[sat[i] - 1].lock[f]++; - rtk->ssat[sat[i] - 1].outc[f] = 0; - if (f == 0) rtk->sol.ns++; /* valid satellite count by L1 */ - } + { + for (f = 0; f < nf; f++) + { + if (!rtk->ssat[sat[i] - 1].vsat[f]) + { + continue; + } + rtk->ssat[sat[i] - 1].lock[f]++; + rtk->ssat[sat[i] - 1].outc[f] = 0; + if (f == 0) + { + rtk->sol.ns++; /* valid satellite count by L1 */ + } + } + } /* lack of valid satellites */ - if (rtk->sol.ns < 4) stat = SOLQ_NONE; + if (rtk->sol.ns < 4) + { + stat = SOLQ_NONE; + } } else - stat = SOLQ_NONE; + { + stat = SOLQ_NONE; + } } /* resolve integer ambiguity by WL-NL */ if (stat != SOLQ_NONE && rtk->opt.modear == ARMODE_WLNL) @@ -2096,24 +2412,39 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, rtk->nfix = 0; } for (i = 0; i < n; i++) - for (j = 0; j < nf; j++) - { - if (obs[i].L[j] == 0.0) continue; - rtk->ssat[obs[i].sat - 1].pt[obs[i].rcv - 1][j] = obs[i].time; - rtk->ssat[obs[i].sat - 1].ph[obs[i].rcv - 1][j] = obs[i].L[j]; - } + { + for (j = 0; j < nf; j++) + { + if (obs[i].L[j] == 0.0) + { + continue; + } + rtk->ssat[obs[i].sat - 1].pt[obs[i].rcv - 1][j] = obs[i].time; + rtk->ssat[obs[i].sat - 1].ph[obs[i].rcv - 1][j] = obs[i].L[j]; + } + } for (i = 0; i < ns; i++) - for (j = 0; j < nf; j++) - { - /* output snr of rover receiver */ - rtk->ssat[sat[i] - 1].snr[j] = obs[iu[i]].SNR[j]; - } + { + for (j = 0; j < nf; j++) + { + /* output snr of rover receiver */ + rtk->ssat[sat[i] - 1].snr[j] = obs[iu[i]].SNR[j]; + } + } for (i = 0; i < MAXSAT; i++) - for (j = 0; j < nf; j++) - { - if (rtk->ssat[i].fix[j] == 2 && stat != SOLQ_FIX) rtk->ssat[i].fix[j] = 1; - if (rtk->ssat[i].slip[j] & 1) rtk->ssat[i].slipc[j]++; - } + { + for (j = 0; j < nf; j++) + { + if (rtk->ssat[i].fix[j] == 2 && stat != SOLQ_FIX) + { + rtk->ssat[i].fix[j] = 1; + } + if (rtk->ssat[i].slip[j] & 1) + { + rtk->ssat[i].slipc[j]++; + } + } + } free(rs); free(dts); free(var); @@ -2128,7 +2459,10 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr, free(R); free(bias); - if (stat != SOLQ_NONE) rtk->sol.stat = stat; + if (stat != SOLQ_NONE) + { + rtk->sol.stat = stat; + } return stat != SOLQ_NONE; } @@ -2150,7 +2484,10 @@ void rtkinit(rtk_t *rtk, const prcopt_t *opt) trace(3, "rtkinit :\n"); rtk->sol = sol0; - for (i = 0; i < 6; i++) rtk->rb[i] = 0.0; + for (i = 0; i < 6; i++) + { + rtk->rb[i] = 0.0; + } rtk->nx = opt->mode <= PMODE_FIXED ? NX_RTK(opt) : pppnx(opt); rtk->na = opt->mode <= PMODE_FIXED ? NR_RTK(opt) : pppnx(opt); rtk->tt = 0.0; @@ -2164,7 +2501,10 @@ void rtkinit(rtk_t *rtk, const prcopt_t *opt) rtk->ambc[i] = ambc0; rtk->ssat[i] = ssat0; } - for (i = 0; i < MAXERRMSG; i++) rtk->errbuf[i] = 0; + for (i = 0; i < MAXERRMSG; i++) + { + rtk->errbuf[i] = 0; + } rtk->opt = *opt; } @@ -2265,13 +2605,20 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) if (opt->refpos <= POSOPT_RINEX && opt->mode != PMODE_SINGLE && opt->mode != PMODE_MOVEB) { - for (i = 0; i < 6; i++) rtk->rb[i] = i < 3 ? opt->rb[i] : 0.0; + for (i = 0; i < 6; i++) + { + rtk->rb[i] = i < 3 ? opt->rb[i] : 0.0; + } } /* count rover/base station observations */ for (nu = 0; nu < n && obs[nu].rcv == 1; nu++) - ; + { + ; + } for (nr = 0; nu + nr < n && obs[nu + nr].rcv == 2; nr++) - ; + { + ; + } time = rtk->sol.time; /* previous epoch */ @@ -2285,7 +2632,10 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) return 0; } } - if (time.time != 0) rtk->tt = timediff(rtk->sol.time, time); + if (time.time != 0) + { + rtk->tt = timediff(rtk->sol.time, time); + } /* single point positioning */ if (opt->mode == PMODE_SINGLE) @@ -2323,21 +2673,27 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav) } rtk->sol.age = static_cast(timediff(rtk->sol.time, solb.time)); - if (fabs(rtk->sol.age) > TTOL_MOVEB) + if (std::fabs(rtk->sol.age) > TTOL_MOVEB) { errmsg(rtk, "time sync error for moving-base (age=%.1f)\n", rtk->sol.age); return 0; } - for (i = 0; i < 6; i++) rtk->rb[i] = solb.rr[i]; + for (i = 0; i < 6; i++) + { + rtk->rb[i] = solb.rr[i]; + } /* time-synchronized position of base station */ - for (i = 0; i < 3; i++) rtk->rb[i] += rtk->rb[i + 3] * rtk->sol.age; + for (i = 0; i < 3; i++) + { + rtk->rb[i] += rtk->rb[i + 3] * rtk->sol.age; + } } else { rtk->sol.age = static_cast(timediff(obs[0].time, obs[nu].time)); - if (fabs(rtk->sol.age) > opt->maxtdiff) + if (std::fabs(rtk->sol.age) > opt->maxtdiff) { errmsg(rtk, "age of differential error (age=%.1f)\n", rtk->sol.age); outsolstat(rtk); diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc index ac047012a..8b2e00833 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.cc +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.cc @@ -7,6 +7,7 @@ #include "rtklib_sbas.h" #include "rtklib_solution.h" #include "rtklib_stream.h" +#include /* write solution header to output stream ------------------------------------*/ void writesolhead(stream_t *stream, const solopt_t *solopt) @@ -34,7 +35,7 @@ void saveoutbuf(rtksvr_t *svr, unsigned char *buff, int n, int index) /* write solution to output stream -------------------------------------------*/ void writesol(rtksvr_t *svr, int index) { - solopt_t solopt = solopt_default; + solopt_t solopt = SOLOPT_DEFAULT; unsigned char buff[1024]; int i, n; @@ -77,10 +78,12 @@ void updatenav(nav_t *nav) { int i, j; for (i = 0; i < MAXSAT; i++) - for (j = 0; j < NFREQ; j++) - { - nav->lam[i][j] = satwavelen(i + 1, j, nav); - } + { + for (j = 0; j < NFREQ; j++) + { + nav->lam[i][j] = satwavelen(i + 1, j, nav); + } + } } @@ -95,14 +98,23 @@ void updatefcn(rtksvr_t *svr) for (j = 0, frq = -999; j < 3; j++) { - if (svr->raw[j].nav.geph[i].sat != sat) continue; + if (svr->raw[j].nav.geph[i].sat != sat) + { + continue; + } frq = svr->raw[j].nav.geph[i].frq; } - if (frq < -7 || frq > 6) continue; + if (frq < -7 || frq > 6) + { + continue; + } for (j = 0; j < 3; j++) { - if (svr->raw[j].nav.geph[i].sat == sat) continue; + if (svr->raw[j].nav.geph[i].sat == sat) + { + continue; + } svr->raw[j].nav.geph[i].sat = sat; svr->raw[j].nav.geph[i].frq = frq; } @@ -129,7 +141,10 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, for (i = 0; i < obs->n; i++) { if (svr->rtk.opt.exsats[obs->data[i].sat - 1] == 1 || - !(satsys(obs->data[i].sat, nullptr) & svr->rtk.opt.navsys)) continue; + !(satsys(obs->data[i].sat, nullptr) & svr->rtk.opt.navsys)) + { + continue; + } svr->obs[index][iobs].data[n] = obs->data[i]; svr->obs[index][iobs].data[n++].rcv = index + 1; } @@ -188,7 +203,10 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, } else { - for (i = 0; i < MAXSBSMSG - 1; i++) svr->sbsmsg[i] = svr->sbsmsg[i + 1]; + for (i = 0; i < MAXSBSMSG - 1; i++) + { + svr->sbsmsg[i] = svr->sbsmsg[i + 1]; + } svr->sbsmsg[i] = *sbsmsg; } sbsupdatecorr(sbsmsg, &svr->nav); @@ -199,12 +217,30 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, { /* ion/utc parameters */ if (svr->navsel == index || svr->navsel >= 3) { - for (i = 0; i < 8; i++) svr->nav.ion_gps[i] = nav->ion_gps[i]; - for (i = 0; i < 4; i++) svr->nav.utc_gps[i] = nav->utc_gps[i]; - for (i = 0; i < 4; i++) svr->nav.ion_gal[i] = nav->ion_gal[i]; - for (i = 0; i < 4; i++) svr->nav.utc_gal[i] = nav->utc_gal[i]; - for (i = 0; i < 8; i++) svr->nav.ion_qzs[i] = nav->ion_qzs[i]; - for (i = 0; i < 4; i++) svr->nav.utc_qzs[i] = nav->utc_qzs[i]; + for (i = 0; i < 8; i++) + { + svr->nav.ion_gps[i] = nav->ion_gps[i]; + } + for (i = 0; i < 4; i++) + { + svr->nav.utc_gps[i] = nav->utc_gps[i]; + } + for (i = 0; i < 4; i++) + { + svr->nav.ion_gal[i] = nav->ion_gal[i]; + } + for (i = 0; i < 4; i++) + { + svr->nav.utc_gal[i] = nav->utc_gal[i]; + } + for (i = 0; i < 8; i++) + { + svr->nav.ion_qzs[i] = nav->ion_qzs[i]; + } + for (i = 0; i < 4; i++) + { + svr->nav.utc_qzs[i] = nav->utc_qzs[i]; + } svr->nav.leaps = nav->leaps; } svr->nmsg[index][2]++; @@ -247,7 +283,10 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat, { /* ssr message */ for (i = 0; i < MAXSAT; i++) { - if (!svr->rtcm[index].ssr[i].update) continue; + if (!svr->rtcm[index].ssr[i].update) + { + continue; + } svr->rtcm[index].ssr[i].update = 0; iode = svr->rtcm[index].ssr[i].iode; @@ -332,15 +371,22 @@ int decoderaw(rtksvr_t *svr, int index) } #endif /* update rtk server */ - if (ret > 0) updatesvr(svr, ret, obs, nav, sat, sbsmsg, index, fobs); + if (ret > 0) + { + updatesvr(svr, ret, obs, nav, sat, sbsmsg, index, fobs); + } /* observation data received */ if (ret == 1) { if (fobs < MAXOBSBUF) - fobs++; + { + fobs++; + } else - svr->prcout++; + { + svr->prcout++; + } } } svr->nb[index] = 0; @@ -359,7 +405,9 @@ void decodefile(rtksvr_t *svr, int index) // Allocate space for GLONASS frequency channels depending on availability for (i = 0; i < MAXPRNGLO + 1; i++) - glo_fcn[i] = '0'; + { + glo_fcn[i] = '0'; + } pcv_t pcvt0[MAXSAT] = {{0, {'0'}, {'0'}, {0, 0.0}, {0, 0.0}, {{0.0}, {0.0}}, {{0.0}, {0.0}}}}; sbsfcorr_t sbsfcorr0 = {{0, 0.0}, 0.0, 0.0, 0.0, 0, 0, 0}; sbslcorr_t sbslcorr0 = {{0, 0.0}, 0, {0.0}, {0.0}, 0.0, 0.0}; @@ -412,7 +460,10 @@ void decodefile(rtksvr_t *svr, int index) /* update precise ephemeris */ rtksvrlock(svr); - if (svr->nav.peph) free(svr->nav.peph); + if (svr->nav.peph) + { + free(svr->nav.peph); + } svr->nav.ne = svr->nav.nemax = nav.ne; svr->nav.peph = nav.peph; svr->ftime[index] = utc2gpst(timeget()); @@ -432,7 +483,10 @@ void decodefile(rtksvr_t *svr, int index) /* update precise clock */ rtksvrlock(svr); - if (svr->nav.pclk) free(svr->nav.pclk); + if (svr->nav.pclk) + { + free(svr->nav.pclk); + } svr->nav.nc = svr->nav.ncmax = nav.nc; svr->nav.pclk = nav.pclk; svr->ftime[index] = utc2gpst(timeget()); @@ -554,12 +608,18 @@ void *rtksvrthread(void *arg) } ticknmea = tick; } - if ((cputime = static_cast(tickget() - tick)) > 0) svr->cputime = cputime; + if ((cputime = static_cast(tickget() - tick)) > 0) + { + svr->cputime = cputime; + } /* sleep until next cycle */ sleepms(svr->cycle - cputime); } - for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); + for (i = 0; i < MAXSTRRTK; i++) + { + strclose(svr->stream + i); + } for (i = 0; i < 3; i++) { svr->nb[i] = svr->npb[i] = 0; @@ -601,23 +661,64 @@ int rtksvrinit(rtksvr_t *svr) tracet(3, "rtksvrinit:\n"); svr->state = svr->cycle = svr->nmeacycle = svr->nmeareq = 0; - for (i = 0; i < 3; i++) svr->nmeapos[i] = 0.0; - svr->buffsize = 0; - for (i = 0; i < 3; i++) svr->format[i] = 0; - for (i = 0; i < 2; i++) svr->solopt[i] = solopt_default; - svr->navsel = svr->nsbs = svr->nsol = 0; - rtkinit(&svr->rtk, &prcopt_default); - for (i = 0; i < 3; i++) svr->nb[i] = 0; - for (i = 0; i < 2; i++) svr->nsb[i] = 0; - for (i = 0; i < 3; i++) svr->npb[i] = 0; - for (i = 0; i < 3; i++) svr->buff[i] = nullptr; - for (i = 0; i < 2; i++) svr->sbuf[i] = nullptr; - for (i = 0; i < 3; i++) svr->pbuf[i] = nullptr; - for (i = 0; i < MAXSOLBUF; i++) svr->solbuf[i] = sol0; for (i = 0; i < 3; i++) - for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; - for (i = 0; i < 3; i++) svr->ftime[i] = time0; - for (i = 0; i < 3; i++) svr->files[i][0] = '\0'; + { + svr->nmeapos[i] = 0.0; + } + svr->buffsize = 0; + for (i = 0; i < 3; i++) + { + svr->format[i] = 0; + } + for (i = 0; i < 2; i++) + { + svr->solopt[i] = SOLOPT_DEFAULT; + } + svr->navsel = svr->nsbs = svr->nsol = 0; + rtkinit(&svr->rtk, &PRCOPT_DEFAULT); + for (i = 0; i < 3; i++) + { + svr->nb[i] = 0; + } + for (i = 0; i < 2; i++) + { + svr->nsb[i] = 0; + } + for (i = 0; i < 3; i++) + { + svr->npb[i] = 0; + } + for (i = 0; i < 3; i++) + { + svr->buff[i] = nullptr; + } + for (i = 0; i < 2; i++) + { + svr->sbuf[i] = nullptr; + } + for (i = 0; i < 3; i++) + { + svr->pbuf[i] = nullptr; + } + for (i = 0; i < MAXSOLBUF; i++) + { + svr->solbuf[i] = sol0; + } + for (i = 0; i < 3; i++) + { + for (j = 0; j < 10; j++) + { + svr->nmsg[i][j] = 0; + } + } + for (i = 0; i < 3; i++) + { + svr->ftime[i] = time0; + } + for (i = 0; i < 3; i++) + { + svr->files[i][0] = '\0'; + } svr->moni = nullptr; svr->tick = 0; svr->thread = 0; // NOLINT @@ -630,28 +731,42 @@ int rtksvrinit(rtksvr_t *svr) tracet(1, "rtksvrinit: malloc error\n"); return 0; } - for (i = 0; i < MAXSAT * 2; i++) svr->nav.eph[i] = eph0; - for (i = 0; i < NSATGLO * 2; i++) svr->nav.geph[i] = geph0; - for (i = 0; i < NSATSBS * 2; i++) svr->nav.seph[i] = seph0; + for (i = 0; i < MAXSAT * 2; i++) + { + svr->nav.eph[i] = eph0; + } + for (i = 0; i < NSATGLO * 2; i++) + { + svr->nav.geph[i] = geph0; + } + for (i = 0; i < NSATSBS * 2; i++) + { + svr->nav.seph[i] = seph0; + } svr->nav.n = MAXSAT * 2; svr->nav.ng = NSATGLO * 2; svr->nav.ns = NSATSBS * 2; for (i = 0; i < 3; i++) - for (j = 0; j < MAXOBSBUF; j++) - { - if (!(svr->obs[i][j].data = static_cast(malloc(sizeof(obsd_t) * MAXOBS)))) - { - tracet(1, "rtksvrinit: malloc error\n"); - return 0; - } - } + { + for (j = 0; j < MAXOBSBUF; j++) + { + if (!(svr->obs[i][j].data = static_cast(malloc(sizeof(obsd_t) * MAXOBS)))) + { + tracet(1, "rtksvrinit: malloc error\n"); + return 0; + } + } + } for (i = 0; i < 3; i++) { memset(svr->raw + i, 0, sizeof(raw_t)); memset(svr->rtcm + i, 0, sizeof(rtcm_t)); } - for (i = 0; i < MAXSTRRTK; i++) strinit(svr->stream + i); + for (i = 0; i < MAXSTRRTK; i++) + { + strinit(svr->stream + i); + } initlock(&svr->lock); @@ -672,10 +787,12 @@ void rtksvrfree(rtksvr_t *svr) free(svr->nav.geph); free(svr->nav.seph); for (i = 0; i < 3; i++) - for (j = 0; j < MAXOBSBUF; j++) - { - free(svr->obs[i][j].data); - } + { + for (j = 0; j < MAXOBSBUF; j++) + { + free(svr->obs[i][j].data); + } + } } @@ -741,15 +858,24 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, tracet(3, "rtksvrstart: cycle=%d buffsize=%d navsel=%d nmeacycle=%d nmeareq=%d\n", cycle, buffsize, navsel, nmeacycle, nmeareq); - if (svr->state) return 0; + if (svr->state) + { + return 0; + } strinitcom(); svr->cycle = cycle > 1 ? cycle : 1; svr->nmeacycle = nmeacycle > 1000 ? nmeacycle : 1000; svr->nmeareq = nmeareq; - for (i = 0; i < 3; i++) svr->nmeapos[i] = nmeapos[i]; + for (i = 0; i < 3; i++) + { + svr->nmeapos[i] = nmeapos[i]; + } svr->buffsize = buffsize > 4096 ? buffsize : 4096; - for (i = 0; i < 3; i++) svr->format[i] = formats[i]; + for (i = 0; i < 3; i++) + { + svr->format[i] = formats[i]; + } svr->navsel = navsel; svr->nsbs = 0; svr->nsol = 0; @@ -766,16 +892,28 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, tracet(1, "rtksvrstart: malloc error\n"); return 0; } - for (j = 0; j < 10; j++) svr->nmsg[i][j] = 0; - for (j = 0; j < MAXOBSBUF; j++) svr->obs[i][j].n = 0; + for (j = 0; j < 10; j++) + { + svr->nmsg[i][j] = 0; + } + for (j = 0; j < MAXOBSBUF; j++) + { + svr->obs[i][j].n = 0; + } /* initialize receiver raw and rtcm control */ //init_raw (svr->raw +i); init_rtcm(svr->rtcm + i); /* set receiver and rtcm option */ - if (strlen(rcvopts[i]) < 256) strcpy(svr->raw[i].opt, rcvopts[i]); - if (strlen(rcvopts[i]) < 256) strcpy(svr->rtcm[i].opt, rcvopts[i]); + if (strlen(rcvopts[i]) < 256) + { + strcpy(svr->raw[i].opt, rcvopts[i]); + } + if (strlen(rcvopts[i]) < 256) + { + strcpy(svr->rtcm[i].opt, rcvopts[i]); + } /* connect dgps corrections */ svr->rtcm[i].dgps = svr->nav.dgps; @@ -799,9 +937,18 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, svr->rtk.rb[i] = i < 3 ? prcopt->rb[i] : 0.0; } /* update navigation data */ - for (i = 0; i < MAXSAT * 2; i++) svr->nav.eph[i].ttr = time0; - for (i = 0; i < NSATGLO * 2; i++) svr->nav.geph[i].tof = time0; - for (i = 0; i < NSATSBS * 2; i++) svr->nav.seph[i].tof = time0; + for (i = 0; i < MAXSAT * 2; i++) + { + svr->nav.eph[i].ttr = time0; + } + for (i = 0; i < NSATGLO * 2; i++) + { + svr->nav.geph[i].tof = time0; + } + for (i = 0; i < NSATSBS * 2; i++) + { + svr->nav.seph[i].tof = time0; + } updatenav(&svr->nav); /* set monitor stream */ @@ -811,10 +958,16 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, for (i = 0; i < 8; i++) { rw = i < 3 ? STR_MODE_R : STR_MODE_W; - if (strs[i] != STR_FILE) rw |= STR_MODE_W; + if (strs[i] != STR_FILE) + { + rw |= STR_MODE_W; + } if (!stropen(svr->stream + i, strs[i], rw, paths[i])) { - for (i--; i >= 0; i--) strclose(svr->stream + i); + for (i--; i >= 0; i--) + { + strclose(svr->stream + i); + } return 0; } /* set initial time for rtcm and raw */ @@ -832,7 +985,10 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, /* write start commands to input streams */ for (i = 0; i < 3; i++) { - if (cmds[i]) strsendcmd(svr->stream + i, cmds[i]); + if (cmds[i]) + { + strsendcmd(svr->stream + i, cmds[i]); + } } /* write solution header to solution streams */ for (i = 3; i < 5; i++) @@ -842,7 +998,10 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs, /* create rtk server thread */ if (pthread_create(&svr->thread, nullptr, rtksvrthread, svr)) { - for (i = 0; i < MAXSTRRTK; i++) strclose(svr->stream + i); + for (i = 0; i < MAXSTRRTK; i++) + { + strclose(svr->stream + i); + } return 0; } return 1; @@ -868,7 +1027,10 @@ void rtksvrstop(rtksvr_t *svr, char **cmds) rtksvrlock(svr); for (i = 0; i < 3; i++) { - if (cmds[i]) strsendcmd(svr->stream + i, cmds[i]); + if (cmds[i]) + { + strsendcmd(svr->stream + i, cmds[i]); + } } rtksvrunlock(svr); @@ -896,7 +1058,10 @@ int rtksvropenstr(rtksvr_t *svr, int index, int str, const char *path, { tracet(3, "rtksvropenstr: index=%d str=%d path=%s\n", index, str, path); - if (index < 3 || index > 7 || !svr->state) return 0; + if (index < 3 || index > 7 || !svr->state) + { + return 0; + } rtksvrlock(svr); @@ -935,7 +1100,10 @@ void rtksvrclosestr(rtksvr_t *svr, int index) { tracet(3, "rtksvrclosestr: index=%d\n", index); - if (index < 3 || index > 7 || !svr->state) return; + if (index < 3 || index > 7 || !svr->state) + { + return; + } rtksvrlock(svr); @@ -965,7 +1133,10 @@ int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat, tracet(4, "rtksvrostat: rcv=%d\n", rcv); - if (!svr->state) return 0; + if (!svr->state) + { + return 0; + } rtksvrlock(svr); ns = svr->obs[rcv][0].n; if (ns > 0) @@ -1013,7 +1184,10 @@ void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg) for (i = 0; i < MAXSTRRTK; i++) { sstat[i] = strstat(svr->stream + i, s); - if (*s) p += sprintf(p, "(%d) %s ", i + 1, s); + if (*s) + { + p += sprintf(p, "(%d) %s ", i + 1, s); + } } rtksvrunlock(svr); } diff --git a/src/algorithms/libs/rtklib/rtklib_rtksvr.h b/src/algorithms/libs/rtklib/rtklib_rtksvr.h index d5edbd252..9d84b13c9 100644 --- a/src/algorithms/libs/rtklib/rtklib_rtksvr.h +++ b/src/algorithms/libs/rtklib/rtklib_rtksvr.h @@ -57,7 +57,7 @@ #include "rtklib.h" -const solopt_t solopt_default = { +const solopt_t SOLOPT_DEFAULT = { /* defaults solution output options */ SOLF_LLH, TIMES_GPST, 1, 3, /* posf, times, timef, timeu */ 0, 1, 0, 0, 0, 0, /* degf, outhead, outopt, datum, height, geoid */ @@ -66,7 +66,7 @@ const solopt_t solopt_default = { " ", "", 0 /* separator/program name */ }; -const prcopt_t prcopt_default = { /* defaults processing options */ +const prcopt_t PRCOPT_DEFAULT = { /* defaults processing options */ PMODE_SINGLE, 0, 2, SYS_GPS, /* mode, soltype, nf, navsys */ 15.0 * D2R, {{}, {{}, {}}}, /* elmin, snrmask */ 0, 1, 1, 1, /* sateph, modear, glomodear, bdsmodear */ diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.cc b/src/algorithms/libs/rtklib/rtklib_sbas.cc index d4c45aad8..943b271f0 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.cc +++ b/src/algorithms/libs/rtklib/rtklib_sbas.cc @@ -61,12 +61,18 @@ #include "rtklib_sbas.h" #include "rtklib_rtkcmn.h" +#include /* extract field from line ---------------------------------------------------*/ char *getfield(char *p, int pos) { for (pos--; pos > 0; pos--, p++) - if (!(p = strchr(p, ','))) return nullptr; + { + if (!(p = strchr(p, ','))) + { + return nullptr; + } + } return p; } @@ -113,21 +119,37 @@ int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat) if (getbitu(msg->msg, 13 + i, 1)) { if (i <= 37) - sat = satno(SYS_GPS, i); /* 0- 37: gps */ + { + sat = satno(SYS_GPS, i); /* 0- 37: gps */ + } else if (i <= 61) - sat = satno(SYS_GLO, i - 37); /* 38- 61: glonass */ + { + sat = satno(SYS_GLO, i - 37); /* 38- 61: glonass */ + } else if (i <= 119) - sat = 0; /* 62-119: future gnss */ + { + sat = 0; /* 62-119: future gnss */ + } else if (i <= 138) - sat = satno(SYS_SBS, i); /* 120-138: geo/waas */ + { + sat = satno(SYS_SBS, i); /* 120-138: geo/waas */ + } else if (i <= 182) - sat = 0; /* 139-182: reserved */ + { + sat = 0; /* 139-182: reserved */ + } else if (i <= 192) - sat = satno(SYS_SBS, i + 10); /* 183-192: qzss ref [2] */ + { + sat = satno(SYS_SBS, i + 10); /* 183-192: qzss ref [2] */ + } else if (i <= 202) - sat = satno(SYS_QZS, i); /* 193-202: qzss ref [2] */ + { + sat = satno(SYS_QZS, i); /* 193-202: qzss ref [2] */ + } else - sat = 0; /* 203- : reserved */ + { + sat = 0; /* 203- : reserved */ + } sbssat->sat[n++].sat = sat; } } @@ -148,14 +170,20 @@ int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype2:\n"); - if (sbssat->iodp != static_cast(getbitu(msg->msg, 16, 2))) return 0; + if (sbssat->iodp != static_cast(getbitu(msg->msg, 16, 2))) + { + return 0; + } type = getbitu(msg->msg, 8, 6); iodf = getbitu(msg->msg, 14, 2); for (i = 0; i < 13; i++) { - if ((j = 13 * ((type == 0 ? 2 : type) - 2) + i) >= sbssat->nsat) break; + if ((j = 13 * ((type == 0 ? 2 : type) - 2) + i) >= sbssat->nsat) + { + break; + } udre = getbitu(msg->msg, 174 + 4 * i, 4); t0 = sbssat->sat[j].fcorr.t0; prc = sbssat->sat[j].fcorr.prc; @@ -193,7 +221,10 @@ int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat) } for (i = 0; i < sbssat->nsat && i < MAXSAT; i++) { - if (sbssat->sat[i].fcorr.iodf != iodf[i / 28]) continue; + if (sbssat->sat[i].fcorr.iodf != iodf[i / 28]) + { + continue; + } udre = getbitu(msg->msg, 22 + i * 4, 4); sbssat->sat[i].fcorr.udre = udre + 1; } @@ -209,7 +240,10 @@ int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype7\n"); - if (sbssat->iodp != static_cast(getbitu(msg->msg, 18, 2))) return 0; + if (sbssat->iodp != static_cast(getbitu(msg->msg, 18, 2))) + { + return 0; + } sbssat->tlat = getbitu(msg->msg, 14, 4); @@ -236,9 +270,13 @@ int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav) } t = static_cast(getbitu(msg->msg, 22, 13)) * 16 - msg->tow % 86400; if (t <= -43200) - t += 86400; + { + t += 86400; + } else if (t > 43200) - t -= 86400; + { + t -= 86400; + } seph.sat = sat; seph.t0 = gpst2time(msg->week, msg->tow + t); seph.tof = gpst2time(msg->week, msg->tow); @@ -281,25 +319,33 @@ int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion) if (0 <= band && band <= 8) { - p = igpband1[band]; + p = IGPBAND1[band]; m = 8; } else if (9 <= band && band <= 10) { - p = igpband2[band - 9]; + p = IGPBAND2[band - 9]; m = 5; } else - return 0; + { + return 0; + } sbsion[band].iodi = static_cast(getbitu(msg->msg, 22, 2)); for (i = 1, n = 0; i <= 201; i++) { - if (!getbitu(msg->msg, 23 + i, 1)) continue; + if (!getbitu(msg->msg, 23 + i, 1)) + { + continue; + } for (j = 0; j < m; j++) { - if (i < p[j].bits || p[j].bite < i) continue; + if (i < p[j].bits || p[j].bite < i) + { + continue; + } sbsion[band].igp[n].lat = band <= 8 ? p[j].y[i - p[j].bits] : p[j].x; sbsion[band].igp[n++].lon = band <= 8 ? p[j].x : p[j].y[i - p[j].bits]; break; @@ -319,7 +365,10 @@ int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat) trace(4, "decode_longcorr0:\n"); - if (n == 0 || n > MAXSAT) return 0; + if (n == 0 || n > MAXSAT) + { + return 0; + } sbssat->sat[n - 1].lcorr.iode = getbitu(msg->msg, p + 6, 8); @@ -344,7 +393,10 @@ int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat) trace(4, "decode_longcorr1:\n"); - if (n == 0 || n > MAXSAT) return 0; + if (n == 0 || n > MAXSAT) + { + return 0; + } sbssat->sat[n - 1].lcorr.iode = getbitu(msg->msg, p + 6, 8); @@ -357,9 +409,13 @@ int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat) sbssat->sat[n - 1].lcorr.daf1 = getbits(msg->msg, p + 82, 8) * TWO_N39; t = static_cast(getbitu(msg->msg, p + 90, 13)) * 16 - msg->tow % 86400; if (t <= -43200) - t += 86400; + { + t += 86400; + } else if (t > 43200) - t -= 86400; + { + t -= 86400; + } sbssat->sat[n - 1].lcorr.t0 = gpst2time(msg->week, msg->tow + t); trace(5, "decode_longcorr1: sat=%2d\n", sbssat->sat[n - 1].sat); @@ -395,14 +451,20 @@ int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat) trace(4, "decode_sbstype24:\n"); - if (sbssat->iodp != static_cast(getbitu(msg->msg, 110, 2))) return 0; /* check IODP */ + if (sbssat->iodp != static_cast(getbitu(msg->msg, 110, 2))) + { + return 0; /* check IODP */ + } blk = getbitu(msg->msg, 112, 2); iodf = getbitu(msg->msg, 114, 2); for (i = 0; i < 6; i++) { - if ((j = 13 * blk + i) >= sbssat->nsat) break; + if ((j = 13 * blk + i) >= sbssat->nsat) + { + break; + } udre = getbitu(msg->msg, 86 + 4 * i, 4); sbssat->sat[j].fcorr.t0 = gpst2time(msg->week, msg->tow); @@ -430,13 +492,19 @@ int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion) trace(4, "decode_sbstype26:\n"); - if (band > MAXBAND || sbsion[band].iodi != static_cast(getbitu(msg->msg, 217, 2))) return 0; + if (band > MAXBAND || sbsion[band].iodi != static_cast(getbitu(msg->msg, 217, 2))) + { + return 0; + } block = getbitu(msg->msg, 18, 4); for (i = 0; i < 15; i++) { - if ((j = block * 15 + i) >= sbsion[band].nigp) continue; + if ((j = block * 15 + i) >= sbsion[band].nigp) + { + continue; + } give = getbitu(msg->msg, 22 + i * 13 + 9, 4); delay = getbitu(msg->msg, 22 + i * 13, 9); @@ -469,7 +537,10 @@ int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav) trace(3, "sbsupdatecorr: type=%d\n", type); - if (msg->week == 0) return -1; + if (msg->week == 0) + { + return -1; + } switch (type) { @@ -550,27 +621,62 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, } else if (!strncmp(buff, "#RAWWAASFRAMEA", 14)) { /* NovAtel OEM4/V */ - if (!(p = getfield(buff, 6))) continue; - if (sscanf(p, "%d,%lf", &week, &tow) < 2) continue; - if (!(p = strchr(++p, ';'))) continue; - if (sscanf(++p, "%d,%d", &ch, &prn) < 2) continue; - if (!(p = getfield(p, 4))) continue; + if (!(p = getfield(buff, 6))) + { + continue; + } + if (sscanf(p, "%d,%lf", &week, &tow) < 2) + { + continue; + } + if (!(p = strchr(++p, ';'))) + { + continue; + } + if (sscanf(++p, "%d,%d", &ch, &prn) < 2) + { + continue; + } + if (!(p = getfield(p, 4))) + { + continue; + } } else if (!strncmp(buff, "$FRMA", 5)) { /* NovAtel OEM3 */ - if (!(p = getfield(buff, 2))) continue; - if (sscanf(p, "%d,%lf,%d", &week, &tow, &prn) < 3) continue; - if (!(p = getfield(p, 6))) continue; - if (week < WEEKOFFSET) week += WEEKOFFSET; + if (!(p = getfield(buff, 2))) + { + continue; + } + if (sscanf(p, "%d,%lf,%d", &week, &tow, &prn) < 3) + { + continue; + } + if (!(p = getfield(p, 6))) + { + continue; + } + if (week < WEEKOFFSET) + { + week += WEEKOFFSET; + } } else - continue; + { + continue; + } - if (sel != 0 && sel != prn) continue; + if (sel != 0 && sel != prn) + { + continue; + } time = gpst2time(week, tow); - if (!screent(time, ts, te, 0.0)) continue; + if (!screent(time, ts, te, 0.0)) + { + continue; + } if (sbs->n >= sbs->nmax) { @@ -589,10 +695,16 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, sbs->msgs[sbs->n].week = week; sbs->msgs[sbs->n].tow = static_cast(tow + 0.5); sbs->msgs[sbs->n].prn = prn; - for (i = 0; i < 29; i++) sbs->msgs[sbs->n].msg[i] = 0; + for (i = 0; i < 29; i++) + { + sbs->msgs[sbs->n].msg[i] = 0; + } for (i = 0; *(p - 1) && *p && i < 29; p += 2, i++) { - if (sscanf(p, "%2X", &b) == 1) sbs->msgs[sbs->n].msg[i] = static_cast(b); + if (sscanf(p, "%2X", &b) == 1) + { + sbs->msgs[sbs->n].msg[i] = static_cast(b); + } } sbs->msgs[sbs->n++].msg[28] &= 0xC0; } @@ -635,7 +747,10 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, { if (!(efiles[i] = static_cast(malloc(1024)))) { - for (i--; i >= 0; i--) free(efiles[i]); + for (i--; i >= 0; i--) + { + free(efiles[i]); + } return 0; } } @@ -644,13 +759,22 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, for (i = 0; i < n; i++) { - if (!(ext = strrchr(efiles[i], '.'))) continue; + if (!(ext = strrchr(efiles[i], '.'))) + { + continue; + } if (strcmp(ext, ".sbs") != 0 && strcmp(ext, ".SBS") != 0 && - strcmp(ext, ".ems") != 0 && strcmp(ext, ".EMS") != 0) continue; + strcmp(ext, ".ems") != 0 && strcmp(ext, ".EMS") != 0) + { + continue; + } readmsgs(efiles[i], sel, ts, te, sbs); } - for (i = 0; i < MAXEXFILE; i++) free(efiles[i]); + for (i = 0; i < MAXEXFILE; i++) + { + free(efiles[i]); + } /* sort messages */ if (sbs->n > 0) @@ -684,7 +808,10 @@ void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg) trace(4, "sbsoutmsg:\n"); fprintf(fp, "%4d %6d %3d %2d : ", sbsmsg->week, sbsmsg->tow, sbsmsg->prn, type); - for (i = 0; i < 29; i++) fprintf(fp, "%02X", sbsmsg->msg[i]); + for (i = 0; i < 29; i++) + { + fprintf(fp, "%02X", sbsmsg->msg[i]); + } fprintf(fp, "\n"); } @@ -699,7 +826,10 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb trace(4, "searchigp: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D); - if (lon >= 180.0) lon -= 360.0; + if (lon >= 180.0) + { + lon -= 360.0; + } if (-55.0 <= lat && lat < 55.0) { latp[0] = static_cast(floor(lat / 5.0)) * 5; @@ -729,29 +859,54 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb } else if (lat >= 85.0) { - for (i = 0; i < 4; i++) lonp[i] = static_cast(floor(lon / 90.0)) * 90; + for (i = 0; i < 4; i++) + { + lonp[i] = static_cast(floor(lon / 90.0)) * 90; + } } else if (lat < -85.0) { - for (i = 0; i < 4; i++) lonp[i] = static_cast(floor((lon - 50.0) / 90.0)) * 90 + 40; + for (i = 0; i < 4; i++) + { + lonp[i] = static_cast(floor((lon - 50.0) / 90.0)) * 90 + 40; + } } } for (i = 0; i < 4; i++) - if (lonp[i] == 180) lonp[i] = -180; + { + if (lonp[i] == 180) + { + lonp[i] = -180; + } + } for (i = 0; i <= MAXBAND; i++) { for (p = ion[i].igp; p < ion[i].igp + ion[i].nigp; p++) { - if (p->t0.time == 0) continue; + if (p->t0.time == 0) + { + continue; + } if (p->lat == latp[0] && p->lon == lonp[0] && p->give > 0) - igp[0] = p; + { + igp[0] = p; + } else if (p->lat == latp[1] && p->lon == lonp[1] && p->give > 0) - igp[1] = p; + { + igp[1] = p; + } else if (p->lat == latp[0] && p->lon == lonp[2] && p->give > 0) - igp[2] = p; + { + igp[2] = p; + } else if (p->lat == latp[1] && p->lon == lonp[3] && p->give > 0) - igp[3] = p; - if (igp[0] && igp[1] && igp[2] && igp[3]) return; + { + igp[3] = p; + } + if (igp[0] && igp[1] && igp[2] && igp[3]) + { + return; + } } } } @@ -782,7 +937,10 @@ int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, azel[0] * R2D, azel[1] * R2D); *delay = *var = 0.0; - if (pos[2] < -100.0 || azel[1] <= 0) return 1; + if (pos[2] < -100.0 || azel[1] <= 0) + { + return 1; + } /* ipp (ionospheric pierce point) position */ fp = ionppp(pos, azel, re, hion, posp); @@ -802,28 +960,42 @@ int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, { w[1] = y; w[2] = x; - if ((w[0] = 1.0 - w[1] - w[2]) < 0.0) err = 1; + if ((w[0] = 1.0 - w[1] - w[2]) < 0.0) + { + err = 1; + } } else if (igp[0] && igp[2] && igp[3]) { w[0] = 1.0 - x; w[3] = y; - if ((w[2] = 1.0 - w[0] - w[3]) < 0.0) err = 1; + if ((w[2] = 1.0 - w[0] - w[3]) < 0.0) + { + err = 1; + } } else if (igp[0] && igp[1] && igp[3]) { w[0] = 1.0 - y; w[3] = x; - if ((w[1] = 1.0 - w[0] - w[3]) < 0.0) err = 1; + if ((w[1] = 1.0 - w[0] - w[3]) < 0.0) + { + err = 1; + } } else if (igp[1] && igp[2] && igp[3]) { w[1] = 1.0 - x; w[2] = 1.0 - y; - if ((w[3] = 1.0 - w[1] - w[2]) < 0.0) err = 1; + if ((w[3] = 1.0 - w[1] - w[2]) < 0.0) + { + err = 1; + } } else - err = 1; + { + err = 1; + } if (err) { @@ -833,7 +1005,10 @@ int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, } for (i = 0; i < 4; i++) { - if (!igp[i]) continue; + if (!igp[i]) + { + continue; + } t = timediff(time, igp[i]->t0); *delay += w[i] * igp[i]->delay; *var += w[i] * varicorr(igp[i]->give) * 9e-8 * fabs(t); @@ -859,14 +1034,27 @@ void getmet(double lat, double *met) double a; lat = fabs(lat); if (lat <= 15.0) - for (i = 0; i < 10; i++) met[i] = metprm[0][i]; + { + for (i = 0; i < 10; i++) + { + met[i] = metprm[0][i]; + } + } else if (lat >= 75.0) - for (i = 0; i < 10; i++) met[i] = metprm[4][i]; + { + for (i = 0; i < 10; i++) + { + met[i] = metprm[4][i]; + } + } else { j = static_cast(lat / 15.0); a = (lat - j * 15.0) / 15.0; - for (i = 0; i < 10; i++) met[i] = (1.0 - a) * metprm[j - 1][i] + a * metprm[j][i]; + for (i = 0; i < 10; i++) + { + met[i] = (1.0 - a) * metprm[j - 1][i] + a * metprm[j][i]; + } } } @@ -900,12 +1088,18 @@ double sbstropcorr(gtime_t time, const double *pos, const double *azel, { getmet(pos[0] * R2D, met); c = cos(2.0 * PI * (time2doy(time) - (pos[0] >= 0.0 ? 28.0 : 211.0)) / 365.25); - for (i = 0; i < 5; i++) met[i] -= met[i + 5] * c; + for (i = 0; i < 5; i++) + { + met[i] -= met[i + 5] * c; + } zh = 1e-6 * k1 * rd * met[0] / gm; zw = 1e-6 * k2 * rd / (gm * (met[4] + 1.0) - met[3] * rd) * met[2] / met[1]; zh *= pow(1.0 - met[3] * h / met[1], g / (rd * met[3])); zw *= pow(1.0 - met[3] * h / met[1], (met[4] + 1.0) * g / (rd * met[3]) - 1.0); - for (i = 0; i < 3; i++) pos_[i] = pos[i]; + for (i = 0; i < 3; i++) + { + pos_[i] = pos[i]; + } } m = 1.001 / sqrt(0.002001 + sinel * sinel); *var = 0.12 * 0.12 * m * m; @@ -925,7 +1119,10 @@ int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, for (p = sbssat->sat; p < sbssat->sat + sbssat->nsat; p++) { - if (p->sat != sat || p->lcorr.t0.time == 0) continue; + if (p->sat != sat || p->lcorr.t0.time == 0) + { + continue; + } t = timediff(time, p->lcorr.t0); if (fabs(t) > MAXSBSAGEL) { @@ -933,7 +1130,10 @@ int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, time_str(time, 0), sat, t); return 0; } - for (i = 0; i < 3; i++) drs[i] = p->lcorr.dpos[i] + p->lcorr.dvel[i] * t; + for (i = 0; i < 3; i++) + { + drs[i] = p->lcorr.dpos[i] + p->lcorr.dvel[i] * t; + } *ddts = p->lcorr.daf0 + p->lcorr.daf1 * t; trace(5, "sbslongcorr: sat=%2d drs=%7.2f%7.2f%7.2f ddts=%7.2f\n", @@ -942,7 +1142,10 @@ int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, return 1; } /* if sbas satellite without correction, no correction applied */ - if (satsys(sat, nullptr) == SYS_SBS) return 1; + if (satsys(sat, nullptr) == SYS_SBS) + { + return 1; + } trace(2, "no sbas long-term correction: %s sat=%2d\n", time_str(time, 0), sat); return 0; @@ -960,12 +1163,21 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, for (p = sbssat->sat; p < sbssat->sat + sbssat->nsat; p++) { - if (p->sat != sat) continue; - if (p->fcorr.t0.time == 0) break; + if (p->sat != sat) + { + continue; + } + if (p->fcorr.t0.time == 0) + { + break; + } t = timediff(time, p->fcorr.t0) + sbssat->tlat; /* expire age of correction or UDRE==14 (not monitored) */ - if (fabs(t) > MAXSBSAGEF || p->fcorr.udre >= 15) continue; + if (fabs(t) > MAXSBSAGEF || p->fcorr.udre >= 15) + { + continue; + } *prc = p->fcorr.prc; #ifdef RRCENA if (p->fcorr.ai > 0 && fabs(t) <= 8.0 * p->fcorr.dt) @@ -1019,7 +1231,10 @@ int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, { return 0; } - for (i = 0; i < 3; i++) rs[i] += drs[i]; + for (i = 0; i < 3; i++) + { + rs[i] += drs[i]; + } dts[0] += dclk + prc / SPEED_OF_LIGHT; @@ -1047,17 +1262,25 @@ int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words, trace(5, "sbsdecodemsg: prn=%d\n", prn); - if (time.time == 0) return 0; + if (time.time == 0) + { + return 0; + } tow = time2gpst(time, &sbsmsg->week); sbsmsg->tow = static_cast(tow + DTTOL); sbsmsg->prn = prn; for (i = 0; i < 7; i++) - for (j = 0; j < 4; j++) - { - sbsmsg->msg[i * 4 + j] = static_cast(words[i] >> ((3 - j) * 8)); - } + { + for (j = 0; j < 4; j++) + { + sbsmsg->msg[i * 4 + j] = static_cast(words[i] >> ((3 - j) * 8)); + } + } sbsmsg->msg[28] = static_cast(words[7] >> 18) & 0xC0; - for (i = 28; i > 0; i--) f[i] = (sbsmsg->msg[i] >> 6) + (sbsmsg->msg[i - 1] << 2); + for (i = 28; i > 0; i--) + { + f[i] = (sbsmsg->msg[i] >> 6) + (sbsmsg->msg[i - 1] << 2); + } f[0] = sbsmsg->msg[0] >> 6; return rtk_crc24q(f, 29) == (words[7] & 0xFFFFFF); /* check crc */ diff --git a/src/algorithms/libs/rtklib/rtklib_sbas.h b/src/algorithms/libs/rtklib/rtklib_sbas.h index 1ff7bf6ad..801df1202 100644 --- a/src/algorithms/libs/rtklib/rtklib_sbas.h +++ b/src/algorithms/libs/rtklib/rtklib_sbas.h @@ -70,50 +70,50 @@ const int WEEKOFFSET = 1024; /* gps week offset for NovAtel OEM-3 */ /* sbas igp definition -------------------------------------------------------*/ static const short - x1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, + X1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75, 85}, - x2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, + X2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}, - x3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, + X3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75}, - x4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, + X4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75}, - x5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, + X5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, -110, -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175}, - x6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50, + X6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170}, - x7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150}, - x8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160}; + X7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150}, + X8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160}; -const sbsigpband_t igpband1[9][8] = {/* band 0-8 */ - {{-180, x1, 1, 28}, {-175, x2, 29, 51}, {-170, x3, 52, 78}, {-165, x2, 79, 101}, - {-160, x3, 102, 128}, {-155, x2, 129, 151}, {-150, x3, 152, 178}, {-145, x2, 179, 201}}, - {{-140, x4, 1, 28}, {-135, x2, 29, 51}, {-130, x3, 52, 78}, {-125, x2, 79, 101}, - {-120, x3, 102, 128}, {-115, x2, 129, 151}, {-110, x3, 152, 178}, {-105, x2, 179, 201}}, - {{-100, x3, 1, 27}, {-95, x2, 28, 50}, {-90, x1, 51, 78}, {-85, x2, 79, 101}, - {-80, x3, 102, 128}, {-75, x2, 129, 151}, {-70, x3, 152, 178}, {-65, x2, 179, 201}}, - {{-60, x3, 1, 27}, {-55, x2, 28, 50}, {-50, x4, 51, 78}, {-45, x2, 79, 101}, - {-40, x3, 102, 128}, {-35, x2, 129, 151}, {-30, x3, 152, 178}, {-25, x2, 179, 201}}, - {{-20, x3, 1, 27}, {-15, x2, 28, 50}, {-10, x3, 51, 77}, {-5, x2, 78, 100}, - {0, x1, 101, 128}, {5, x2, 129, 151}, {10, x3, 152, 178}, {15, x2, 179, 201}}, - {{20, x3, 1, 27}, {25, x2, 28, 50}, {30, x3, 51, 77}, {35, x2, 78, 100}, - {40, x4, 101, 128}, {45, x2, 129, 151}, {50, x3, 152, 178}, {55, x2, 179, 201}}, - {{60, x3, 1, 27}, {65, x2, 28, 50}, {70, x3, 51, 77}, {75, x2, 78, 100}, - {80, x3, 101, 127}, {85, x2, 128, 150}, {90, x1, 151, 178}, {95, x2, 179, 201}}, - {{100, x3, 1, 27}, {105, x2, 28, 50}, {110, x3, 51, 77}, {115, x2, 78, 100}, - {120, x3, 101, 127}, {125, x2, 128, 150}, {130, x4, 151, 178}, {135, x2, 179, 201}}, - {{140, x3, 1, 27}, {145, x2, 28, 50}, {150, x3, 51, 77}, {155, x2, 78, 100}, - {160, x3, 101, 127}, {165, x2, 128, 150}, {170, x3, 151, 177}, {175, x2, 178, 200}}}; -const sbsigpband_t igpband2[2][5] = {/* band 9-10 */ - {{60, x5, 1, 72}, {65, x6, 73, 108}, {70, x6, 109, 144}, {75, x6, 145, 180}, - {85, x7, 181, 192}}, - {{-60, x5, 1, 72}, {-65, x6, 73, 108}, {-70, x6, 109, 144}, {-75, x6, 145, 180}, - {-85, x8, 181, 192}}}; +const sbsigpband_t IGPBAND1[9][8] = {/* band 0-8 */ + {{-180, X1, 1, 28}, {-175, X2, 29, 51}, {-170, X3, 52, 78}, {-165, X2, 79, 101}, + {-160, X3, 102, 128}, {-155, X2, 129, 151}, {-150, X3, 152, 178}, {-145, X2, 179, 201}}, + {{-140, X4, 1, 28}, {-135, X2, 29, 51}, {-130, X3, 52, 78}, {-125, X2, 79, 101}, + {-120, X3, 102, 128}, {-115, X2, 129, 151}, {-110, X3, 152, 178}, {-105, X2, 179, 201}}, + {{-100, X3, 1, 27}, {-95, X2, 28, 50}, {-90, X1, 51, 78}, {-85, X2, 79, 101}, + {-80, X3, 102, 128}, {-75, X2, 129, 151}, {-70, X3, 152, 178}, {-65, X2, 179, 201}}, + {{-60, X3, 1, 27}, {-55, X2, 28, 50}, {-50, X4, 51, 78}, {-45, X2, 79, 101}, + {-40, X3, 102, 128}, {-35, X2, 129, 151}, {-30, X3, 152, 178}, {-25, X2, 179, 201}}, + {{-20, X3, 1, 27}, {-15, X2, 28, 50}, {-10, X3, 51, 77}, {-5, X2, 78, 100}, + {0, X1, 101, 128}, {5, X2, 129, 151}, {10, X3, 152, 178}, {15, X2, 179, 201}}, + {{20, X3, 1, 27}, {25, X2, 28, 50}, {30, X3, 51, 77}, {35, X2, 78, 100}, + {40, X4, 101, 128}, {45, X2, 129, 151}, {50, X3, 152, 178}, {55, X2, 179, 201}}, + {{60, X3, 1, 27}, {65, X2, 28, 50}, {70, X3, 51, 77}, {75, X2, 78, 100}, + {80, X3, 101, 127}, {85, X2, 128, 150}, {90, X1, 151, 178}, {95, X2, 179, 201}}, + {{100, X3, 1, 27}, {105, X2, 28, 50}, {110, X3, 51, 77}, {115, X2, 78, 100}, + {120, X3, 101, 127}, {125, X2, 128, 150}, {130, X4, 151, 178}, {135, X2, 179, 201}}, + {{140, X3, 1, 27}, {145, X2, 28, 50}, {150, X3, 51, 77}, {155, X2, 78, 100}, + {160, X3, 101, 127}, {165, X2, 128, 150}, {170, X3, 151, 177}, {175, X2, 178, 200}}}; +const sbsigpband_t IGPBAND2[2][5] = {/* band 9-10 */ + {{60, X5, 1, 72}, {65, X6, 73, 108}, {70, X6, 109, 144}, {75, X6, 145, 180}, + {85, X7, 181, 192}}, + {{-60, X5, 1, 72}, {-65, X6, 73, 108}, {-70, X6, 109, 144}, {-75, X6, 145, 180}, + {-85, X8, 181, 192}}}; char *getfield(char *p, int pos); diff --git a/src/algorithms/libs/rtklib/rtklib_solution.cc b/src/algorithms/libs/rtklib/rtklib_solution.cc index e2c19cecd..ab7c6a72e 100644 --- a/src/algorithms/libs/rtklib/rtklib_solution.cc +++ b/src/algorithms/libs/rtklib/rtklib_solution.cc @@ -55,6 +55,7 @@ #include "rtklib_rtkcmn.h" #include "rtklib_rtksvr.h" #include +#include /* constants and macros ------------------------------------------------------*/ @@ -66,7 +67,7 @@ const int MAXFIELD = 64; /* max number of fields in a record */ const double KNOT2M = 0.514444444; /* m/knot */ -static const int solq_nmea[] = {/* nmea quality flags to rtklib sol quality */ +static const int SOLQ_NMEA[] = {/* nmea quality flags to rtklib sol quality */ /* nmea 0183 v.2.3 quality flags: */ /* 0=invalid, 1=gps fix (sps), 2=dgps fix, 3=pps fix, 4=rtk, 5=float rtk */ /* 6=estimated (dead reckoning), 7=manual input, 8=simulation */ @@ -78,9 +79,13 @@ static const int solq_nmea[] = {/* nmea quality flags to rtklib sol quality */ const char *opt2sep(const solopt_t *opt) { if (!*opt->sep) - return " "; + { + return " "; + } if (!strcmp(opt->sep, "\\t")) - return "\t"; + { + return "\t"; + } return opt->sep; } @@ -93,9 +98,18 @@ int tonum(char *buff, const char *sep, double *v) for (p = buff, n = 0; n < MAXFIELD; p = q + len) { - if ((q = strstr(p, sep))) *q = '\0'; - if (*p) v[n++] = atof(p); - if (!q) break; + if ((q = strstr(p, sep))) + { + *q = '\0'; + } + if (*p) + { + v[n++] = atof(p); + } + if (!q) + { + break; + } } return n; } @@ -300,13 +314,19 @@ int decode_nmeagga(char **val, int n, sol_t *sol) time = utc2gpst(epoch2time(ep)); tt = timediff(time, sol->time); if (tt < -43200.0) - sol->time = timeadd(time, 86400.0); + { + sol->time = timeadd(time, 86400.0); + } else if (tt > 43200.0) - sol->time = timeadd(time, -86400.0); + { + sol->time = timeadd(time, -86400.0); + } else - sol->time = time; + { + sol->time = time; + } pos2ecef(pos, sol->rr); - sol->stat = 0 <= solq && solq <= 8 ? solq_nmea[solq] : SOLQ_NONE; + sol->stat = 0 <= solq && solq <= 8 ? SOLQ_NMEA[solq] : SOLQ_NONE; sol->ns = nrcv; sol->type = 0; /* position type = xyz */ @@ -336,7 +356,9 @@ int decode_nmea(char *buff, sol_t *sol) *q = '\0'; } else - break; + { + break; + } } /* decode nmea sentence */ if (!strcmp(val[0], "$GPRMC")) @@ -361,9 +383,13 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) trace(4, "decode_soltime:\n"); if (!strcmp(opt->sep, "\\t")) - strcpy(s, "\t"); + { + strcpy(s, "\t"); + } else if (*opt->sep) - strcpy(s, opt->sep); + { + strcpy(s, opt->sep); + } len = static_cast(strlen(s)); /* yyyy/mm/dd hh:mm:ss or yyyy mm dd hh:mm:ss */ @@ -382,8 +408,14 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) { *time = utc2gpst(timeadd(*time, -9 * 3600.0)); } - if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return nullptr; - for (p++; isdigit(static_cast(*p)) || *p == '.';) p++; + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) + { + return nullptr; + } + for (p++; isdigit(static_cast(*p)) || *p == '.';) + { + p++; + } return p + len; } if (opt->posf == SOLF_GSIF) @@ -393,16 +425,31 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time) return nullptr; } *time = timeadd(epoch2time(v), -12.0 * 3600.0); - if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) return nullptr; - for (p++; isdigit(static_cast(*p)) || *p == '.';) p++; + if (!(p = strchr(buff, ':')) || !(p = strchr(p + 1, ':'))) + { + return nullptr; + } + for (p++; isdigit(static_cast(*p)) || *p == '.';) + { + p++; + } return p + len; } /* wwww ssss */ for (p = buff, n = 0; n < 2; p = q + len) { - if ((q = strstr(p, s))) *q = '\0'; - if (*p) v[n++] = atof(p); - if (!q) break; + if ((q = strstr(p, s))) + { + *q = '\0'; + } + if (*p) + { + v[n++] = atof(p); + } + if (!q) + { + break; + } } if (n >= 2 && 0.0 <= v[0] && v[0] <= 3000.0 && 0.0 <= v[1] && v[1] < 604800.0) { @@ -422,14 +469,23 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol) trace(4, "decode_solxyz:\n"); - if ((n = tonum(buff, sep, val)) < 3) return 0; + if ((n = tonum(buff, sep, val)) < 3) + { + return 0; + } for (j = 0; j < 3; j++) { sol->rr[j] = val[i++]; /* xyz */ } - if (i < n) sol->stat = static_cast(val[i++]); - if (i < n) sol->ns = static_cast(val[i++]); + if (i < n) + { + sol->stat = static_cast(val[i++]); + } + if (i < n) + { + sol->ns = static_cast(val[i++]); + } if (i + 3 < n) { P[0] = val[i] * val[i]; @@ -449,12 +505,21 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol) } covtosol(P, sol); } - if (i < n) sol->age = static_cast(val[i++]); - if (i < n) sol->ratio = static_cast(val[i]); + if (i < n) + { + sol->age = static_cast(val[i++]); + } + if (i < n) + { + sol->ratio = static_cast(val[i]); + } sol->type = 0; /* position type = xyz */ - if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) + { + sol->stat = SOLQ_NONE; + } return 1; } @@ -472,22 +537,34 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol) if (!opt->degf) { - if (n < 3) return 0; + if (n < 3) + { + return 0; + } pos[0] = val[i++] * D2R; /* lat/lon/hgt (ddd.ddd) */ pos[1] = val[i++] * D2R; pos[2] = val[i++]; } else { - if (n < 7) return 0; + if (n < 7) + { + return 0; + } pos[0] = dms2deg(val) * D2R; /* lat/lon/hgt (ddd mm ss) */ pos[1] = dms2deg(val + 3) * D2R; pos[2] = val[6]; i += 7; } pos2ecef(pos, sol->rr); - if (i < n) sol->stat = static_cast(val[i++]); - if (i < n) sol->ns = static_cast(val[i++]); + if (i < n) + { + sol->stat = static_cast(val[i++]); + } + if (i < n) + { + sol->ns = static_cast(val[i++]); + } if (i + 3 < n) { Q[4] = val[i] * val[i]; @@ -508,12 +585,21 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol) covecef(pos, Q, P); covtosol(P, sol); } - if (i < n) sol->age = static_cast(val[i++]); - if (i < n) sol->ratio = static_cast(val[i]); + if (i < n) + { + sol->age = static_cast(val[i++]); + } + if (i < n) + { + sol->ratio = static_cast(val[i]); + } sol->type = 0; /* position type = xyz */ - if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) + { + sol->stat = SOLQ_NONE; + } return 1; } @@ -527,14 +613,23 @@ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol) trace(4, "decode_solenu:\n"); - if ((n = tonum(buff, sep, val)) < 3) return 0; + if ((n = tonum(buff, sep, val)) < 3) + { + return 0; + } for (j = 0; j < 3; j++) { sol->rr[j] = val[i++]; /* enu */ } - if (i < n) sol->stat = static_cast(val[i++]); - if (i < n) sol->ns = static_cast(val[i++]); + if (i < n) + { + sol->stat = static_cast(val[i++]); + } + if (i < n) + { + sol->ns = static_cast(val[i++]); + } if (i + 3 < n) { Q[0] = val[i] * val[i]; @@ -554,12 +649,21 @@ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol) } covtosol(Q, sol); } - if (i < n) sol->age = static_cast(val[i++]); - if (i < n) sol->ratio = static_cast(val[i]); + if (i < n) + { + sol->age = static_cast(val[i++]); + } + if (i < n) + { + sol->ratio = static_cast(val[i]); + } sol->type = 1; /* position type = enu */ - if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE; + if (MAXSOLQ < sol->stat) + { + sol->stat = SOLQ_NONE; + } return 1; } @@ -572,7 +676,10 @@ int decode_solgsi(char *buff, const solopt_t *opt __attribute((unused)), sol_t * trace(4, "decode_solgsi:\n"); - if (tonum(buff, " ", val) < 3) return 0; + if (tonum(buff, " ", val) < 3) + { + return 0; + } for (j = 0; j < 3; j++) { @@ -623,11 +730,17 @@ void decode_refpos(char *buff, const solopt_t *opt, double *rb) trace(3, "decode_refpos: buff=%s\n", buff); - if ((n = tonum(buff, sep, val)) < 3) return; + if ((n = tonum(buff, sep, val)) < 3) + { + return; + } if (opt->posf == SOLF_XYZ) { /* xyz */ - for (i = 0; i < 3; i++) rb[i] = val[i]; + for (i = 0; i < 3; i++) + { + rb[i] = val[i]; + } } else if (opt->degf == 0) { /* lat/lon/hgt (ddd.ddd) */ @@ -655,21 +768,36 @@ int decode_sol(char *buff, const solopt_t *opt, sol_t *sol, double *rb) if (!strncmp(buff, COMMENTH, 1)) { /* reference position */ - if (!strstr(buff, "ref pos") && !strstr(buff, "slave pos")) return 0; - if (!(p = strchr(buff, ':'))) return 0; + if (!strstr(buff, "ref pos") && !strstr(buff, "slave pos")) + { + return 0; + } + if (!(p = strchr(buff, ':'))) + { + return 0; + } decode_refpos(p + 1, opt, rb); return 0; } if (!strncmp(buff, "$GP", 3)) { /* decode nmea */ - if (!decode_nmea(buff, sol)) return 0; + if (!decode_nmea(buff, sol)) + { + return 0; + } /* for time update only */ - if (opt->posf != SOLF_NMEA && !strncmp(buff, "$GPRMC", 6)) return 2; + if (opt->posf != SOLF_NMEA && !strncmp(buff, "$GPRMC", 6)) + { + return 2; + } } else { /* decode position record */ - if (!decode_solpos(buff, opt, sol)) return 0; + if (!decode_solpos(buff, opt, sol)) + { + return 0; + } } return 1; } @@ -682,14 +810,23 @@ void decode_solopt(char *buff, solopt_t *opt) trace(4, "decode_solhead: buff=%s\n", buff); - if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1) != 0) return; + if (strncmp(buff, COMMENTH, 1) != 0 && strncmp(buff, "+", 1) != 0) + { + return; + } if (strstr(buff, "GPST")) - opt->times = TIMES_GPST; + { + opt->times = TIMES_GPST; + } else if (strstr(buff, "UTC")) - opt->times = TIMES_UTC; + { + opt->times = TIMES_UTC; + } else if (strstr(buff, "JST")) - opt->times = TIMES_JST; + { + opt->times = TIMES_JST; + } if ((p = strstr(buff, "x-ecef(m)"))) { @@ -770,7 +907,10 @@ int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint, solbuf->nb = 0; } solbuf->buff[solbuf->nb++] = data; - if (data != '\n' && solbuf->nb < MAXSOLMSG) return 0; /* sync trailer */ + if (data != '\n' && solbuf->nb < MAXSOLMSG) + { + return 0; /* sync trailer */ + } solbuf->buff[solbuf->nb] = '\0'; solbuf->nb = 0; @@ -828,7 +968,10 @@ int sort_solbuf(solbuf_t *solbuf) trace(4, "sort_solbuf: n=%d\n", solbuf->n); - if (solbuf->n <= 0) return 0; + if (solbuf->n <= 0) + { + return 0; + } if (!(solbuf_data = static_cast(realloc(solbuf->data, sizeof(sol_t) * solbuf->n)))) { @@ -862,7 +1005,7 @@ int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te, double tint, int qflag, solbuf_t *solbuf) { FILE *fp; - solopt_t opt = solopt_default; + solopt_t opt = SOLOPT_DEFAULT; int i; trace(3, "readsolt: nfile=%d\n", nfile); @@ -915,15 +1058,26 @@ int addsol(solbuf_t *solbuf, const sol_t *sol) if (solbuf->cyclic) { /* ring buffer */ - if (solbuf->nmax <= 1) return 0; + if (solbuf->nmax <= 1) + { + return 0; + } solbuf->data[solbuf->end] = *sol; - if (++solbuf->end >= solbuf->nmax) solbuf->end = 0; + if (++solbuf->end >= solbuf->nmax) + { + solbuf->end = 0; + } if (solbuf->start == solbuf->end) { - if (++solbuf->start >= solbuf->nmax) solbuf->start = 0; + if (++solbuf->start >= solbuf->nmax) + { + solbuf->start = 0; + } } else - solbuf->n++; + { + solbuf->n++; + } return 1; } @@ -956,7 +1110,10 @@ sol_t *getsol(solbuf_t *solbuf, int index) { trace(4, "getsol: index=%d\n", index); - if (index < 0 || solbuf->n <= index) return nullptr; + if (index < 0 || solbuf->n <= index) + { + return nullptr; + } if ((index = solbuf->start + index) >= solbuf->nmax) { index -= solbuf->nmax; @@ -984,7 +1141,10 @@ void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) solbuf->data = nullptr; if (cyclic) { - if (nmax <= 2) nmax = 2; + if (nmax <= 2) + { + nmax = 2; + } if (!(solbuf->data = static_cast(malloc(sizeof(sol_t) * nmax)))) { trace(1, "initsolbuf: memory allocation error\n"); @@ -1036,7 +1196,10 @@ int sort_solstat(solstatbuf_t *statbuf) trace(4, "sort_solstat: n=%d\n", statbuf->n); - if (statbuf->n <= 0) return 0; + if (statbuf->n <= 0) + { + return 0; + } if (!(statbuf_data = static_cast(realloc(statbuf->data, sizeof(solstat_t) * statbuf->n)))) { @@ -1063,10 +1226,18 @@ int decode_solstat(char *buff, solstat_t *stat) trace(4, "decode_solstat: buff=%s\n", buff); - if (strstr(buff, "$SAT") != buff) return 0; + if (strstr(buff, "$SAT") != buff) + { + return 0; + } for (p = buff; *p; p++) - if (*p == ',') *p = ' '; + { + if (*p == ',') + { + *p = ' '; + } + } n = sscanf(buff, "$SAT%d%lf%s%d%lf%lf%lf%lf%d%d%d%d%d%d%d%d", &week, &tow, id, &frq, &az, &el, &resp, &resc, &vsat, &snr, &fix, &slip, @@ -1137,7 +1308,10 @@ int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint, while (fgets(buff, sizeof(buff), fp)) { /* decode solution status */ - if (!decode_solstat(buff, &stat)) continue; + if (!decode_solstat(buff, &stat)) + { + continue; + } /* add solution to solution buffer */ if (screent(stat.time, ts, te, tint)) @@ -1244,7 +1418,9 @@ int outpos(unsigned char *buff, const char *s, const sol_t *sol, dms2[2]); } else - p += sprintf(p, "%s%s%14.9f%s%14.9f", s, sep, pos[0] * R2D, sep, pos[1] * R2D); + { + p += sprintf(p, "%s%s%14.9f%s%14.9f", s, sep, pos[0] * R2D, sep, pos[1] * R2D); + } p += sprintf(p, "%s%10.4f%s%3d%s%3d%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%8.4f%s%6.2f%s%6.1f\n", sep, pos[2], sep, sol->stat, sep, sol->ns, sep, SQRT_SOL(Q[4]), sep, SQRT_SOL(Q[0]), sep, SQRT_SOL(Q[8]), sep, sqvar(Q[1]), sep, sqvar(Q[2]), @@ -1264,7 +1440,10 @@ int outenu(unsigned char *buff, const char *s, const sol_t *sol, trace(3, "outenu :\n"); - for (i = 0; i < 3; i++) rr[i] = sol->rr[i] - rb[i]; + for (i = 0; i < 3; i++) + { + rr[i] = sol->rr[i] - rb[i]; + } ecef2pos(rb, pos); soltocov(sol, P); covenu(pos, P, Q); @@ -1290,7 +1469,10 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol) if (sol->stat <= SOLQ_NONE) { p += sprintf(p, "$GPRMC,,,,,,,,,,,,"); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } @@ -1307,11 +1489,16 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol) if (vel >= 1.0) { dir = atan2(enuv[0], enuv[1]) * R2D; - if (dir < 0.0) dir += 360.0; + if (dir < 0.0) + { + dir += 360.0; + } dirp = dir; } else - dir = dirp; + { + dir = dirp; + } deg2dms(fabs(pos[0]) * R2D, dms1); deg2dms(fabs(pos[1]) * R2D, dms2); p += sprintf(p, "$GPRMC,%02.0f%02.0f%05.2f,A,%02.0f%010.7f,%s,%03.0f%010.7f,%s,%4.2f,%4.2f,%02.0f%02.0f%02d,%.1f,%s,%s", @@ -1319,7 +1506,10 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol) dms2[0], dms2[1] + dms2[2] / 60.0, pos[1] >= 0 ? "E" : "W", vel / KNOT2M, dir, ep[2], ep[1], static_cast(ep[0]) % 100, amag, emag, sol->stat == SOLQ_DGPS || sol->stat == SOLQ_FLOAT || sol->stat == SOLQ_FIX ? "D" : "A"); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } @@ -1338,13 +1528,24 @@ int outnmea_gga(unsigned char *buff, const sol_t *sol) if (sol->stat <= SOLQ_NONE) { p += sprintf(p, "$GPGGA,,,,,,,,,,,,,,"); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } for (solq = 0; solq < 8; solq++) - if (solq_nmea[solq] == sol->stat) break; - if (solq >= 8) solq = 0; + { + if (SOLQ_NMEA[solq] == sol->stat) + { + break; + } + } + if (solq >= 8) + { + solq = 0; + } time = gpst2utc(sol->time); if (time.sec >= 0.995) { @@ -1360,7 +1561,10 @@ int outnmea_gga(unsigned char *buff, const sol_t *sol) ep[3], ep[4], ep[5], dms1[0], dms1[1] + dms1[2] / 60.0, pos[0] >= 0 ? "N" : "S", dms2[0], dms2[1] + dms2[2] / 60.0, pos[1] >= 0 ? "E" : "W", solq, sol->ns, dop, pos[2] - h, h, sol->age); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } @@ -1379,7 +1583,10 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol, if (sol->stat <= SOLQ_NONE) { p += sprintf(p, "$GPGSA,A,1,,,,,,,,,,,,,,,"); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } @@ -1387,11 +1594,23 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol, /* GPGSA: gps/sbas */ for (sat = 1, nsat = 0; sat <= MAXSAT && nsat < 12; sat++) { - if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) continue; + if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) + { + continue; + } sys = satsys(sat, prn + nsat); - if (sys != SYS_GPS && sys != SYS_SBS) continue; - if (sys == SYS_SBS) prn[nsat] += 33 - MINPRNSBS; - for (i = 0; i < 2; i++) azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + if (sys != SYS_GPS && sys != SYS_SBS) + { + continue; + } + if (sys == SYS_SBS) + { + prn[nsat] += 33 - MINPRNSBS; + } + for (i = 0; i < 2; i++) + { + azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + } nsat++; } if (nsat > 0) @@ -1401,21 +1620,37 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol, for (i = 0; i < 12; i++) { if (i < nsat) - p += sprintf(p, ",%02d", prn[i]); + { + p += sprintf(p, ",%02d", prn[i]); + } else - p += sprintf(p, ","); + { + p += sprintf(p, ","); + } } dops(nsat, azel, 0.0, dop); p += sprintf(p, ",%3.1f,%3.1f,%3.1f,1", dop[1], dop[2], dop[3]); - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } /* GLGSA: glonass */ for (sat = 1, nsat = 0; sat <= MAXSAT && nsat < 12; sat++) { - if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) continue; - if (satsys(sat, prn + nsat) != SYS_GLO) continue; - for (i = 0; i < 2; i++) azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) + { + continue; + } + if (satsys(sat, prn + nsat) != SYS_GLO) + { + continue; + } + for (i = 0; i < 2; i++) + { + azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + } nsat++; } if (nsat > 0) @@ -1425,21 +1660,37 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol, for (i = 0; i < 12; i++) { if (i < nsat) - p += sprintf(p, ",%02d", prn[i] + 64); + { + p += sprintf(p, ",%02d", prn[i] + 64); + } else - p += sprintf(p, ","); + { + p += sprintf(p, ","); + } } dops(nsat, azel, 0.0, dop); p += sprintf(p, ",%3.1f,%3.1f,%3.1f,2", dop[1], dop[2], dop[3]); - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } /* GAGSA: galileo */ for (sat = 1, nsat = 0; sat <= MAXSAT && nsat < 12; sat++) { - if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) continue; - if (satsys(sat, prn + nsat) != SYS_GAL) continue; - for (i = 0; i < 2; i++) azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + if (!ssat[sat - 1].vs || ssat[sat - 1].azel[1] <= 0.0) + { + continue; + } + if (satsys(sat, prn + nsat) != SYS_GAL) + { + continue; + } + for (i = 0; i < 2; i++) + { + azel[i + nsat * 2] = ssat[sat - 1].azel[i]; + } nsat++; } if (nsat > 0) @@ -1449,13 +1700,20 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol, for (i = 0; i < 12; i++) { if (i < nsat) - p += sprintf(p, ",%02d", prn[i]); + { + p += sprintf(p, ",%02d", prn[i]); + } else - p += sprintf(p, ","); + { + p += sprintf(p, ","); + } } dops(nsat, azel, 0.0, dop); p += sprintf(p, ",%3.1f,%3.1f,%3.1f,3", dop[1], dop[2], dop[3]); - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } return p - reinterpret_cast(buff); @@ -1475,7 +1733,10 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol, if (sol->stat <= SOLQ_NONE) { p += sprintf(p, "$GPGSV,1,1,0,,,,,,,,,,,,,,,,"); - for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) sum ^= *q; + for (q = reinterpret_cast(buff) + 1, sum = 0; *q; q++) + { + sum ^= *q; + } p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); return p - reinterpret_cast(buff); } @@ -1483,8 +1744,14 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol, for (sat = 1, n = 0; sat < MAXSAT && n < 12; sat++) { sys = satsys(sat, &prn); - if (sys != SYS_GPS && sys != SYS_SBS) continue; - if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; + if (sys != SYS_GPS && sys != SYS_SBS) + { + continue; + } + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) + { + sats[n++] = sat; + } } nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; @@ -1497,25 +1764,42 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol, { if (k < n) { - if (satsys(sats[k], &prn) == SYS_SBS) prn += 33 - MINPRNSBS; + if (satsys(sats[k], &prn) == SYS_SBS) + { + prn += 33 - MINPRNSBS; + } az = ssat[sats[k] - 1].azel[0] * R2D; - if (az < 0.0) az += 360.0; + if (az < 0.0) + { + az += 360.0; + } el = ssat[sats[k] - 1].azel[1] * R2D; snr = ssat[sats[k] - 1].snr[0] * 0.25; p += sprintf(p, ",%02d,%02.0f,%03.0f,%02.0f", prn, el, az, snr); } else - p += sprintf(p, ",,,,"); + { + p += sprintf(p, ",,,,"); + } + } + p += sprintf(p, ",1"); /* L1C/A */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ } - p += sprintf(p, ",1"); /* L1C/A */ - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } /* GLGSV: glonass */ for (sat = 1, n = 0; sat < MAXSAT && n < 12; sat++) { - if (satsys(sat, &prn) != SYS_GLO) continue; - if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; + if (satsys(sat, &prn) != SYS_GLO) + { + continue; + } + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) + { + sats[n++] = sat; + } } nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; @@ -1531,23 +1815,37 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol, satsys(sats[k], &prn); prn += 64; /* 65-99 */ az = ssat[sats[k] - 1].azel[0] * R2D; - if (az < 0.0) az += 360.0; + if (az < 0.0) + { + az += 360.0; + } el = ssat[sats[k] - 1].azel[1] * R2D; snr = ssat[sats[k] - 1].snr[0] * 0.25; p += sprintf(p, ",%02d,%02.0f,%03.0f,%02.0f", prn, el, az, snr); } else - p += sprintf(p, ",,,,"); + { + p += sprintf(p, ",,,,"); + } + } + p += sprintf(p, ",1"); /* L1C/A */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ } - p += sprintf(p, ",1"); /* L1C/A */ - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } /* GAGSV: galileo */ for (sat = 1, n = 0; sat < MAXSAT && n < 12; sat++) { - if (satsys(sat, &prn) != SYS_GAL) continue; - if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) sats[n++] = sat; + if (satsys(sat, &prn) != SYS_GAL) + { + continue; + } + if (ssat[sat - 1].vs && ssat[sat - 1].azel[1] > 0.0) + { + sats[n++] = sat; + } } nmsg = n <= 0 ? 0 : (n - 1) / 4 + 1; @@ -1562,16 +1860,24 @@ int outnmea_gsv(unsigned char *buff, const sol_t *sol, { satsys(sats[k], &prn); /* 1-36 */ az = ssat[sats[k] - 1].azel[0] * R2D; - if (az < 0.0) az += 360.0; + if (az < 0.0) + { + az += 360.0; + } el = ssat[sats[k] - 1].azel[1] * R2D; snr = ssat[sats[k] - 1].snr[0] * 0.25; p += sprintf(p, ",%02d,%02.0f,%03.0f,%02.0f", prn, el, az, snr); } else - p += sprintf(p, ",,,,"); + { + p += sprintf(p, ",,,,"); + } + } + p += sprintf(p, ",7"); /* L1BC */ + for (q = s + 1, sum = 0; *q; q++) + { + sum ^= *q; /* check-sum */ } - p += sprintf(p, ",7"); /* L1BC */ - for (q = s + 1, sum = 0; *q; q++) sum ^= *q; /* check-sum */ p += sprintf(p, "*%02X%c%c", sum, 0x0D, 0x0A); } return p - reinterpret_cast(buff); @@ -1632,7 +1938,10 @@ int outprcopts(unsigned char *buff, const prcopt_t *opt) p += sprintf(p, "%s navi sys :", COMMENTH); for (i = 0; sys[i]; i++) { - if (opt->navsys & sys[i]) p += sprintf(p, " %s", s7[i]); + if (opt->navsys & sys[i]) + { + p += sprintf(p, " %s", s7[i]); + } } p += sprintf(p, "\n"); } @@ -1655,7 +1964,10 @@ int outprcopts(unsigned char *buff, const prcopt_t *opt) } for (i = 0; i < 2; i++) { - if (opt->mode == PMODE_SINGLE || (i >= 1 && opt->mode > PMODE_FIXED)) continue; + if (opt->mode == PMODE_SINGLE || (i >= 1 && opt->mode > PMODE_FIXED)) + { + continue; + } p += sprintf(p, "%s antenna%d : %-21s (%7.4f %7.4f %7.4f)\n", COMMENTH, i + 1, opt->anttype[i], opt->antdel[i][0], opt->antdel[i][1], opt->antdel[i][2]); @@ -1679,17 +1991,26 @@ int outsolheads(unsigned char *buff, const solopt_t *opt) trace(3, "outsolheads:\n"); - if (opt->posf == SOLF_NMEA) return 0; + if (opt->posf == SOLF_NMEA) + { + return 0; + } if (opt->outhead) { p += sprintf(p, "%s (", COMMENTH); if (opt->posf == SOLF_XYZ) - p += sprintf(p, "x/y/z-ecef=WGS84"); + { + p += sprintf(p, "x/y/z-ecef=WGS84"); + } else if (opt->posf == SOLF_ENU) - p += sprintf(p, "e/n/u-baseline=WGS84"); + { + p += sprintf(p, "e/n/u-baseline=WGS84"); + } else - p += sprintf(p, "lat/lon/height=%s/%s", s1[opt->datum], s2[opt->height]); + { + p += sprintf(p, "lat/lon/height=%s/%s", s1[opt->datum], s2[opt->height]); + } p += sprintf(p, ",Q=1:fix,2:float,3:sbas,4:dgps,5:single,6:ppp,ns=# of satellites)\n"); } p += sprintf(p, "%s %-*s%s", COMMENTH, (opt->timef ? 16 : 8) + timeu + 1, s3[opt->times], sep); @@ -1751,8 +2072,14 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb, if (opt->posf == SOLF_NMEA) { - if (opt->nmeaintv[0] < 0.0) return 0; - if (!screent(sol->time, ts, ts, opt->nmeaintv[0])) return 0; + if (opt->nmeaintv[0] < 0.0) + { + return 0; + } + if (!screent(sol->time, ts, ts, opt->nmeaintv[0])) + { + return 0; + } } if (sol->stat <= SOLQ_NONE || (opt->posf == SOLF_ENU && norm_rtk(rb, 3) <= 0.0)) { @@ -1761,11 +2088,19 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb, timeu = opt->timeu < 0 ? 0 : (opt->timeu > 20 ? 20 : opt->timeu); time = sol->time; - if (opt->times >= TIMES_UTC) time = gpst2utc(time); - if (opt->times == TIMES_JST) time = timeadd(time, 9 * 3600.0); + if (opt->times >= TIMES_UTC) + { + time = gpst2utc(time); + } + if (opt->times == TIMES_JST) + { + time = timeadd(time, 9 * 3600.0); + } if (opt->timef) - time2str(time, s, timeu); + { + time2str(time, s, timeu); + } else { gpst = time2gpst(time, &week); @@ -1815,8 +2150,14 @@ int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat, if (opt->posf == SOLF_NMEA) { - if (opt->nmeaintv[1] < 0.0) return 0; - if (!screent(sol->time, ts, ts, opt->nmeaintv[1])) return 0; + if (opt->nmeaintv[1] < 0.0) + { + return 0; + } + if (!screent(sol->time, ts, ts, opt->nmeaintv[1])) + { + return 0; + } } if (opt->posf == SOLF_NMEA) { diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc index 9b2a0d3e2..48a1564e6 100644 --- a/src/algorithms/libs/rtklib/rtklib_stream.cc +++ b/src/algorithms/libs/rtklib/rtklib_stream.cc @@ -50,15 +50,16 @@ * *----------------------------------------------------------------------------*/ +#include "rtklib_stream.h" +#include "rtklib_rtkcmn.h" +#include "rtklib_solution.h" #include #include #include +#include #include #include #include -#include -#include -#include #include #include #include @@ -96,7 +97,10 @@ serial_t *openserial(const char *path, int mode, char *msg) int rw = 0; tracet(3, "openserial: path=%s mode=%d\n", path, mode); - if (!(serial = static_cast(malloc(sizeof(serial_t))))) return nullptr; + if (!(serial = static_cast(malloc(sizeof(serial_t))))) + { + return nullptr; + } if ((p = strchr(const_cast(path), ':'))) { @@ -105,10 +109,17 @@ serial_t *openserial(const char *path, int mode, char *msg) sscanf(p, ":%d:%d:%c:%d:%s", &brate, &bsize, &parity, &stopb, fctr); } else if (strlen(path) < 128) - strcpy(port, path); + { + strcpy(port, path); + } for (i = 0; i < 10; i++) - if (br[i] == brate) break; + { + if (br[i] == brate) + { + break; + } + } if (i >= 11) { sprintf(msg, "bitrate error (%d)", brate); @@ -122,15 +133,27 @@ serial_t *openserial(const char *path, int mode, char *msg) std::string s_aux = "/dev/" + std::string(port); s_aux.resize(128, '\0'); int n = s_aux.length(); - for (int i = 0; i < n; i++) dev[i] = s_aux[i]; - if (n == 0) dev[0] = '\0'; + for (int i = 0; i < n; i++) + { + dev[i] = s_aux[i]; + } + if (n == 0) + { + dev[0] = '\0'; + } if ((mode & STR_MODE_R) && (mode & STR_MODE_W)) - rw = O_RDWR; + { + rw = O_RDWR; + } else if (mode & STR_MODE_R) - rw = O_RDONLY; + { + rw = O_RDONLY; + } else if (mode & STR_MODE_W) - rw = O_WRONLY; + { + rw = O_WRONLY; + } if ((serial->dev = open(dev, rw | O_NOCTTY | O_NONBLOCK)) < 0) { @@ -160,7 +183,10 @@ serial_t *openserial(const char *path, int mode, char *msg) /* close serial --------------------------------------------------------------*/ void closeserial(serial_t *serial) { - if (!serial) return; + if (!serial) + { + return; + } tracet(3, "closeserial: dev=%d\n", serial->dev); close(serial->dev); free(serial); @@ -171,9 +197,15 @@ void closeserial(serial_t *serial) int readserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribute__((unused))) { int nr; - if (!serial) return 0; + if (!serial) + { + return 0; + } tracet(4, "readserial: dev=%d n=%d\n", serial->dev, n); - if ((nr = read(serial->dev, buff, n)) < 0) return 0; + if ((nr = read(serial->dev, buff, n)) < 0) + { + return 0; + } tracet(5, "readserial: exit dev=%d nr=%d\n", serial->dev, nr); return nr; } @@ -183,9 +215,15 @@ int readserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribu int writeserial(serial_t *serial, unsigned char *buff, int n, char *msg __attribute__((unused))) { int ns; - if (!serial) return 0; + if (!serial) + { + return 0; + } tracet(3, "writeserial: dev=%d n=%d\n", serial->dev, n); - if ((ns = write(serial->dev, buff, n)) < 0) return 0; + if ((ns = write(serial->dev, buff, n)) < 0) + { + return 0; + } tracet(5, "writeserial: exit dev=%d ns=%d\n", serial->dev, ns); return ns; } @@ -226,9 +264,13 @@ int openfile_(file_t *file, gtime_t time, char *msg) createdir(file->openpath); } if (file->mode & STR_MODE_R) - rw = (char *)"rb"; + { + rw = (char *)"rb"; + } else - rw = (char *)"wb"; + { + rw = (char *)"wb"; + } if (!(file->fp = fopen(file->openpath, rw))) { @@ -282,7 +324,10 @@ int openfile_(file_t *file, gtime_t time, char *msg) if ((fp = fopen(tagpath, "rbe"))) { fclose(fp); - if (remove(tagpath) != 0) trace(1, "Error removing file"); + if (remove(tagpath) != 0) + { + trace(1, "Error removing file"); + } } } return 1; @@ -293,10 +338,22 @@ int openfile_(file_t *file, gtime_t time, char *msg) void closefile_(file_t *file) { tracet(3, "closefile_: path=%s\n", file->path); - if (file->fp) fclose(file->fp); - if (file->fp_tag) fclose(file->fp_tag); - if (file->fp_tmp) fclose(file->fp_tmp); - if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); + if (file->fp) + { + fclose(file->fp); + } + if (file->fp_tag) + { + fclose(file->fp_tag); + } + if (file->fp_tmp) + { + fclose(file->fp_tmp); + } + if (file->fp_tag_tmp) + { + fclose(file->fp_tag_tmp); + } file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; } @@ -312,28 +369,54 @@ file_t *openfile(const char *path, int mode, char *msg) tracet(3, "openfile: path=%s mode=%d\n", path, mode); - if (!(mode & (STR_MODE_R | STR_MODE_W))) return nullptr; + if (!(mode & (STR_MODE_R | STR_MODE_W))) + { + return nullptr; + } /* file options */ for (p = const_cast(path); (p = strstr(p, "::")); p += 2) { /* file options */ if (*(p + 2) == 'T') - timetag = 1; + { + timetag = 1; + } else if (*(p + 2) == '+') - sscanf(p + 2, "+%lf", &start); + { + sscanf(p + 2, "+%lf", &start); + } else if (*(p + 2) == 'x') - sscanf(p + 2, "x%lf", &speed); + { + sscanf(p + 2, "x%lf", &speed); + } else if (*(p + 2) == 'S') - sscanf(p + 2, "S=%lf", &swapintv); + { + sscanf(p + 2, "S=%lf", &swapintv); + } + } + if (start <= 0.0) + { + start = 0.0; + } + if (swapintv <= 0.0) + { + swapintv = 0.0; } - if (start <= 0.0) start = 0.0; - if (swapintv <= 0.0) swapintv = 0.0; - if (!(file = static_cast(malloc(sizeof(file_t))))) return nullptr; + if (!(file = static_cast(malloc(sizeof(file_t))))) + { + return nullptr; + } file->fp = file->fp_tag = file->fp_tmp = file->fp_tag_tmp = nullptr; - if (strlen(path) < MAXSTRPATH) strcpy(file->path, path); - if ((p = strstr(file->path, "::"))) *p = '\0'; + if (strlen(path) < MAXSTRPATH) + { + strcpy(file->path, path); + } + if ((p = strstr(file->path, "::"))) + { + *p = '\0'; + } file->openpath[0] = '\0'; file->mode = mode; file->timetag = timetag; @@ -361,7 +444,10 @@ file_t *openfile(const char *path, int mode, char *msg) /* close file ----------------------------------------------------------------*/ void closefile(file_t *file) { - if (!file) return; + if (!file) + { + return; + } tracet(3, "closefile: fp=%d\n", file->fp); closefile_(file); free(file); @@ -376,7 +462,10 @@ void swapfile(file_t *file, gtime_t time, char *msg) tracet(3, "swapfile: fp=%d time=%s\n", file->fp, time_str(time, 0)); /* return if old swap file open */ - if (file->fp_tmp || file->fp_tag_tmp) return; + if (file->fp_tmp || file->fp_tag_tmp) + { + return; + } /* check path of new swap file */ reppath(file->path, openpath, time, "", ""); @@ -399,8 +488,14 @@ void swapfile(file_t *file, gtime_t time, char *msg) void swapclose(file_t *file) { tracet(3, "swapclose: fp_tmp=%d\n", file->fp_tmp); - if (file->fp_tmp) fclose(file->fp_tmp); - if (file->fp_tag_tmp) fclose(file->fp_tag_tmp); + if (file->fp_tmp) + { + fclose(file->fp_tmp); + } + if (file->fp_tag_tmp) + { + fclose(file->fp_tag_tmp); + } file->fp_tmp = file->fp_tag_tmp = nullptr; } @@ -421,7 +516,10 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) int nr = 0; size_t fpos; - if (!file) return 0; + if (!file) + { + return 0; + } tracet(4, "readfile: fp=%d nmax=%d\n", file->fp, nmax); if (file->fp == stdin) @@ -429,8 +527,14 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) /* input from stdin */ FD_ZERO(&rs); FD_SET(0, &rs); - if (!select(1, &rs, nullptr, nullptr, &tv)) return 0; - if ((nr = read(0, buff, nmax)) < 0) return 0; + if (!select(1, &rs, nullptr, nullptr, &tv)) + { + return 0; + } + if ((nr = read(0, buff, nmax)) < 0) + { + return 0; + } return nr; } if (file->fp_tag) @@ -448,21 +552,33 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) if (fread(&tick, sizeof(tick), 1, file->fp_tag) < 1 || fread(&fpos, sizeof(fpos), 1, file->fp_tag) < 1) { - if (fseek(file->fp, 0, SEEK_END) != 0) trace(1, "fseek error"); + if (fseek(file->fp, 0, SEEK_END) != 0) + { + trace(1, "fseek error"); + } sprintf(msg, "end"); break; } if (file->repmode || file->speed > 0.0) { - if (static_cast(tick - t) < 1) continue; + if (static_cast(tick - t) < 1) + { + continue; + } + } + if (!file->repmode) + { + tick_master = tick; } - if (!file->repmode) tick_master = tick; sprintf(msg, "T%+.1fs", static_cast(tick) < 0 ? 0.0 : static_cast(tick) / 1000.0); if (static_cast(fpos - file->fpos) >= nmax) { - if (fseek(file->fp, fpos, SEEK_SET) != 0) trace(1, "Error fseek"); + if (fseek(file->fp, fpos, SEEK_SET) != 0) + { + trace(1, "Error fseek"); + } file->fpos = fpos; return 0; } @@ -470,7 +586,10 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) if (file->repmode || file->speed > 0.0) { - if (fseek(file->fp_tag, -static_cast(sizeof(tick) + sizeof(fpos)), SEEK_CUR) != 0) trace(1, "Error fseek"); + if (fseek(file->fp_tag, -static_cast(sizeof(tick) + sizeof(fpos)), SEEK_CUR) != 0) + { + trace(1, "Error fseek"); + } } break; } @@ -479,7 +598,10 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) { nr = fread(buff, 1, nmax, file->fp); file->fpos += nr; - if (nr <= 0) sprintf(msg, "end"); + if (nr <= 0) + { + sprintf(msg, "end"); + } } tracet(5, "readfile: fp=%d nr=%d fpos=%d\n", file->fp, nr, file->fpos); return nr; @@ -495,7 +617,10 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg) double tow1, tow2, intv; size_t fpos, fpos_tmp; - if (!file) return 0; + if (!file) + { + return 0; + } tracet(3, "writefile: fp=%d n=%d\n", file->fp, n); wtime = utc2gpst(timeget()); /* write time in gpst */ @@ -519,7 +644,10 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg) swapclose(file); } } - if (!file->fp) return 0; + if (!file->fp) + { + return 0; + } ns = fwrite(buff, 1, n, file->fp); fpos = ftell(file->fp); @@ -555,7 +683,10 @@ int writefile(file_t *file, unsigned char *buff, int n, char *msg) /* sync files by time-tag ----------------------------------------------------*/ void syncfile(file_t *file1, file_t *file2) { - if (!file1->fp_tag || !file2->fp_tag) return; + if (!file1->fp_tag || !file2->fp_tag) + { + return; + } file1->repmode = 0; file2->repmode = 1; file2->offset = static_cast(file1->tick_f - file2->tick_f); @@ -570,25 +701,52 @@ void decodetcppath(const char *path, char *addr, char *port, char *user, tracet(4, "decodetcpepath: path=%s\n", path); - if (port) *port = '\0'; - if (user) *user = '\0'; - if (passwd) *passwd = '\0'; - if (mntpnt) *mntpnt = '\0'; - if (str) *str = '\0'; + if (port) + { + *port = '\0'; + } + if (user) + { + *user = '\0'; + } + if (passwd) + { + *passwd = '\0'; + } + if (mntpnt) + { + *mntpnt = '\0'; + } + if (str) + { + *str = '\0'; + } - if (strlen(path) < MAXSTRPATH) strcpy(buff, path); + if (strlen(path) < MAXSTRPATH) + { + strcpy(buff, path); + } - if (!(p = strrchr(buff, '@'))) p = buff; + if (!(p = strrchr(buff, '@'))) + { + p = buff; + } if ((p = strchr(p, '/'))) { if ((q = strchr(p + 1, ':'))) { *q = '\0'; - if (str) strcpy(str, q + 1); + if (str) + { + strcpy(str, q + 1); + } } *p = '\0'; - if (mntpnt) strcpy(mntpnt, p + 1); + if (mntpnt) + { + strcpy(mntpnt, p + 1); + } } if ((p = strrchr(buff, '@'))) { @@ -596,19 +754,33 @@ void decodetcppath(const char *path, char *addr, char *port, char *user, if ((q = strchr(buff, ':'))) { *q = '\0'; - if (passwd) strcpy(passwd, q + 1); + if (passwd) + { + strcpy(passwd, q + 1); + } + } + if (user) + { + strcpy(user, buff); } - if (user) strcpy(user, buff); } else - p = buff; + { + p = buff; + } if ((q = strchr(p, ':'))) { *q = '\0'; - if (port) strcpy(port, q + 1); + if (port) + { + strcpy(port, q + 1); + } + } + if (addr) + { + strcpy(addr, p); } - if (addr) strcpy(addr, p); } @@ -654,7 +826,10 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; + if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) + { + return 0; + } return accept(sock, addr, len); } @@ -667,15 +842,24 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len) int err, flag; flag = fcntl(sock, F_GETFL, 0); - if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1) trace(1, "fcntl error"); + if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1) + { + trace(1, "fcntl error"); + } if (connect(sock, addr, len) == -1) { err = errsock(); - if (err != EISCONN && err != EINPROGRESS && err != EALREADY) return -1; + if (err != EISCONN && err != EINPROGRESS && err != EALREADY) + { + return -1; + } FD_ZERO(&rs); FD_SET(sock, &rs); ws = rs; - if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) return 0; + if (select(sock + 1, &rs, &ws, nullptr, &tv) == 0) + { + return 0; + } } return 1; } @@ -688,7 +872,10 @@ int recv_nb(socket_t sock, unsigned char *buff, int n) fd_set rs; FD_ZERO(&rs); FD_SET(sock, &rs); - if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) return 0; + if (!select(sock + 1, &rs, nullptr, nullptr, &tv)) + { + return 0; + } return recv(sock, reinterpret_cast(buff), n, 0); } @@ -700,7 +887,10 @@ int send_nb(socket_t sock, unsigned char *buff, int n) fd_set ws; FD_ZERO(&ws); FD_SET(sock, &ws); - if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) return 0; + if (!select(sock + 1, nullptr, &ws, nullptr, &tv)) + { + return 0; + } return send(sock, reinterpret_cast(buff), n, 0); } @@ -790,7 +980,10 @@ tcpsvr_t *opentcpsvr(const char *path, char *msg) tcpsvr0 = {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}, {{0, {0}, 0, {0, 0, 0, {0}}, 0, 0, 0, 0}}}; tracet(3, "opentcpsvr: path=%s\n", path); - if (!(tcpsvr = static_cast(malloc(sizeof(tcpsvr_t))))) return nullptr; + if (!(tcpsvr = static_cast(malloc(sizeof(tcpsvr_t))))) + { + return nullptr; + } *tcpsvr = tcpsvr0; decodetcppath(path, tcpsvr->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); if (sscanf(port, "%d", &tcpsvr->svr.port) < 1) @@ -817,7 +1010,10 @@ void closetcpsvr(tcpsvr_t *tcpsvr) tracet(3, "closetcpsvr:\n"); for (i = 0; i < MAXCLI; i++) { - if (tcpsvr->cli[i].state) closesocket(tcpsvr->cli[i].sock); + if (tcpsvr->cli[i].state) + { + closesocket(tcpsvr->cli[i].sock); + } } closesocket(tcpsvr->svr.sock); free(tcpsvr); @@ -832,14 +1028,23 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) tracet(3, "updatetcpsvr: state=%d\n", tcpsvr->svr.state); - if (tcpsvr->svr.state == 0) return; + if (tcpsvr->svr.state == 0) + { + return; + } for (i = 0; i < MAXCLI; i++) { - if (tcpsvr->cli[i].state) continue; + if (tcpsvr->cli[i].state) + { + continue; + } for (j = i + 1; j < MAXCLI; j++) { - if (!tcpsvr->cli[j].state) continue; + if (!tcpsvr->cli[j].state) + { + continue; + } tcpsvr->cli[i] = tcpsvr->cli[j]; tcpsvr->cli[j].state = 0; break; @@ -847,7 +1052,10 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) } for (i = 0; i < MAXCLI; i++) { - if (!tcpsvr->cli[i].state) continue; + if (!tcpsvr->cli[i].state) + { + continue; + } strcpy(saddr, tcpsvr->cli[i].saddr); n++; } @@ -859,9 +1067,13 @@ void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg) } tcpsvr->svr.state = 2; if (n == 1) - sprintf(msg, "%s", saddr); + { + sprintf(msg, "%s", saddr); + } else - sprintf(msg, "%d clients", n); + { + sprintf(msg, "%d clients", n); + } } @@ -878,8 +1090,16 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) tracet(3, "accsock: sock=%d\n", tcpsvr->svr.sock); for (i = 0; i < MAXCLI; i++) - if (tcpsvr->cli[i].state == 0) break; - if (i >= MAXCLI) return 0; /* too many client */ + { + if (tcpsvr->cli[i].state == 0) + { + break; + } + } + if (i >= MAXCLI) + { + return 0; /* too many client */ + } if ((sock = accept_nb(tcpsvr->svr.sock, reinterpret_cast(&addr), &len)) == -1) { @@ -890,12 +1110,21 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) tcpsvr->svr.state = 0; return 0; } - if (sock == 0) return 0; + if (sock == 0) + { + return 0; + } tcpsvr->cli[i].sock = sock; - if (!setsock(tcpsvr->cli[i].sock, msg)) return 0; + if (!setsock(tcpsvr->cli[i].sock, msg)) + { + return 0; + } memcpy(&tcpsvr->cli[i].addr, &addr, sizeof(addr)); - if (strlen(inet_ntoa(addr.sin_addr)) < 256) strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr)); + if (strlen(inet_ntoa(addr.sin_addr)) < 256) + { + strcpy(tcpsvr->cli[i].saddr, inet_ntoa(addr.sin_addr)); + } sprintf(msg, "%s", tcpsvr->cli[i].saddr); tracet(2, "accsock: connected sock=%d addr=%s\n", tcpsvr->cli[i].sock, tcpsvr->cli[i].saddr); tcpsvr->cli[i].state = 2; @@ -908,9 +1137,14 @@ int accsock(tcpsvr_t *tcpsvr, char *msg) int waittcpsvr(tcpsvr_t *tcpsvr, char *msg) { tracet(4, "waittcpsvr: sock=%d state=%d\n", tcpsvr->svr.sock, tcpsvr->svr.state); - if (tcpsvr->svr.state <= 0) return 0; + if (tcpsvr->svr.state <= 0) + { + return 0; + } while (accsock(tcpsvr, msg)) - ; + { + ; + } updatetcpsvr(tcpsvr, msg); return tcpsvr->svr.state == 2; } @@ -923,7 +1157,10 @@ int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) tracet(4, "readtcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n); - if (!waittcpsvr(tcpsvr, msg) || tcpsvr->cli[0].state != 2) return 0; + if (!waittcpsvr(tcpsvr, msg) || tcpsvr->cli[0].state != 2) + { + return 0; + } if ((nr = recv_nb(tcpsvr->cli[0].sock, buff, n)) == -1) { @@ -934,7 +1171,10 @@ int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) updatetcpsvr(tcpsvr, msg); return 0; } - if (nr > 0) tcpsvr->cli[0].tact = tickget(); + if (nr > 0) + { + tcpsvr->cli[0].tact = tickget(); + } tracet(5, "readtcpsvr: exit sock=%d nr=%d\n", tcpsvr->cli[0].sock, nr); return nr; } @@ -947,11 +1187,17 @@ int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) tracet(3, "writetcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n); - if (!waittcpsvr(tcpsvr, msg)) return 0; + if (!waittcpsvr(tcpsvr, msg)) + { + return 0; + } for (i = 0; i < MAXCLI; i++) { - if (tcpsvr->cli[i].state != 2) continue; + if (tcpsvr->cli[i].state != 2) + { + continue; + } if ((ns = send_nb(tcpsvr->cli[i].sock, buff, n)) == -1) { @@ -962,7 +1208,10 @@ int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg) updatetcpsvr(tcpsvr, msg); return 0; } - if (ns > 0) tcpsvr->cli[i].tact = tickget(); + if (ns > 0) + { + tcpsvr->cli[i].tact = tickget(); + } tracet(5, "writetcpsvr: send i=%d ns=%d\n", i, ns); } return ns; @@ -1022,7 +1271,10 @@ tcpcli_t *opentcpcli(const char *path, char *msg) tracet(3, "opentcpcli: path=%s\n", path); - if (!(tcpcli = static_cast(malloc(sizeof(tcpcli_t))))) return nullptr; + if (!(tcpcli = static_cast(malloc(sizeof(tcpcli_t))))) + { + return nullptr; + } *tcpcli = tcpcli0; decodetcppath(path, tcpcli->svr.saddr, port, nullptr, nullptr, nullptr, nullptr); if (sscanf(port, "%d", &tcpcli->svr.port) < 1) @@ -1053,15 +1305,24 @@ int waittcpcli(tcpcli_t *tcpcli, char *msg) { tracet(4, "waittcpcli: sock=%d state=%d\n", tcpcli->svr.sock, tcpcli->svr.state); - if (tcpcli->svr.state < 0) return 0; + if (tcpcli->svr.state < 0) + { + return 0; + } if (tcpcli->svr.state == 0) { /* close */ - if (!gentcp(&tcpcli->svr, 1, msg)) return 0; + if (!gentcp(&tcpcli->svr, 1, msg)) + { + return 0; + } } if (tcpcli->svr.state == 1) { /* wait */ - if (!consock(tcpcli, msg)) return 0; + if (!consock(tcpcli, msg)) + { + return 0; + } } if (tcpcli->svr.state == 2) { /* connect */ @@ -1085,7 +1346,10 @@ int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) tracet(4, "readtcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n); - if (!waittcpcli(tcpcli, msg)) return 0; + if (!waittcpcli(tcpcli, msg)) + { + return 0; + } if ((nr = recv_nb(tcpcli->svr.sock, buff, n)) == -1) { @@ -1095,7 +1359,10 @@ int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) discontcp(&tcpcli->svr, tcpcli->tirecon); return 0; } - if (nr > 0) tcpcli->svr.tact = tickget(); + if (nr > 0) + { + tcpcli->svr.tact = tickget(); + } tracet(5, "readtcpcli: exit sock=%d nr=%d\n", tcpcli->svr.sock, nr); return nr; } @@ -1108,7 +1375,10 @@ int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) tracet(3, "writetcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n); - if (!waittcpcli(tcpcli, msg)) return 0; + if (!waittcpcli(tcpcli, msg)) + { + return 0; + } if ((ns = send_nb(tcpcli->svr.sock, buff, n)) == -1) { @@ -1118,7 +1388,10 @@ int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg) discontcp(&tcpcli->svr, tcpcli->tirecon); return 0; } - if (ns > 0) tcpcli->svr.tact = tickget(); + if (ns > 0) + { + tcpcli->svr.tact = tickget(); + } tracet(5, "writetcpcli: exit sock=%d ns=%d\n", tcpcli->svr.sock, ns); return ns; } @@ -1145,11 +1418,17 @@ int encbase64(char *str, const unsigned char *byte, int n) for (k = b = 0; k < 6; k++, i++) { b <<= 1; - if (i / 8 < n) b |= (byte[i / 8] >> (7 - i % 8)) & 0x1; + if (i / 8 < n) + { + b |= (byte[i / 8] >> (7 - i % 8)) & 0x1; + } } str[j++] = table[b]; } - while (j & 0x3) str[j++] = '='; + while (j & 0x3) + { + str[j++] = '='; + } str[j] = '\0'; tracet(5, "encbase64: str=%s\n", str); return j; @@ -1168,7 +1447,10 @@ int reqntrip_s(ntrip_t *ntrip, char *msg) p += sprintf(p, "STR: %s\r\n", ntrip->str); p += sprintf(p, "\r\n"); - if (writetcpcli(ntrip->tcp, reinterpret_cast(buff), p - buff, msg) != p - buff) return 0; + if (writetcpcli(ntrip->tcp, reinterpret_cast(buff), p - buff, msg) != p - buff) + { + return 0; + } tracet(2, "reqntrip_s: send request state=%d ns=%d\n", ntrip->state, p - buff); tracet(5, "reqntrip_s: n=%d buff=\n%s\n", p - buff, buff); @@ -1201,7 +1483,10 @@ int reqntrip_c(ntrip_t *ntrip, char *msg) } p += sprintf(p, "\r\n"); - if (writetcpcli(ntrip->tcp, reinterpret_cast(buff), p - buff, msg) != p - buff) return 0; + if (writetcpcli(ntrip->tcp, reinterpret_cast(buff), p - buff, msg) != p - buff) + { + return 0; + } tracet(2, "reqntrip_c: send request state=%d ns=%d\n", ntrip->state, p - buff); tracet(5, "reqntrip_c: n=%d buff=\n%s\n", p - buff, buff); @@ -1225,7 +1510,10 @@ int rspntrip_s(ntrip_t *ntrip, char *msg) q = reinterpret_cast(ntrip->buff); p += strlen(NTRIP_RSP_OK_SVR); ntrip->nb -= p - q; - for (i = 0; i < ntrip->nb; i++) *q++ = *p++; + for (i = 0; i < ntrip->nb; i++) + { + *q++ = *p++; + } ntrip->state = 2; sprintf(msg, "%s/%s", ntrip->tcp->svr.saddr, ntrip->mntpnt); tracet(2, "rspntrip_s: response ok nb=%d\n", ntrip->nb); @@ -1237,7 +1525,10 @@ int rspntrip_s(ntrip_t *ntrip, char *msg) // strncpy(msg, (char *)ntrip->buff, nb); This line triggers a warning. Replaced by; std::string s_aux(reinterpret_cast(ntrip->buff)); s_aux.resize(nb, '\0'); - for (int i = 0; i < nb; i++) msg[i] = s_aux[i]; + for (int i = 0; i < nb; i++) + { + msg[i] = s_aux[i]; + } msg[nb] = 0; tracet(1, "rspntrip_s: %s nb=%d\n", msg, ntrip->nb); @@ -1275,7 +1566,10 @@ int rspntrip_c(ntrip_t *ntrip, char *msg) q = reinterpret_cast(ntrip->buff); p += strlen(NTRIP_RSP_OK_CLI); ntrip->nb -= p - q; - for (i = 0; i < ntrip->nb; i++) *q++ = *p++; + for (i = 0; i < ntrip->nb; i++) + { + *q++ = *p++; + } ntrip->state = 2; sprintf(msg, "%s/%s", ntrip->tcp->svr.saddr, ntrip->mntpnt); tracet(2, "rspntrip_c: response ok nb=%d\n", ntrip->nb); @@ -1300,9 +1594,13 @@ int rspntrip_c(ntrip_t *ntrip, char *msg) else if ((p = strstr(reinterpret_cast(ntrip->buff), NTRIP_RSP_HTTP))) { /* http response */ if ((q = strchr(p, '\r'))) - *q = '\0'; + { + *q = '\0'; + } else - ntrip->buff[128] = '\0'; + { + ntrip->buff[128] = '\0'; + } strcpy(msg, p); tracet(1, "rspntrip_s: %s nb=%d\n", msg, ntrip->nb); ntrip->nb = 0; @@ -1332,9 +1630,15 @@ int waitntrip(ntrip_t *ntrip, char *msg) tracet(4, "waitntrip: state=%d nb=%d\n", ntrip->state, ntrip->nb); - if (ntrip->state < 0) return 0; /* error */ + if (ntrip->state < 0) + { + return 0; /* error */ + } - if (ntrip->tcp->svr.state < 2) ntrip->state = 0; /* tcp disconnected */ + if (ntrip->tcp->svr.state < 2) + { + ntrip->state = 0; /* tcp disconnected */ + } if (ntrip->state == 0) { /* send request */ @@ -1371,14 +1675,20 @@ ntrip_t *openntrip(const char *path, int type, char *msg) tracet(3, "openntrip: path=%s type=%d\n", path, type); - if (!(ntrip = static_cast(malloc(sizeof(ntrip_t))))) return nullptr; + if (!(ntrip = static_cast(malloc(sizeof(ntrip_t))))) + { + return nullptr; + } ntrip->state = 0; ntrip->type = type; /* 0:server, 1:client */ ntrip->nb = 0; ntrip->url[0] = '\0'; ntrip->mntpnt[0] = ntrip->user[0] = ntrip->passwd[0] = ntrip->str[0] = '\0'; - for (i = 0; i < NTRIP_MAXRSP; i++) ntrip->buff[i] = 0; + for (i = 0; i < NTRIP_MAXRSP; i++) + { + ntrip->buff[i] = 0; + } /* decode tcp/ntrip path */ decodetcppath(path, addr, port, ntrip->user, ntrip->passwd, ntrip->mntpnt, @@ -1398,7 +1708,12 @@ ntrip_t *openntrip(const char *path, int type, char *msg) std::string s_aux = "http://" + std::string(tpath); int n = s_aux.length(); if (n < 256) - for (int k = 0; k < n; k++) ntrip->url[k] = s_aux[k]; + { + for (int k = 0; k < n; k++) + { + ntrip->url[k] = s_aux[k]; + } + } strcpy(tpath, proxyaddr); } /* open tcp client stream */ @@ -1428,7 +1743,10 @@ int readntrip(ntrip_t *ntrip, unsigned char *buff, int n, char *msg) tracet(4, "readntrip: n=%d\n", n); - if (!waitntrip(ntrip, msg)) return 0; + if (!waitntrip(ntrip, msg)) + { + return 0; + } if (ntrip->nb > 0) { /* read response buffer first */ nb = ntrip->nb <= n ? ntrip->nb : n; @@ -1445,7 +1763,10 @@ int writentrip(ntrip_t *ntrip, unsigned char *buff, int n, char *msg) { tracet(3, "writentrip: n=%d\n", n); - if (!waitntrip(ntrip, msg)) return 0; + if (!waitntrip(ntrip, msg)) + { + return 0; + } return writetcpcli(ntrip->tcp, buff, n, msg); } @@ -1465,8 +1786,14 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, tracet(4, "decodeftpath: path=%s\n", path); - if (user) *user = '\0'; - if (passwd) *passwd = '\0'; + if (user) + { + *user = '\0'; + } + if (passwd) + { + *passwd = '\0'; + } if (topts) { topts[0] = 0; /* time offset in path (s) */ @@ -1474,20 +1801,28 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, topts[2] = 0; /* download time offset (s) */ topts[3] = 0; /* retry interval (s) (0: no retry) */ } - if (strlen(path) < MAXSTRPATH) strcpy(buff, path); + if (strlen(path) < MAXSTRPATH) + { + strcpy(buff, path); + } if ((p = strchr(buff, '/'))) { if ((q = strstr(p + 1, "::"))) { *q = '\0'; - if (topts) sscanf(q + 2, "T=%d, %d, %d, %d", topts, topts + 1, topts + 2, topts + 3); + if (topts) + { + sscanf(q + 2, "T=%d, %d, %d, %d", topts, topts + 1, topts + 2, topts + 3); + } } strcpy(file, p + 1); *p = '\0'; } else - file[0] = '\0'; + { + file[0] = '\0'; + } if ((p = strrchr(buff, '@'))) { @@ -1495,12 +1830,20 @@ void decodeftppath(const char *path, char *addr, char *file, char *user, if ((q = strchr(buff, ':'))) { *q = '\0'; - if (passwd) strcpy(passwd, q + 1); + if (passwd) + { + strcpy(passwd, q + 1); + } + } + if (user) + { + strcpy(user, buff); } - if (user) strcpy(user, buff); } else - p = buff; + { + p = buff; + } strcpy(addr, p); } @@ -1559,20 +1902,34 @@ void *ftpthread(void *arg) reppath(ftp->file, remote, time, "", ""); if ((p = strrchr(remote, '/'))) - p++; + { + p++; + } else - p = remote; + { + p = remote; + } // sprintf(local, "%s%c%s", localdir, FILEPATHSEP, p); This line triggers a warning. Replaced by: std::string s_aux = std::string(localdir) + std::to_string(FILEPATHSEP) + std::string(p); int n = s_aux.length(); if (n < 1024) - for (int i = 0; i < n; i++) local[i] = s_aux[i]; + { + for (int i = 0; i < n; i++) + { + local[i] = s_aux[i]; + } + } // sprintf(errfile, "%s.err", local); This line triggers a warning. Replaced by: std::string s_aux2 = std::string(local) + ".err"; n = s_aux2.length(); if (n < 1024) - for (int i = 0; i < n; i++) errfile[i] = s_aux2[i]; + { + for (int i = 0; i < n; i++) + { + errfile[i] = s_aux2[i]; + } + } /* if local file exist, skip download */ strcpy(tmpfile, local); @@ -1607,39 +1964,59 @@ void *ftpthread(void *arg) " -O \"" + std::string(local) + "\""; int k = s_aux.length(); if (k < 1024) - for (int i = 0; i < k; i++) opt[i] = s_aux[i]; + { + for (int i = 0; i < k; i++) + { + opt[i] = s_aux[i]; + } + } // sprintf(cmd, "%s%s %s \"ftp://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, // remote, errfile); This line triggers a warning. Replaced by: std::string s_aux2 = std::string(env) + std::string(FTP_CMD) + " " + std::string(opt) + " " + "\"ftp://" + std::string(ftp->addr) + "/" + std::string(remote) + "\" 2> \"" + std::string(errfile) + "\"\n"; k = s_aux2.length(); - for (int i = 0; (i < k) && (i < 1024); i++) cmd[i] = s_aux2[i]; + for (int i = 0; (i < k) && (i < 1024); i++) + { + cmd[i] = s_aux2[i]; + } } else { /* http */ // sprintf(opt, "%s-t 1 -T %d -O \"%s\"", proxyopt, FTP_TIMEOUT, local); This line triggers a warning. Replaced by: std::string s_aux = std::string(proxyopt) + " -t 1 -T " + std::to_string(FTP_TIMEOUT) + " -O \"" + std::string(local) + "\""; int l = s_aux.length(); - for (int i = 0; (i < l) && (i < 1024); i++) opt[i] = s_aux[i]; + for (int i = 0; (i < l) && (i < 1024); i++) + { + opt[i] = s_aux[i]; + } // sprintf(cmd, "%s%s %s \"http://%s/%s\" 2> \"%s\"\n", env, FTP_CMD, opt, ftp->addr, // remote, errfile); This line triggers a warning. Replaced by: std::string s_aux2 = std::string(env) + std::string(FTP_CMD) + " " + std::string(opt) + " " + "\"http://" + std::string(ftp->addr) + "/" + std::string(remote) + "\" 2> \"" + std::string(errfile) + "\"\n"; l = s_aux2.length(); - for (int i = 0; (i < l) && (i < 1024); i++) cmd[i] = s_aux2[i]; + for (int i = 0; (i < l) && (i < 1024); i++) + { + cmd[i] = s_aux2[i]; + } } /* execute download command */ if ((ret = execcmd(cmd))) { - if (remove(local) != 0) trace(1, "Error removing file"); + if (remove(local) != 0) + { + trace(1, "Error removing file"); + } tracet(1, "execcmd error: cmd=%s ret=%d\n", cmd, ret); ftp->error = ret; ftp->state = 3; return nullptr; } - if (remove(errfile) != 0) trace(1, "Error removing file"); + if (remove(errfile) != 0) + { + trace(1, "Error removing file"); + } /* uncompress downloaded file */ if ((p = strrchr(local, '.')) && @@ -1648,8 +2025,14 @@ void *ftpthread(void *arg) { if (rtk_uncompress(local, tmpfile)) { - if (remove(local) != 0) trace(1, "Error removing file"); - if (strlen(tmpfile) < 1024) strcpy(local, tmpfile); + if (remove(local) != 0) + { + trace(1, "Error removing file"); + } + if (strlen(tmpfile) < 1024) + { + strcpy(local, tmpfile); + } } else { @@ -1659,7 +2042,10 @@ void *ftpthread(void *arg) return nullptr; } } - if (strlen(local) < 1024) strcpy(ftp->local, local); + if (strlen(local) < 1024) + { + strcpy(ftp->local, local); + } ftp->state = 2; /* ftp completed */ tracet(3, "ftpthread: complete cmd=%s\n", cmd); @@ -1676,7 +2062,10 @@ ftp_t *openftp(const char *path, int type, char *msg) msg[0] = '\0'; - if (!(ftp = static_cast(malloc(sizeof(ftp_t))))) return nullptr; + if (!(ftp = static_cast(malloc(sizeof(ftp_t))))) + { + return nullptr; + } ftp->state = 0; ftp->proto = type; @@ -1699,7 +2088,10 @@ void closeftp(ftp_t *ftp) { tracet(3, "closeftp: state=%d\n", ftp->state); - if (ftp->state != 1) free(ftp); + if (ftp->state != 1) + { + free(ftp); + } } @@ -1730,7 +2122,10 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) return 0; } } - if (ftp->state <= 1) return 0; /* ftp/http on going? */ + if (ftp->state <= 1) + { + return 0; /* ftp/http on going? */ + } if (ftp->state == 3) { /* ftp error */ @@ -1744,7 +2139,10 @@ int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg) /* return local file path if ftp completed */ p = buff; q = reinterpret_cast(ftp->local); - while (*q && static_cast(p - buff) < n) *p++ = *q++; + while (*q && static_cast(p - buff) < n) + { + *p++ = *q++; + } p += sprintf(reinterpret_cast(p), "\r\n"); /* set next download time */ @@ -1837,7 +2235,10 @@ int stropen(stream_t *stream, int type, int mode, const char *path) stream->type = type; stream->mode = mode; - if (strlen(path) < MAXSTRPATH) strcpy(stream->path, path); + if (strlen(path) < MAXSTRPATH) + { + strcpy(stream->path, path); + } stream->inb = stream->inr = stream->outb = stream->outr = 0; stream->tick = tickget(); stream->inbt = stream->outbt = 0; @@ -1941,10 +2342,16 @@ void strclose(stream_t *stream) void strsync(stream_t *stream1, stream_t *stream2) { file_t *file1, *file2; - if (stream1->type != STR_FILE || stream2->type != STR_FILE) return; + if (stream1->type != STR_FILE || stream2->type != STR_FILE) + { + return; + } file1 = static_cast(stream1->port); file2 = static_cast(stream2->port); - if (file1 && file2) syncfile(file1, file2); + if (file1 && file2) + { + syncfile(file1, file2); + } } @@ -1974,7 +2381,10 @@ int strread(stream_t *stream, unsigned char *buff, int n) tracet(4, "strread: n=%d\n", n); - if (!(stream->mode & STR_MODE_R) || !stream->port) return 0; + if (!(stream->mode & STR_MODE_R) || !stream->port) + { + return 0; + } strlock(stream); @@ -2007,7 +2417,10 @@ int strread(stream_t *stream, unsigned char *buff, int n) } stream->inb += nr; tick = tickget(); - if (nr > 0) stream->tact = tick; + if (nr > 0) + { + stream->tact = tick; + } if (static_cast(tick - stream->tick) >= tirate) { @@ -2036,7 +2449,10 @@ int strwrite(stream_t *stream, unsigned char *buff, int n) tracet(3, "strwrite: n=%d\n", n); - if (!(stream->mode & STR_MODE_W) || !stream->port) return 0; + if (!(stream->mode & STR_MODE_W) || !stream->port) + { + return 0; + } strlock(stream); @@ -2066,7 +2482,10 @@ int strwrite(stream_t *stream, unsigned char *buff, int n) } stream->outb += ns; tick = tickget(); - if (ns > 0) stream->tact = tick; + if (ns > 0) + { + stream->tact = tick; + } if (static_cast(tick - stream->tick) > tirate) { @@ -2097,7 +2516,10 @@ int strstat(stream_t *stream, char *msg) // strncpy(msg, stream->msg, MAXSTRMSG - 1); This line triggers a warning. Replaced by: std::string aux_s(stream->msg); aux_s.resize(MAXSTRMSG - 1, '0'); - for (int i = 0; i < MAXSTRMSG - 1; i++) msg[i] = aux_s[i]; + for (int i = 0; i < MAXSTRMSG - 1; i++) + { + msg[i] = aux_s[i]; + } msg[MAXSTRMSG - 1] = '\0'; } if (!stream->port) @@ -2133,7 +2555,10 @@ int strstat(stream_t *stream, char *msg) strunlock(stream); return 0; } - if (state == 2 && static_cast(tickget() - stream->tact) <= TINTACT) state = 3; + if (state == 2 && static_cast(tickget() - stream->tact) <= TINTACT) + { + state = 3; + } strunlock(stream); return state; } @@ -2153,10 +2578,22 @@ void strsum(stream_t *stream, int *inb, int *inr, int *outb, int *outr) tracet(4, "strsum:\n"); strlock(stream); - if (inb) *inb = stream->inb; - if (inr) *inr = stream->inr; - if (outb) *outb = stream->outb; - if (outr) *outr = stream->outr; + if (inb) + { + *inb = stream->inb; + } + if (inr) + { + *inr = stream->inr; + } + if (outb) + { + *outb = stream->outb; + } + if (outr) + { + *outr = stream->outr; + } strunlock(stream); } @@ -2209,7 +2646,9 @@ void strsettimeout(stream_t *stream, int toinact, int tirecon) tcpcli = (static_cast(stream->port))->tcp; } else - return; + { + return; + } tcpcli->toinact = toinact; tcpcli->tirecon = tirecon; @@ -2224,7 +2663,10 @@ void strsettimeout(stream_t *stream, int toinact, int tirecon) void strsetdir(const char *dir) { tracet(3, "strsetdir: dir=%s\n", dir); - if (strlen(dir) < 1024) strcpy(localdir, dir); + if (strlen(dir) < 1024) + { + strcpy(localdir, dir); + } } @@ -2236,7 +2678,10 @@ void strsetdir(const char *dir) void strsetproxy(const char *addr) { tracet(3, "strsetproxy: addr=%s\n", addr); - if (strlen(addr) < 256) strcpy(proxyaddr, addr); + if (strlen(addr) < 256) + { + strcpy(proxyaddr, addr); + } } @@ -2273,7 +2718,10 @@ void strsendnmea(stream_t *stream, const double *pos) sol.stat = SOLQ_SINGLE; sol.time = utc2gpst(timeget()); - for (i = 0; i < 3; i++) sol.rr[i] = pos[i]; + for (i = 0; i < 3; i++) + { + sol.rr[i] = pos[i]; + } n = outnmea_gga(buff, &sol); strwrite(stream, buff, n); } @@ -2296,7 +2744,10 @@ int gen_hex(const char *msg, unsigned char *buff) } for (i = 0; i < narg; i++) { - if (sscanf(args[i], "%x", &byte)) *q++ = static_cast(byte); + if (sscanf(args[i], "%x", &byte)) + { + *q++ = static_cast(byte); + } } return static_cast(q - buff); } @@ -2320,7 +2771,12 @@ void strsendcmd(stream_t *str, const char *cmd) for (;;) { for (q = p;; q++) - if (*q == '\r' || *q == '\n' || *q == '\0') break; + { + if (*q == '\r' || *q == '\n' || *q == '\0') + { + break; + } + } n = static_cast(q - p); strncpy(msg, p, n); msg[n] = '\0'; @@ -2333,8 +2789,14 @@ void strsendcmd(stream_t *str, const char *cmd) { /* binary escape */ if (!strncmp(msg + 1, "WAIT", 4)) { /* wait */ - if (sscanf(msg + 5, "%d", &ms) < 1) ms = 100; - if (ms > 3000) ms = 3000; /* max 3 s */ + if (sscanf(msg + 5, "%d", &ms) < 1) + { + ms = 100; + } + if (ms > 3000) + { + ms = 3000; /* max 3 s */ + } sleepms(ms); } @@ -2356,7 +2818,10 @@ void strsendcmd(stream_t *str, const char *cmd) //} else if (!strncmp(msg + 1, "HEX", 3)) { /* general hex message */ - if ((m = gen_hex(msg + 4, buff)) > 0) strwrite(str, buff, m); + if ((m = gen_hex(msg + 4, buff)) > 0) + { + strwrite(str, buff, m); + } } } else @@ -2365,7 +2830,9 @@ void strsendcmd(stream_t *str, const char *cmd) strwrite(str, reinterpret_cast(cmdend), 2); } if (*q == '\0') - break; + { + break; + } p = q + 1; } diff --git a/src/algorithms/libs/rtklib/rtklib_tides.cc b/src/algorithms/libs/rtklib/rtklib_tides.cc index c53d5cd98..eb5355a61 100644 --- a/src/algorithms/libs/rtklib/rtklib_tides.cc +++ b/src/algorithms/libs/rtklib/rtklib_tides.cc @@ -65,9 +65,15 @@ void tide_pl(const double *eu, const double *rp, double GMp, trace(4, "tide_pl : pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D); - if ((r = norm_rtk(rp, 3)) <= 0.0) return; + if ((r = norm_rtk(rp, 3)) <= 0.0) + { + return; + } - for (i = 0; i < 3; i++) ep[i] = rp[i] / r; + for (i = 0; i < 3; i++) + { + ep[i] = rp[i] / r; + } K2 = GMp / GME * std::pow(RE_WGS84, 2.04) * std::pow(RE_WGS84, 2.0) / (r * r * r); K3 = K2 * RE_WGS84 / r; @@ -181,8 +187,14 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu) for (i = 0; i < 11; i++) { ang = 0.0; - for (j = 0; j < 5; j++) ang += a[j] * args[i][j]; - for (j = 0; j < 3; j++) dp[j] += odisp[j + i * 6] * cos(ang - odisp[j + 3 + i * 6] * D2R); + for (j = 0; j < 5; j++) + { + ang += a[j] * args[i][j]; + } + for (j = 0; j < 3; j++) + { + dp[j] += odisp[j + i * 6] * cos(ang - odisp[j + 3 + i * 6] * D2R); + } } denu[0] = -dp[1]; denu[1] = -dp[2]; @@ -279,13 +291,19 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, trace(3, "tidedisp: tutc=%s\n", time_str(tutc, 0)); - if (erp) geterp(erp, tutc, erpv); + if (erp) + { + geterp(erp, tutc, erpv); + } tut = timeadd(tutc, erpv[2]); dr[0] = dr[1] = dr[2] = 0.0; - if (norm_rtk(rr, 3) <= 0.0) return; + if (norm_rtk(rr, 3) <= 0.0) + { + return; + } pos[0] = asin(rr[2] / norm_rtk(rr, 3)); pos[1] = atan2(rr[1], rr[0]); @@ -309,19 +327,28 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp, #else tide_solid(rs, rm, pos, E, gmst, opt, drt); #endif - for (i = 0; i < 3; i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) + { + dr[i] += drt[i]; + } } if ((opt & 2) && odisp) { /* ocean tide loading */ tide_oload(tut, odisp, denu); matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); - for (i = 0; i < 3; i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) + { + dr[i] += drt[i]; + } } if ((opt & 4) && erp) { /* pole tide */ tide_pole(tut, pos, erpv, denu); matmul("TN", 3, 1, 3, 1.0, E, denu, 0.0, drt); - for (i = 0; i < 3; i++) dr[i] += drt[i]; + for (i = 0; i < 3; i++) + { + dr[i] += drt[i]; + } } trace(5, "tidedisp: dr=%.3f %.3f %.3f\n", dr[0], dr[1], dr[2]); } diff --git a/src/algorithms/libs/short_x2_to_cshort.h b/src/algorithms/libs/short_x2_to_cshort.h index a95ae1214..1591c5412 100644 --- a/src/algorithms/libs/short_x2_to_cshort.h +++ b/src/algorithms/libs/short_x2_to_cshort.h @@ -37,7 +37,7 @@ class short_x2_to_cshort; -typedef boost::shared_ptr short_x2_to_cshort_sptr; +using short_x2_to_cshort_sptr = boost::shared_ptr; short_x2_to_cshort_sptr make_short_x2_to_cshort(); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 59a8d1ff7..79e64245e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose build type: None Debug Release RelWithDebInfo MinSizeRel") project(volk_gnsssdr) enable_language(CXX) @@ -135,7 +135,7 @@ message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.") set(VERSION_INFO_MAJOR_VERSION 0) set(VERSION_INFO_MINOR_VERSION 0) -set(VERSION_INFO_MAINT_VERSION 10) +set(VERSION_INFO_MAINT_VERSION 10.git) include(VolkVersion) #setup version info @@ -369,6 +369,10 @@ install( COMPONENT "volk_gnsssdr_devel" ) +install(EXPORT VOLK_GNSSSDR-export FILE VolkGnsssdrTargets.cmake + NAMESPACE VolkGnsssdr:: DESTINATION ${CMAKE_MODULES_DIR}/volk_gnsssdr +) + ######################################################################## # Option to enable QA testing, on by default ######################################################################## diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc index c211ed710..c18bb2e3a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/apps/volk_gnsssdr_profile.cc @@ -250,10 +250,10 @@ void write_results(const std::vector *results, bool const fs::path config_path(path); // Until we can update the config on a kernel by kernel basis // do not overwrite volk_gnsssdr_config when using a regex. - if (!fs::exists(config_path.branch_path())) + if (!fs::exists(config_path.parent_path())) { - std::cout << "Creating " << config_path.branch_path() << " ..." << std::endl; - fs::create_directories(config_path.branch_path()); + std::cout << "Creating " << config_path.parent_path() << " ..." << std::endl; + fs::create_directories(config_path.parent_path()); } std::ofstream config; diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in index af9e75169..ef8dce6e6 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkGnsssdrConfig.cmake.in @@ -15,33 +15,8 @@ # You should have received a copy of the GNU General Public License # along with GNSS-SDR. If not, see . -include(FindPkgConfig) -pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr) +get_filename_component(VOLK_GNSSSDR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -find_path( - VOLK_GNSSSDR_INCLUDE_DIRS - NAMES volk_gnsssdr/volk_gnsssdr.h - HINTS $ENV{VOLK_DIR}/include - ${PC_VOLK_INCLUDEDIR} - PATHS /usr/local/include - /usr/include - /opt/local/include - "@CMAKE_INSTALL_PREFIX@/include" -) - -find_library( - VOLK_GNSSSDR_LIBRARIES - NAMES volk_gnsssdr - HINTS $ENV{VOLK_DIR}/lib - ${PC_VOLK_LIBDIR} - PATHS /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - /opt/local/lib - "@CMAKE_INSTALL_PREFIX@/lib" -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) -mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) +if(NOT TARGET VolkGnsssdr::volkgnsssdr) + include("${VOLK_GNSSSDR_CMAKE_DIR}/VolkGnsssdrTargets.cmake") +endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml index 1f741ac02..6d293da91 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/archs.xml @@ -6,14 +6,17 @@ -mfloat-abi=softfp + -mfloat-abi=softfp -mfloat-abi=hard + -mfloat-abi=hard -funsafe-math-optimizations + -funsafe-math-optimizations 16 @@ -21,18 +24,22 @@ -mfpu=neon -funsafe-math-optimizations + -mfpu=neon + -funsafe-math-optimizations 16 -funsafe-math-optimizations + -funsafe-math-optimizations 16 -m32 + -m32 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py index fb1ae58f9..229d44a7a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/gen/volk_gnsssdr_kernel_defs.py @@ -53,7 +53,7 @@ def split_into_nested_ifdef_sections(code): header = 'text' in_section_depth = 0 for i, line in enumerate(code.splitlines()): - m = re.match('^(\s*)#(\s*)(\w+)(.*)$', line) + m = re.match(r'^(\s*)#(\s*)(\w+)(.*)$', line) line_is = 'normal' if m: p0, p1, fcn, stuff = m.groups() @@ -121,11 +121,11 @@ def flatten_section_text(sections): class impl_class(object): def __init__(self, kern_name, header, body): #extract LV_HAVE_* - self.deps = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', header)) + self.deps = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', header)) #extract function suffix and args body = flatten_section_text(body) try: - fcn_matcher = re.compile('^.*(%s\\w*)\\s*\\((.*)$'%kern_name, re.DOTALL | re.MULTILINE) + fcn_matcher = re.compile(r'^.*(%s\w*)\s*\((.*)$'%kern_name, re.DOTALL | re.MULTILINE) body = body.split('{')[0].rsplit(')', 1)[0] #get the part before the open ){ bracket m = fcn_matcher.match(body) impl_name, the_rest = m.groups() @@ -133,7 +133,7 @@ class impl_class(object): self.args = list() fcn_args = the_rest.split(',') for fcn_arg in fcn_args: - arg_matcher = re.compile('^\s*(.*\\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE) + arg_matcher = re.compile(r'^\s*(.*\W)\s*(\w+)\s*$', re.DOTALL | re.MULTILINE) m = arg_matcher.match(fcn_arg) arg_type, arg_name = m.groups() self.args.append((arg_type, arg_name)) @@ -153,7 +153,7 @@ def extract_lv_haves(code): haves = list() for line in code.splitlines(): if not line.strip().startswith('#'): continue - have_set = set(res.lower() for res in re.findall('LV_HAVE_(\w+)', line)) + have_set = set(res.lower() for res in re.findall(r'LV_HAVE_(\w+)', line)) if have_set: haves.append(have_set) return haves diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt index 48c012c09..5211c1cf5 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/CMakeLists.txt @@ -254,6 +254,8 @@ if(NOT CPU_IS_x86) overrule_arch(sse4_1 "Architecture is not x86 or x86_64") overrule_arch(sse4_2 "Architecture is not x86 or x86_64") overrule_arch(avx "Architecture is not x86 or x86_64") + overrule_arch(avx512f "Architecture is not x86 or x86_64") + overrule_arch(avx512cd "Architecture is not x86 or x86_64") endif() ######################################################################## @@ -477,7 +479,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9") endforeach() endif() enable_language(ASM) - set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS}) + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ARCH_ASM_FLAGS}") message(STATUS "c flags: ${FULL_C_FLAGS}") message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}") endforeach() @@ -567,71 +569,67 @@ if(MSVC) set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX) endif() -#Use object library for faster overall build in newer versions of cmake -if(CMAKE_VERSION VERSION_GREATER "2.8.7") - #Create a volk_gnsssdr object library (requires cmake >= 2.8.8) - add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) +#Create a volk_gnsssdr object library +add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) +target_include_directories(volk_gnsssdr_obj + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} +) - #Add dynamic library - add_library(volk_gnsssdr SHARED $) - target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES}) +#Add dynamic library +add_library(volk_gnsssdr SHARED $) +target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} m) +target_include_directories(volk_gnsssdr + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} +) - #Configure target properties - set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC") - set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) - set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") +#Configure target properties +set_target_properties(volk_gnsssdr_obj PROPERTIES COMPILE_FLAGS "-fPIC") +set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) +set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") - #Install locations - install(TARGETS volk_gnsssdr - LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file +#Install locations +install(TARGETS volk_gnsssdr + EXPORT VOLK_GNSSSDR-export + LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file + RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file +) + +#Configure static library +if(ENABLE_STATIC_LIBS) + add_library(volk_gnsssdr_static STATIC $) + target_link_libraries(volk_gnsssdr_static ${volk_gnsssdr_libraries} pthread m) + target_include_directories(volk_gnsssdr_static + PUBLIC $ + PUBLIC $ + PUBLIC $ + PRIVATE ${PROJECT_SOURCE_DIR}/kernels + PRIVATE ${CMAKE_CURRENT_BINARY_DIR} + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) - #Configure static library - if(ENABLE_STATIC_LIBS) - add_library(volk_gnsssdr_static STATIC $) - - set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) - - install(TARGETS volk_gnsssdr_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" - ) - endif() - -#Older cmake versions (slower to build when building dynamic/static libs) -else() - #create the volk_gnsssdr runtime library - add_library(volk_gnsssdr SHARED ${volk_gnsssdr_sources}) - target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries}) - set_target_properties(volk_gnsssdr PROPERTIES SOVERSION ${LIBVER}) - set_target_properties(volk_gnsssdr PROPERTIES DEFINE_SYMBOL "volk_gnsssdr_EXPORTS") - - install(TARGETS volk_gnsssdr - LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_runtime" # .so file - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - RUNTIME DESTINATION bin COMPONENT "volk_gnsssdr_runtime" # .dll file + install(TARGETS volk_gnsssdr_static + EXPORT VOLK_GNSSSDR-export + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" ) - if(ENABLE_STATIC_LIBS) - add_library(volk_gnsssdr_static STATIC ${volk_gnsssdr_sources}) - - if(NOT WIN32) - set_target_properties(volk_gnsssdr_static - PROPERTIES OUTPUT_NAME volk_gnsssdr) - endif() - - install(TARGETS volk_gnsssdr_static - ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file - ) - endif() + set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) endif() ######################################################################## # Build the QA test application ######################################################################## if(ENABLE_TESTING) - #include Boost headers include_directories(${Boost_INCLUDE_DIRS}) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.unittest) @@ -645,11 +643,11 @@ if(ENABLE_TESTING) SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc TARGET_DEPS volk_gnsssdr - ) + ) + foreach(kernel ${h_files}) get_filename_component(kernel ${kernel} NAME) string(REPLACE ".h" "" kernel ${kernel}) volk_add_test(${kernel} "volk_gnsssdr_test_all") endforeach() - endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/CMakeLists.txt index 3309080ba..4c35e9c60 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/CMakeLists.txt @@ -35,4 +35,4 @@ VOLK_PYTHON_INSTALL( volk_gnsssdr_modtool DESTINATION ${VOLK_RUNTIME_DIR} COMPONENT "volk_gnsssdr" -) \ No newline at end of file +) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py index e4f12a62c..26ffc790a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/cfg.py @@ -29,7 +29,7 @@ from six.moves import configparser, input class volk_gnsssdr_modtool_config(object): def key_val_sub(self, num, stuff, section): - return re.sub('\$' + 'k' + str(num), stuff[num][0], (re.sub('\$' + str(num), stuff[num][1], section[1][num]))); + return re.sub(r'\$' + 'k' + str(num), stuff[num][0], (re.sub(r'\$' + str(num), stuff[num][1], section[1][num]))); def verify(self): for i in self.verification: @@ -95,4 +95,3 @@ class volk_gnsssdr_modtool_config(object): for i in stuff: retval[i[0]] = i[1] return retval - diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py index df613a938..35905ad15 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/python/volk_gnsssdr_modtool/volk_gnsssdr_modtool_generate.py @@ -28,13 +28,13 @@ class volk_gnsssdr_modtool(object): def __init__(self, cfg): self.volk_gnsssdr = re.compile('volk_gnsssdr'); self.remove_after_underscore = re.compile("_.*"); - self.volk_gnsssdr_run_tests = re.compile('^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE); - self.volk_gnsssdr_profile = re.compile('^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE); + self.volk_gnsssdr_run_tests = re.compile(r'^\s*VOLK_RUN_TESTS.*\n', re.MULTILINE); + self.volk_gnsssdr_profile = re.compile(r'^\s*(VOLK_PROFILE|VOLK_PUPPET_PROFILE).*\n', re.MULTILINE); self.my_dict = cfg; - self.lastline = re.compile('\s*char path\[1024\];.*'); - self.badassert = re.compile('^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE); + self.lastline = re.compile(r'\s*char path\[1024\];.*'); + self.badassert = re.compile(r'^\s*assert\(toked\[0\] == "volk_gnsssdr_.*\n', re.MULTILINE); self.goodassert = ' assert(toked[0] == "volk_gnsssdr");\n' - self.baderase = re.compile('^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE); + self.baderase = re.compile(r'^\s*toked.erase\(toked.begin\(\)\);.*\n', re.MULTILINE); self.gooderase = ' toked.erase(toked.begin());\n toked.erase(toked.begin());\n'; def get_basename(self, base=None): @@ -65,7 +65,7 @@ class volk_gnsssdr_modtool(object): for line in hdr_files: - subline = re.search(".*\.h.*", os.path.basename(line)) + subline = re.search(r".*\.h.*", os.path.basename(line)) if subline: subsubline = begins.search(subline.group(0)); if subsubline: @@ -81,7 +81,7 @@ class volk_gnsssdr_modtool(object): for dt in datatypes: if dt in line: #subline = re.search("(?<=volk_gnsssdr_)" + dt + ".*(?=\.h)", line); - subline = re.search(begins.pattern[:-2] + dt + ".*(?=\.h)", line); + subline = re.search(begins.pattern[:-2] + dt + r".*(?=\.h)", line); if subline: functions.append(subline.group(0)); @@ -188,8 +188,8 @@ class volk_gnsssdr_modtool(object): inpath = os.path.abspath(base); kernel = re.compile(name) search_kernels = set([kernel]) - profile = re.compile('^\s*VOLK_PROFILE') - puppet = re.compile('^\s*VOLK_PUPPET') + profile = re.compile(r'^\s*VOLK_PROFILE') + puppet = re.compile(r'^\s*VOLK_PUPPET') src_dest = os.path.join(inpath, 'apps/', top[:-1] + '_profile.cc'); infile = open(src_dest); otherlines = infile.readlines(); @@ -257,8 +257,8 @@ class volk_gnsssdr_modtool(object): kernel = re.compile(name) search_kernels = set([kernel]) - profile = re.compile('^\s*VOLK_PROFILE') - puppet = re.compile('^\s*VOLK_PUPPET') + profile = re.compile(r'^\s*VOLK_PROFILE') + puppet = re.compile(r'^\s*VOLK_PUPPET') infile = open(os.path.join(inpath, 'apps/', oldvolk_gnsssdr.pattern + '_profile.cc')); otherinfile = open(os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc')); dest = os.path.join(self.my_dict['destination'], 'volk_gnsssdr_' + self.my_dict['name'], 'apps/volk_gnsssdr_' + self.my_dict['name'] + '_profile.cc'); diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index ef0df1d7d..a75cd92df 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -24,19 +24,35 @@ set(OBS_ADAPTER_HEADERS hybrid_observables.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${OBS_ADAPTER_HEADERS}) add_library(obs_adapters ${OBS_ADAPTER_SOURCES} ${OBS_ADAPTER_HEADERS}) -source_group(Headers FILES ${OBS_ADAPTER_HEADERS}) -target_link_libraries(obs_adapters obs_gr_blocks ${GNURADIO_RUNTIME_LIBRARIES}) + +target_include_directories(obs_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +target_link_libraries(obs_adapters + PUBLIC + obs_gr_blocks + algorithms_libs + PRIVATE + Gflags::gflags + Glog::glog +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET obs_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index e829c474d..e50fabfd2 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -24,42 +24,38 @@ set(OBS_GR_BLOCKS_HEADERS hybrid_observables_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} -) +source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) add_library(obs_gr_blocks ${OBS_GR_BLOCKS_SOURCES} ${OBS_GR_BLOCKS_HEADERS}) -source_group(Headers FILES ${OBS_GR_BLOCKS_HEADERS}) - -if(MATIO_FOUND) - add_dependencies(obs_gr_blocks - gnss_sp_libs - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - ) -else() - add_dependencies(obs_gr_blocks - gnss_sp_libs - glog-${glog_RELEASE} - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) -endif() +target_include_directories(obs_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) target_link_libraries(obs_gr_blocks - gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${MATIO_LIBRARIES} + PUBLIC + Boost::boost + Gnuradio::blocks + core_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + Boost::filesystem + Matio::matio + algorithms_libs +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(obs_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET obs_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc index cf9807ece..429931dd0 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.cc @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -140,7 +141,14 @@ hybrid_observables_cc::~hybrid_observables_cc() } if (d_dump_mat) { - save_matfile(); + try + { + save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } } } @@ -474,9 +482,9 @@ void hybrid_observables_cc::compute_pranges(std::vector &data) { if (it->Flag_valid_word) { - double traveltime_s = (static_cast(T_rx_TOW_ms) - it->interp_TOW_ms + GPS_STARTOFFSET_ms) / 1000.0; + double traveltime_s = (static_cast(T_rx_TOW_ms) - it->interp_TOW_ms + GPS_STARTOFFSET_MS) / 1000.0; //todo: check what happens during the week rollover (TOW rollover at 604800000s) - it->RX_time = (static_cast(T_rx_TOW_ms) + GPS_STARTOFFSET_ms) / 1000.0; + it->RX_time = (static_cast(T_rx_TOW_ms) + GPS_STARTOFFSET_MS) / 1000.0; it->Pseudorange_m = traveltime_s * SPEED_OF_LIGHT; it->Flag_valid_pseudorange = true; // debug code @@ -568,7 +576,10 @@ int hybrid_observables_cc::general_work(int noutput_items __attribute__((unused) } } - if (n_valid > 0) compute_pranges(epoch_data); + if (n_valid > 0) + { + compute_pranges(epoch_data); + } for (uint32_t n = 0; n < d_nchannels_out; n++) { diff --git a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h index 9f6d31e47..8a4d4c56e 100644 --- a/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h +++ b/src/algorithms/observables/gnuradio_blocks/hybrid_observables_cc.h @@ -45,7 +45,7 @@ class hybrid_observables_cc; -typedef boost::shared_ptr hybrid_observables_cc_sptr; +using hybrid_observables_cc_sptr = boost::shared_ptr; hybrid_observables_cc_sptr hybrid_make_observables_cc(unsigned int nchannels_in, unsigned int nchannels_out, bool dump, bool dump_mat, std::string dump_filename); diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 07e8ddc74..18554d352 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,28 +27,45 @@ set(RESAMPLER_ADAPTER_HEADERS mmse_resampler_conditioner.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - list(SORT RESAMPLER_ADAPTER_HEADERS) list(SORT RESAMPLER_ADAPTER_SOURCES) +source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) + add_library(resampler_adapters ${RESAMPLER_ADAPTER_SOURCES} ${RESAMPLER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${RESAMPLER_ADAPTER_HEADERS}) +target_link_libraries(resampler_adapters + PUBLIC + Gnuradio::runtime + resampler_gr_blocks + PRIVATE + Gflags::gflags + Glog::glog + Volk::volk +) -target_link_libraries(resampler_adapters resampler_gr_blocks) +target_include_directories(resampler_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET resampler_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index ae570d644..33dd7b6ab 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -29,22 +29,32 @@ set(RESAMPLER_GR_BLOCKS_HEADERS direct_resampler_conditioner_cb.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - list(SORT RESAMPLER_GR_BLOCKS_HEADERS) list(SORT RESAMPLER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) + add_library(resampler_gr_blocks ${RESAMPLER_GR_BLOCKS_SOURCES} ${RESAMPLER_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${RESAMPLER_GR_BLOCKS_HEADERS}) +target_link_libraries(resampler_gr_blocks + PUBLIC + Gnuradio::runtime + Volk::volk +) -add_dependencies(resampler_gr_blocks glog-${glog_RELEASE}) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(resampler_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET resampler_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc index 39bf2883a..99948c3bb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.cc @@ -33,12 +33,9 @@ #include "direct_resampler_conditioner_cb.h" -#include #include -using google::LogMessage; - direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb( double sample_freq_in, double sample_freq_out) { diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h index 1db7f374d..ac93ab82b 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cb.h @@ -36,8 +36,7 @@ #include class direct_resampler_conditioner_cb; -typedef boost::shared_ptr - direct_resampler_conditioner_cb_sptr; +using direct_resampler_conditioner_cb_sptr = boost::shared_ptr; direct_resampler_conditioner_cb_sptr direct_resampler_make_conditioner_cb(double sample_freq_in, diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc index a288cd4da..b302272ca 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.cc @@ -33,12 +33,9 @@ #include "direct_resampler_conditioner_cc.h" -#include #include -using google::LogMessage; - direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc( double sample_freq_in, double sample_freq_out) { diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h index 0c477c571..945f797ce 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cc.h @@ -43,7 +43,7 @@ #include class direct_resampler_conditioner_cc; -typedef boost::shared_ptr direct_resampler_conditioner_cc_sptr; +using direct_resampler_conditioner_cc_sptr = boost::shared_ptr; direct_resampler_conditioner_cc_sptr direct_resampler_make_conditioner_cc(double sample_freq_in, double sample_freq_out); diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc index 3506879b6..6a4b5a8d3 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.cc @@ -33,10 +33,8 @@ #include "direct_resampler_conditioner_cs.h" -#include #include -using google::LogMessage; direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( double sample_freq_in, double sample_freq_out) @@ -49,7 +47,9 @@ direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs( direct_resampler_conditioner_cs::direct_resampler_conditioner_cs( double sample_freq_in, - double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), + double sample_freq_out) : gr::block("direct_resampler_make_conditioner_cs", + gr::io_signature::make(1, 1, sizeof(lv_16sc_t)), + gr::io_signature::make(1, 1, sizeof(lv_16sc_t))), d_sample_freq_in(sample_freq_in), d_sample_freq_out(sample_freq_out), d_phase(0), diff --git a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h index 40602a68d..9d904abfb 100644 --- a/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h +++ b/src/algorithms/resampler/gnuradio_blocks/direct_resampler_conditioner_cs.h @@ -36,8 +36,7 @@ #include class direct_resampler_conditioner_cs; -typedef boost::shared_ptr - direct_resampler_conditioner_cs_sptr; +using direct_resampler_conditioner_cs_sptr = boost::shared_ptr; direct_resampler_conditioner_cs_sptr direct_resampler_make_conditioner_cs(double sample_freq_in, diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index fe793203b..fb651871e 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,29 +19,38 @@ set(SIGNAL_GENERATOR_ADAPTER_SOURCES signal_generator.cc) set(SIGNAL_GENERATOR_ADAPTER_HEADERS signal_generator.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) +source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) add_library(signal_generator_adapters ${SIGNAL_GENERATOR_ADAPTER_SOURCES} ${SIGNAL_GENERATOR_ADAPTER_HEADERS} ) -source_group(Headers FILES ${SIGNAL_GENERATOR_ADAPTER_HEADERS}) - target_link_libraries(signal_generator_adapters - gnss_sp_libs - signal_generator_blocks - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} + PUBLIC + Gnuradio::blocks + signal_generator_gr_blocks + PRIVATE + Gflags::gflags + Glog::glog + algorithms_libs +) + +target_include_directories(signal_generator_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_generator_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/signal_generator/adapters/signal_generator.cc b/src/algorithms/signal_generator/adapters/signal_generator.cc index 91536357a..8a4d5ab8e 100644 --- a/src/algorithms/signal_generator/adapters/signal_generator.cc +++ b/src/algorithms/signal_generator/adapters/signal_generator.cc @@ -90,11 +90,11 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, { if (signal1[0].at(0) == '5') { - vector_length = round(static_cast(fs_in) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); + vector_length = round(static_cast(fs_in) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)); } else { - vector_length = round(static_cast(fs_in) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)) * Galileo_E1_C_SECONDARY_CODE_LENGTH; + vector_length = round(static_cast(fs_in) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)) * GALILEO_E1_C_SECONDARY_CODE_LENGTH; } } else if (std::find(system.begin(), system.end(), "G") != system.end()) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 30ab655e1..99e7debab 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,36 +19,38 @@ set(SIGNAL_GENERATOR_BLOCK_SOURCES signal_generator_c.cc) set(SIGNAL_GENERATOR_BLOCK_HEADERS signal_generator_c.h) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) +source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) -add_library(signal_generator_blocks +add_library(signal_generator_gr_blocks ${SIGNAL_GENERATOR_BLOCK_SOURCES} ${SIGNAL_GENERATOR_BLOCK_HEADERS} ) -source_group(Headers FILES ${SIGNAL_GENERATOR_BLOCK_HEADERS}) - -target_link_libraries(signal_generator_blocks - gnss_system_parameters - gnss_sp_libs - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${ORC_LIBRARIES} +target_link_libraries(signal_generator_gr_blocks + PUBLIC + Boost::boost + Gnuradio::runtime + core_system_parameters + PRIVATE + Volkgnsssdr::volkgnsssdr + algorithms_libs ) -if(VOLKGNSSSDR_FOUND) - # add_dependencies(signal_generator_blocks glog-${glog_RELEASE}) -else() - add_dependencies(signal_generator_blocks volk_gnsssdr_module) +target_include_directories(signal_generator_gr_blocks + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_generator_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET signal_generator_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc index 84a90d555..37c3ca36f 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.cc @@ -107,39 +107,39 @@ void signal_generator_c::init() current_data_bit_int_.push_back(1); current_data_bits_.emplace_back(1, 0); ms_counter_.push_back(0); - data_modulation_.push_back((Galileo_E5a_I_SECONDARY_CODE.at(0) == '0' ? 1 : -1)); - pilot_modulation_.push_back((Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat]].at(0) == '0' ? 1 : -1)); + data_modulation_.push_back((GALILEO_E5A_I_SECONDARY_CODE.at(0) == '0' ? 1 : -1)); + pilot_modulation_.push_back((GALILEO_E5A_Q_SECONDARY_CODE[PRN_[sat]].at(0) == '0' ? 1 : -1)); if (system_[sat] == "G") { samples_per_code_.push_back(round(static_cast(fs_in_) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); - num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1); + num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH) : 1); data_bit_duration_ms_.push_back(1e3 / GPS_CA_TELEMETRY_RATE_BITS_SECOND); } else if (system_[sat] == "R") { samples_per_code_.push_back(round(static_cast(fs_in_) / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS))); - num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH) : 1); + num_of_codes_per_vector_.push_back(galileo_signal ? 4 * static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH) : 1); data_bit_duration_ms_.push_back(1e3 / GLONASS_GNAV_TELEMETRY_RATE_BITS_SECOND); } else if (system_[sat] == "E") { if (signal_[sat].at(0) == '5') { - int codelen = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); - samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E5a_CODE_CHIP_RATE_HZ / codelen))); + int codelen = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS); + samples_per_code_.push_back(round(static_cast(fs_in_) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / codelen))); num_of_codes_per_vector_.push_back(1); - data_bit_duration_ms_.push_back(1e3 / Galileo_E5a_SYMBOL_RATE_BPS); + data_bit_duration_ms_.push_back(1e3 / GALILEO_E5A_SYMBOL_RATE_BPS); } else { - samples_per_code_.push_back(round(static_cast(fs_in_) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + samples_per_code_.push_back(round(static_cast(fs_in_) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); - num_of_codes_per_vector_.push_back(static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH)); - data_bit_duration_ms_.push_back(1e3 / Galileo_E1_B_SYMBOL_RATE_BPS); + num_of_codes_per_vector_.push_back(static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH)); + data_bit_duration_ms_.push_back(1e3 / GALILEO_E1_B_SYMBOL_RATE_BPS); } } } @@ -212,7 +212,7 @@ void signal_generator_c::generate_codes() strcpy(signal, "5X"); galileo_e5_a_code_gen_complex_sampled(sampled_code_data_[sat], signal, PRN_[sat], fs_in_, - static_cast(Galileo_E5a_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS) - delay_chips_[sat]); //noise if (noise_flag_) { @@ -230,7 +230,7 @@ void signal_generator_c::generate_codes() strcpy(signal, "1B"); galileo_e1_code_gen_complex_sampled(code, signal, cboc, PRN_[sat], fs_in_, - static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]); + static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat]); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) @@ -254,7 +254,7 @@ void signal_generator_c::generate_codes() strcpy(signal, "1C"); galileo_e1_code_gen_complex_sampled(sampled_code_pilot_[sat], signal, cboc, PRN_[sat], fs_in_, - static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); + static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) - delay_chips_[sat], true); // Obtain the desired CN0 assuming that Pn = 1. if (noise_flag_) @@ -380,7 +380,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), if (signal_[sat].at(0) == '5') { // EACH WORK outputs 1 modulated primary code - int codelen = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); + int codelen = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS); unsigned int delay_samples = (delay_chips_[sat] % codelen) * samples_per_code_[sat] / codelen; for (k = 0; k < delay_samples; k++) { @@ -395,10 +395,10 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), // New random data bit current_data_bit_int_[sat] = (uniform_dist(e1) % 2) == 0 ? 1 : -1; } - data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat] + delay_sec_[sat]) % 20) == '0' ? 1 : -1); - pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1); + data_modulation_[sat] = current_data_bit_int_[sat] * (GALILEO_E5A_I_SECONDARY_CODE.at((ms_counter_[sat] + delay_sec_[sat]) % 20) == '0' ? 1 : -1); + pilot_modulation_[sat] = (GALILEO_E5A_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1); - ms_counter_[sat] = ms_counter_[sat] + static_cast(round(1e3 * GALILEO_E5a_CODE_PERIOD)); + ms_counter_[sat] = ms_counter_[sat] + static_cast(round(1e3 * GALILEO_E5A_CODE_PERIOD)); for (k = delay_samples; k < samples_per_code_[sat]; k++) { @@ -410,7 +410,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), } else { - unsigned int delay_samples = (delay_chips_[sat] % static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / Galileo_E1_B_CODE_LENGTH_CHIPS; + unsigned int delay_samples = (delay_chips_[sat] % static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * samples_per_code_[sat] / GALILEO_E1_B_CODE_LENGTH_CHIPS; for (i = 0; i < num_of_codes_per_vector_[sat]; i++) { @@ -432,7 +432,7 @@ int signal_generator_c::general_work(int noutput_items __attribute__((unused)), out_idx++; } - ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3 * Galileo_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat]; + ms_counter_[sat] = (ms_counter_[sat] + static_cast(round(1e3 * GALILEO_E1_CODE_PERIOD))) % data_bit_duration_ms_[sat]; } } } diff --git a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h index d47fc558b..2201a849c 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h +++ b/src/algorithms/signal_generator/gnuradio_blocks/signal_generator_c.h @@ -33,7 +33,6 @@ #include "gnss_signal.h" #include -//#include #include #include #include @@ -52,7 +51,7 @@ class signal_generator_c; * * As a convention, the _sptr suffix indicates a boost::shared_ptr */ -typedef boost::shared_ptr signal_generator_c_sptr; +using signal_generator_c_sptr = boost::shared_ptr; /*! * \brief Return a shared_ptr to a new instance of gen_source. diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 6674cd853..5374a6fbf 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,20 +19,13 @@ # Optional drivers -if(ENABLE_RAW_UDP) - 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}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h) endif() + if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) if(NOT GRIIO_FOUND) message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "Please build and install the following projects:") @@ -41,12 +34,10 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) endif() + if(ENABLE_AD9361) - find_package(LIBIIO REQUIRED) if(NOT LIBIIO_FOUND) message(STATUS "libiio not found, its installation is required.") message(STATUS "Please build and install the following projects:") @@ -55,8 +46,6 @@ if(ENABLE_AD9361) message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled.") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) endif() @@ -97,33 +86,16 @@ if(ENABLE_GN3S) ############################################## # GN3S (USB dongle) ############################################## - find_package(GRGN3S REQUIRED) if(NOT GRGN3S_FOUND) message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h) endif() -if(ENABLE_FLEXIBAND) - ############################################## - # TELEORBIT FLEXIBAND FRONTEND ADAPTER - ############################################## - find_package(TELEORBIT REQUIRED) - if(NOT TELEORBIT_FOUND) - message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") - endif() - # Set up variables - set(FLEXIBAND_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${TELEORBIT_INCLUDE_DIR}/teleorbit - ) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS}) +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h) endif() @@ -133,7 +105,6 @@ if(ENABLE_ARRAY) ############################################## # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE ############################################## - find_package(GRDBFCTTC REQUIRED) if(NOT GRDBFCTTC_FOUND) message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") @@ -154,15 +125,8 @@ if(ENABLE_OSMOSDR) list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h) endif() else() - # set OSMO include dirs - set(OSMO_DRIVER_INCLUDE_DIRS - ${OPT_DRIVER_INCLUDE_DIRS} - ${GROSMOSDR_INCLUDE_DIR}/osmosdr - ) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS}) endif() endif() @@ -170,8 +134,6 @@ endif() if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS}) endif() @@ -197,7 +159,6 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS ${OPT_DRIVER_HEADERS} ) - if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES} two_bit_cpx_file_signal_source.cc @@ -207,36 +168,100 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) two_bit_packed_file_signal_source.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${OPT_DRIVER_INCLUDE_DIRS} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} -) - -if(ARCH_64BITS) - add_definitions(-DARCH_64BITS=1) -endif() - -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") - list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) -add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS}) -target_link_libraries(signal_source_adapters signal_source_gr_blocks - ${Boost_LIBRARIES} - ${GNURADIO_PMT_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${OPT_LIBRARIES} - gnss_sp_libs + +add_library(signal_source_adapters + ${SIGNAL_SOURCE_ADAPTER_SOURCES} + ${SIGNAL_SOURCE_ADAPTER_HEADERS} +) + +target_include_directories(signal_source_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +target_link_libraries(signal_source_adapters + PUBLIC + Boost::boost + Gnuradio::runtime + Gnuradio::blocks + signal_source_gr_blocks + signal_source_libs + PRIVATE + gnss_sdr_flags + core_system_parameters + Gflags::gflags + Glog::glog + Volk::volk +) + +if(ENABLE_RAW_UDP AND PCAP_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Pcap::pcap + ) +endif() + +if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) + target_link_libraries(signal_source_adapters + PUBLIC + Gnuradio::uhd + PRIVATE + Uhd::uhd + ) +endif() + +if(ENABLE_OSMOSDR AND GROSMOSDR_FOUND) + target_link_libraries(signal_source_adapters + PUBLIC + Gnuradio::osmosdr + ) +endif() + +if(ENABLE_AD9361 AND LIBIIO_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Iio::iio + ) +endif() + +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::teleorbit + ) +endif() + +if(ENABLE_GN3S AND GRGN3S_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::gn3s + ) +endif() + +if(ENABLE_ARRAY AND GRDBFCTTC_FOUND) + target_link_libraries(signal_source_adapters + PRIVATE + Gnuradio::dbfcttc + ) +endif() + +target_compile_definitions(signal_source_adapters + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index a9ff78db5..ba2078719 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -110,7 +110,7 @@ Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configura std::string default_device_name = "/dev/uio1"; std::string device_name = configuration->property(role + ".devicename", default_device_name); int switch_position = configuration->property(role + ".switch_position", 0); - switch_fpga = std::make_shared(device_name); + switch_fpga = std::make_shared(device_name); switch_fpga->set_switch_position(switch_position); if (in_stream_ > 0) { diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index 79ebeff3e..9277c4c2b 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -114,7 +114,7 @@ private: boost::shared_ptr queue_; - std::shared_ptr switch_fpga; + std::shared_ptr switch_fpga; }; #endif /*GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_*/ diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc index 2f2e76ef3..2b4714bca 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.cc @@ -72,7 +72,7 @@ CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configurati // output item size is always gr_complex item_size_ = sizeof(gr_complex); - udp_gnss_rx_source_ = gr_complex_ip_packet_source::make(capture_device, + udp_gnss_rx_source_ = Gr_Complex_Ip_Packet_Source::make(capture_device, address, port, payload_bytes, diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index bec7c3d73..18cc21c9e 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -97,7 +97,7 @@ private: bool dump_; std::string dump_filename_; std::vector> null_sinks_; - gr_complex_ip_packet_source::sptr udp_gnss_rx_source_; + Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; std::vector> file_sink_; boost::shared_ptr queue_; }; diff --git a/src/algorithms/signal_source/adapters/file_signal_source.cc b/src/algorithms/signal_source/adapters/file_signal_source.cc index bc4fb6329..d7856ee57 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/file_signal_source.cc @@ -60,8 +60,14 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; - if (FLAGS_s != "-") filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") + { + filename_ = FLAGS_signal_source; + } + if (FLAGS_s != "-") + { + filename_ = FLAGS_s; + } item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 0d4658304..bfded2ce8 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -97,19 +97,19 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: uint64_t samples_; - long sampling_frequency_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc index 95b3c56cd..216fa084c 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.cc +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.cc @@ -1,6 +1,8 @@ /*! - * \file raw_array_signal_source.cc - * \brief CTTC Experimental GNSS 8 channels array signal source + * \file flexiband_signal_source.cc + * \brief ignal Source adapter for the Teleorbit Flexiband front-end device. + * This adapter requires a Flexiband GNU Radio driver + * installed (not included with GNSS-SDR) * \author Javier Arribas, jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -34,12 +36,18 @@ #include #include #include - +#include using google::LogMessage; FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr 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, + gr::msg_queue::sptr queue) : role_(role), + in_stream_(in_stream), + out_stream_(out_stream), + queue_(std::move(queue)) { std::string default_item_type = "byte"; item_type_ = configuration->property(role + ".item_type", default_item_type); @@ -60,7 +68,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati RF_channels_ = configuration->property(role + ".RF_channels", 1); - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); flexiband_source_ = gr::teleorbit::frontend::make(firmware_filename_.c_str(), gain1_, gain2_, gain3_, AGC_, usb_packet_buffer_size_, signal_file.c_str(), flag_read_file); @@ -96,9 +104,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati } -FlexibandSignalSource::~FlexibandSignalSource() -{ -} +FlexibandSignalSource::~FlexibandSignalSource() = default; void FlexibandSignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index 54e7eeff4..40030af6c 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -1,7 +1,8 @@ /*! - * \file raw_array_signal_source.h - * \brief Signal Source adapter for the Teleorbit Flexiband front-end device. - * This adapter requires a Flexiband GNURadio driver installed (not included with GNSS-SDR) + * \file flexiband_signal_source.h + * \brief ignal Source adapter for the Teleorbit Flexiband front-end device. + * This adapter requires a Flexiband GNU Radio driver + * installed (not included with GNSS-SDR) * \author Javier Arribas, jarribas(at)cttc.es * * ------------------------------------------------------------------------- @@ -30,8 +31,8 @@ */ -#ifndef FLEXIBAND_SIGNAL_SOURCE_H_ -#define FLEXIBAND_SIGNAL_SOURCE_H_ +#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ +#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" #include @@ -53,7 +54,7 @@ class FlexibandSignalSource : public GNSSBlockInterface { public: FlexibandSignalSource(ConfigurationInterface* configuration, - std::string role, unsigned int in_stream, + const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue); virtual ~FlexibandSignalSource(); @@ -108,4 +109,4 @@ private: boost::shared_ptr queue_; }; -#endif /*FLEXIBAND_SIGNAL_SOURCE_H_*/ +#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_ diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index 8a36f8ad5..bf8f990ef 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -81,7 +81,7 @@ private: unsigned int out_stream_; std::string item_type_; size_t item_size_; - long samples_; + uint64_t samples_; std::string filename_; bool dump_; std::string dump_filename_; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc index 60566ed5e..2ceeca528 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.cc @@ -58,8 +58,14 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; - if (FLAGS_s != "-") filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") + { + filename_ = FLAGS_signal_source; + } + if (FLAGS_s != "-") + { + filename_ = FLAGS_s; + } item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index 89bc32ac0..a2b3ee547 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -96,27 +96,27 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: - unsigned long long samples_; - long sampling_frequency_; + uint64_t samples_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; bool dump_; std::string dump_filename_; std::string role_; - unsigned int in_streams_; - unsigned int out_streams_; + uint32_t in_streams_; + uint32_t out_streams_; gr::blocks::file_source::sptr file_source_; unpack_byte_2bit_samples_sptr unpack_byte_; boost::shared_ptr valve_; diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc index b7f29a012..589af32c5 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.cc +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.cc @@ -66,7 +66,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration int sampling_freq_; sampling_freq_ = configuration->property(role + ".sampling_freq", 5000000); - if (item_type_.compare("gr_complex") == 0) + if (item_type_ == "gr_complex") { item_size_ = sizeof(gr_complex); raw_array_source_ = gr::dbfcttc::raw_array::make(eth_device_.c_str(), channels_, snapshots_per_frame_, inter_frame_delay_, sampling_freq_); @@ -97,9 +97,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration } -RawArraySignalSource::~RawArraySignalSource() -{ -} +RawArraySignalSource::~RawArraySignalSource() = default; void RawArraySignalSource::connect(gr::top_block_sptr top_block) diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index 9af4df30f..321895cef 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -29,8 +29,8 @@ */ -#ifndef RAW_ARRAY_SIGNAL_SOURCE_H_ -#define RAW_ARRAY_SIGNAL_SOURCE_H_ +#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_ +#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_ #include "gnss_block_interface.h" #include @@ -90,4 +90,4 @@ private: boost::shared_ptr queue_; }; -#endif /*RAW_ARRAY_SIGNAL_SOURCE_H_*/ +#endif /*GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_*/ diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc index 5166840f5..fd9fc9751 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.cc @@ -48,10 +48,10 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, const std::string& role, unsigned int in_stream, unsigned int out_stream, - boost::shared_ptr queue) : role_(std::move(role)), + boost::shared_ptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), - queue_(queue) + queue_(std::move(queue)) { // DUMP PARAMETERS std::string empty = ""; @@ -122,7 +122,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration, item_size_ = sizeof(int16_t); } - if (samples_ != 0) + if (samples_ != 0ULL) { DLOG(INFO) << "Send STOP signal after " << samples_ << " samples"; valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_); @@ -167,7 +167,7 @@ void RtlTcpSignalSource::MakeBlock() void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) { - if (samples_) + if (samples_ != 0ULL) { top_block->connect(signal_source_, 0, valve_, 0); DLOG(INFO) << "connected rtl tcp source to valve"; @@ -187,7 +187,7 @@ void RtlTcpSignalSource::connect(gr::top_block_sptr top_block) void RtlTcpSignalSource::disconnect(gr::top_block_sptr top_block) { - if (samples_) + if (samples_ != 0ULL) { top_block->disconnect(signal_source_, 0, valve_, 0); if (dump_) @@ -211,12 +211,9 @@ gr::basic_block_sptr RtlTcpSignalSource::get_left_block() gr::basic_block_sptr RtlTcpSignalSource::get_right_block() { - if (samples_ != 0) + if (samples_ != 0ULL) { return valve_; } - else - { - return signal_source_; - } + return signal_source_; } diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index 3a89bb088..74f2b02d5 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -90,7 +90,7 @@ private: // rtl_tcp settings std::string address_; - short port_; + int16_t port_; bool AGC_enabled_; double sample_rate_; bool flip_iq_; @@ -105,7 +105,7 @@ private: std::string item_type_; size_t item_size_; - long samples_; + uint64_t samples_; bool dump_; std::string dump_filename_; diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc index d5692e434..58675e527 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.cc @@ -57,8 +57,14 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; - if (FLAGS_s != "-") filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") + { + filename_ = FLAGS_signal_source; + } + if (FLAGS_s != "-") + { + filename_ = FLAGS_s; + } item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index 659f5b19a..ad76ce23b 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -39,6 +39,7 @@ #include #include #include +#include #include class ConfigurationInterface; @@ -93,19 +94,19 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: - unsigned long long samples_; - long sampling_frequency_; + uint64_t samples_; + int64_t sampling_frequency_; std::string filename_; std::string item_type_; bool repeat_; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc index ff8f45411..5b9534129 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.cc @@ -50,7 +50,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* item_type_ = "int"; samples_ = configuration->property(role + ".samples", 0); - sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0.0); + sampling_frequency_ = configuration->property(role + ".sampling_frequency", 0); filename_ = configuration->property(role + ".filename", default_filename); repeat_ = configuration->property(role + ".repeat", false); dump_ = configuration->property(role + ".dump", false); diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index 71eb9c9df..0757c24af 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -97,19 +97,19 @@ public: return repeat_; } - inline long sampling_frequency() const + inline int64_t sampling_frequency() const { return sampling_frequency_; } - inline long samples() const + inline uint64_t samples() const { return samples_; } private: uint64_t samples_; - double sampling_frequency_; + int64_t sampling_frequency_; std::string filename_; bool repeat_; bool dump_; //Enables dumping the gr_complex sample output diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc index 7115771e9..b1e578b1b 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.cc @@ -62,8 +62,14 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; - if (FLAGS_s != "-") filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") + { + filename_ = FLAGS_signal_source; + } + if (FLAGS_s != "-") + { + filename_ = FLAGS_s; + } item_type_ = configuration->property(role + ".item_type", default_item_type); repeat_ = configuration->property(role + ".repeat", false); diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc index 9355537ce..00a50257e 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.cc @@ -66,8 +66,14 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac filename_ = configuration->property(role + ".filename", default_filename); // override value with commandline flag, if present - if (FLAGS_signal_source != "-") filename_ = FLAGS_signal_source; - if (FLAGS_s != "-") filename_ = FLAGS_s; + if (FLAGS_signal_source != "-") + { + filename_ = FLAGS_signal_source; + } + if (FLAGS_s != "-") + { + filename_ = FLAGS_s; + } item_type_ = configuration->property(role + ".item_type", default_item_type); big_endian_items_ = configuration->property(role + ".big_endian_items", true); diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc index 54a353837..1f551fa5d 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc @@ -215,7 +215,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, for (int i = 0; i < RF_channels_; i++) { - if (samples_.at(i) != 0) + if (samples_.at(i) != 0ULL) { LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples"; valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_)); @@ -247,7 +247,7 @@ void UhdSignalSource::connect(gr::top_block_sptr top_block) { for (int i = 0; i < RF_channels_; i++) { - if (samples_.at(i) != 0) + if (samples_.at(i) != 0ULL) { top_block->connect(uhd_source_, i, valve_.at(i), 0); DLOG(INFO) << "connected usrp source to valve RF Channel " << i; @@ -273,7 +273,7 @@ void UhdSignalSource::disconnect(gr::top_block_sptr top_block) { for (int i = 0; i < RF_channels_; i++) { - if (samples_.at(i) != 0) + if (samples_.at(i) != 0ULL) { top_block->disconnect(uhd_source_, i, valve_.at(i), 0); LOG(INFO) << "UHD source disconnected"; @@ -310,7 +310,7 @@ gr::basic_block_sptr UhdSignalSource::get_right_block() gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel) { //TODO: There is a incoherence here: Multichannel UHD is a single block with multiple outputs, but if the sample limit is enabled, the output is a multiple block! - if (samples_.at(RF_channel) != 0) + if (samples_.at(RF_channel) != 0ULL) { return valve_.at(RF_channel); } diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index 68d6e6b76..50d233c2e 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -99,7 +100,7 @@ private: std::vector freq_; std::vector gain_; std::vector IF_bandwidth_hz_; - std::vector samples_; + std::vector samples_; std::vector dump_; std::vector dump_filename_; diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index fb94ec51c..4a4a264d2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,14 +17,7 @@ # -if(ENABLE_RAW_UDP) - find_package(PCAP) - if(NOT PCAP_FOUND) - message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source") - 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}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h) endif() @@ -55,32 +48,51 @@ set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS ${OPT_DRIVER_HEADERS} ) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} -) - list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS) list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) + add_library(signal_source_gr_blocks ${SIGNAL_SOURCE_GR_BLOCKS_SOURCES} ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${SIGNAL_SOURCE_GR_BLOCKS_HEADERS}) - target_link_libraries(signal_source_gr_blocks - signal_source_lib - ${GNURADIO_RUNTIME_LIBRARIES} - ${Boost_LIBRARIES} - ${OPT_LIBRARIES} + PUBLIC + Boost::thread + Gnuradio::runtime + signal_source_libs + PRIVATE + Gflags::gflags + Glog::glog ) -add_dependencies(signal_source_gr_blocks glog-${glog_RELEASE}) +if(ENABLE_RAW_UDP AND PCAP_FOUND) + target_link_libraries(signal_source_gr_blocks + PUBLIC + Pcap::pcap + ) +endif() + +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(signal_source_gr_blocks + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_source_gr_blocks APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES $ +) diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc index ba6a8ec3e..8085e9e81 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.cc @@ -75,8 +75,8 @@ typedef struct gr_udp_header } gr_udp_header; -gr_complex_ip_packet_source::sptr -gr_complex_ip_packet_source::make(std::string src_device, +Gr_Complex_Ip_Packet_Source::sptr +Gr_Complex_Ip_Packet_Source::make(std::string src_device, const std::string &origin_address, int udp_port, int udp_packet_size, @@ -85,7 +85,7 @@ gr_complex_ip_packet_source::make(std::string src_device, size_t item_size, bool IQ_swap_) { - return gnuradio::get_initial_sptr(new gr_complex_ip_packet_source(std::move(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,7 +99,7 @@ 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, +Gr_Complex_Ip_Packet_Source::Gr_Complex_Ip_Packet_Source(std::string src_device, __attribute__((unused)) const std::string &origin_address, int udp_port, int udp_packet_size, @@ -151,14 +151,14 @@ gr_complex_ip_packet_source::gr_complex_ip_packet_source(std::string src_device, // Called by gnuradio to enable drivers, etc for i/o devices. -bool gr_complex_ip_packet_source::start() +bool Gr_Complex_Ip_Packet_Source::start() { std::cout << "gr_complex_ip_packet_source START\n"; // open the ethernet device if (open() == true) { // start pcap capture thread - d_pcap_thread = new boost::thread(boost::bind(&gr_complex_ip_packet_source::my_pcap_loop_thread, this, descr)); + d_pcap_thread = new boost::thread(boost::bind(&Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread, this, descr)); return true; } else @@ -169,7 +169,7 @@ bool gr_complex_ip_packet_source::start() // Called by gnuradio to disable drivers, etc for i/o devices. -bool gr_complex_ip_packet_source::stop() +bool Gr_Complex_Ip_Packet_Source::stop() { std::cout << "gr_complex_ip_packet_source STOP\n"; if (descr != nullptr) @@ -182,7 +182,7 @@ bool gr_complex_ip_packet_source::stop() } -bool gr_complex_ip_packet_source::open() +bool Gr_Complex_Ip_Packet_Source::open() { char errbuf[PCAP_ERRBUF_SIZE]; boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function @@ -219,7 +219,7 @@ bool gr_complex_ip_packet_source::open() } -gr_complex_ip_packet_source::~gr_complex_ip_packet_source() +Gr_Complex_Ip_Packet_Source::~Gr_Complex_Ip_Packet_Source() { if (d_pcap_thread != nullptr) { @@ -230,15 +230,15 @@ 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, +void Gr_Complex_Ip_Packet_Source::static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet) { - auto *bridge = reinterpret_cast(args); + auto *bridge = reinterpret_cast(args); bridge->pcap_callback(args, pkthdr, packet); } -void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr, +void Gr_Complex_Ip_Packet_Source::pcap_callback(__attribute__((unused)) u_char *args, __attribute__((unused)) const struct pcap_pkthdr *pkthdr, const u_char *packet) { boost::mutex::scoped_lock lock(d_mutex); // hold mutex for duration of this function @@ -312,13 +312,13 @@ void gr_complex_ip_packet_source::pcap_callback(__attribute__((unused)) u_char * } -void gr_complex_ip_packet_source::my_pcap_loop_thread(pcap_t *pcap_handle) +void Gr_Complex_Ip_Packet_Source::my_pcap_loop_thread(pcap_t *pcap_handle) { - pcap_loop(pcap_handle, -1, gr_complex_ip_packet_source::static_pcap_callback, reinterpret_cast(this)); + pcap_loop(pcap_handle, -1, Gr_Complex_Ip_Packet_Source::static_pcap_callback, reinterpret_cast(this)); } -void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) +void Gr_Complex_Ip_Packet_Source::demux_samples(gr_vector_void_star output_items, int num_samples_readed) { int8_t real; int8_t imag; @@ -383,7 +383,7 @@ void gr_complex_ip_packet_source::demux_samples(gr_vector_void_star output_items } -int gr_complex_ip_packet_source::work(int noutput_items, +int Gr_Complex_Ip_Packet_Source::work(int noutput_items, __attribute__((unused)) gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index d008e1314..ee915a662 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -30,8 +30,8 @@ */ -#ifndef INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H -#define INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H +#ifndef GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H +#define GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H #include #include @@ -43,7 +43,7 @@ #include #include -class gr_complex_ip_packet_source : virtual public gr::sync_block +class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block { private: boost::mutex d_mutex; @@ -82,7 +82,7 @@ private: static void static_pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; static sptr make(std::string src_device, const std::string &origin_address, int udp_port, @@ -91,7 +91,7 @@ public: const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); - gr_complex_ip_packet_source(std::string src_device, + Gr_Complex_Ip_Packet_Source(std::string src_device, const std::string &origin_address, int udp_port, int udp_packet_size, @@ -99,7 +99,7 @@ public: const std::string &wire_sample_type, size_t item_size, bool IQ_swap_); - ~gr_complex_ip_packet_source(); + ~Gr_Complex_Ip_Packet_Source(); // Where all the action really happens int work(int noutput_items, @@ -112,4 +112,4 @@ public: bool stop(); }; -#endif /* INCLUDED_GR_COMPLEX_IP_PACKET_SOURCE_H */ +#endif /* GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H */ diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 2ae97cd1d..bc636f23c 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -31,6 +31,7 @@ #include "labsat23_source.h" #include +#include #include #include @@ -88,9 +89,20 @@ labsat23_source::labsat23_source(const char *signal_file_basename, labsat23_source::~labsat23_source() { - if (binary_input_file->is_open()) + try { - binary_input_file->close(); + if (binary_input_file->is_open()) + { + binary_input_file->close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing input file" << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } delete binary_input_file; } @@ -186,7 +198,10 @@ int labsat23_source::general_work(int noutput_items, bool preamble_ok = true; for (int i = 0; i < 8; i++) { - if (memblock[byte_counter] != 0x00) preamble_ok = false; + if (memblock[byte_counter] != 0x00) + { + preamble_ok = false; + } //std::cout << "H[" << i << "]:" << (int)memblock[byte_counter] << std::endl; byte_counter++; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index e7776efd9..6f4435c24 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -39,7 +39,7 @@ class labsat23_source; -typedef boost::shared_ptr labsat23_source_sptr; +using labsat23_source_sptr = boost::shared_ptr; labsat23_source_sptr labsat23_make_source(const char *signal_file_basename, int channel_selector); diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index f43f3e90c..5450a4377 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -222,7 +222,7 @@ void rtl_tcp_signal_source_c::set_if_gain(int gain) { double start, stop, step; }; - if (info_.get_tuner_type() != rtl_tcp_dongle_info::TUNER_E4000) + if (info_.get_tuner_type() != Rtl_Tcp_Dongle_Info::TUNER_E4000) { return; } @@ -333,7 +333,7 @@ int rtl_tcp_signal_source_c::work(int noutput_items, gr_vector_const_void_star & /*input_items*/, gr_vector_void_star &output_items) { - gr_complex *out = reinterpret_cast(output_items[0]); + auto *out = reinterpret_cast(output_items[0]); int i = 0; if (io_service_.stopped()) { diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index 62e7f2c07..2edbf9db0 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -50,8 +50,7 @@ class rtl_tcp_signal_source_c; -typedef boost::shared_ptr - rtl_tcp_signal_source_c_sptr; +using rtl_tcp_signal_source_c_sptr = boost::shared_ptr; rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, @@ -78,7 +77,7 @@ public: void set_if_gain(int gain); private: - typedef boost::circular_buffer_space_optimized buffer_type; + using buffer_type = boost::circular_buffer_space_optimized; friend rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, @@ -89,7 +88,7 @@ private: int16_t port, bool flip_iq); - rtl_tcp_dongle_info info_; + Rtl_Tcp_Dongle_Info info_; // IO members boost::asio::io_service io_service_; diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index 1fd5c2032..db56ff0b2 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -65,7 +65,9 @@ bool systemBytesAreBigEndian() byte_and_samples b{}; b.byte = static_cast(0x01); if (*reinterpret_cast(&b.byte) == 1) - return false; + { + return false; + } return true; } diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index b2148b23b..876a38d1d 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -39,7 +39,7 @@ * * Value_0, Value_1, Value_2, ..., Value_n, Value_n+1, Value_n+2, ... * - * \author Cillian O'Driscoll cillian.odriscoll (at) gmail . com + * \author Cillian O'Driscoll cillian.odriscoll (at) gmail . com * ------------------------------------------------------------------------- * * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) @@ -73,7 +73,7 @@ class unpack_2bit_samples; -typedef boost::shared_ptr unpack_2bit_samples_sptr; +using unpack_2bit_samples_sptr = boost::shared_ptr; unpack_2bit_samples_sptr make_unpack_2bit_samples(bool big_endian_bytes, size_t item_size, @@ -102,7 +102,7 @@ private: std::vector work_buffer_; public: - unpack_2bit_samples(bool big_endianBytes, + unpack_2bit_samples(bool big_endian_bytes, size_t item_size, bool big_endian_items, bool reverse_interleaving); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h index 090568aa7..66ff922df 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_cpx_samples.h @@ -39,7 +39,7 @@ class unpack_byte_2bit_cpx_samples; -typedef boost::shared_ptr unpack_byte_2bit_cpx_samples_sptr; +using unpack_byte_2bit_cpx_samples_sptr = boost::shared_ptr; unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h index 90ed74e60..92a115adf 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_2bit_samples.h @@ -35,7 +35,7 @@ class unpack_byte_2bit_samples; -typedef boost::shared_ptr unpack_byte_2bit_samples_sptr; +using unpack_byte_2bit_samples_sptr = boost::shared_ptr; unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h index 0a48bcb5f..8b9ad7454 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_byte_4bit_samples.h @@ -30,14 +30,14 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_unpack_byte_4bit_samples_H -#define GNSS_SDR_unpack_byte_4bit_samples_H +#ifndef GNSS_SDR_UNPACK_BYTE_4BIT_SAMPLES_H +#define GNSS_SDR_UNPACK_BYTE_4BIT_SAMPLES_H #include class unpack_byte_4bit_samples; -typedef boost::shared_ptr unpack_byte_4bit_samples_sptr; +using unpack_byte_4bit_samples_sptr = boost::shared_ptr; unpack_byte_4bit_samples_sptr make_unpack_byte_4bit_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h index 536816f0c..7b8e7d7dc 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_intspir_1bit_samples.h @@ -35,7 +35,7 @@ class unpack_intspir_1bit_samples; -typedef boost::shared_ptr unpack_intspir_1bit_samples_sptr; +using unpack_intspir_1bit_samples_sptr = boost::shared_ptr; unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples(); diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index a8f4b47f9..dcb0552ca 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -36,7 +36,7 @@ class unpack_spir_gss6450_samples; -typedef boost::shared_ptr unpack_spir_gss6450_samples_sptr; +using unpack_spir_gss6450_samples_sptr = boost::shared_ptr; unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int adc_nbit); @@ -47,7 +47,7 @@ public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); - void decode_4bits_word(uint32_t input_int32, gr_complex *out, int adc_bits); + void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits); unpack_spir_gss6450_samples(unsigned int adc_nbit); ~unpack_spir_gss6450_samples(); diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 3f2a6bbe5..f6015ec59 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -17,36 +17,25 @@ # if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - find_package(GRIIO REQUIRED) - if(NOT GRIIO_FOUND) - message(STATUS "gnuradio-iio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + if(NOT GRIIO_FOUND) + message(STATUS "gnuradio-iio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") + endif() endif() if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - find_package(LIBIIO REQUIRED) - if(NOT LIBIIO_FOUND) - message(STATUS "libiio not found, its installation is required.") - message(STATUS "Please build and install the following projects:") - message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") - message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") - message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - endif() - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS}) - - ############################################### - # FMCOMMS2 based SDR Hardware - ############################################### - if(LIBIIO_FOUND) + if(NOT LIBIIO_FOUND) + message(STATUS "libiio not found, its installation is required.") + message(STATUS "Please build and install the following projects:") + message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") + message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") + message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") + message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") + else() set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) endif() @@ -57,30 +46,62 @@ if(ENABLE_FPGA OR ENABLE_AD9361) set(OPT_SIGNAL_SOURCE_LIB_HEADERS ${OPT_SIGNAL_SOURCE_LIB_HEADERS} fpga_switch.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_DRIVER_INCLUDE_DIRS} -) - set(SIGNAL_SOURCE_LIB_SOURCES rtl_tcp_commands.cc rtl_tcp_dongle_info.cc + gnss_sdr_valve.cc ${OPT_SIGNAL_SOURCE_LIB_SOURCES} ) set(SIGNAL_SOURCE_LIB_HEADERS rtl_tcp_commands.h rtl_tcp_dongle_info.h + gnss_sdr_valve.h ${OPT_SIGNAL_SOURCE_LIB_HEADERS} ) list(SORT SIGNAL_SOURCE_LIB_HEADERS) list(SORT SIGNAL_SOURCE_LIB_SOURCES) -add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS}) -target_link_libraries(signal_source_lib ${OPT_LIBRARIES}) -add_dependencies(signal_source_lib glog-${glog_RELEASE}) + +add_library(signal_source_libs ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS}) + +target_link_libraries(signal_source_libs + PUBLIC + Boost::boost + Gnuradio::runtime + PRIVATE + Gflags::gflags + Glog::glog + core_receiver +) + +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + target_link_libraries(signal_source_libs + PUBLIC + Gnuradio::iio + PRIVATE + Iio::iio + ) +endif() + +if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) + target_link_libraries(signal_source_libs + PUBLIC + Iio::iio + ) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_source_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET signal_source_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/signal_source/libs/fpga_switch.cc b/src/algorithms/signal_source/libs/fpga_switch.cc index 71fd26eba..3f1caec12 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.cc +++ b/src/algorithms/signal_source/libs/fpga_switch.cc @@ -45,7 +45,7 @@ const size_t PAGE_SIZE = 0x10000; const unsigned int TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; -fpga_switch::fpga_switch(const 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) { @@ -67,7 +67,7 @@ fpga_switch::fpga_switch(const std::string &device_name) // sanity check : check test register unsigned writeval = TEST_REGISTER_TRACK_WRITEVAL; unsigned readval; - readval = fpga_switch::fpga_switch_test_register(writeval); + readval = Fpga_Switch::fpga_switch_test_register(writeval); if (writeval != readval) { LOG(WARNING) << "Test register sanity check failed"; @@ -81,19 +81,19 @@ fpga_switch::fpga_switch(const std::string &device_name) } -fpga_switch::~fpga_switch() +Fpga_Switch::~Fpga_Switch() { close_device(); } -void fpga_switch::set_switch_position(int switch_position) +void Fpga_Switch::set_switch_position(int switch_position) { d_map_base[0] = switch_position; } -unsigned fpga_switch::fpga_switch_test_register( +unsigned Fpga_Switch::fpga_switch_test_register( unsigned writeval) { unsigned readval; @@ -106,7 +106,7 @@ unsigned fpga_switch::fpga_switch_test_register( } -void fpga_switch::close_device() +void Fpga_Switch::close_device() { auto *aux = const_cast(d_map_base); if (munmap(static_cast(aux), PAGE_SIZE) == -1) diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index 2ab67dbef..f535bce7d 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -41,11 +41,11 @@ #define MAX_LENGTH_DEVICEIO_NAME 50 -class fpga_switch +class Fpga_Switch { public: - fpga_switch(const std::string& device_name); - ~fpga_switch(); + Fpga_Switch(const std::string& device_name); + ~Fpga_Switch(); void set_switch_position(int switch_position); private: diff --git a/src/algorithms/libs/gnss_sdr_valve.cc b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc similarity index 91% rename from src/algorithms/libs/gnss_sdr_valve.cc rename to src/algorithms/signal_source/libs/gnss_sdr_valve.cc index b613f3e2b..5e0d6f4cd 100644 --- a/src/algorithms/libs/gnss_sdr_valve.cc +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.cc @@ -39,7 +39,7 @@ #include // for memcpy #include -gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, +Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph) : gr::sync_block("valve", @@ -56,25 +56,25 @@ gnss_sdr_valve::gnss_sdr_valve(size_t sizeof_stream_item, boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph) { - boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph)); + boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph)); return valve_; } boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue) { - boost::shared_ptr valve_(new gnss_sdr_valve(sizeof_stream_item, nitems, std::move(queue), true)); + boost::shared_ptr valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true)); return valve_; } -void gnss_sdr_valve::open_valve() +void Gnss_Sdr_Valve::open_valve() { d_open_valve = true; } -int gnss_sdr_valve::work(int noutput_items, +int Gnss_Sdr_Valve::work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { @@ -94,7 +94,10 @@ int gnss_sdr_valve::work(int noutput_items, return 0; // do not produce or consume } uint64_t n = std::min(d_nitems - d_ncopied_items, static_cast(noutput_items)); - if (n == 0) return 0; + if (n == 0) + { + return 0; + } memcpy(output_items[0], input_items[0], n * input_signature()->sizeof_stream_item(0)); d_ncopied_items += n; return n; diff --git a/src/algorithms/libs/gnss_sdr_valve.h b/src/algorithms/signal_source/libs/gnss_sdr_valve.h similarity index 96% rename from src/algorithms/libs/gnss_sdr_valve.h rename to src/algorithms/signal_source/libs/gnss_sdr_valve.h index 19c104b99..16a141cd4 100644 --- a/src/algorithms/libs/gnss_sdr_valve.h +++ b/src/algorithms/signal_source/libs/gnss_sdr_valve.h @@ -52,7 +52,7 @@ boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, * \brief Implementation of a GNU Radio block that sends a STOP message to the * control queue right after a specific number of samples have passed through it. */ -class gnss_sdr_valve : public gr::sync_block +class Gnss_Sdr_Valve : public gr::sync_block { friend boost::shared_ptr gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, @@ -69,7 +69,7 @@ class gnss_sdr_valve : public gr::sync_block bool d_open_valve; public: - gnss_sdr_valve(size_t sizeof_stream_item, + Gnss_Sdr_Valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph); void open_valve(); diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc index fab664d28..09abb26db 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.cc @@ -37,13 +37,13 @@ using boost::asio::ip::tcp; -rtl_tcp_dongle_info::rtl_tcp_dongle_info() : tuner_type_(0), tuner_gain_count_(0) +Rtl_Tcp_Dongle_Info::Rtl_Tcp_Dongle_Info() : tuner_type_(0), tuner_gain_count_(0) { std::memset(magic_, 0, sizeof(magic_)); } -boost::system::error_code rtl_tcp_dongle_info::read(boost::asio::ip::tcp::socket &socket) +boost::system::error_code Rtl_Tcp_Dongle_Info::read(boost::asio::ip::tcp::socket &socket) { boost::system::error_code ec; @@ -67,7 +67,7 @@ boost::system::error_code rtl_tcp_dongle_info::read(boost::asio::ip::tcp::socket } -const char *rtl_tcp_dongle_info::get_type_name() const +const char *Rtl_Tcp_Dongle_Info::get_type_name() const { switch (get_tuner_type()) { @@ -89,7 +89,7 @@ const char *rtl_tcp_dongle_info::get_type_name() const } -double rtl_tcp_dongle_info::clip_gain(int gain) const +double Rtl_Tcp_Dongle_Info::clip_gain(int gain) const { // the following gain values have been copied from librtlsdr // all gain values are expressed in tenths of a dB @@ -121,7 +121,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const } // clip - if (gains.size() == 0) + if (gains.empty()) { // no defined gains to clip to return gain; @@ -138,10 +138,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const { return g; } - else - { - return last_stop; - } + return last_stop; } last_stop = g; } @@ -149,7 +146,7 @@ double rtl_tcp_dongle_info::clip_gain(int gain) const } -bool rtl_tcp_dongle_info::is_valid() const +bool Rtl_Tcp_Dongle_Info::is_valid() const { return std::memcmp(magic_, "RTL0", 4) == 0; } diff --git a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h index 983b94a29..e7ac9eb94 100644 --- a/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h +++ b/src/algorithms/signal_source/libs/rtl_tcp_dongle_info.h @@ -39,7 +39,7 @@ * \brief This class represents the dongle information * which is sent by rtl_tcp. */ -class rtl_tcp_dongle_info +class Rtl_Tcp_Dongle_Info { private: char magic_[4]{}; @@ -58,7 +58,7 @@ public: TUNER_R828D }; - rtl_tcp_dongle_info(); + Rtl_Tcp_Dongle_Info(); boost::system::error_code read(boost::asio::ip::tcp::socket &socket); diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index 3c354d806..17eb17e5d 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -41,32 +41,42 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS beidou_b1i_telemetry_decoder.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - list(SORT TELEMETRY_DECODER_ADAPTER_HEADERS) list(SORT TELEMETRY_DECODER_ADAPTER_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) + add_library(telemetry_decoder_adapters ${TELEMETRY_DECODER_ADAPTER_SOURCES} ${TELEMETRY_DECODER_ADAPTER_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_ADAPTER_HEADERS}) - target_link_libraries(telemetry_decoder_adapters - telemetry_decoder_gr_blocks - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} + PUBLIC + telemetry_decoder_gr_blocks + core_system_parameters + PRIVATE + Gflags::gflags + Glog::glog + Gnuradio::runtime + telemetry_decoder_libs +) + +target_include_directories(telemetry_decoder_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET telemetry_decoder_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index e123b8980..8e71b0681 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -38,37 +38,39 @@ set(TELEMETRY_DECODER_GR_BLOCKS_HEADERS beidou_b1i_telemetry_decoder_cc.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - list(SORT TELEMETRY_DECODER_GR_BLOCKS_HEADERS) list(SORT TELEMETRY_DECODER_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) + add_library(telemetry_decoder_gr_blocks ${TELEMETRY_DECODER_GR_BLOCKS_SOURCES} ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_GR_BLOCKS_HEADERS}) - target_link_libraries(telemetry_decoder_gr_blocks - telemetry_decoder_libswiftcnav - telemetry_decoder_lib - gnss_system_parameters - ${GNURADIO_RUNTIME_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} + PUBLIC + Gnuradio::runtime + Volkgnsssdr::volkgnsssdr + telemetry_decoder_libswiftcnav + telemetry_decoder_libs + core_system_parameters + PRIVATE + Boost::boost + Gflags::gflags + Glog::glog ) -if(NOT VOLKGNSSSDR_FOUND) - add_dependencies(telemetry_decoder_gr_blocks volk_gnsssdr_module) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET telemetry_decoder_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc index 0553023de..7a39e31ec 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.cc @@ -8,7 +8,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -33,7 +33,6 @@ #include "beidou_b1i_telemetry_decoder_cc.h" -#include "control_message_factory.h" #include "convolutional.h" #include "display.h" #include "gnss_synchro.h" @@ -74,7 +73,6 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( d_secondary_code_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_B1I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; // Setting samples of secondary code for (int32_t i = 0; i < BEIDOU_B1I_SECONDARY_CODE_LENGTH; i++) @@ -116,7 +114,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( } } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(double), volk_gnsssdr_get_alignment())); d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS * d_samples_per_symbol + d_samples_per_preamble; // Generic settings @@ -125,6 +123,7 @@ beidou_b1i_telemetry_decoder_cc::beidou_b1i_telemetry_decoder_cc( d_preamble_index = 0; d_flag_frame_sync = false; d_TOW_at_current_symbol_ms = 0; + d_TOW_at_Preamble_ms = 0U; Flag_valid_word = false; d_CRC_error_counter = 0; d_flag_preamble = false; @@ -155,15 +154,15 @@ beidou_b1i_telemetry_decoder_cc::~beidou_b1i_telemetry_decoder_cc() void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(const int32_t *bits, int32_t *decbits) { - int bit, err, reg[4] = {1, 1, 1, 1}; - int errind[15] = {14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; + int32_t bit, err, reg[4] = {1, 1, 1, 1}; + int32_t errind[15] = {14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2}; - for (unsigned int i = 0; i < 15; i++) + for (uint32_t i = 0; i < 15; i++) { decbits[i] = bits[i]; } - for (unsigned int i = 0; i < 15; i++) + for (uint32_t i = 0; i < 15; i++) { bit = reg[3]; reg[3] = reg[2]; @@ -181,6 +180,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_bch15_11_01(const int32_t *bits, in } } + void beidou_b1i_telemetry_decoder_cc::decode_word( int32_t word_counter, const double *enc_word_symbols, @@ -190,31 +190,31 @@ void beidou_b1i_telemetry_decoder_cc::decode_word( if (word_counter == 1) { - for (unsigned int j = 0; j < 30; j++) + for (uint32_t j = 0; j < 30; j++) { - dec_word_symbols[j] = (int32_t)(enc_word_symbols[j] > 0) ? (1) : (-1); + dec_word_symbols[j] = static_cast(enc_word_symbols[j] > 0) ? (1) : (-1); } } else { - for (unsigned int r = 0; r < 2; r++) + for (uint32_t r = 0; r < 2; r++) { - for (unsigned int c = 0; c < 15; c++) + for (uint32_t c = 0; c < 15; c++) { - bitsbch[r * 15 + c] = (int32_t)(enc_word_symbols[c * 2 + r] > 0) ? (1) : (-1); + bitsbch[r * 15 + c] = static_cast(enc_word_symbols[c * 2 + r] > 0) ? (1) : (-1); } } decode_bch15_11_01(&bitsbch[0], first_branch); decode_bch15_11_01(&bitsbch[15], second_branch); - for (unsigned int j = 0; j < 11; j++) + for (uint32_t j = 0; j < 11; j++) { dec_word_symbols[j] = first_branch[j]; dec_word_symbols[j + 11] = second_branch[j]; } - for (unsigned int j = 0; j < 4; j++) + for (uint32_t j = 0; j < 4; j++) { dec_word_symbols[j + 22] = first_branch[11 + j]; dec_word_symbols[j + 26] = second_branch[11 + j]; @@ -223,7 +223,7 @@ void beidou_b1i_telemetry_decoder_cc::decode_word( } -void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int32_t frame_length) +void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols) { // 1. Transform from symbols to bits std::string data_bits; @@ -288,9 +288,9 @@ void beidou_b1i_telemetry_decoder_cc::decode_subframe(double *frame_symbols, int } if (d_nav.have_new_almanac() == true) { - // unsigned int slot_nbr = d_nav.i_alm_satellite_PRN; - // std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); - // this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); + // uint32_t slot_nbr = d_nav.i_alm_satellite_PRN; + // std::shared_ptr tmp_obj = std::make_shared(d_nav.get_almanac(slot_nbr)); + // this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); LOG(INFO) << "BEIDOU DNAV Almanac have been received in channel" << d_channel << " from satellite " << d_satellite << std::endl; std::cout << "New BEIDOU B1I DNAV almanac received in channel " << d_channel << " from satellite " << d_satellite << std::endl; } @@ -322,7 +322,6 @@ void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell d_secondary_code_symbols = nullptr; d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_preamble_period_samples = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * d_samples_per_symbol; - d_subframe_length_symbols = BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; // Setting samples of preamble code int32_t n = 0; @@ -346,13 +345,13 @@ void beidou_b1i_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satell } } - d_subframe_symbols = static_cast(volk_gnsssdr_malloc(d_subframe_length_symbols * sizeof(double), volk_gnsssdr_get_alignment())); + d_subframe_symbols = static_cast(volk_gnsssdr_malloc(BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS * sizeof(double), volk_gnsssdr_get_alignment())); d_required_symbols = BEIDOU_DNAV_SUBFRAME_SYMBOLS * d_samples_per_symbol + d_samples_per_preamble; } } -void beidou_b1i_telemetry_decoder_cc::set_channel(int channel) +void beidou_b1i_telemetry_decoder_cc::set_channel(int32_t channel) { d_channel = channel; LOG(INFO) << "Navigation channel set to " << channel; @@ -388,11 +387,11 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ auto **out = reinterpret_cast(&output_items[0]); // Get the output buffer pointer const auto **in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer - Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block - //1. Copy the current tracking output + Gnss_Synchro current_symbol; // structure to save the synchronization information and send the output object to the next block + // 1. Copy the current tracking output current_symbol = in[0][0]; - d_symbol_history.push_back(current_symbol.Prompt_I); //add new symbol to the symbol queue - d_sample_counter++; //count for the processed samples + d_symbol_history.push_back(current_symbol.Prompt_I); // add new symbol to the symbol queue + d_sample_counter++; // count for the processed samples consume_each(1); d_flag_preamble = false; @@ -400,7 +399,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ if (d_symbol_history.size() > d_required_symbols) { //******* preamble correlation ******** - for (int i = 0; i < d_samples_per_preamble; i++) + for (int32_t i = 0; i < d_samples_per_preamble; i++) { if (d_symbol_history.at(i) < 0) // symbols clipping { @@ -414,7 +413,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } //******* frame sync ****************** - if (d_stat == 0) //no preamble information + if (d_stat == 0) // no preamble information { if (abs(corr_value) >= d_samples_per_preamble) { @@ -429,11 +428,11 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ { if (abs(corr_value) >= d_samples_per_preamble) { - //check preamble separation + // check preamble separation preamble_diff = static_cast(d_sample_counter - d_preamble_index); if (abs(preamble_diff - d_preamble_period_samples) == 0) { - //try to decode frame + // try to decode frame LOG(INFO) << "Starting BeiDou DNAV frame decoding for BeiDou B1I SAT " << this->d_satellite; d_preamble_index = d_sample_counter; //record the preamble sample stamp d_stat = 2; @@ -452,14 +451,14 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ { if (d_sample_counter == d_preamble_index + static_cast(d_preamble_period_samples)) { - //******* SAMPLES TO SYMBOLS ******* + // ******* SAMPLES TO SYMBOLS ******* if (corr_value > 0) //normal PLL lock { - int k = 0; - for (uint32_t i = 0; i < d_subframe_length_symbols; i++) + int32_t k = 0; + for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { d_subframe_symbols[i] = 0; - //integrate samples into symbols + // integrate samples into symbols for (uint32_t m = 0; m < d_samples_per_symbol; m++) { if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6) @@ -477,13 +476,13 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } } } - else //180 deg. inverted carrier phase PLL lock + else // 180 deg. inverted carrier phase PLL lock { - int k = 0; - for (uint32_t i = 0; i < d_subframe_length_symbols; i++) + int32_t k = 0; + for (uint32_t i = 0; i < BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS; i++) { d_subframe_symbols[i] = 0; - //integrate samples into symbols + // integrate samples into symbols for (uint32_t m = 0; m < d_samples_per_symbol; m++) { if (d_satellite.get_PRN() > 0 and d_satellite.get_PRN() < 6) @@ -502,14 +501,14 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } } - //call the decoder - decode_subframe(d_subframe_symbols, d_subframe_length_symbols); + // call the decoder + decode_subframe(d_subframe_symbols); if (d_nav.flag_crc_test == true) { d_CRC_error_counter = 0; - d_flag_preamble = true; //valid preamble indicator (initialized to false every work()) - d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P) + d_flag_preamble = true; // valid preamble indicator (initialized to false every work()) + d_preamble_index = d_sample_counter; // record the preamble sample stamp (t_P) if (!d_flag_frame_sync) { d_flag_frame_sync = true; @@ -519,7 +518,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ else { d_CRC_error_counter++; - d_preamble_index = d_sample_counter; //record the preamble sample stamp + d_preamble_index = d_sample_counter; // record the preamble sample stamp if (d_CRC_error_counter > CRC_ERROR_LIMIT) { LOG(INFO) << "BeiDou DNAV frame sync lost for SAT " << this->d_satellite; @@ -532,9 +531,9 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ } // UPDATE GNSS SYNCHRO DATA - //2. Add the telemetry decoder information + // 2. Add the telemetry decoder information if (this->d_flag_preamble == true and d_nav.flag_new_SOW_available == true) - //update TOW at the preamble instant + // update TOW at the preamble instant { // Reporting sow as gps time of week d_TOW_at_Preamble_ms = static_cast((d_nav.d_SOW + 14) * 1000.0); @@ -542,7 +541,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ flag_SOW_set = true; d_nav.flag_new_SOW_available = false; } - else //if there is not a new preamble, we define the TOW of the current symbol + else // if there is not a new preamble, we define the TOW of the current symbol { d_TOW_at_current_symbol_ms += static_cast(BEIDOU_B1I_CODE_PERIOD_MS); } @@ -566,11 +565,11 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ try { double tmp_double; - unsigned long int tmp_ulong_int; + uint64_t tmp_ulong_int; tmp_double = d_TOW_at_current_symbol_ms; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); tmp_ulong_int = current_symbol.Tracking_sample_counter; - d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(unsigned long int)); + d_dump_file.write(reinterpret_cast(&tmp_ulong_int), sizeof(uint64_t)); tmp_double = 0; d_dump_file.write(reinterpret_cast(&tmp_double), sizeof(double)); } @@ -585,7 +584,7 @@ int beidou_b1i_telemetry_decoder_cc::general_work(int noutput_items __attribute_ { d_symbol_history.pop_front(); } - //3. Make the output (copy the object contents to the GNURadio reserved memory) + // 3. Make the output (copy the object contents to the GNURadio reserved memory) *out[0] = current_symbol; return 1; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h index e3ce59392..e1b0b02ec 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/beidou_b1i_telemetry_decoder_cc.h @@ -9,7 +9,7 @@ * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -49,7 +49,7 @@ class beidou_b1i_telemetry_decoder_cc; -typedef boost::shared_ptr beidou_b1i_telemetry_decoder_cc_sptr; +using beidou_b1i_telemetry_decoder_cc_sptr = boost::shared_ptr; beidou_b1i_telemetry_decoder_cc_sptr beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); @@ -78,13 +78,12 @@ private: beidou_b1i_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); beidou_b1i_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); - void decode_subframe(double *symbols, int32_t frame_length); + void decode_subframe(double *symbols); void decode_word(int32_t word_counter, const double *enc_word_symbols, int32_t *dec_word_symbols); void decode_bch15_11_01(const int32_t *bits, int32_t *decbits); - //!< Preamble decoding - unsigned short int d_preambles_symbols[BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS]; + // Preamble decoding int32_t *d_preamble_samples; int32_t *d_secondary_code_symbols; uint32_t d_samples_per_symbol; @@ -92,20 +91,19 @@ private: int32_t d_samples_per_preamble; int32_t d_preamble_period_samples; double *d_subframe_symbols; - uint32_t d_subframe_length_symbols; uint32_t d_required_symbols; - //!< Storage for incoming data + // Storage for incoming data std::deque d_symbol_history; - //!< Variables for internal functionality - uint64_t d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed - uint64_t d_preamble_index; //!< Index of sample number where preamble was found - uint32_t d_stat; //!< Status of decoder - bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved - bool d_flag_preamble; //!< Flag indicating when preamble was found - int32_t d_CRC_error_counter; //!< Number of failed CRC operations - bool flag_SOW_set; //!< Indicates when time of week is set + // Variables for internal functionality + uint64_t d_sample_counter; // Sample counter as an index (1,2,3,..etc) indicating number of samples processed + uint64_t d_preamble_index; // Index of sample number where preamble was found + uint32_t d_stat; // Status of decoder + bool d_flag_frame_sync; // Indicate when a frame sync is achieved + bool d_flag_preamble; // Flag indicating when preamble was found + int32_t d_CRC_error_counter; // Number of failed CRC operations + bool flag_SOW_set; // Indicates when time of week is set //!< Navigation Message variable Beidou_Dnav_Navigation_Message d_nav; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc index bb5b68a9e..cf794ca49 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.cc @@ -30,7 +30,6 @@ #include "galileo_telemetry_decoder_cc.h" -#include "control_message_factory.h" #include "convolutional.h" #include "display.h" #include "gnss_synchro.h" @@ -89,8 +88,8 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( { case 1: // INAV { - d_PRN_code_period_ms = static_cast(GALILEO_E1_CODE_PERIOD_MS); - d_samples_per_symbol = Galileo_E1_B_SAMPLES_PER_SYMBOL; + d_PRN_code_period_ms = static_cast(GALILEO_E5A_CODE_PERIOD_MS); + d_samples_per_symbol = GALILEO_E1_B_SAMPLES_PER_SYMBOL; d_bits_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS; // set the preamble d_samples_per_preamble = GALILEO_INAV_PREAMBLE_LENGTH_BITS * d_samples_per_symbol; @@ -106,7 +105,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( } case 2: // FNAV { - d_PRN_code_period_ms = static_cast(GALILEO_E5a_CODE_PERIOD_MS); + d_PRN_code_period_ms = static_cast(GALILEO_E5A_CODE_PERIOD_MS); d_samples_per_symbol = GALILEO_FNAV_CODES_PER_SYMBOL; d_bits_per_preamble = GALILEO_FNAV_PREAMBLE_LENGTH_BITS; // set the preamble @@ -115,13 +114,13 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( d_required_symbols = static_cast(GALILEO_FNAV_SYMBOLS_PER_PAGE) * d_samples_per_symbol + d_samples_per_preamble; // preamble bits to sampled symbols d_preamble_samples = static_cast(volk_gnsssdr_malloc(d_samples_per_preamble * sizeof(int32_t), volk_gnsssdr_get_alignment())); - d_secondary_code_samples = static_cast(volk_gnsssdr_malloc(Galileo_E5a_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); + d_secondary_code_samples = static_cast(volk_gnsssdr_malloc(GALILEO_E5A_I_SECONDARY_CODE_LENGTH * sizeof(int32_t), volk_gnsssdr_get_alignment())); d_frame_length_symbols = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; CodeLength = GALILEO_FNAV_SYMBOLS_PER_PAGE - GALILEO_FNAV_PREAMBLE_LENGTH_BITS; DataLength = (CodeLength / nn) - mm; - for (int32_t i = 0; i < Galileo_E5a_I_SECONDARY_CODE_LENGTH; i++) + for (int32_t i = 0; i < GALILEO_E5A_I_SECONDARY_CODE_LENGTH; i++) { - if (Galileo_E5a_I_SECONDARY_CODE.at(i) == '1') + if (GALILEO_E5A_I_SECONDARY_CODE.at(i) == '1') { d_secondary_code_samples[i] = 1; } @@ -184,7 +183,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( d_preamble_samples[n] = d_secondary_code_samples[m]; n++; m++; - m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH; + m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH; } } else @@ -194,7 +193,7 @@ galileo_telemetry_decoder_cc::galileo_telemetry_decoder_cc( d_preamble_samples[n] = -d_secondary_code_samples[m]; n++; m++; - m = m % Galileo_E5a_I_SECONDARY_CODE_LENGTH; + m = m % GALILEO_E5A_I_SECONDARY_CODE_LENGTH; } } break; @@ -564,7 +563,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { d_page_part_symbols[i] += static_cast(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now! k++; - k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH; + k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH; } } } @@ -578,7 +577,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { d_page_part_symbols[i] -= static_cast(d_secondary_code_samples[k]) * d_symbol_history.at(i * d_samples_per_symbol + d_samples_per_preamble + m); // because last symbol of the preamble is just received now! k++; - k = k % Galileo_E5a_I_SECONDARY_CODE_LENGTH; + k = k % GALILEO_E5A_I_SECONDARY_CODE_LENGTH; } } } @@ -635,7 +634,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { // TOW_5 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay d_TOW_at_Preamble_ms = static_cast(d_inav_nav.TOW_5 * 1000.0); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); d_inav_nav.flag_TOW_5 = false; } @@ -643,13 +642,13 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { // TOW_6 refers to the even preamble, but when we decode it we are in the odd part, so 1 second later plus the decoding delay d_TOW_at_Preamble_ms = static_cast(d_inav_nav.TOW_6 * 1000.0); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E1_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast(GALILEO_INAV_PAGE_PART_MS + (d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); d_inav_nav.flag_TOW_6 = false; } else { // this page has no timing information - d_TOW_at_current_symbol_ms += static_cast(GALILEO_E1_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD; + d_TOW_at_current_symbol_ms += static_cast(GALILEO_E5A_CODE_PERIOD_MS); // + GALILEO_INAV_PAGE_PART_SYMBOLS*GALILEO_E1_CODE_PERIOD; } } break; @@ -661,7 +660,7 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( if (d_fnav_nav.flag_TOW_1 == true) { d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_1 * 1000.0); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); //d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS); d_fnav_nav.flag_TOW_1 = false; } @@ -669,26 +668,26 @@ int galileo_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( { d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_2 * 1000.0); //d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); d_fnav_nav.flag_TOW_2 = false; } else if (d_fnav_nav.flag_TOW_3 == true) { d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_3 * 1000.0); //d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); d_fnav_nav.flag_TOW_3 = false; } else if (d_fnav_nav.flag_TOW_4 == true) { d_TOW_at_Preamble_ms = static_cast(d_fnav_nav.FNAV_TOW_4 * 1000.0); //d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((GALILEO_FNAV_CODES_PER_PAGE + GALILEO_FNAV_CODES_PER_PREAMBLE) * GALILEO_E5a_CODE_PERIOD_MS); - d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5a_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms = d_TOW_at_Preamble_ms + static_cast((d_required_symbols + 1) * GALILEO_E5A_CODE_PERIOD_MS); d_fnav_nav.flag_TOW_4 = false; } else { - d_TOW_at_current_symbol_ms += static_cast(GALILEO_E5a_CODE_PERIOD_MS); + d_TOW_at_current_symbol_ms += static_cast(GALILEO_E5A_CODE_PERIOD_MS); } break; } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h index c06df6010..96bd0081b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_cc.h @@ -50,7 +50,7 @@ class galileo_telemetry_decoder_cc; -typedef boost::shared_ptr galileo_telemetry_decoder_cc_sptr; +using galileo_telemetry_decoder_cc_sptr = boost::shared_ptr; galileo_telemetry_decoder_cc_sptr galileo_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, int frame_type, bool dump); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h index 1bdde14da..01b8dcd5a 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l1_ca_telemetry_decoder_cc.h @@ -48,7 +48,7 @@ class glonass_l1_ca_telemetry_decoder_cc; -typedef boost::shared_ptr glonass_l1_ca_telemetry_decoder_cc_sptr; +using glonass_l1_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; glonass_l1_ca_telemetry_decoder_cc_sptr glonass_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h index 8b1a25ee9..0ee799a34 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/glonass_l2_ca_telemetry_decoder_cc.h @@ -47,7 +47,7 @@ class glonass_l2_ca_telemetry_decoder_cc; -typedef boost::shared_ptr glonass_l2_ca_telemetry_decoder_cc_sptr; +using glonass_l2_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; glonass_l2_ca_telemetry_decoder_cc_sptr glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc index ef2988629..658397b46 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc @@ -30,7 +30,6 @@ */ #include "gps_l1_ca_telemetry_decoder_cc.h" -#include "control_message_factory.h" #include #include #include @@ -204,7 +203,10 @@ bool gps_l1_ca_telemetry_decoder_cc::decode_subframe() if (symbol_accumulator_counter == 20) { // symbol to bit - if (symbol_accumulator > 0) GPS_frame_4bytes += 1; // insert the telemetry bit in LSB + if (symbol_accumulator > 0) + { + GPS_frame_4bytes += 1; // insert the telemetry bit in LSB + } symbol_accumulator = 0; symbol_accumulator_counter = 0; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h index c1b55cd9f..f77a98153 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h @@ -42,7 +42,7 @@ class gps_l1_ca_telemetry_decoder_cc; -typedef boost::shared_ptr gps_l1_ca_telemetry_decoder_cc_sptr; +using gps_l1_ca_telemetry_decoder_cc_sptr = boost::shared_ptr; gps_l1_ca_telemetry_decoder_cc_sptr gps_l1_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h index 8b5922575..3c7747f1b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l2c_telemetry_decoder_cc.h @@ -57,7 +57,7 @@ extern "C" class gps_l2c_telemetry_decoder_cc; -typedef boost::shared_ptr gps_l2c_telemetry_decoder_cc_sptr; +using gps_l2c_telemetry_decoder_cc_sptr = boost::shared_ptr; gps_l2c_telemetry_decoder_cc_sptr gps_l2c_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc index 76e64eaaf..a0b54b74d 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.cc @@ -68,9 +68,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc( d_TOW_at_Preamble_ms = 0U; // initialize the CNAV frame decoder (libswiftcnav) cnav_msg_decoder_init(&d_cnav_decoder); - for (int32_t aux = 0; aux < GPS_L5i_NH_CODE_LENGTH; aux++) + for (int32_t aux = 0; aux < GPS_L5I_NH_CODE_LENGTH; aux++) { - if (GPS_L5i_NH_CODE[aux] == 0) + if (GPS_L5I_NH_CODE[aux] == 0) { bits_NH[aux] = -1.0; } @@ -154,9 +154,9 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u int32_t symbol_value = 0; // Search correlation with Neuman-Hofman Code (see IS-GPS-705D) - if (sym_hist.size() == GPS_L5i_NH_CODE_LENGTH) + if (sym_hist.size() == GPS_L5I_NH_CODE_LENGTH) { - for (int32_t i = 0; i < GPS_L5i_NH_CODE_LENGTH; i++) + for (int32_t i = 0; i < GPS_L5I_NH_CODE_LENGTH; i++) { if ((bits_NH[i] * sym_hist.at(i)) > 0.0) { @@ -167,7 +167,7 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u corr_NH -= 1; } } - if (abs(corr_NH) == GPS_L5i_NH_CODE_LENGTH) + if (abs(corr_NH) == GPS_L5I_NH_CODE_LENGTH) { sync_NH = true; if (corr_NH > 0) @@ -241,12 +241,12 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u // delay by the formulae: // \code // symbolTime_ms = msg->tow * 6000 + *pdelay * 10 + (12 * 10); 12 symbols of the encoder's transitory - d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5i_SYMBOL_PERIOD_MS; + d_TOW_at_current_symbol_ms = msg.tow * 6000 + (delay + 12) * GPS_L5I_SYMBOL_PERIOD_MS; d_flag_valid_word = true; } else { - d_TOW_at_current_symbol_ms += GPS_L5i_PERIOD_MS; + d_TOW_at_current_symbol_ms += GPS_L5I_PERIOD_MS; if (current_synchro_data.Flag_valid_symbol_output == false) { d_flag_valid_word = false; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h index eb57696bc..d28e8b58f 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l5_telemetry_decoder_cc.h @@ -53,7 +53,7 @@ extern "C" class gps_l5_telemetry_decoder_cc; -typedef boost::shared_ptr gps_l5_telemetry_decoder_cc_sptr; +using gps_l5_telemetry_decoder_cc_sptr = boost::shared_ptr; gps_l5_telemetry_decoder_cc_sptr gps_l5_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); @@ -90,7 +90,7 @@ private: bool d_flag_valid_word; Gps_CNAV_Navigation_Message d_CNAV_Message; - double bits_NH[GPS_L5i_NH_CODE_LENGTH]{}; + double bits_NH[GPS_L5I_NH_CODE_LENGTH]{}; std::deque sym_hist; bool sync_NH; bool new_sym; diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc index 705df32a4..8a3628cbd 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.cc @@ -29,7 +29,6 @@ */ #include "sbas_l1_telemetry_decoder_cc.h" -#include "control_message_factory.h" #include "gnss_synchro.h" #include #include @@ -65,7 +64,7 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc( d_dump = dump; d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite; - d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits; + d_block_size = D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * D_BLOCK_SIZE_IN_BITS; d_channel = 0; set_output_multiple(1); } @@ -102,7 +101,7 @@ void sbas_l1_telemetry_decoder_cc::set_channel(int32_t channel) // ### helper class for sample alignment ### -sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() +sbas_l1_telemetry_decoder_cc::Sample_Aligner::Sample_Aligner() { d_n_smpls_in_history = 3; d_iir_par = 0.05; @@ -110,10 +109,10 @@ sbas_l1_telemetry_decoder_cc::sample_aligner::sample_aligner() } -sbas_l1_telemetry_decoder_cc::sample_aligner::~sample_aligner() = default; +sbas_l1_telemetry_decoder_cc::Sample_Aligner::~Sample_Aligner() = default; -void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() +void sbas_l1_telemetry_decoder_cc::Sample_Aligner::reset() { d_past_sample = 0; d_corr_paired = 0; @@ -125,7 +124,7 @@ void sbas_l1_telemetry_decoder_cc::sample_aligner::reset() /* * samples length must be a multiple of two */ -bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector &samples, std::vector &symbols) +bool sbas_l1_telemetry_decoder_cc::Sample_Aligner::get_symbols(const std::vector &samples, std::vector &symbols) { double smpls[3] = {}; double corr_diff; @@ -135,12 +134,12 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector VLOG(FLOW) << "get_symbols(): " << "d_past_sample=" << d_past_sample << "\tsamples size=" << samples.size(); - for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::d_samples_per_symbol; i_sym++) + for (uint32_t i_sym = 0; i_sym < samples.size() / sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL; i_sym++) { // get the next samples for (int32_t i = 0; i < d_n_smpls_in_history; i++) { - smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::d_samples_per_symbol + i - 1]; + smpls[i] = static_cast(i_sym) * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1 == -1 ? d_past_sample : samples[i_sym * sbas_l1_telemetry_decoder_cc::D_SAMPLES_PER_SYMBOL + i - 1]; } // update the pseudo correlations (IIR method) of the two possible alignments @@ -183,7 +182,7 @@ bool sbas_l1_telemetry_decoder_cc::sample_aligner::get_symbols(const std::vector // ### helper class for symbol alignment and viterbi decoding ### -sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_decoder() +sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::Symbol_Aligner_And_Decoder() { // convolutional code properties d_KK = 7; @@ -198,14 +197,14 @@ sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::symbol_aligner_and_dec } -sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::~symbol_aligner_and_decoder() +sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::~Symbol_Aligner_And_Decoder() { delete d_vd1; delete d_vd2; } -void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset() +void sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::reset() { d_past_symbol = 0; d_vd1->reset(); @@ -213,10 +212,10 @@ void sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::reset() } -bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector &symbols, std::vector &bits) +bool sbas_l1_telemetry_decoder_cc::Symbol_Aligner_And_Decoder::get_bits(const std::vector &symbols, std::vector &bits) { const int32_t traceback_depth = 5 * d_KK; - int32_t nbits_requested = symbols.size() / d_symbols_per_bit; + int32_t nbits_requested = symbols.size() / D_SYMBOLS_PER_BIT; int32_t nbits_decoded; // fill two vectors with the two possible symbol alignments std::vector symbols_vd1(symbols); // aligned symbol vector -> copy input symbol vector @@ -252,13 +251,13 @@ bool sbas_l1_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const st // ### helper class for detecting the preamble and collect the corresponding message candidates ### -void sbas_l1_telemetry_decoder_cc::frame_detector::reset() +void sbas_l1_telemetry_decoder_cc::Frame_Detector::reset() { d_buffer.clear(); } -void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates) +void sbas_l1_telemetry_decoder_cc::Frame_Detector::get_frame_candidates(const std::vector &bits, std::vector>> &msg_candidates) { std::stringstream ss; uint32_t sbas_msg_length = 250; @@ -300,13 +299,17 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st { // invert bits for (int &candidate_bit_it : candidate) - candidate_bit_it = candidate_bit_it == 0 ? 1 : 0; + { + candidate_bit_it = candidate_bit_it == 0 ? 1 : 0; + } } msg_candidates.emplace_back(relative_preamble_start, candidate); ss.str(""); ss << "preamble " << preample_it - preambles.begin() << (inv_preamble_detected ? " inverted" : " normal") << " detected! candidate="; for (auto bit_it = candidate.begin(); bit_it < candidate.end(); ++bit_it) - ss << *bit_it; + { + ss << *bit_it; + } VLOG(EVENT) << ss.str(); } } @@ -318,12 +321,12 @@ void sbas_l1_telemetry_decoder_cc::frame_detector::get_frame_candidates(const st // ### helper class for checking the CRC of the message candidates ### -void sbas_l1_telemetry_decoder_cc::crc_verifier::reset() +void sbas_l1_telemetry_decoder_cc::Crc_Verifier::reset() { } -void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector &msg_candidates, std::vector &valid_msgs) +void sbas_l1_telemetry_decoder_cc::Crc_Verifier::get_valid_frames(const std::vector &msg_candidates, std::vector &valid_msgs) { std::stringstream ss; VLOG(FLOW) << "get_valid_frames(): " @@ -361,7 +364,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vec } -void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) +void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_back_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) { std::stringstream ss; const size_t bits_per_byte = 8; @@ -388,7 +391,7 @@ void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_by } -void sbas_l1_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) +void sbas_l1_telemetry_decoder_cc::Crc_Verifier::zerropad_front_and_convert_to_bytes(const std::vector &msg_candidate, std::vector &bytes) { std::stringstream ss; const size_t bits_per_byte = 8; @@ -463,7 +466,7 @@ int sbas_l1_telemetry_decoder_cc::general_work(int noutput_items __attribute__(( for (const auto &valid_msg : valid_msgs) { int32_t message_sample_offset = - (sample_alignment ? 0 : -1) + d_samples_per_symbol * (symbol_alignment ? -1 : 0) + d_samples_per_symbol * d_symbols_per_bit * valid_msg.first; + (sample_alignment ? 0 : -1) + D_SAMPLES_PER_SYMBOL * (symbol_alignment ? -1 : 0) + D_SAMPLES_PER_SYMBOL * D_SYMBOLS_PER_BIT * valid_msg.first; double message_sample_stamp = sample_stamp + static_cast(message_sample_offset) / 1000.0; VLOG(EVENT) << "message_sample_stamp=" << message_sample_stamp << " (sample_stamp=" << sample_stamp diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h index 5dcf4f27b..f1188737b 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/sbas_l1_telemetry_decoder_cc.h @@ -46,7 +46,7 @@ class sbas_l1_telemetry_decoder_cc; -typedef boost::shared_ptr sbas_l1_telemetry_decoder_cc_sptr; +using sbas_l1_telemetry_decoder_cc_sptr = boost::shared_ptr; sbas_l1_telemetry_decoder_cc_sptr sbas_l1_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump); @@ -76,9 +76,9 @@ private: void viterbi_decoder(double *page_part_symbols, int32_t *page_part_bits); void align_samples(); - static const int32_t d_samples_per_symbol = 2; - static const int32_t d_symbols_per_bit = 2; - static const int32_t d_block_size_in_bits = 30; + static const int32_t D_SAMPLES_PER_SYMBOL = 2; + static const int32_t D_SYMBOLS_PER_BIT = 2; + static const int32_t D_BLOCK_SIZE_IN_BITS = 30; bool d_dump; Gnss_Satellite d_satellite; @@ -94,11 +94,11 @@ private: typedef std::pair> msg_candiate_char_t; // helper class for sample alignment - class sample_aligner + class Sample_Aligner { public: - sample_aligner(); - ~sample_aligner(); + Sample_Aligner(); + ~Sample_Aligner(); void reset(); /* * samples length must be a multiple of two @@ -116,11 +116,11 @@ private: } d_sample_aligner; // helper class for symbol alignment and Viterbi decoding - class symbol_aligner_and_decoder + class Symbol_Aligner_And_Decoder { public: - symbol_aligner_and_decoder(); - ~symbol_aligner_and_decoder(); + Symbol_Aligner_And_Decoder(); + ~Symbol_Aligner_And_Decoder(); void reset(); bool get_bits(const std::vector &symbols, std::vector &bits); @@ -133,7 +133,7 @@ private: // helper class for detecting the preamble and collect the corresponding message candidates - class frame_detector + class Frame_Detector { public: void reset(); @@ -145,7 +145,7 @@ private: // helper class for checking the CRC of the message candidates - class crc_verifier + class Crc_Verifier { public: void reset(); diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 53a997cc8..a802b970c 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -28,24 +28,32 @@ set(TELEMETRY_DECODER_LIB_HEADERS convolutional.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} -) - list(SORT TELEMETRY_DECODER_LIB_HEADERS) list(SORT TELEMETRY_DECODER_LIB_SOURCES) -add_library(telemetry_decoder_lib +source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) + +add_library(telemetry_decoder_libs ${TELEMETRY_DECODER_LIB_SOURCES} ${TELEMETRY_DECODER_LIB_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_LIB_HEADERS}) -target_link_libraries(telemetry_decoder_lib gnss_system_parameters) +target_link_libraries(telemetry_decoder_libs + PRIVATE + Gflags::gflags + Glog::glog +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(telemetry_decoder_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET telemetry_decoder_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/telemetry_decoder/libs/convolutional.h b/src/algorithms/telemetry_decoder/libs/convolutional.h index 4195154df..cc775110b 100644 --- a/src/algorithms/telemetry_decoder/libs/convolutional.h +++ b/src/algorithms/telemetry_decoder/libs/convolutional.h @@ -88,7 +88,7 @@ inline static int parity_counter(int symbol, int length) inline static int nsc_enc_bit(int state_out_p[], int input, int state_in, - int g[], + const int g[], int KK, int nn) { @@ -144,7 +144,7 @@ inline static void nsc_transit(int output_p[], * \param[in] nn The length of the received vector * */ -inline static float Gamma(float rec_array[], +inline static float Gamma(const float rec_array[], int symbol, int nn) { @@ -155,7 +155,9 @@ inline static float Gamma(float rec_array[], for (i = 0; i < nn; i++) { if (symbol & mask) - rm += rec_array[nn - i - 1]; + { + rm += rec_array[nn - i - 1]; + } mask = mask << 1; } return (rm); @@ -175,11 +177,11 @@ inline static float Gamma(float rec_array[], * */ inline static void Viterbi(int output_u_int[], - int out0[], - int state0[], - int out1[], - int state1[], - double input_c[], + const int out0[], + const int state0[], + const int out1[], + const int state1[], + const double input_c[], int KK, int nn, int LL) @@ -219,11 +221,15 @@ inline static void Viterbi(int output_u_int[], for (t = 0; t < LL + mm; t++) { for (i = 0; i < nn; i++) - rec_array[i] = static_cast(input_c[nn * t + i]); + { + rec_array[i] = static_cast(input_c[nn * t + i]); + } /* precompute all possible branch metrics */ for (i = 0; i < number_symbols; i++) - metric_c[i] = Gamma(rec_array, i, nn); + { + metric_c[i] = Gamma(rec_array, i, nn); + } /* step through all states */ for (state = 0; state < states; state++) diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt index af753c057..ffe8b2c37 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -31,19 +31,21 @@ set(TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS fec.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} -) - list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS) list(SORT TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES) +source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) + add_library(telemetry_decoder_libswiftcnav STATIC ${TELEMETRY_DECODER_LIBSWIFTCNAV_SOURCES} ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS} ) -source_group(Headers FILES ${TELEMETRY_DECODER_LIBSWIFTCNAV_HEADERS}) +set_property(TARGET telemetry_decoder_libswiftcnav + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) set_target_properties(telemetry_decoder_libswiftcnav - PROPERTIES LINKER_LANGUAGE C) + PROPERTIES LINKER_LANGUAGE C +) diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c index 866b822fb..1cbe9eb12 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.c @@ -30,12 +30,11 @@ */ #include "bits.h" - #include #include -static const u8 bitn[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; +static const uint8_t BITN[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; /** \defgroup bits Bit Utils * Bit field packing, unpacking and utility functions. @@ -50,7 +49,7 @@ static const u8 bitn[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; * \return 1 if there are an odd number of bits set. * 0 if there are an even number of bits set. */ -u8 parity(u32 x) +uint8_t parity(uint32_t x) { x ^= x >> 16; x ^= x >> 8; @@ -69,14 +68,14 @@ u8 parity(u32 x) * \param len Length of bit field in bits. * \return Bit field as an unsigned value. */ -u32 getbitu(const u8 *buff, u32 pos, u8 len) +uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len) { - u32 bits = 0; - u32 i=0; + uint32_t bits = 0; + uint32_t i = 0; for (i = pos; i < pos + len; i++) { bits = (bits << 1) + - ((buff[i/8] >> (7 - i%8)) & 1u); + ((buff[i / 8] >> (7 - i % 8)) & 1u); } return bits; @@ -93,14 +92,14 @@ u32 getbitu(const u8 *buff, u32 pos, u8 len) * \param len Length of bit field in bits. * \return Bit field as a signed value. */ -s32 getbits(const u8 *buff, u32 pos, u8 len) +int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len) { - s32 bits = (s32)getbitu(buff, pos, len); + int32_t bits = (int32_t)getbitu(buff, pos, len); /* Sign extend, taken from: * http://graphics.stanford.edu/~seander/bithacks.html#VariableSignExtend */ - s32 m = 1u << (len - 1); + int32_t m = 1u << (len - 1); return (bits ^ m) - m; } @@ -113,19 +112,25 @@ s32 getbits(const u8 *buff, u32 pos, u8 len) * \param len Length of bit field in bits. * \param data Unsigned integer to be packed into bit field. */ -void setbitu(u8 *buff, u32 pos, u32 len, u32 data) +void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data) { - u32 mask = 1u << (len - 1); + uint32_t mask = 1u << (len - 1); if (len <= 0 || 32 < len) - return; - u32 i = 0; + { + return; + } + uint32_t i = 0; for (i = pos; i < pos + len; i++, mask >>= 1) { if (data & mask) - buff[i/8] |= 1u << (7 - i % 8); + { + buff[i / 8] |= 1u << (7 - i % 8); + } else - buff[i/8] &= ~(1u << (7 - i % 8)); + { + buff[i / 8] &= ~(1u << (7 - i % 8)); + } } } @@ -138,9 +143,9 @@ void setbitu(u8 *buff, u32 pos, u32 len, u32 data) * \param len Length of bit field in bits. * \param data Signed integer to be packed into bit field. */ -void setbits(u8 *buff, u32 pos, u32 len, s32 data) +void setbits(uint8_t *buff, uint32_t pos, uint32_t len, int32_t data) { - setbitu(buff, pos, len, (u32)data); + setbitu(buff, pos, len, (uint32_t)data); } /** @@ -153,7 +158,7 @@ void setbits(u8 *buff, u32 pos, u32 len, s32 data) * * \return None */ -void bitshl(void *buf, u32 size, u32 shift) +void bitshl(void *buf, uint32_t size, uint32_t shift) { if (shift > size * CHAR_BIT) { @@ -162,12 +167,12 @@ void bitshl(void *buf, u32 size, u32 shift) return; } - unsigned char *dst = buf; /* Destination byte. */ + unsigned char *dst = buf; /* Destination byte. */ const unsigned char *src = dst + shift / CHAR_BIT; /* First source byte, possibly incomplete. */ - u32 copy_bits = size * CHAR_BIT - shift; /* Number of bits to move */ - u32 byte_shift = copy_bits % CHAR_BIT; /* Shift of data */ - u32 full_bytes = copy_bits / CHAR_BIT; /* Number of bytes to move */ + uint32_t copy_bits = size * CHAR_BIT - shift; /* Number of bits to move */ + uint32_t byte_shift = copy_bits % CHAR_BIT; /* Shift of data */ + uint32_t full_bytes = copy_bits / CHAR_BIT; /* Number of bytes to move */ if (0 == byte_shift) { @@ -179,8 +184,8 @@ void bitshl(void *buf, u32 size, u32 shift) else { /* Create an accumulator: it will hold a value of two consecutive bytes */ - u32 acc = *src++; - u32 i = 0; + uint32_t acc = *src++; + uint32_t i = 0; for (i = 0; i < full_bytes; ++i) { acc = (acc << CHAR_BIT) | *src++; @@ -210,22 +215,22 @@ void bitshl(void *buf, u32 size, u32 shift) * \todo This function can be optimized for copying aligned data and using * proper native type like long. */ -void bitcopy(void *dst, u32 dst_index, const void *src, u32 src_index, - u32 count) +void bitcopy(void *dst, uint32_t dst_index, const void *src, uint32_t src_index, + uint32_t count) { - u32 limit1 = count / 32; - u32 limit2 = count % 32; - u32 idx = 0; + uint32_t limit1 = count / 32; + uint32_t limit2 = count % 32; + uint32_t idx = 0; for (idx = 0; idx < limit1; ++idx) { - u32 tmp = getbitu(src, src_index, 32); + uint32_t tmp = getbitu(src, src_index, 32); setbitu(dst, dst_index, 32, tmp); src_index += 32; dst_index += 32; } if (0 != limit2) { - u32 tmp = getbitu(src, src_index, limit2); + uint32_t tmp = getbitu(src, src_index, limit2); setbitu(dst, dst_index, limit2, tmp); } } @@ -238,12 +243,14 @@ void bitcopy(void *dst, u32 dst_index, const void *src, u32 src_index, * * \return Number of bits set to one or zero. */ -u8 count_bits_u64(u64 v, u8 bv) +uint8_t count_bits_u64(uint64_t v, uint8_t bv) { - u8 r = 0; + uint8_t r = 0; int i = 0; for (i = 0; i < 16; i++) - r += bitn[(v >> (i*4)) & 0xf]; + { + r += BITN[(v >> (i * 4)) & 0xf]; + } return bv == 1 ? r : 64 - r; } @@ -255,12 +262,14 @@ u8 count_bits_u64(u64 v, u8 bv) * * \return Number of bits set to one or zero. */ -u8 count_bits_u32(u32 v, u8 bv) +uint8_t count_bits_u32(uint32_t v, uint8_t bv) { - u8 r = 0; + uint8_t r = 0; int i = 0; for (i = 0; i < 8; i++) - r += bitn[(v >> (i*4)) & 0xf]; + { + r += BITN[(v >> (i * 4)) & 0xf]; + } return bv == 1 ? r : 32 - r; } @@ -272,12 +281,14 @@ u8 count_bits_u32(u32 v, u8 bv) * * \return Number of bits set to one or zero. */ -u8 count_bits_u16(u16 v, u8 bv) +uint8_t count_bits_u16(uint16_t v, uint8_t bv) { - u8 r = 0; + uint8_t r = 0; int i = 0; - for (i= 0; i < 4; i++) - r += bitn[(v >> (i*4)) & 0xf]; + for (i = 0; i < 4; i++) + { + r += BITN[(v >> (i * 4)) & 0xf]; + } return bv == 1 ? r : 16 - r; } @@ -289,12 +300,14 @@ u8 count_bits_u16(u16 v, u8 bv) * * \return Number of bits set to one or zero. */ -u8 count_bits_u8(u8 v, u8 bv) +uint8_t count_bits_u8(uint8_t v, uint8_t bv) { - u8 r = 0; + uint8_t r = 0; int i = 0; for (i = 0; i < 2; i++) - r += bitn[(v >> (i*4)) & 0xf]; + { + r += BITN[(v >> (i * 4)) & 0xf]; + } return bv == 1 ? r : 8 - r; } diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h index 8e73ccf4a..11f5e512e 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/bits.h @@ -34,17 +34,17 @@ #include "swift_common.h" -u8 parity(u32 x); -u32 getbitu(const u8 *buff, u32 pos, u8 len); -s32 getbits(const u8 *buff, u32 pos, u8 len); -void setbitu(u8 *buff, u32 pos, u32 len, u32 data); -void setbits(u8 *buff, u32 pos, u32 len, s32 data); -void bitcopy(void *dst, u32 dst_index, - const void *src, u32 src_index, u32 count); -void bitshl(void *buf, u32 size, u32 shift); -u8 count_bits_u64(u64 v, u8 bv); -u8 count_bits_u32(u32 v, u8 bv); -u8 count_bits_u16(u16 v, u8 bv); -u8 count_bits_u8(u8 v, u8 bv); +uint8_t parity(uint32_t x); +uint32_t getbitu(const uint8_t *buff, uint32_t pos, uint8_t len); +int32_t getbits(const uint8_t *buff, uint32_t pos, uint8_t len); +void setbitu(uint8_t *buff, uint32_t pos, uint32_t len, uint32_t data); +void setbits(uint8_t *buff, uint32_t pos, uint32_t len, int32_t data); +void bitcopy(void *dst, uint32_t dst_index, + const void *src, uint32_t src_index, uint32_t count); +void bitshl(void *buf, uint32_t size, uint32_t shift); +uint8_t count_bits_u64(uint64_t v, uint8_t bv); +uint8_t count_bits_u32(uint32_t v, uint8_t bv); +uint8_t count_bits_u16(uint16_t v, uint8_t bv); +uint8_t count_bits_u8(uint8_t v, uint8_t bv); #endif /* LIBSWIFTNAV_BITS_H */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c index bbb52ac4d..1676fc0cd 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.c @@ -56,9 +56,9 @@ */ /** GPS L2C preamble */ -const u32 GPS_CNAV_PREAMBLE1 = 0x8Bu; /* (0b10001011u) */ +const uint32_t GPS_CNAV_PREAMBLE1 = 0x8Bu; /* (0b10001011u) */ /** Inverted GPS L2C preamble */ -const u32 GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */ +const uint32_t GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */ /** GPS L2C preamble length in bits */ #define GPS_CNAV_PREAMBLE_LENGTH (8) /** GPS L2C CNAV message length in bits */ @@ -81,9 +81,9 @@ const u32 GPS_CNAV_PREAMBLE2 = 0x74u; /* (0b01110100u) */ * * \private */ -static u32 _cnav_compute_crc(cnav_v27_part_t *part) +static uint32_t _cnav_compute_crc(cnav_v27_part_t *part) { - u32 crc = crc24q_bits(0, part->decoded, GPS_CNAV_MSG_DATA_LENGTH, + uint32_t crc = crc24q_bits(0, part->decoded, GPS_CNAV_MSG_DATA_LENGTH, part->invert); return crc; @@ -100,9 +100,9 @@ static u32 _cnav_compute_crc(cnav_v27_part_t *part) * * \private */ -static u32 _cnav_extract_crc(const cnav_v27_part_t *part) +static uint32_t _cnav_extract_crc(const cnav_v27_part_t *part) { - u32 crc = getbitu(part->decoded, GPS_CNAV_MSG_DATA_LENGTH, + uint32_t crc = getbitu(part->decoded, GPS_CNAV_MSG_DATA_LENGTH, GPS_CNAV_MSG_CRC_LENGTH); if (part->invert) { @@ -136,7 +136,7 @@ static void _cnav_rescan_preamble(cnav_v27_part_t *part) size_t j = 0; for (i = 1, j = part->n_decoded - GPS_CNAV_PREAMBLE_LENGTH; i < j; ++i) { - u32 c = getbitu(part->decoded, i, GPS_CNAV_PREAMBLE_LENGTH); + uint32_t c = getbitu(part->decoded, i, GPS_CNAV_PREAMBLE_LENGTH); if (GPS_CNAV_PREAMBLE1 == c || GPS_CNAV_PREAMBLE2 == c) { part->preamble_seen = true; @@ -171,7 +171,7 @@ static void _cnav_rescan_preamble(cnav_v27_part_t *part) * * \private */ -static void _cnav_add_symbol(cnav_v27_part_t *part, u8 ch) +static void _cnav_add_symbol(cnav_v27_part_t *part, uint8_t ch) { part->symbols[part->n_symbols++] = ch; @@ -240,8 +240,8 @@ static void _cnav_add_symbol(cnav_v27_part_t *part, u8 ch) { /* We have collected 300 bits starting from message preamble. Now try * to compute CRC-24Q */ - u32 crc = _cnav_compute_crc(part); - u32 crc2 = _cnav_extract_crc(part); + uint32_t crc = _cnav_compute_crc(part); + uint32_t crc2 = _cnav_extract_crc(part); if (part->message_lock) { @@ -332,7 +332,7 @@ static void _cnav_msg_invert(cnav_v27_part_t *part) * * \private */ -static bool _cnav_msg_decode(cnav_v27_part_t *part, cnav_msg_t *msg, u32 *delay) +static bool _cnav_msg_decode(cnav_v27_part_t *part, cnav_msg_t *msg, uint32_t *delay) { bool res = false; if (GPS_CNAV_MSG_LENGTH <= part->n_decoded) @@ -425,9 +425,9 @@ void cnav_msg_decoder_init(cnav_msg_decoder_t *dec) * \retval false More data is required. */ bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec, - u8 symbol, + uint8_t symbol, cnav_msg_t *msg, - u32 *pdelay) + uint32_t *pdelay) { _cnav_add_symbol(&dec->part1, symbol); _cnav_add_symbol(&dec->part2, symbol); diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h index f402675c5..9e4bdd65f 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/cnav_msg.h @@ -60,11 +60,11 @@ */ typedef struct { - u8 prn; /**< SV PRN. 0..31 */ - u8 msg_id; /**< Message id. 0..31 */ - u32 tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */ - bool alert; /**< CNAV message alert flag */ - u8 raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */ + uint8_t prn; /**< SV PRN. 0..31 */ + uint8_t msg_id; /**< Message id. 0..31 */ + uint32_t tow; /**< GPS ToW in 6-second units. Multiply to 6 to get seconds. */ + bool alert; /**< CNAV message alert flag */ + uint8_t raw_msg[GPS_L2C_V27_DECODE_BITS + GPS_L2C_V27_DELAY_BITS]; /**< RAW MSG for GNSS-SDR */ } cnav_msg_t; /** @@ -112,7 +112,7 @@ void cnav_msg_decoder_init(cnav_msg_decoder_t *dec); bool cnav_msg_decoder_add_symbol(cnav_msg_decoder_t *dec, unsigned char symbol, cnav_msg_t *msg, - u32 *delay); + uint32_t *delay); /** \} */ /** \} */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c index c89bae64d..6e3e06c6f 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.c @@ -39,40 +39,39 @@ * Cyclic redundancy checks. * \{ */ -static const u32 crc24qtab[256] = { - 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, - 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, - 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, - 0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7, - 0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE, - 0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7, - 0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077, - 0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E, - 0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5, - 0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC, - 0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C, - 0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375, - 0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C, - 0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15, - 0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5, - 0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C, - 0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3, - 0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A, - 0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A, - 0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703, - 0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A, - 0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863, - 0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3, - 0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA, - 0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61, - 0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58, - 0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8, - 0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1, - 0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88, - 0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1, - 0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401, - 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538 -}; +static const uint32_t CRC24QTAB[256] = { + 0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC, 0x9F7F17, + 0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5, 0x3EFE2E, + 0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65, 0x5A319E, + 0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C, 0xFBB0A7, + 0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205, 0x93AEFE, + 0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C, 0x322FC7, + 0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C, 0x56E077, + 0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5, 0xF7614E, + 0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E, 0x86DCC5, + 0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107, 0x275DFC, + 0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7, 0x43924C, + 0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E, 0xE21375, + 0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7, 0x8A0D2C, + 0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE, 0x2B8C15, + 0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E, 0x4F43A5, + 0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67, 0xEEC29C, + 0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448, 0xAC38B3, + 0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571, 0x0DB98A, + 0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1, 0x69763A, + 0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8, 0xC8F703, + 0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1, 0xA0E95A, + 0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498, 0x016863, + 0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28, 0x65A7D3, + 0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11, 0xC426EA, + 0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A, 0xB59B61, + 0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3, 0x141A58, + 0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913, 0x70D5E8, + 0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A, 0xD154D1, + 0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673, 0xB94A88, + 0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A, 0x18CBB1, + 0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA, 0x7C0401, + 0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3, 0xDD8538}; /** Calculate Qualcomm 24-bit Cyclical Redundancy Check (CRC-24Q). * @@ -89,11 +88,13 @@ static const u32 crc24qtab[256] = { * * \return CRC-24Q value */ -u32 crc24q(const u8 *buf, u32 len, u32 crc) +uint32_t crc24q(const uint8_t *buf, uint32_t len, uint32_t crc) { - u32 i = 0; + uint32_t i = 0; for (i = 0; i < len; i++) - crc = ((crc << 8) & 0xFFFFFF) ^ crc24qtab[((crc >> 16) ^ buf[i]) & 0xff]; + { + crc = ((crc << 8) & 0xFFFFFF) ^ CRC24QTAB[((crc >> 16) ^ buf[i]) & 0xff]; + } return crc; } @@ -112,30 +113,30 @@ u32 crc24q(const u8 *buf, u32 len, u32 crc) * * \return CRC-24Q value */ -u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert) +uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool invert) { - u16 acc = 0; - u8 b = 0; - u32 shift = 8 - n_bits % 8; + uint16_t acc = 0; + uint8_t b = 0; + uint32_t shift = 8 - n_bits % 8; - u32 i = 0; + uint32_t i = 0; for (i = 0; i < n_bits / 8; ++i) { - acc = (acc << 8) | *buf++; + acc = (acc << 8) | *buf++; if (invert) { acc ^= 0xFFu; } - b = (acc >> shift) & 0xFFu; - crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu]; + b = (acc >> shift) & 0xFFu; + crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu]; } - acc = (acc << 8) | *buf; + acc = (acc << 8) | *buf; if (invert) { acc ^= 0xFFu; } - b = (acc >> shift) & 0xFFu; - crc = ((crc << 8) & 0xFFFFFFu) ^ crc24qtab[((crc >> 16) ^ b) & 0xFFu]; + b = (acc >> shift) & 0xFFu; + crc = ((crc << 8) & 0xFFFFFFu) ^ CRC24QTAB[((crc >> 16) ^ b) & 0xFFu]; return crc; } diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.h index 58a968a65..03a4022a7 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/edc.h @@ -35,7 +35,7 @@ #include "swift_common.h" -u32 crc24q(const u8 *buf, u32 len, u32 crc); -u32 crc24q_bits(u32 crc, const u8 *buf, u32 n_bits, bool invert); +uint32_t crc24q(const uint8_t *buf, uint32_t len, uint32_t crc); +uint32_t crc24q_bits(uint32_t crc, const uint8_t *buf, uint32_t n_bits, bool invert); #endif /* LIBSWIFTNAV_EDC_H */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h index b4a3a6fae..3b83f3034 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/swift_common.h @@ -48,37 +48,6 @@ #include #include -#ifndef COMMON_INT_TYPES -#define COMMON_INT_TYPES - -/** \defgroup common_inttypes Integer types - * Specified-width integer type definitions for shorter and nicer code. - * - * These should be used in preference to unspecified width types such as - * `int` which can lead to portability issues between different platforms. - * \{ */ - -/** Signed 8-bit integer. */ -typedef int8_t s8; -/** Signed 16-bit integer. */ -typedef int16_t s16; -/** Signed 32-bit integer. */ -typedef int32_t s32; -/** Signed 64-bit integer. */ -typedef int64_t s64; -/** Unsigned 8-bit integer. */ -typedef uint8_t u8; -/** Unsigned 16-bit integer. */ -typedef uint16_t u16; -/** Unsigned 32-bit integer. */ -typedef uint32_t u32; -/** Unsigned 64-bit integer. */ -typedef uint64_t u64; - -#endif - -/** \} */ - /** \} */ #endif /* LIBSWIFTNAV_COMMON_H */ diff --git a/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c b/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c index 9739c2ab3..c6486412a 100644 --- a/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c +++ b/src/algorithms/telemetry_decoder/libs/libswiftcnav/viterbi27.c @@ -30,8 +30,8 @@ */ -#include #include "fec.h" +#include static inline int parity(int x) { @@ -52,10 +52,10 @@ void v27_poly_init(v27_poly_t *poly, const signed char polynomial[2]) { int state; - for(state = 0; state < 32; state++) + for (state = 0; state < 32; state++) { - poly->c0[state] = (polynomial[0] < 0) ^ parity((2*state) & abs(polynomial[0])) ? 255 : 0; - poly->c1[state] = (polynomial[1] < 0) ^ parity((2*state) & abs(polynomial[1])) ? 255 : 0; + poly->c0[state] = (polynomial[0] < 0) ^ parity((2 * state) & abs(polynomial[0])) ? 255 : 0; + poly->c1[state] = (polynomial[1] < 0) ^ parity((2 * state) & abs(polynomial[1])) ? 255 : 0; } } @@ -72,7 +72,7 @@ void v27_poly_init(v27_poly_t *poly, const signed char polynomial[2]) * \param initial_state Initial state of the decoder shift register. Usually zero. */ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count, - const v27_poly_t *poly, unsigned char initial_state) + const v27_poly_t *poly, unsigned char initial_state) { int i; @@ -83,28 +83,31 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count, v->decisions_index = 0; v->decisions_count = decisions_count; - for(i = 0; i < 64; i++) - v->old_metrics[i] = 63; + for (i = 0; i < 64; i++) + { + v->old_metrics[i] = 63; + } v->old_metrics[initial_state & 63] = 0; /* Bias known start state */ } /* C-language butterfly */ -#define BFLY(i) {\ - unsigned int metric,m0,m1,decision;\ - metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1);\ - m0 = v->old_metrics[i] + metric;\ - m1 = v->old_metrics[(i)+32] + (510 - metric);\ - decision = (signed int)(m0-m1) > 0;\ - v->new_metrics[2*(i)] = decision ? m1 : m0;\ - d->w[(i)/16] |= decision << ((2*(i))&31);\ - m0 -= (metric+metric-510);\ - m1 += (metric+metric-510);\ - decision = (signed int)(m0-m1) > 0;\ - v->new_metrics[2*(i)+1] = decision ? m1 : m0;\ - d->w[(i)/16] |= decision << ((2*(i)+1)&31);\ -} +#define BFLY(i) \ + { \ + unsigned int metric, m0, m1, decision; \ + metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1); \ + m0 = v->old_metrics[i] + metric; \ + m1 = v->old_metrics[(i) + 32] + (510 - metric); \ + decision = (signed int)(m0 - m1) > 0; \ + v->new_metrics[2 * (i)] = decision ? m1 : m0; \ + d->w[(i) / 16] |= decision << ((2 * (i)) & 31); \ + m0 -= (metric + metric - 510); \ + m1 += (metric + metric - 510); \ + decision = (signed int)(m0 - m1) > 0; \ + v->new_metrics[2 * (i) + 1] = decision ? m1 : m0; \ + d->w[(i) / 16] |= decision << ((2 * (i) + 1) & 31); \ + } /** Update a v27_t decoder with a block of symbols. * @@ -119,7 +122,7 @@ void v27_update(v27_t *v, const unsigned char *syms, int nbits) unsigned int *tmp; int normalize = 0; - while(nbits--) + while (nbits--) { v27_decision_t *d = &v->decisions[v->decisions_index]; @@ -161,26 +164,32 @@ void v27_update(v27_t *v, const unsigned char *syms, int nbits) BFLY(31); /* Normalize metrics if they are nearing overflow */ - if(v->new_metrics[0] > (1 << 30)) + if (v->new_metrics[0] > (1 << 30)) { int i; unsigned int minmetric = 1 << 31; - for(i = 0; i < 64; i++) + for (i = 0; i < 64; i++) { - if(v->new_metrics[i] < minmetric) - minmetric = v->new_metrics[i]; + if (v->new_metrics[i] < minmetric) + { + minmetric = v->new_metrics[i]; + } } - for(i = 0; i < 64; i++) - v->new_metrics[i] -= minmetric; + for (i = 0; i < 64; i++) + { + v->new_metrics[i] -= minmetric; + } normalize += minmetric; } /* Advance decision index */ - if(++v->decisions_index >= v->decisions_count) - v->decisions_index = 0; + if (++v->decisions_index >= v->decisions_count) + { + v->decisions_index = 0; + } /* Swap pointers to old and new metrics */ tmp = v->old_metrics; @@ -199,7 +208,7 @@ void v27_update(v27_t *v, const unsigned char *syms, int nbits) * \param final_state Known final state of the decoder shift register. */ void v27_chainback_fixed(v27_t *v, unsigned char *data, unsigned int nbits, - unsigned char final_state) + unsigned char final_state) { int k; unsigned int decisions_index = v->decisions_index; @@ -207,12 +216,10 @@ void v27_chainback_fixed(v27_t *v, unsigned char *data, unsigned int nbits, final_state %= 64; final_state <<= 2; - while(nbits-- != 0) + while (nbits-- != 0) { - /* Decrement decision index */ - decisions_index = (decisions_index == 0) ? - v->decisions_count-1 : decisions_index-1; + decisions_index = (decisions_index == 0) ? v->decisions_count - 1 : decisions_index - 1; v27_decision_t *d = &v->decisions[decisions_index]; k = (d->w[(final_state >> 2) / 32] >> ((final_state >> 2) % 32)) & 1; @@ -239,9 +246,9 @@ void v27_chainback_likely(v27_t *v, unsigned char *data, unsigned int nbits) int i; unsigned int best_metric = 0xffffffff; unsigned char best_state = 0; - for(i = 0; i < 64; i++) + for (i = 0; i < 64; i++) { - if(v->new_metrics[i] < best_metric) + if (v->new_metrics[i] < best_metric) { best_metric = v->new_metrics[i]; best_state = i; diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc index 957efa9a6..febb18294 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.cc @@ -199,7 +199,9 @@ int Viterbi_Decoder::do_acs(const double sym[], int nbits) { /* Temporarily store the received symbols current decoding step */ for (i = 0; i < d_nn; i++) - d_rec_array[i] = static_cast(sym[d_nn * t + i]); + { + d_rec_array[i] = static_cast(sym[d_nn * t + i]); + } /* precompute all possible branch metrics */ for (i = 0; i < d_number_symbols; i++) diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index c2ae1327a..510673200 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -55,7 +55,7 @@ public: */ float decode_block(const double input_c[], int* output_u_int, const int LL); - float decode_continuous(const double sym[], const int traceback_depth, int output_u_int[], + float decode_continuous(const double sym[], const int traceback_depth, int bits[], const int nbits_requested, int& nbits_decoded); private: @@ -113,7 +113,7 @@ private: void init_trellis_state(); int do_acs(const double sym[], int nbits); int do_traceback(std::size_t traceback_length); - int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int bits[], float& indicator_metric); + int do_tb_and_decode(int traceback_length, int requested_decoding_length, int state, int output_u_int[], float& indicator_metric); // branch metric function float gamma(const float rec_array[], int symbol, int nn); diff --git a/src/algorithms/tracking/CMakeLists.txt b/src/algorithms/tracking/CMakeLists.txt index ea74d8ec3..96259341c 100644 --- a/src/algorithms/tracking/CMakeLists.txt +++ b/src/algorithms/tracking/CMakeLists.txt @@ -18,4 +18,4 @@ add_subdirectory(adapters) add_subdirectory(gnuradio_blocks) -add_subdirectory(libs) \ No newline at end of file +add_subdirectory(libs) diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 934caa56e..e51180bf6 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -26,10 +26,6 @@ if(ENABLE_CUDA) ${OPT_TRACKING_ADAPTERS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu.h ) - set(OPT_TRACKING_INCLUDE_DIRS - ${OPT_TRACKING_INCLUDE_DIRS} - ${CUDA_INCLUDE_DIRS} - ) endif() if(ENABLE_FPGA) @@ -87,34 +83,49 @@ set(TRACKING_ADAPTER_HEADERS ${OPT_TRACKING_ADAPTERS_HEADERS} ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDE_DIRS} -) - list(SORT TRACKING_ADAPTER_HEADERS) list(SORT TRACKING_ADAPTER_SOURCES) +source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) + add_library(tracking_adapters ${TRACKING_ADAPTER_SOURCES} ${TRACKING_ADAPTER_HEADERS} ) -source_group(Headers FILES ${TRACKING_ADAPTER_HEADERS}) - target_link_libraries(tracking_adapters - tracking_gr_blocks - gnss_sp_libs - gnss_sdr_flags + PUBLIC + tracking_gr_blocks + algorithms_libs + gnss_sdr_flags +) + +target_include_directories(tracking_adapters + PUBLIC + ${CMAKE_SOURCE_DIR}/src/core/interfaces +) + +if(ENABLE_CUDA) + target_link_libraries(tracking_adapters + PUBLIC + ${CUDA_LIBRARIES} + ) + target_include_directories(tracking_adapters + PUBLIC + ${CUDA_INCLUDE_DIRS} + ) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_adapters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET tracking_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc index e860da87b..d74732151 100644 --- a/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/beidou_b1i_dll_pll_tracking.cc @@ -59,14 +59,20 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( bool dump = configuration->property(role + ".dump", false); trk_param.dump = dump; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; @@ -105,16 +111,28 @@ BeidouB1iDllPllTracking::BeidouB1iDllPllTracking( char sig_[3] = "B1"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 25); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc index 3bb059dc2..6c2bc02d0 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking.cc @@ -76,10 +76,16 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( trk_param.smoother_length = configuration->property(role + ".smoother_length", 10); } float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.5); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; @@ -111,22 +117,34 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking( } trk_param.track_pilot = track_pilot; trk_param.extend_correlation_symbols = extend_correlation_symbols; - int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + int vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); trk_param.vector_length = vector_length; trk_param.system = 'E'; char sig_[3] = "1B"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 25); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc index 7b6505ba7..179e80a91 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_dll_pll_veml_tracking_fpga.cc @@ -107,7 +107,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( trk_param_fpga.track_pilot = track_pilot; d_track_pilot = track_pilot; trk_param_fpga.extend_correlation_symbols = extend_correlation_symbols; - int vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + int vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); trk_param_fpga.vector_length = vector_length; trk_param_fpga.system = 'E'; char sig_[3] = "1B"; @@ -136,7 +136,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 2; - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); float* ca_codes_f; float* data_codes_f; @@ -144,22 +144,20 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( printf("trk_param_fpga.track_pilot = %d\n", trk_param_fpga.track_pilot); if (trk_param_fpga.track_pilot) { - d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * Galileo_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * GALILEO_E1_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); } - ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); + ca_codes_f = static_cast(volk_gnsssdr_malloc(static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) { - data_codes_f = static_cast(volk_gnsssdr_malloc((static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); + data_codes_f = static_cast(volk_gnsssdr_malloc((static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)) * code_samples_per_chip * sizeof(float), volk_gnsssdr_get_alignment())); } //printf("pppppppp trk_param_fpga.track_pilot = %d\n", trk_param_fpga.track_pilot); //int kk; - - - for (unsigned int PRN = 1; PRN <= Galileo_E1_NUMBER_OF_CODES; PRN++) + for (unsigned int PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++) { char data_signal[3] = "1B"; if (trk_param_fpga.track_pilot) @@ -169,14 +167,11 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( galileo_e1_code_gen_sinboc11_float(ca_codes_f, pilot_signal, PRN); galileo_e1_code_gen_sinboc11_float(data_codes_f, data_signal, PRN); - for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++) + for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) { - d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); - d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(data_codes_f[s]); - //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - //printf("data_codes_f[%d] = %f\n", s, data_codes_f[s]); - //printf("d_ca_codes[%d] = %d\n", static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s, d_data_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s]); - + d_ca_codes[static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); + d_data_codes[static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(data_codes_f[s]); + //printf("%f %d | ", data_codes_f[s], d_data_codes[static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); } //printf("\n next \n"); //scanf ("%d",&kk); @@ -186,11 +181,10 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( //printf("no tracking pilot\n"); galileo_e1_code_gen_sinboc11_float(ca_codes_f, data_signal, PRN); - for (unsigned int s = 0; s < 2 * Galileo_E1_B_CODE_LENGTH_CHIPS; s++) + for (unsigned int s = 0; s < 2 * GALILEO_E1_B_CODE_LENGTH_CHIPS; s++) { - d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); - //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); - + d_ca_codes[static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS) * 2 * (PRN - 1) + s] = static_cast(ca_codes_f[s]); + //printf("%f %d | ", ca_codes_f[s], d_ca_codes[static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS)* 2 * (PRN - 1) + s]); } //printf("\n next \n"); //scanf ("%d",&kk); @@ -204,7 +198,7 @@ GalileoE1DllPllVemlTrackingFpga::GalileoE1DllPllVemlTrackingFpga( } trk_param_fpga.ca_codes = d_ca_codes; trk_param_fpga.data_codes = d_data_codes; - trk_param_fpga.code_length_chips = Galileo_E1_B_CODE_LENGTH_CHIPS; + trk_param_fpga.code_length_chips = GALILEO_E1_B_CODE_LENGTH_CHIPS; trk_param_fpga.code_samples_per_chip = code_samples_per_chip; // 2 sample per chip //################# MAKE TRACKING GNURadio object ################### tracking_fpga_sc = dll_pll_veml_make_tracking_fpga(trk_param_fpga); diff --git a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc index 70fdd98a2..be3a99f0c 100644 --- a/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e1_tcp_connector_tracking.cc @@ -48,7 +48,7 @@ using google::LogMessage; GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## @@ -68,15 +68,21 @@ GalileoE1TcpConnectorTracking::GalileoE1TcpConnectorTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.15); very_early_late_space_chips = configuration->property(role + ".very_early_late_space_chips", 0.6); port_ch0 = configuration->property(role + ".port_ch0", 2060); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); - vector_length = std::round(fs_in / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS)); + vector_length = std::round(fs_in / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS)); //################# MAKE TRACKING GNURadio object ################### if (item_type == "gr_complex") diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc index b0e0a0730..8e5fe8314 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking.cc @@ -76,10 +76,16 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.smoother_length = configuration->property(role + ".smoother_length", 10); } float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 20.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 20.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 5.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; @@ -87,7 +93,7 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; - int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); + int vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)); trk_param.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); @@ -98,9 +104,9 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( extend_correlation_symbols = 1; std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; } - else if (!track_pilot and extend_correlation_symbols > Galileo_E5a_I_SECONDARY_CODE_LENGTH) + else if (!track_pilot and extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH) { - extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH; + extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH; std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; } if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)) @@ -115,16 +121,28 @@ GalileoE5aDllPllTracking::GalileoE5aDllPllTracking( char sig_[3] = "5X"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 25); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc index 0840568c2..47ce428cd 100644 --- a/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/galileo_e5a_dll_pll_tracking_fpga.cc @@ -84,7 +84,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param_fpga.early_late_space_chips = early_late_space_chips; - int vector_length = std::round(fs_in / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS)); + int vector_length = std::round(fs_in / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS)); trk_param_fpga.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); @@ -96,9 +96,9 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( extend_correlation_symbols = 1; std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; } - else if (!track_pilot and extend_correlation_symbols > Galileo_E5a_I_SECONDARY_CODE_LENGTH) + else if (!track_pilot and extend_correlation_symbols > GALILEO_E5A_I_SECONDARY_CODE_LENGTH) { - extend_correlation_symbols = Galileo_E5a_I_SECONDARY_CODE_LENGTH; + extend_correlation_symbols = GALILEO_E5A_I_SECONDARY_CODE_LENGTH; std::cout << TEXT_RED << "WARNING: Galileo E5a. extend_correlation_symbols must be lower than 21 when tracking the data component. Coherent integration has been set to 20 symbols (20 ms)" << TEXT_RESET << std::endl; } if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)) @@ -136,7 +136,7 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; - auto code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); + auto code_length_chips = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS); auto *aux_code = static_cast(volk_gnsssdr_malloc(sizeof(gr_complex) * code_length_chips * code_samples_per_chip, volk_gnsssdr_get_alignment())); @@ -149,15 +149,15 @@ GalileoE5aDllPllTrackingFpga::GalileoE5aDllPllTrackingFpga( } tracking_code = static_cast(volk_gnsssdr_malloc(code_samples_per_chip * code_length_chips * sizeof(float), volk_gnsssdr_get_alignment())); - d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_ca_codes = static_cast(volk_gnsssdr_malloc(static_cast(code_length_chips) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); if (trk_param_fpga.track_pilot) { - d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(code_length_chips)) * code_samples_per_chip * Galileo_E5a_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); + d_data_codes = static_cast(volk_gnsssdr_malloc((static_cast(code_length_chips)) * code_samples_per_chip * GALILEO_E5A_NUMBER_OF_CODES * sizeof(int), volk_gnsssdr_get_alignment())); } - for (unsigned int PRN = 1; PRN <= Galileo_E5a_NUMBER_OF_CODES; PRN++) + for (unsigned int PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++) { //galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(trk_param_fpga.signal.c_str())); galileo_e5_a_code_gen_complex_primary(aux_code, PRN, const_cast(sig_)); diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc index 30101a0ff..e3ca80dbe 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_c_aid_tracking.cc @@ -69,9 +69,15 @@ GlonassL1CaDllPllCAidTracking::GlonassL1CaDllPllCAidTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); int extend_correlation_ms; diff --git a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc index a96165d47..406271643 100644 --- a/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l1_ca_dll_pll_tracking.cc @@ -66,9 +66,15 @@ GlonassL1CaDllPllTracking::GlonassL1CaDllPllTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc index 4ddff7163..419ccc462 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -67,9 +67,15 @@ GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); int extend_correlation_ms; diff --git a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc index 3c39300af..1e7ded9da 100644 --- a/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/glonass_l2_ca_dll_pll_tracking.cc @@ -64,9 +64,15 @@ GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc index 899e878e2..5531be4e0 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_c_aid_tracking.cc @@ -68,9 +68,15 @@ GpsL1CaDllPllCAidTracking::GpsL1CaDllPllCAidTracking( fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated); dump = configuration->property(role + ".dump", false); pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); int extend_correlation_ms; diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc index 394574667..83a60b49a 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_dll_pll_tracking.cc @@ -76,14 +76,20 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( bool dump_mat = configuration->property(role + ".dump_mat", true); trk_param.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0); trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; @@ -119,16 +125,28 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking( char sig_[3] = "1C"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 30); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.80); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index e0960758f..b10cecafd 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -77,7 +77,10 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( f_if = configuration->property(role + ".if", 0); dump = configuration->property(role + ".dump", false); dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); std::string default_dump_filename = "./track_ch"; dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc index 3000ac8ae..15e7f650b 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_tcp_connector_tracking.cc @@ -47,7 +47,7 @@ using google::LogMessage; GpsL1CaTcpConnectorTracking::GpsL1CaTcpConnectorTracking( ConfigurationInterface* configuration, const std::string& role, - unsigned int in_streams, unsigned int out_streams) : role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) + unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { DLOG(INFO) << "role " << role; //################# CONFIGURATION PARAMETERS ######################## diff --git a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc index 332b7b9c2..c55191bd2 100644 --- a/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l2_m_dll_pll_tracking.cc @@ -66,10 +66,16 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( bool dump_mat = configuration->property(role + ".dump_mat", true); trk_param.dump_mat = dump_mat; float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 2.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 0.75); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; @@ -96,16 +102,28 @@ GpsL2MDllPllTracking::GpsL2MDllPllTracking( char sig_[3] = "2S"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 25); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.85); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc index c471f98b8..1fdba0405 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking.cc @@ -76,10 +76,16 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( trk_param.smoother_length = configuration->property(role + ".smoother_length", 10); } float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0); - if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + if (FLAGS_pll_bw_hz != 0.0) + { + pll_bw_hz = static_cast(FLAGS_pll_bw_hz); + } trk_param.pll_bw_hz = pll_bw_hz; float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0); - if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + if (FLAGS_dll_bw_hz != 0.0) + { + dll_bw_hz = static_cast(FLAGS_dll_bw_hz); + } trk_param.dll_bw_hz = dll_bw_hz; float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 2.0); trk_param.pll_bw_narrow_hz = pll_bw_narrow_hz; @@ -87,7 +93,7 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( trk_param.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param.early_late_space_chips = early_late_space_chips; - int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); + int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5I_CODE_RATE_HZ) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS))); trk_param.vector_length = vector_length; int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.15); @@ -98,9 +104,9 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( extend_correlation_symbols = 1; std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; } - else if (!track_pilot and extend_correlation_symbols > GPS_L5i_NH_CODE_LENGTH) + else if (!track_pilot and extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH) { - extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH; + extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH; std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl; } if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)) @@ -115,16 +121,28 @@ GpsL5DllPllTracking::GpsL5DllPllTracking( char sig_[3] = "L5"; std::memcpy(trk_param.signal, sig_, 3); int cn0_samples = configuration->property(role + ".cn0_samples", 20); - if (FLAGS_cn0_samples != 20) cn0_samples = FLAGS_cn0_samples; + if (FLAGS_cn0_samples != 20) + { + cn0_samples = FLAGS_cn0_samples; + } trk_param.cn0_samples = cn0_samples; int cn0_min = configuration->property(role + ".cn0_min", 25); - if (FLAGS_cn0_min != 25) cn0_min = FLAGS_cn0_min; + if (FLAGS_cn0_min != 25) + { + cn0_min = FLAGS_cn0_min; + } trk_param.cn0_min = cn0_min; int max_lock_fail = configuration->property(role + ".max_lock_fail", 50); - if (FLAGS_max_lock_fail != 50) max_lock_fail = FLAGS_max_lock_fail; + if (FLAGS_max_lock_fail != 50) + { + max_lock_fail = FLAGS_max_lock_fail; + } trk_param.max_lock_fail = max_lock_fail; double carrier_lock_th = configuration->property(role + ".carrier_lock_th", 0.75); - if (FLAGS_carrier_lock_th != 0.85) carrier_lock_th = FLAGS_carrier_lock_th; + if (FLAGS_carrier_lock_th != 0.85) + { + carrier_lock_th = FLAGS_carrier_lock_th; + } trk_param.carrier_lock_th = carrier_lock_th; //################# MAKE TRACKING GNURadio object ################### diff --git a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc index 1af8d010f..4afcf4951 100644 --- a/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc +++ b/src/algorithms/tracking/adapters/gps_l5_dll_pll_tracking_fpga.cc @@ -84,7 +84,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.dll_bw_narrow_hz = dll_bw_narrow_hz; float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5); trk_param_fpga.early_late_space_chips = early_late_space_chips; - int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5i_CODE_RATE_HZ) / static_cast(GPS_L5i_CODE_LENGTH_CHIPS))); + int vector_length = std::round(static_cast(fs_in) / (static_cast(GPS_L5I_CODE_RATE_HZ) / static_cast(GPS_L5I_CODE_LENGTH_CHIPS))); trk_param_fpga.vector_length = vector_length; printf("trk vector length = %d\n", vector_length); int extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", 1); @@ -96,9 +96,9 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( extend_correlation_symbols = 1; std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be bigger than 0. Coherent integration has been set to 1 symbol (1 ms)" << TEXT_RESET << std::endl; } - else if (!track_pilot and extend_correlation_symbols > GPS_L5i_NH_CODE_LENGTH) + else if (!track_pilot and extend_correlation_symbols > GPS_L5I_NH_CODE_LENGTH) { - extend_correlation_symbols = GPS_L5i_NH_CODE_LENGTH; + extend_correlation_symbols = GPS_L5I_NH_CODE_LENGTH; std::cout << TEXT_RED << "WARNING: GPS L5. extend_correlation_symbols must be lower than 11 when tracking the data component. Coherent integration has been set to 10 symbols (10 ms)" << TEXT_RESET << std::endl; } if ((extend_correlation_symbols > 1) and (pll_bw_narrow_hz > pll_bw_hz or dll_bw_narrow_hz > dll_bw_hz)) @@ -137,7 +137,7 @@ GpsL5DllPllTrackingFpga::GpsL5DllPllTrackingFpga( trk_param_fpga.multicorr_type = 0; //multicorr_type : 0 -> 3 correlators, 1 -> 5 correlators //################# PRE-COMPUTE ALL THE CODES ################# unsigned int code_samples_per_chip = 1; - auto code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); + auto code_length_chips = static_cast(GPS_L5I_CODE_LENGTH_CHIPS); //printf("TRK code_length_chips = %d\n", code_length_chips); float *tracking_code; diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 2dd5b494f..48da0fc1b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -25,14 +25,6 @@ if(ENABLE_CUDA) ${OPT_TRACKING_BLOCKS_HEADERS} gps_l1_ca_dll_pll_tracking_gpu_cc.h ) - set(OPT_TRACKING_INCLUDES - ${OPT_TRACKING_INCLUDES} - ${CUDA_INCLUDE_DIRS} - ) - set(OPT_TRACKING_LIBRARIES - ${OPT_TRACKING_LIBRARIES} - ${CUDA_LIBRARIES} - ) endif() if(ENABLE_FPGA) @@ -78,59 +70,48 @@ set(TRACKING_GR_BLOCKS_HEADERS ${OPT_TRACKING_BLOCKS_HEADERS} ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${MATIO_INCLUDE_DIRS} -) - -if(ENABLE_GENERIC_ARCH) - add_definitions(-DGENERIC_ARCH=1) -endif() - list(SORT TRACKING_GR_BLOCKS_HEADERS) list(SORT TRACKING_GR_BLOCKS_SOURCES) +source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) + add_library(tracking_gr_blocks ${TRACKING_GR_BLOCKS_SOURCES} ${TRACKING_GR_BLOCKS_HEADERS} ) -source_group(Headers FILES ${TRACKING_GR_BLOCKS_HEADERS}) - target_link_libraries(tracking_gr_blocks - tracking_lib - ${GNURADIO_RUNTIME_LIBRARIES} - gnss_sdr_flags gnss_sp_libs - ${Boost_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${MATIO_LIBRARIES} - ${OPT_TRACKING_LIBRARIES} + PUBLIC + Boost::boost + Gnuradio::blocks + Matio::matio + Volkgnsssdr::volkgnsssdr + gnss_sdr_flags + algorithms_libs + tracking_libs ) -if(NOT VOLKGNSSSDR_FOUND) - if(MATIO_FOUND) - add_dependencies(tracking_gr_blocks volk_gnsssdr_module) - else() - add_dependencies(tracking_gr_blocks volk_gnsssdr_module - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) - endif() -else() - if(NOT MATIO_FOUND) - add_dependencies(tracking_gr_blocks - matio-${GNSSSDR_MATIO_LOCAL_VERSION} +if(ENABLE_CUDA) + target_link_libraries(tracking_gr_blocks + PUBLIC + ${CUDA_LIBRARIES} + ) + target_include_directories(tracking_gr_blocks + PUBLIC + ${CUDA_INCLUDE_DIRS} + ) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_gr_blocks + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) endif() endif() + +set_property(TARGET tracking_gr_blocks + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index cab1780d3..033e49493 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -43,7 +43,6 @@ #include "Galileo_E5a.h" #include "MATH_CONSTANTS.h" #include "beidou_b1i_signal_processing.h" -#include "control_message_factory.h" #include "galileo_e1_signal_processing.h" #include "galileo_e5_signal_processing.h" #include "gnss_sdr_create_directory.h" @@ -59,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -99,6 +99,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_secondary_code_length = 0U; d_secondary_code_string = nullptr; d_preambles_symbols = nullptr; + d_preamble_length_symbols = 0; signal_type = std::string(trk_parameters.signal); std::map map_signal_pretty_name; @@ -172,24 +173,24 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl else if (signal_type == "L5") { d_signal_carrier_freq = GPS_L5_FREQ_HZ; - d_code_period = GPS_L5i_PERIOD; - d_code_chip_rate = GPS_L5i_CODE_RATE_HZ; + d_code_period = GPS_L5I_PERIOD; + d_code_chip_rate = GPS_L5I_CODE_RATE_HZ; d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL; d_correlation_length_ms = 1; d_code_samples_per_chip = 1; - d_code_length_chips = static_cast(GPS_L5i_CODE_LENGTH_CHIPS); + d_code_length_chips = static_cast(GPS_L5I_CODE_LENGTH_CHIPS); d_secondary = true; if (trk_parameters.track_pilot) { - d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); - d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); + d_secondary_code_length = static_cast(GPS_L5Q_NH_CODE_LENGTH); + d_secondary_code_string = const_cast(&GPS_L5Q_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "Q"; interchange_iq = true; } else { - d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); - d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); + d_secondary_code_length = static_cast(GPS_L5I_NH_CODE_LENGTH); + d_secondary_code_string = const_cast(&GPS_L5I_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; interchange_iq = false; } @@ -213,10 +214,10 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl systemName = "Galileo"; if (signal_type == "1B") { - d_signal_carrier_freq = Galileo_E1_FREQ_HZ; - d_code_period = Galileo_E1_CODE_PERIOD; - d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ; - d_code_length_chips = static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS); + d_signal_carrier_freq = GALILEO_E1_FREQ_HZ; + d_code_period = GALILEO_E1_CODE_PERIOD; + d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ; + d_code_length_chips = static_cast(GALILEO_E1_B_CODE_LENGTH_CHIPS); d_symbols_per_bit = 1; d_correlation_length_ms = 4; d_code_samples_per_chip = 2; // CBOC disabled: 2 samples per chip. CBOC enabled: 12 samples per chip @@ -224,8 +225,8 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl if (trk_parameters.track_pilot) { d_secondary = true; - d_secondary_code_length = static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); - d_secondary_code_string = const_cast(&Galileo_E1_C_SECONDARY_CODE); + d_secondary_code_length = static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH); + d_secondary_code_string = const_cast(&GALILEO_E1_C_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "C"; } else @@ -237,18 +238,18 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl } else if (signal_type == "5X") { - d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; - d_code_period = GALILEO_E5a_CODE_PERIOD; - d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ; + d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ; + d_code_period = GALILEO_E5A_CODE_PERIOD; + d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ; d_symbols_per_bit = 20; d_correlation_length_ms = 1; d_code_samples_per_chip = 1; - d_code_length_chips = static_cast(Galileo_E5a_CODE_LENGTH_CHIPS); + d_code_length_chips = static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS); if (trk_parameters.track_pilot) { d_secondary = true; - d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); + d_secondary_code_length = static_cast(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH); signal_pretty_name = signal_pretty_name + "Q"; interchange_iq = true; } @@ -553,7 +554,7 @@ void dll_pll_veml_tracking::start_tracking() galileo_e5_a_code_gen_complex_primary(aux_code, d_acquisition_gnss_synchro->PRN, const_cast(signal_type.c_str())); if (trk_parameters.track_pilot) { - d_secondary_code_string = const_cast(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); + d_secondary_code_string = const_cast(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); for (uint32_t i = 0; i < d_code_length_chips; i++) { d_tracking_code[i] = aux_code[i].imag(); @@ -673,7 +674,14 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking() } if (d_dump_mat) { - save_matfile(); + try + { + save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } } try { @@ -757,7 +765,10 @@ bool dll_pll_veml_tracking::cn0_and_tracking_lock_status(double coh_integration_ } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > trk_parameters.max_lock_fail) { @@ -846,7 +857,10 @@ void dll_pll_veml_tracking::run_dll_pll() void dll_pll_veml_tracking::clear_tracking_vars() { std::fill_n(d_correlator_outs, d_n_correlator_taps, gr_complex(0.0, 0.0)); - if (trk_parameters.track_pilot) d_Prompt_Data[0] = gr_complex(0.0, 0.0); + if (trk_parameters.track_pilot) + { + d_Prompt_Data[0] = gr_complex(0.0, 0.0); + } d_carr_error_hz = 0.0; d_carr_error_filt_hz = 0.0; d_code_error_chips = 0.0; @@ -982,9 +996,13 @@ void dll_pll_veml_tracking::save_correlation_results() } // If tracking pilot, disable Costas loop if (trk_parameters.track_pilot) - d_cloop = false; + { + d_cloop = false; + } else - d_cloop = true; + { + d_cloop = true; + } } diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index bce6e9048..477880b03 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -47,7 +47,7 @@ class dll_pll_veml_tracking; -typedef boost::shared_ptr dll_pll_veml_tracking_sptr; +using dll_pll_veml_tracking_sptr = boost::shared_ptr; dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_); @@ -121,8 +121,8 @@ private: float *d_data_code; float *d_local_code_shift_chips; float *d_prompt_data_shift; - cpu_multicorrelator_real_codes multicorrelator_cpu; - cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel + Cpu_Multicorrelator_Real_Codes multicorrelator_cpu; + Cpu_Multicorrelator_Real_Codes correlator_data_cpu; //for data channel /* TODO: currently the multicorrelator does not support adding extra correlator with different local code, thus we need extra multicorrelator instance. Implement this functionality inside multicorrelator class diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 592947de8..0d23430a5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -151,7 +152,7 @@ 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(volk_gnsssdr_malloc(GPS_CA_PREAMBLE_LENGTH_SYMBOLS * sizeof(int32_t), volk_gnsssdr_get_alignment())); int32_t n = 0; - for (unsigned short preambles_bit : preambles_bits) + for (uint16_t preambles_bit : preambles_bits) { for (uint32_t j = 0; j < GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; j++) { @@ -186,8 +187,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & else if (signal_type == "L5") { d_signal_carrier_freq = GPS_L5_FREQ_HZ; - d_code_period = GPS_L5i_PERIOD; - d_code_chip_rate = GPS_L5i_CODE_RATE_HZ; + d_code_period = GPS_L5I_PERIOD; + d_code_chip_rate = GPS_L5I_CODE_RATE_HZ; d_symbols_per_bit = GPS_L5_SAMPLES_PER_SYMBOL; d_correlation_length_ms = 1; //d_code_samples_per_chip = 1; @@ -195,15 +196,15 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & d_secondary = true; if (trk_parameters.track_pilot) { - d_secondary_code_length = static_cast(GPS_L5q_NH_CODE_LENGTH); - d_secondary_code_string = const_cast(&GPS_L5q_NH_CODE_STR); + d_secondary_code_length = static_cast(GPS_L5Q_NH_CODE_LENGTH); + d_secondary_code_string = const_cast(&GPS_L5Q_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "Q"; interchange_iq = true; } else { - d_secondary_code_length = static_cast(GPS_L5i_NH_CODE_LENGTH); - d_secondary_code_string = const_cast(&GPS_L5i_NH_CODE_STR); + d_secondary_code_length = static_cast(GPS_L5I_NH_CODE_LENGTH); + d_secondary_code_string = const_cast(&GPS_L5I_NH_CODE_STR); signal_pretty_name = signal_pretty_name + "I"; interchange_iq = false; } @@ -227,10 +228,10 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & systemName = "Galileo"; if (signal_type == "1B") { - d_signal_carrier_freq = Galileo_E1_FREQ_HZ; - d_code_period = Galileo_E1_CODE_PERIOD; - d_code_chip_rate = Galileo_E1_CODE_CHIP_RATE_HZ; - //d_code_length_chips = static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS); + d_signal_carrier_freq = GALILEO_E1_FREQ_HZ; + d_code_period = GALILEO_E1_CODE_PERIOD; + d_code_chip_rate = GALILEO_E1_CODE_CHIP_RATE_HZ; + //d_code_length_chips = static_cast(Galileo_E1_B_CODE_LENGTH_CHIPS); d_symbols_per_bit = 1; d_correlation_length_ms = 4; //d_code_samples_per_chip = 2; // CBOC disabled: 2 samples per chip. CBOC enabled: 12 samples per chip @@ -238,8 +239,8 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & if (trk_parameters.track_pilot) { d_secondary = true; - d_secondary_code_length = static_cast(Galileo_E1_C_SECONDARY_CODE_LENGTH); - d_secondary_code_string = const_cast(&Galileo_E1_C_SECONDARY_CODE); + d_secondary_code_length = static_cast(GALILEO_E1_C_SECONDARY_CODE_LENGTH); + d_secondary_code_string = const_cast(&GALILEO_E1_C_SECONDARY_CODE); signal_pretty_name = signal_pretty_name + "C"; } else @@ -251,9 +252,9 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & } else if (signal_type == "5X") { - d_signal_carrier_freq = Galileo_E5a_FREQ_HZ; - d_code_period = GALILEO_E5a_CODE_PERIOD; - d_code_chip_rate = Galileo_E5a_CODE_CHIP_RATE_HZ; + d_signal_carrier_freq = GALILEO_E5A_FREQ_HZ; + d_code_period = GALILEO_E5A_CODE_PERIOD; + d_code_chip_rate = GALILEO_E5A_CODE_CHIP_RATE_HZ; d_symbols_per_bit = 20; d_correlation_length_ms = 1; //d_code_samples_per_chip = 1; @@ -262,7 +263,7 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & if (trk_parameters.track_pilot) { d_secondary = true; - d_secondary_code_length = static_cast(Galileo_E5a_Q_SECONDARY_CODE_LENGTH); + d_secondary_code_length = static_cast(GALILEO_E5A_Q_SECONDARY_CODE_LENGTH); signal_pretty_name = signal_pretty_name + "Q"; interchange_iq = true; } @@ -270,6 +271,10 @@ dll_pll_veml_tracking_fpga::dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga & { //Do not acquire secondary code in data component. It is done in telemetry decoder d_secondary = false; +//======= +// d_secondary_code_length = static_cast(GALILEO_E5A_I_SECONDARY_CODE_LENGTH); +// d_secondary_code_string = const_cast(&GALILEO_E5A_I_SECONDARY_CODE); +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 signal_pretty_name = signal_pretty_name + "I"; interchange_iq = false; } @@ -548,12 +553,7 @@ void dll_pll_veml_tracking_fpga::start_tracking() //galileo_e5_a_code_gen_complex_primary(aux_code, d_acquisition_gnss_synchro->PRN, const_cast(signal_type.c_str())); if (trk_parameters.track_pilot) { - d_secondary_code_string = const_cast(&Galileo_E5a_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); - //for (uint32_t i = 0; i < d_code_length_chips; i++) - // { - // d_tracking_code[i] = aux_code[i].imag(); - // d_data_code[i] = aux_code[i].real(); //the same because it is generated the full signal (E5aI + E5aQ) - // } + d_secondary_code_string = const_cast(&GALILEO_E5A_Q_SECONDARY_CODE[d_acquisition_gnss_synchro->PRN - 1]); d_Prompt_Data[0] = gr_complex(0.0, 0.0); //correlator_data_cpu.set_local_code_and_taps(d_code_length_chips, d_data_code, d_prompt_data_shift); } @@ -632,7 +632,14 @@ dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga() } if (d_dump_mat) { - save_matfile(); + try + { + save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } } try { @@ -1504,182 +1511,15 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_hz << ". PULL-IN Code Phase [samples] = " << d_acq_code_phase_samples; + run_state_2(current_synchro_data); + break; + //consume_each(samples_offset); // shift input to perform alignment with local replica - return 0; + //return 0; } case 2: // Wide tracking and symbol synchronization { - //printf("state 2\n"); - d_sample_counter = d_sample_counter_next; - d_sample_counter_next = d_sample_counter + static_cast(d_current_prn_length_samples); - - do_correlation_step(); - // Save single correlation step variables - if (d_veml) - { - d_VE_accu = *d_Very_Early; - d_VL_accu = *d_Very_Late; - } - d_E_accu = *d_Early; - d_P_accu = *d_Prompt; - d_L_accu = *d_Late; - - // Check lock status - if (!cn0_and_tracking_lock_status(d_code_period)) - { - clear_tracking_vars(); - d_state = 0; // loss-of-lock detected - } - else - { - bool next_state = false; - // Perform DLL/PLL tracking loop computations. Costas Loop enabled - run_dll_pll(); - update_tracking_vars(); - - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(false); - if (d_secondary) - { - // ####### SECONDARY CODE LOCK ##### - d_Prompt_buffer_deque.push_back(*d_Prompt); - if (d_Prompt_buffer_deque.size() == d_secondary_code_length) - { - next_state = acquire_secondary(); - if (next_state) - { - std::cout << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel - << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; - } - - d_Prompt_buffer_deque.pop_front(); - } - } - else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change - { - float current_tracking_time_s = static_cast(d_sample_counter - d_absolute_samples_offset) / trk_parameters.fs_in; - if (current_tracking_time_s > 10) - { - d_symbol_history.push_back(d_Prompt->real()); - //******* preamble correlation ******** - int32_t corr_value = 0; - if ((d_symbol_history.size() == GPS_CA_PREAMBLE_LENGTH_SYMBOLS)) // and (d_make_correlation or !d_flag_frame_sync)) - { - for (uint32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) - { - if (d_symbol_history.at(i) < 0) // symbols clipping - { - corr_value -= d_gps_l1ca_preambles_symbols[i]; - } - else - { - corr_value += d_gps_l1ca_preambles_symbols[i]; - } - } - } - if (corr_value == GPS_CA_PREAMBLE_LENGTH_SYMBOLS) - { - //std::cout << "Preamble detected at tracking!" << std::endl; - next_state = true; - } - else - { - next_state = false; - } - } - else - { - next_state = false; - } - } - else - { - next_state = true; - } - - // ########### Output the tracking results to Telemetry block ########## - if (interchange_iq) - { - if (trk_parameters.track_pilot) - { - // Note that data and pilot components are in quadrature. I and Q are interchanged - current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).imag()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).real()); - } - else - { - current_synchro_data.Prompt_I = static_cast((*d_Prompt).imag()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt).real()); - } - } - else - { - if (trk_parameters.track_pilot) - { - // Note that data and pilot components are in quadrature. I and Q are interchanged - current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); - } - else - { - current_synchro_data.Prompt_I = static_cast((*d_Prompt).real()); - current_synchro_data.Prompt_Q = static_cast((*d_Prompt).imag()); - } - } - current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; - current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; - current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; - current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; - current_synchro_data.Flag_valid_symbol_output = true; - current_synchro_data.correlation_length_ms = d_correlation_length_ms; - - if (next_state) - { // reset extended correlator - d_VE_accu = gr_complex(0.0, 0.0); - d_E_accu = gr_complex(0.0, 0.0); - d_P_accu = gr_complex(0.0, 0.0); - d_L_accu = gr_complex(0.0, 0.0); - d_VL_accu = gr_complex(0.0, 0.0); - d_last_prompt = gr_complex(0.0, 0.0); - d_Prompt_buffer_deque.clear(); - d_current_symbol = 0; - - if (d_enable_extended_integration) - { - // UPDATE INTEGRATION TIME - d_extend_correlation_symbols_count = 0; - float new_correlation_time = static_cast(trk_parameters.extend_correlation_symbols) * static_cast(d_code_period); - d_carrier_loop_filter.set_pdi(new_correlation_time); - d_code_loop_filter.set_pdi(new_correlation_time); - d_state = 3; // next state is the extended correlator integrator - LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " - << d_channel - << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); - std::cout << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " - << d_channel - << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; - // Set narrow taps delay values [chips] - d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_narrow_hz); - d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_narrow_hz); - if (d_veml) - { - d_local_code_shift_chips[0] = -trk_parameters.very_early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - d_local_code_shift_chips[1] = -trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - d_local_code_shift_chips[3] = trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - d_local_code_shift_chips[4] = trk_parameters.very_early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - } - else - { - d_local_code_shift_chips[0] = -trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - d_local_code_shift_chips[2] = trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); - } - } - else - { - d_state = 4; - } - } - } + run_state_2(current_synchro_data); break; } case 3: // coherent integration (correlation time extension) @@ -1828,6 +1668,182 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un return 0; } +void dll_pll_veml_tracking_fpga::run_state_2(Gnss_Synchro ¤t_synchro_data) +{ + //printf("state 2\n"); + d_sample_counter = d_sample_counter_next; + d_sample_counter_next = d_sample_counter + static_cast(d_current_prn_length_samples); + + do_correlation_step(); + // Save single correlation step variables + if (d_veml) + { + d_VE_accu = *d_Very_Early; + d_VL_accu = *d_Very_Late; + } + d_E_accu = *d_Early; + d_P_accu = *d_Prompt; + d_L_accu = *d_Late; + + // Check lock status + if (!cn0_and_tracking_lock_status(d_code_period)) + { + clear_tracking_vars(); + d_state = 0; // loss-of-lock detected + } + else + { + bool next_state = false; + // Perform DLL/PLL tracking loop computations. Costas Loop enabled + run_dll_pll(); + update_tracking_vars(); + + // enable write dump file this cycle (valid DLL/PLL cycle) + log_data(false); + if (d_secondary) + { + // ####### SECONDARY CODE LOCK ##### + d_Prompt_buffer_deque.push_back(*d_Prompt); + if (d_Prompt_buffer_deque.size() == d_secondary_code_length) + { + next_state = acquire_secondary(); + if (next_state) + { + std::cout << systemName << " " << signal_pretty_name << " secondary code locked in channel " << d_channel + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + } + + d_Prompt_buffer_deque.pop_front(); + } + } + else if (d_symbols_per_bit > 1) //Signal does not have secondary code. Search a bit transition by sign change + { + float current_tracking_time_s = static_cast(d_sample_counter - d_absolute_samples_offset) / trk_parameters.fs_in; + if (current_tracking_time_s > 10) + { + d_symbol_history.push_back(d_Prompt->real()); + //******* preamble correlation ******** + int32_t corr_value = 0; + if ((d_symbol_history.size() == GPS_CA_PREAMBLE_LENGTH_SYMBOLS)) // and (d_make_correlation or !d_flag_frame_sync)) + { + for (uint32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_SYMBOLS; i++) + { + if (d_symbol_history.at(i) < 0) // symbols clipping + { + corr_value -= d_gps_l1ca_preambles_symbols[i]; + } + else + { + corr_value += d_gps_l1ca_preambles_symbols[i]; + } + } + } + if (corr_value == GPS_CA_PREAMBLE_LENGTH_SYMBOLS) + { + //std::cout << "Preamble detected at tracking!" << std::endl; + next_state = true; + } + else + { + next_state = false; + } + } + else + { + next_state = false; + } + } + else + { + next_state = true; + } + + // ########### Output the tracking results to Telemetry block ########## + if (interchange_iq) + { + if (trk_parameters.track_pilot) + { + // Note that data and pilot components are in quadrature. I and Q are interchanged + current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).imag()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).real()); + } + else + { + current_synchro_data.Prompt_I = static_cast((*d_Prompt).imag()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt).real()); + } + } + else + { + if (trk_parameters.track_pilot) + { + // Note that data and pilot components are in quadrature. I and Q are interchanged + current_synchro_data.Prompt_I = static_cast((*d_Prompt_Data).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt_Data).imag()); + } + else + { + current_synchro_data.Prompt_I = static_cast((*d_Prompt).real()); + current_synchro_data.Prompt_Q = static_cast((*d_Prompt).imag()); + } + } + current_synchro_data.Code_phase_samples = d_rem_code_phase_samples; + current_synchro_data.Carrier_phase_rads = d_acc_carrier_phase_rad; + current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz; + current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; + current_synchro_data.Flag_valid_symbol_output = true; + current_synchro_data.correlation_length_ms = d_correlation_length_ms; + + if (next_state) + { // reset extended correlator + d_VE_accu = gr_complex(0.0, 0.0); + d_E_accu = gr_complex(0.0, 0.0); + d_P_accu = gr_complex(0.0, 0.0); + d_L_accu = gr_complex(0.0, 0.0); + d_VL_accu = gr_complex(0.0, 0.0); + d_last_prompt = gr_complex(0.0, 0.0); + d_Prompt_buffer_deque.clear(); + d_current_symbol = 0; + + if (d_enable_extended_integration) + { + // UPDATE INTEGRATION TIME + d_extend_correlation_symbols_count = 0; + float new_correlation_time = static_cast(trk_parameters.extend_correlation_symbols) * static_cast(d_code_period); + d_carrier_loop_filter.set_pdi(new_correlation_time); + d_code_loop_filter.set_pdi(new_correlation_time); + d_state = 3; // next state is the extended correlator integrator + LOG(INFO) << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " + << d_channel + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN); + std::cout << "Enabled " << trk_parameters.extend_correlation_symbols * static_cast(d_code_period * 1000.0) << " ms extended correlator in channel " + << d_channel + << " for satellite " << Gnss_Satellite(systemName, d_acquisition_gnss_synchro->PRN) << std::endl; + // Set narrow taps delay values [chips] + d_code_loop_filter.set_DLL_BW(trk_parameters.dll_bw_narrow_hz); + d_carrier_loop_filter.set_PLL_BW(trk_parameters.pll_bw_narrow_hz); + if (d_veml) + { + d_local_code_shift_chips[0] = -trk_parameters.very_early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + d_local_code_shift_chips[1] = -trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + d_local_code_shift_chips[3] = trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + d_local_code_shift_chips[4] = trk_parameters.very_early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + } + else + { + d_local_code_shift_chips[0] = -trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + d_local_code_shift_chips[2] = trk_parameters.early_late_space_narrow_chips * static_cast(d_code_samples_per_chip); + } + } + else + { + d_state = 4; + } + } + } + +} + void dll_pll_veml_tracking_fpga::reset(void) { diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index 6e93a7cc2..a2fb3ed74 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -89,6 +89,8 @@ private: void log_data(bool integrating); int32_t save_matfile(); + void run_state_2(Gnss_Synchro ¤t_synchro_data); + // tracking configuration vars Dll_Pll_Conf_Fpga trk_parameters; bool d_veml; diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc index 2c755b088..e6177bbe7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.cc @@ -39,15 +39,12 @@ #include "galileo_e1_tcp_connector_tracking_cc.h" #include "GPS_L1_CA.h" #include "Galileo_E1.h" -#include "control_message_factory.h" #include "galileo_e1_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" #include "tcp_communication.h" #include "tcp_packet_data.h" #include "tracking_discriminators.h" -#include -#include #include #include #include @@ -104,7 +101,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; // Initialize tracking ========================================== //--- DLL variables -------------------------------------------------------- @@ -119,7 +116,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( // Initialization of local code replica // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip - d_ca_code = static_cast(volk_gnsssdr_malloc((2 * Galileo_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); + d_ca_code = static_cast(volk_gnsssdr_malloc((2 * GALILEO_E1_B_CODE_LENGTH_CHIPS) * sizeof(gr_complex), volk_gnsssdr_get_alignment())); // correlator outputs (scalar) d_n_correlator_taps = 5; // Very-Early, Early, Prompt, Late, Very-Late @@ -149,7 +146,7 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( //--- Perform initializations ------------------------------ // define initial code frequency basis of NCO - d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ; + d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ; // define residual code phase (in chips) d_rem_code_phase_samples = 0.0; // define residual carrier phase @@ -197,10 +194,10 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::start_tracking() d_acquisition_gnss_synchro->Signal, false, d_acquisition_gnss_synchro->PRN, - 2 * Galileo_E1_CODE_CHIP_RATE_HZ, + 2 * GALILEO_E1_CODE_CHIP_RATE_HZ, 0); - multicorrelator_cpu.set_local_code_and_taps(static_cast(2 * Galileo_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); + multicorrelator_cpu.set_local_code_and_taps(static_cast(2 * GALILEO_E1_B_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); for (int32_t n = 0; n < d_n_correlator_taps; n++) { d_correlator_outs[n] = gr_complex(0, 0); @@ -270,7 +267,7 @@ void Galileo_E1_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -305,12 +302,12 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri float carr_error_filt_hz = 0.0; float code_error_filt_chips = 0.0; - tcp_packet_data tcp_data; + Tcp_Packet_Data tcp_data; // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { // Fill the acquisition data @@ -324,8 +321,8 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri float acq_trk_shif_correction_samples; int32_t acq_to_trk_delay_samples; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); - samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); + acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); + samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; @@ -375,11 +372,11 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri // New carrier Doppler frequency estimation d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_error_filt_hz; // New code Doppler frequency estimation - d_code_freq_chips = Galileo_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * Galileo_E1_CODE_CHIP_RATE_HZ) / Galileo_E1_FREQ_HZ); + d_code_freq_chips = GALILEO_E1_CODE_CHIP_RATE_HZ + ((d_carrier_doppler_hz * GALILEO_E1_CODE_CHIP_RATE_HZ) / GALILEO_E1_FREQ_HZ); //carrier phase accumulator for (K) doppler estimation - d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; + d_acc_carrier_phase_rad -= GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD; //remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * Galileo_E1_CODE_PERIOD; + d_rem_carr_phase_rad = d_rem_carr_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * GALILEO_E1_CODE_PERIOD; d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, GPS_TWO_PI); // ################## DLL ########################################################## @@ -387,7 +384,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri code_error_filt_chips = tcp_data.proc_pack_code_error; //Code phase accumulator float code_error_filt_secs; - code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds] + code_error_filt_secs = (GALILEO_E1_CODE_PERIOD * code_error_filt_chips) / GALILEO_E1_CODE_CHIP_RATE_HZ; //[seconds] d_acc_code_phase_secs = d_acc_code_phase_secs + code_error_filt_secs; // ################## CARRIER AND CODE NCO BUFFER ALIGNMENT ####################### @@ -398,7 +395,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri double K_blk_samples; // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation T_chip_seconds = 1 / static_cast(d_code_freq_chips); - T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS; + T_prn_seconds = T_chip_seconds * GALILEO_E1_B_CODE_LENGTH_CHIPS; T_prn_samples = T_prn_seconds * static_cast(d_fs_in); K_blk_samples = T_prn_samples + d_rem_code_phase_samples + code_error_filt_secs * static_cast(d_fs_in); d_current_prn_length_samples = round(K_blk_samples); //round to a discrete samples @@ -416,7 +413,7 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri d_cn0_estimation_counter = 0; // Code lock indicator - d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, Galileo_E1_CODE_PERIOD); + d_CN0_SNV_dB_Hz = cn0_svn_estimator(d_Prompt_buffer, FLAGS_cn0_samples, GALILEO_E1_CODE_PERIOD); // Carrier lock indicator d_carrier_lock_test = carrier_lock_detector(d_Prompt_buffer, FLAGS_cn0_samples); @@ -428,7 +425,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h index acce9db54..423eef516 100644 --- a/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/galileo_e1_tcp_connector_tracking_cc.h @@ -51,7 +51,7 @@ class Galileo_E1_Tcp_Connector_Tracking_cc; -typedef boost::shared_ptr galileo_e1_tcp_connector_tracking_cc_sptr; +using galileo_e1_tcp_connector_tracking_cc_sptr = boost::shared_ptr; galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking_cc( @@ -142,7 +142,7 @@ private: // correlator float *d_local_code_shift_chips; gr_complex *d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // tracking vars double d_code_freq_chips; @@ -154,7 +154,7 @@ private: size_t d_port; int32_t d_listen_connection; float d_control_id; - tcp_communication d_tcp_com; + Tcp_Communication d_tcp_com; //PRN period in samples int32_t d_current_prn_length_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc index 77603d0aa..21a040646 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -38,7 +38,6 @@ #include "glonass_l1_ca_dll_pll_c_aid_tracking_cc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l1_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -50,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -326,7 +326,14 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c { std::cout << "Writing .mat files ..."; } - glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + try + { + glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } if (d_channel == 0) { std::cout << " done." << std::endl; @@ -801,7 +808,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h index 10f1064f5..93c43c35a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -53,8 +53,7 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_cc; -typedef boost::shared_ptr - glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr; +using glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr; glonass_l1_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_cc( @@ -126,7 +125,7 @@ private: gr_complex* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc index 96009c777..3e0338be2 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -38,7 +38,6 @@ #include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l1_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -49,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -529,7 +529,15 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s { std::cout << "Writing .mat files ..."; } - glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + try + { + glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -790,7 +798,10 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h index b0717532e..a58fee4aa 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -54,8 +54,7 @@ class glonass_l1_ca_dll_pll_c_aid_tracking_sc; -typedef boost::shared_ptr - glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr; +using glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr; glonass_l1_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l1_ca_dll_pll_c_aid_make_tracking_sc( @@ -130,7 +129,7 @@ private: //gr_complex* d_correlator_outs; lv_16sc_t* d_correlator_outs_16sc; //cpu_multicorrelator multicorrelator_cpu; - cpu_multicorrelator_16sc multicorrelator_cpu_16sc; + Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc index 70cc662bb..e00604c90 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.cc @@ -38,7 +38,6 @@ #include "glonass_l1_ca_dll_pll_tracking_cc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l1_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -48,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -279,7 +279,15 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc() { std::cout << "Writing .mat files ..."; } - Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); + try + { + Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -566,7 +574,7 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut double acq_trk_shif_correction_samples; int32_t acq_to_trk_delay_samples; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); + acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); d_sample_counter = d_sample_counter + static_cast(samples_offset); // count for the processed samples @@ -659,7 +667,10 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h index d8716f5ee..158eaa761 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l1_ca_dll_pll_tracking_cc.h @@ -50,8 +50,7 @@ class Glonass_L1_Ca_Dll_Pll_Tracking_cc; -typedef boost::shared_ptr - glonass_l1_ca_dll_pll_tracking_cc_sptr; +using glonass_l1_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr; glonass_l1_ca_dll_pll_tracking_cc_sptr glonass_l1_ca_dll_pll_make_tracking_cc( @@ -127,7 +126,7 @@ private: gr_complex* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // tracking vars diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc index 0299968b3..ae689ab8a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc @@ -36,7 +36,6 @@ #include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l2_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -48,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -323,7 +323,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::~glonass_l2_ca_dll_pll_c_aid_tracking_c { std::cout << "Writing .mat files ..."; } - glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + try + { + glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -798,7 +806,10 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h index 129e4609e..44b711243 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_cc.h @@ -51,8 +51,7 @@ class glonass_l2_ca_dll_pll_c_aid_tracking_cc; -typedef boost::shared_ptr - glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr; +using glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr; glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr glonass_l2_ca_dll_pll_c_aid_make_tracking_cc( @@ -124,7 +123,7 @@ private: gr_complex* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc index ec9db011a..aebdf3db7 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -36,7 +36,6 @@ #include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l2_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -47,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -528,7 +528,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s { std::cout << "Writing .mat files ..."; } - glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + try + { + glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -789,7 +797,10 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h index 5745d8ff9..d451da17b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_c_aid_tracking_sc.h @@ -52,8 +52,7 @@ class glonass_l2_ca_dll_pll_c_aid_tracking_sc; -typedef boost::shared_ptr - glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr; +using glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr; glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr glonass_l2_ca_dll_pll_c_aid_make_tracking_sc( @@ -128,7 +127,7 @@ private: //gr_complex* d_correlator_outs; lv_16sc_t* d_correlator_outs_16sc; //cpu_multicorrelator multicorrelator_cpu; - cpu_multicorrelator_16sc multicorrelator_cpu_16sc; + Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc index 62b90e984..b161483c5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.cc @@ -38,7 +38,6 @@ #include "glonass_l2_ca_dll_pll_tracking_cc.h" #include "GLONASS_L1_L2_CA.h" -#include "control_message_factory.h" #include "glonass_l2_signal_processing.h" #include "gnss_sdr_flags.h" #include "lock_detectors.h" @@ -48,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -279,7 +279,15 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::~Glonass_L2_Ca_Dll_Pll_Tracking_cc() { std::cout << "Writing .mat files ..."; } - Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile(); + try + { + Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -566,7 +574,7 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut double acq_trk_shif_correction_samples; int32_t acq_to_trk_delay_samples; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_current_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); + acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_current_prn_length_samples)); samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); d_sample_counter = d_sample_counter + static_cast(samples_offset); // count for the processed samples @@ -659,7 +667,10 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h index f2f4ebab5..d72137d29 100644 --- a/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/glonass_l2_ca_dll_pll_tracking_cc.h @@ -48,8 +48,7 @@ class Glonass_L2_Ca_Dll_Pll_Tracking_cc; -typedef boost::shared_ptr - glonass_l2_ca_dll_pll_tracking_cc_sptr; +using glonass_l2_ca_dll_pll_tracking_cc_sptr = boost::shared_ptr; glonass_l2_ca_dll_pll_tracking_cc_sptr glonass_l2_ca_dll_pll_make_tracking_cc( @@ -125,7 +124,7 @@ private: gr_complex* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // tracking vars diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc index 5db4bef9b..45a890cbe 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.cc @@ -30,7 +30,6 @@ #include "gps_l1_ca_dll_pll_c_aid_tracking_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include "lock_detectors.h" @@ -41,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -305,7 +305,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc() { std::cout << "Writing .mat files ..."; } - gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + try + { + gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -779,7 +787,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __attrib } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h index 43db468ae..dc9283932 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_cc.h @@ -51,8 +51,7 @@ class gps_l1_ca_dll_pll_c_aid_tracking_cc; -typedef boost::shared_ptr - gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr; +using gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr = boost::shared_ptr; gps_l1_ca_dll_pll_c_aid_tracking_cc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_cc( @@ -122,7 +121,7 @@ private: gr_complex* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc index 457b7e65f..8a3dd9a7d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.cc @@ -30,7 +30,6 @@ #include "gps_l1_ca_dll_pll_c_aid_tracking_sc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include "lock_detectors.h" @@ -41,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -306,7 +306,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc() { std::cout << "Writing .mat files ..."; } - gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + try + { + gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -780,7 +788,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __attrib } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h index f7624e944..9aec25252 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_c_aid_tracking_sc.h @@ -52,8 +52,7 @@ class gps_l1_ca_dll_pll_c_aid_tracking_sc; -typedef boost::shared_ptr - gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr; +using gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr = boost::shared_ptr; gps_l1_ca_dll_pll_c_aid_tracking_sc_sptr gps_l1_ca_dll_pll_c_aid_make_tracking_sc( @@ -127,7 +126,7 @@ private: //gr_complex* d_correlator_outs; lv_16sc_t* d_correlator_outs_16sc; //cpu_multicorrelator multicorrelator_cpu; - cpu_multicorrelator_16sc multicorrelator_cpu_16sc; + Cpu_Multicorrelator_16sc multicorrelator_cpu_16sc; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc index 36d27c0f6..6fb8197d1 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc @@ -30,7 +30,6 @@ #include "gps_l1_ca_dll_pll_tracking_gpu_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include "lock_detectors.h" diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 20c800430..96c478a3f 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -39,7 +39,6 @@ #include "gps_l1_ca_kf_tracking_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include "lock_detectors.h" @@ -49,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -375,7 +375,15 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() { std::cout << "Writing .mat files ..."; } - Gps_L1_Ca_Kf_Tracking_cc::save_matfile(); + try + { + Gps_L1_Ca_Kf_Tracking_cc::save_matfile(); + } + catch (const std::exception &ex) + { + LOG(WARNING) << "Error saving the .mat file: " << ex.what(); + } + if (d_channel == 0) { std::cout << " done." << std::endl; @@ -842,7 +850,10 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index a40e257b9..e2faa339c 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -53,8 +53,7 @@ class Gps_L1_Ca_Kf_Tracking_cc; -typedef boost::shared_ptr - gps_l1_ca_kf_tracking_cc_sptr; +using gps_l1_ca_kf_tracking_cc_sptr = boost::shared_ptr; gps_l1_ca_kf_tracking_cc_sptr gps_l1_ca_kf_make_tracking_cc(uint32_t order, @@ -62,7 +61,7 @@ gps_l1_ca_kf_make_tracking_cc(uint32_t order, int64_t fs_in, uint32_t vector_length, bool dump, std::string dump_filename, - float pll_bw_hz, + float dll_bw_hz, float early_late_space_chips, bool bce_run, uint32_t bce_ptrans, @@ -174,7 +173,7 @@ private: float* d_ca_code; float* d_local_code_shift_chips; gr_complex* d_correlator_outs; - cpu_multicorrelator_real_codes multicorrelator_cpu; + Cpu_Multicorrelator_Real_Codes multicorrelator_cpu; // tracking vars double d_code_freq_chips; diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc index 832e94207..8521314b4 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.cc @@ -37,19 +37,17 @@ #include "gps_l1_ca_tcp_connector_tracking_cc.h" #include "GPS_L1_CA.h" -#include "control_message_factory.h" #include "gnss_sdr_flags.h" #include "gps_sdr_signal_processing.h" #include "lock_detectors.h" #include "tcp_communication.h" #include "tcp_packet_data.h" #include "tracking_discriminators.h" -#include -#include #include #include #include #include +#include #include #include #include @@ -95,7 +93,7 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( d_dump = dump; d_fs_in = fs_in; d_vector_length = vector_length; - d_dump_filename = std::move(dump_filename); + d_dump_filename = dump_filename; //--- DLL variables -------------------------------------------------------- d_early_late_spc_chips = early_late_space_chips; // Define early-late offset (in chips) @@ -206,7 +204,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS; T_prn_mod_samples = T_prn_mod_seconds * static_cast(d_fs_in); - d_next_prn_length_samples = round(T_prn_mod_samples); + d_next_prn_length_samples = std::round(T_prn_mod_samples); float T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ; float T_prn_true_samples = T_prn_true_seconds * static_cast(d_fs_in); @@ -215,7 +213,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking() float N_prn_diff; N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds; float corrected_acq_phase_samples, delay_correction_samples; - corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast(d_fs_in)), T_prn_true_samples); + corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast(d_fs_in)), T_prn_true_samples); if (corrected_acq_phase_samples < 0) { corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples; @@ -300,7 +298,7 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::set_channel(uint32_t channel) { try { - d_dump_filename.append(boost::lexical_cast(d_channel)); + d_dump_filename.append(std::to_string(d_channel)); d_dump_filename.append(".dat"); d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit); d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); @@ -336,13 +334,13 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib float code_error = 0.0; float code_nco = 0.0; - tcp_packet_data tcp_data; + Tcp_Packet_Data tcp_data; // GNSS_SYNCHRO OBJECT to interchange data between tracking->telemetry_decoder Gnss_Synchro current_synchro_data = Gnss_Synchro(); // Block input data and block output stream pointers - const gr_complex *in = reinterpret_cast(input_items[0]); - Gnss_Synchro **out = reinterpret_cast(&output_items[0]); + const auto *in = reinterpret_cast(input_items[0]); + auto **out = reinterpret_cast(&output_items[0]); if (d_enable_tracking == true) { @@ -359,8 +357,8 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib float acq_trk_shif_correction_samples; int32_t acq_to_trk_delay_samples; acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp; - acq_trk_shif_correction_samples = d_next_prn_length_samples - fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_next_prn_length_samples)); - samples_offset = round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); + acq_trk_shif_correction_samples = d_next_prn_length_samples - std::fmod(static_cast(acq_to_trk_delay_samples), static_cast(d_next_prn_length_samples)); + samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples); current_synchro_data.Tracking_sample_counter = d_sample_counter + static_cast(samples_offset); current_synchro_data.fs = d_fs_in; *out[0] = current_synchro_data; @@ -463,7 +461,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib } else { - if (d_carrier_lock_fail_counter > 0) d_carrier_lock_fail_counter--; + if (d_carrier_lock_fail_counter > 0) + { + d_carrier_lock_fail_counter--; + } } if (d_carrier_lock_fail_counter > FLAGS_max_lock_fail) { diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h index 636a9fe28..3fa928a4d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_tcp_connector_tracking_cc.h @@ -48,7 +48,7 @@ class Gps_L1_Ca_Tcp_Connector_Tracking_cc; -typedef boost::shared_ptr gps_l1_ca_tcp_connector_tracking_cc_sptr; +using gps_l1_ca_tcp_connector_tracking_cc_sptr = boost::shared_ptr; gps_l1_ca_tcp_connector_tracking_cc_sptr gps_l1_ca_tcp_connector_make_tracking_cc( @@ -128,7 +128,7 @@ private: // correlator float *d_local_code_shift_chips; gr_complex *d_correlator_outs; - cpu_multicorrelator multicorrelator_cpu; + Cpu_Multicorrelator multicorrelator_cpu; // tracking vars double d_code_freq_hz; @@ -139,7 +139,7 @@ private: size_t d_port; int32_t d_listen_connection; float d_control_id; - tcp_communication d_tcp_com; + Tcp_Communication d_tcp_com; //PRN period in samples int32_t d_current_prn_length_samples; diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index 6991fbd55..7a7951645 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -66,45 +66,50 @@ if(ENABLE_FPGA) set(TRACKING_LIB_HEADERS ${TRACKING_LIB_HEADERS} fpga_multicorrelator.h dll_pll_conf_fpga.h) endif() -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${OPT_TRACKING_INCLUDES} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - -if(ENABLE_GENERIC_ARCH) - add_definitions(-DGENERIC_ARCH=1) -endif() - -if(SSE3_AVAILABLE) - add_definitions(-DHAVE_SSE3=1) -endif() - list(SORT TRACKING_LIB_HEADERS) list(SORT TRACKING_LIB_SOURCES) -add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) - source_group(Headers FILES ${TRACKING_LIB_HEADERS}) -target_link_libraries(tracking_lib - ${OPT_TRACKING_LIBRARIES} - ${VOLK_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} +add_library(tracking_libs ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS}) + +target_link_libraries(tracking_libs + PUBLIC + Armadillo::armadillo + Boost::boost + Gnuradio::runtime + Volkgnsssdr::volkgnsssdr + core_system_parameters + ${OPT_TRACKING_LIBRARIES} + PRIVATE + Gflags::gflags + Glog::glog ) -if(VOLKGNSSSDR_FOUND) - add_dependencies(tracking_lib glog-${glog_RELEASE}) -else() - add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module) +target_include_directories(tracking_libs + PUBLIC + ${OPT_TRACKING_INCLUDES} +) + +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(tracking_libs + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(tracking_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET tracking_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.cc b/src/algorithms/tracking/libs/cpu_multicorrelator.cc index 0e30856ce..c201a5df7 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator.cc @@ -37,7 +37,7 @@ #include -cpu_multicorrelator::cpu_multicorrelator() +Cpu_Multicorrelator::Cpu_Multicorrelator() { d_sig_in = nullptr; d_local_code_in = nullptr; @@ -49,16 +49,16 @@ cpu_multicorrelator::cpu_multicorrelator() } -cpu_multicorrelator::~cpu_multicorrelator() +Cpu_Multicorrelator::~Cpu_Multicorrelator() { if (d_local_codes_resampled != nullptr) { - cpu_multicorrelator::free(); + Cpu_Multicorrelator::free(); } } -bool cpu_multicorrelator::init( +bool Cpu_Multicorrelator::init( int max_signal_length_samples, int n_correlators) { @@ -75,7 +75,7 @@ bool cpu_multicorrelator::init( } -bool cpu_multicorrelator::set_local_code_and_taps( +bool Cpu_Multicorrelator::set_local_code_and_taps( int code_length_chips, const std::complex* local_code_in, float* shifts_chips) @@ -87,7 +87,7 @@ bool cpu_multicorrelator::set_local_code_and_taps( } -bool cpu_multicorrelator::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) +bool Cpu_Multicorrelator::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) { // Save CPU pointers d_sig_in = sig_in; @@ -96,7 +96,7 @@ bool cpu_multicorrelator::set_input_output_vectors(std::complex* corr_out } -void cpu_multicorrelator::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) +void Cpu_Multicorrelator::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) { volk_gnsssdr_32fc_xn_resampler_32fc_xn(d_local_codes_resampled, d_local_code_in, @@ -109,7 +109,7 @@ void cpu_multicorrelator::update_local_code(int correlator_length_samples, float } -bool cpu_multicorrelator::Carrier_wipeoff_multicorrelator_resampler( +bool Cpu_Multicorrelator::Carrier_wipeoff_multicorrelator_resampler( float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, @@ -126,7 +126,7 @@ bool cpu_multicorrelator::Carrier_wipeoff_multicorrelator_resampler( } -bool cpu_multicorrelator::free() +bool Cpu_Multicorrelator::free() { // Free memory if (d_local_codes_resampled != nullptr) diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator.h b/src/algorithms/tracking/libs/cpu_multicorrelator.h index 8dab4c4a4..d0f73d616 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator.h +++ b/src/algorithms/tracking/libs/cpu_multicorrelator.h @@ -41,11 +41,11 @@ /*! * \brief Class that implements carrier wipe-off and correlators. */ -class cpu_multicorrelator +class Cpu_Multicorrelator { public: - cpu_multicorrelator(); - ~cpu_multicorrelator(); + Cpu_Multicorrelator(); + ~Cpu_Multicorrelator(); bool init(int max_signal_length_samples, int n_correlators); bool set_local_code_and_taps(int code_length_chips, const std::complex *local_code_in, float *shifts_chips); bool set_input_output_vectors(std::complex *corr_out, const std::complex *sig_in); diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc index e57d1c2eb..107a38f7d 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.cc @@ -36,7 +36,7 @@ #include -bool cpu_multicorrelator_16sc::init( +bool Cpu_Multicorrelator_16sc::init( int max_signal_length_samples, int n_correlators) { @@ -54,7 +54,7 @@ bool cpu_multicorrelator_16sc::init( } -bool cpu_multicorrelator_16sc::set_local_code_and_taps( +bool Cpu_Multicorrelator_16sc::set_local_code_and_taps( int code_length_chips, const lv_16sc_t* local_code_in, float* shifts_chips) @@ -66,7 +66,7 @@ bool cpu_multicorrelator_16sc::set_local_code_and_taps( } -bool cpu_multicorrelator_16sc::set_input_output_vectors(lv_16sc_t* corr_out, const lv_16sc_t* sig_in) +bool Cpu_Multicorrelator_16sc::set_input_output_vectors(lv_16sc_t* corr_out, const lv_16sc_t* sig_in) { // Save CPU pointers d_sig_in = sig_in; @@ -75,7 +75,7 @@ bool cpu_multicorrelator_16sc::set_input_output_vectors(lv_16sc_t* corr_out, con } -void cpu_multicorrelator_16sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) +void Cpu_Multicorrelator_16sc::update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips) { volk_gnsssdr_16ic_xn_resampler_16ic_xn(d_local_codes_resampled, d_local_code_in, @@ -88,7 +88,7 @@ void cpu_multicorrelator_16sc::update_local_code(int correlator_length_samples, } -bool cpu_multicorrelator_16sc::Carrier_wipeoff_multicorrelator_resampler( +bool Cpu_Multicorrelator_16sc::Carrier_wipeoff_multicorrelator_resampler( float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, @@ -105,7 +105,7 @@ bool cpu_multicorrelator_16sc::Carrier_wipeoff_multicorrelator_resampler( } -cpu_multicorrelator_16sc::cpu_multicorrelator_16sc() +Cpu_Multicorrelator_16sc::Cpu_Multicorrelator_16sc() { d_sig_in = nullptr; d_local_code_in = nullptr; @@ -117,16 +117,16 @@ cpu_multicorrelator_16sc::cpu_multicorrelator_16sc() } -cpu_multicorrelator_16sc::~cpu_multicorrelator_16sc() +Cpu_Multicorrelator_16sc::~Cpu_Multicorrelator_16sc() { if (d_local_codes_resampled != nullptr) { - cpu_multicorrelator_16sc::free(); + Cpu_Multicorrelator_16sc::free(); } } -bool cpu_multicorrelator_16sc::free() +bool Cpu_Multicorrelator_16sc::free() { // Free memory if (d_local_codes_resampled != nullptr) diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h index 16881ca07..7ef9549e8 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_16sc.h @@ -41,11 +41,11 @@ /*! * \brief Class that implements carrier wipe-off and correlators. */ -class cpu_multicorrelator_16sc +class Cpu_Multicorrelator_16sc { public: - cpu_multicorrelator_16sc(); - ~cpu_multicorrelator_16sc(); + Cpu_Multicorrelator_16sc(); + ~Cpu_Multicorrelator_16sc(); bool init(int max_signal_length_samples, int n_correlators); bool set_local_code_and_taps(int code_length_chips, const lv_16sc_t *local_code_in, float *shifts_chips); bool set_input_output_vectors(lv_16sc_t *corr_out, const lv_16sc_t *sig_in); diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc index f23537fad..46475c286 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc @@ -37,7 +37,7 @@ #include #include -cpu_multicorrelator_real_codes::cpu_multicorrelator_real_codes() +Cpu_Multicorrelator_Real_Codes::Cpu_Multicorrelator_Real_Codes() { d_sig_in = nullptr; d_local_code_in = nullptr; @@ -50,16 +50,16 @@ cpu_multicorrelator_real_codes::cpu_multicorrelator_real_codes() } -cpu_multicorrelator_real_codes::~cpu_multicorrelator_real_codes() +Cpu_Multicorrelator_Real_Codes::~Cpu_Multicorrelator_Real_Codes() { if (d_local_codes_resampled != nullptr) { - cpu_multicorrelator_real_codes::free(); + Cpu_Multicorrelator_Real_Codes::free(); } } -bool cpu_multicorrelator_real_codes::init( +bool Cpu_Multicorrelator_Real_Codes::init( int max_signal_length_samples, int n_correlators) { @@ -76,7 +76,7 @@ bool cpu_multicorrelator_real_codes::init( } -bool cpu_multicorrelator_real_codes::set_local_code_and_taps( +bool Cpu_Multicorrelator_Real_Codes::set_local_code_and_taps( int code_length_chips, const float* local_code_in, float* shifts_chips) @@ -89,7 +89,7 @@ bool cpu_multicorrelator_real_codes::set_local_code_and_taps( } -bool cpu_multicorrelator_real_codes::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) +bool Cpu_Multicorrelator_Real_Codes::set_input_output_vectors(std::complex* corr_out, const std::complex* sig_in) { // Save CPU pointers d_sig_in = sig_in; @@ -98,7 +98,7 @@ bool cpu_multicorrelator_real_codes::set_input_output_vectors(std::complex *corr_out, const std::complex *sig_in); diff --git a/src/algorithms/tracking/libs/tcp_communication.cc b/src/algorithms/tracking/libs/tcp_communication.cc index 8ca6fde27..40cf6bb55 100644 --- a/src/algorithms/tracking/libs/tcp_communication.cc +++ b/src/algorithms/tracking/libs/tcp_communication.cc @@ -35,13 +35,13 @@ #include -tcp_communication::tcp_communication() : tcp_socket_(io_service_) {} // NOLINT +Tcp_Communication::Tcp_Communication() : tcp_socket_(io_service_) {} // NOLINT -tcp_communication::~tcp_communication() = default; +Tcp_Communication::~Tcp_Communication() = default; -int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) +int Tcp_Communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) { try { @@ -73,7 +73,7 @@ int tcp_communication::listen_tcp_connection(size_t d_port_, size_t d_port_ch0_) } -void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array buf, tcp_packet_data* tcp_data_) +void Tcp_Communication::send_receive_tcp_packet_galileo_e1(boost::array buf, Tcp_Packet_Data* tcp_data_) { int controlc = 0; boost::array readbuf; @@ -108,7 +108,7 @@ void tcp_communication::send_receive_tcp_packet_galileo_e1(boost::array buf, tcp_packet_data* tcp_data_) +void Tcp_Communication::send_receive_tcp_packet_gps_l1_ca(boost::array buf, Tcp_Packet_Data* tcp_data_) { int controlc = 0; boost::array readbuf; @@ -143,7 +143,7 @@ void tcp_communication::send_receive_tcp_packet_gps_l1_ca(boost::array buf, tcp_packet_data *tcp_data_); - void send_receive_tcp_packet_gps_l1_ca(boost::array buf, tcp_packet_data *tcp_data_); + void send_receive_tcp_packet_galileo_e1(boost::array buf, Tcp_Packet_Data *tcp_data_); + void send_receive_tcp_packet_gps_l1_ca(boost::array buf, Tcp_Packet_Data *tcp_data_); void close_tcp_connection(size_t d_port_); private: diff --git a/src/algorithms/tracking/libs/tcp_packet_data.cc b/src/algorithms/tracking/libs/tcp_packet_data.cc index eb53ff59b..a48c3631a 100644 --- a/src/algorithms/tracking/libs/tcp_packet_data.cc +++ b/src/algorithms/tracking/libs/tcp_packet_data.cc @@ -30,11 +30,11 @@ */ #include "tcp_packet_data.h" -tcp_packet_data::tcp_packet_data() +Tcp_Packet_Data::Tcp_Packet_Data() { proc_pack_code_error = 0; proc_pack_carr_error = 0; proc_pack_carrier_doppler_hz = 0; } -tcp_packet_data::~tcp_packet_data() = default; +Tcp_Packet_Data::~Tcp_Packet_Data() = default; diff --git a/src/algorithms/tracking/libs/tcp_packet_data.h b/src/algorithms/tracking/libs/tcp_packet_data.h index c803fa936..44eb4346e 100644 --- a/src/algorithms/tracking/libs/tcp_packet_data.h +++ b/src/algorithms/tracking/libs/tcp_packet_data.h @@ -35,11 +35,11 @@ /*! * \brief Class that implements a TCP data packet */ -class tcp_packet_data +class Tcp_Packet_Data { public: - tcp_packet_data(); - ~tcp_packet_data(); + Tcp_Packet_Data(); + ~Tcp_Packet_Data(); float proc_pack_code_error; float proc_pack_carr_error; float proc_pack_carrier_doppler_hz; diff --git a/src/algorithms/tracking/libs/tracking_discriminators.cc b/src/algorithms/tracking/libs/tracking_discriminators.cc index c7ba2858f..f1944ddc5 100644 --- a/src/algorithms/tracking/libs/tracking_discriminators.cc +++ b/src/algorithms/tracking/libs/tracking_discriminators.cc @@ -64,7 +64,7 @@ double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double */ double pll_four_quadrant_atan(gr_complex prompt_s1) { - return atan2(prompt_s1.imag(), prompt_s1.real()); + return static_cast(std::atan2(prompt_s1.imag(), prompt_s1.real())); } @@ -79,7 +79,7 @@ double pll_cloop_two_quadrant_atan(gr_complex prompt_s1) { if (prompt_s1.real() != 0.0) { - return atan(prompt_s1.imag() / prompt_s1.real()); + return static_cast(std::atan(prompt_s1.imag() / prompt_s1.real())); } return 0.0; } diff --git a/src/core/interfaces/acquisition_interface.h b/src/core/interfaces/acquisition_interface.h index 794748175..7067d403a 100644 --- a/src/core/interfaces/acquisition_interface.h +++ b/src/core/interfaces/acquisition_interface.h @@ -42,7 +42,7 @@ #include "gnss_synchro.h" template -class concurrent_queue; +class Concurrent_Queue; /*! \brief This abstract class represents an interface to an acquisition GNSS block. * diff --git a/src/core/interfaces/tracking_interface.h b/src/core/interfaces/tracking_interface.h index da2b3c41b..406c5748d 100644 --- a/src/core/interfaces/tracking_interface.h +++ b/src/core/interfaces/tracking_interface.h @@ -41,7 +41,7 @@ #include "gnss_synchro.h" template -class concurrent_queue; +class Concurrent_Queue; /*! * \brief This abstract class represents an interface to a tracking block. diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 9557199c4..68b52890c 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -18,10 +18,6 @@ add_subdirectory(supl) -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - set(CORE_LIBS_SOURCES ini.cc INIReader.cc @@ -36,25 +32,36 @@ set(CORE_LIBS_HEADERS gnss_sdr_supl_client.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} -) - list(SORT CORE_LIBS_HEADERS) list(SORT CORE_LIBS_SOURCES) -add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) source_group(Headers FILES ${CORE_LIBS_HEADERS}) -target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY}) -if(PUGIXML_LOCAL) - add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) +add_library(core_libs ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS}) + +target_link_libraries(core_libs + PUBLIC + Boost::boost + core_libs_supl + core_system_parameters + PRIVATE + Boost::serialization + Gflags::gflags + Glog::glog + Pugixml::pugixml +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_libs + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET core_libs + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ +) diff --git a/src/core/libs/INIReader.cc b/src/core/libs/INIReader.cc index 9ca9dd039..63c076b82 100644 --- a/src/core/libs/INIReader.cc +++ b/src/core/libs/INIReader.cc @@ -87,7 +87,9 @@ std::string INIReader::MakeKey(const std::string& section, const std::string& na std::string key = section + "." + name; // Convert to lower case to make lookups case-insensitive for (char& i : key) - i = tolower(i); + { + i = tolower(i); + } return key; } diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc index 0311892bd..366d628ae 100644 --- a/src/core/libs/gnss_sdr_supl_client.cc +++ b/src/core/libs/gnss_sdr_supl_client.cc @@ -32,11 +32,12 @@ */ #include "gnss_sdr_supl_client.h" +#include #include #include #include -gnss_sdr_supl_client::gnss_sdr_supl_client() +Gnss_Sdr_Supl_Client::Gnss_Sdr_Supl_Client() { mcc = 0; mns = 0; @@ -49,10 +50,10 @@ gnss_sdr_supl_client::gnss_sdr_supl_client() } -gnss_sdr_supl_client::~gnss_sdr_supl_client() = default; +Gnss_Sdr_Supl_Client::~Gnss_Sdr_Supl_Client() = default; -void gnss_sdr_supl_client::print_assistance() +void Gnss_Sdr_Supl_Client::print_assistance() { if (assist.set & SUPL_RRLP_ASSIST_REFTIME) { @@ -151,7 +152,7 @@ void gnss_sdr_supl_client::print_assistance() } -int gnss_sdr_supl_client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_ci) +int Gnss_Sdr_Supl_Client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_ci) { // SET SUPL CLIENT INFORMATION // GSM CELL PARAMETERS @@ -193,7 +194,7 @@ int gnss_sdr_supl_client::get_assistance(int i_mcc, int i_mns, int i_lac, int i_ } -void gnss_sdr_supl_client::read_supl_data() +void Gnss_Sdr_Supl_Client::read_supl_data() { // READ REFERENCE LOCATION if (assist.set & SUPL_RRLP_ASSIST_REFLOC) @@ -369,7 +370,7 @@ void gnss_sdr_supl_client::read_supl_data() } -bool gnss_sdr_supl_client::load_ephemeris_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_ephemeris_xml(const std::string& file_name) { std::ifstream ifs; try @@ -389,7 +390,7 @@ bool gnss_sdr_supl_client::load_ephemeris_xml(const std::string& file_name) } -bool gnss_sdr_supl_client::save_ephemeris_map_xml(const std::string& file_name, std::map eph_map) +bool Gnss_Sdr_Supl_Client::save_ephemeris_map_xml(const std::string& file_name, std::map eph_map) { if (eph_map.empty() == false) { @@ -416,7 +417,7 @@ bool gnss_sdr_supl_client::save_ephemeris_map_xml(const std::string& file_name, } -bool gnss_sdr_supl_client::load_gal_ephemeris_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_gal_ephemeris_xml(const std::string& file_name) { std::ifstream ifs; try @@ -463,7 +464,7 @@ bool save_gal_ephemeris_map_xml(const std::string& file_name, std::map gps_almanac_map) +bool Gnss_Sdr_Supl_Client::save_gps_almanac_xml(const std::string& file_name, std::map gps_almanac_map) { if (gps_almanac_map.empty() == false) { @@ -834,7 +835,7 @@ bool gnss_sdr_supl_client::save_gps_almanac_xml(const std::string& file_name, st } -bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_gal_almanac_xml(const std::string& file_name) { std::ifstream ifs; try @@ -854,7 +855,7 @@ bool gnss_sdr_supl_client::load_gal_almanac_xml(const std::string& file_name) } -bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::read_gal_almanac_from_gsa(const std::string& file_name) { pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(file_name.c_str()); @@ -904,7 +905,7 @@ bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string& file_nam } -bool gnss_sdr_supl_client::save_gal_almanac_xml(const std::string& file_name, std::map gal_almanac_map) +bool Gnss_Sdr_Supl_Client::save_gal_almanac_xml(const std::string& file_name, std::map gal_almanac_map) { if (gal_almanac_map.empty() == false) { @@ -931,7 +932,7 @@ bool gnss_sdr_supl_client::save_gal_almanac_xml(const std::string& file_name, st } -bool gnss_sdr_supl_client::load_glo_utc_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_glo_utc_xml(const std::string& file_name) { std::ifstream ifs; try @@ -950,7 +951,7 @@ bool gnss_sdr_supl_client::load_glo_utc_xml(const std::string& file_name) } -bool gnss_sdr_supl_client::save_glo_utc_xml(const std::string& file_name, Glonass_Gnav_Utc_Model& utc) +bool Gnss_Sdr_Supl_Client::save_glo_utc_xml(const std::string& file_name, Glonass_Gnav_Utc_Model& utc) { if (utc.valid) { @@ -977,7 +978,7 @@ bool gnss_sdr_supl_client::save_glo_utc_xml(const std::string& file_name, Glonas } -bool gnss_sdr_supl_client::load_ref_time_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_ref_time_xml(const std::string& file_name) { std::ifstream ifs; try @@ -996,7 +997,7 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string& file_name) } -bool gnss_sdr_supl_client::save_ref_time_xml(const std::string& file_name, Agnss_Ref_Time& ref_time) +bool Gnss_Sdr_Supl_Client::save_ref_time_xml(const std::string& file_name, Agnss_Ref_Time& ref_time) { if (ref_time.valid == true) { @@ -1023,7 +1024,7 @@ bool gnss_sdr_supl_client::save_ref_time_xml(const std::string& file_name, Agnss } -bool gnss_sdr_supl_client::load_ref_location_xml(const std::string& file_name) +bool Gnss_Sdr_Supl_Client::load_ref_location_xml(const std::string& file_name) { std::ifstream ifs; try @@ -1042,7 +1043,7 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string& file_name) } -bool gnss_sdr_supl_client::save_ref_location_xml(const std::string& file_name, Agnss_Ref_Location& ref_location) +bool Gnss_Sdr_Supl_Client::save_ref_location_xml(const std::string& file_name, Agnss_Ref_Location& ref_location) { if (ref_location.valid == true) { diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h index 281d2a82d..af78c9f16 100644 --- a/src/core/libs/gnss_sdr_supl_client.h +++ b/src/core/libs/gnss_sdr_supl_client.h @@ -57,7 +57,6 @@ extern "C" #include #include #include -#include #include #include #include @@ -65,7 +64,7 @@ extern "C" /*! * \brief class that implements a C++ interface to external Secure User Location Protocol (SUPL) client library.. */ -class gnss_sdr_supl_client +class Gnss_Sdr_Supl_Client { private: // GSM CELL INFO @@ -275,8 +274,8 @@ public: */ void print_assistance(); - gnss_sdr_supl_client(); - ~gnss_sdr_supl_client(); + Gnss_Sdr_Supl_Client(); + ~Gnss_Sdr_Supl_Client(); }; #endif diff --git a/src/core/libs/ini.cc b/src/core/libs/ini.cc index 49991e57f..17506e56e 100644 --- a/src/core/libs/ini.cc +++ b/src/core/libs/ini.cc @@ -68,7 +68,9 @@ static char* rstrip(char* s) { char* p = s + std::char_traits::length(s); while (p > s && isspace(*--p)) - *p = '\0'; + { + *p = '\0'; + } return s; } @@ -76,7 +78,9 @@ static char* rstrip(char* s) static char* lskip(char* s) { while (*s && isspace(*s)) - s++; + { + s++; + } return static_cast(s); } @@ -85,7 +89,9 @@ static char* lskip(char* s) static char* find_char_or_comment(char* s, char c) { while (*s && *s != c && *s != ';') - s++; + { + s++; + } return static_cast(s); } @@ -121,7 +127,9 @@ int ini_parse(const char* filename, file.open(filename, std::fstream::in); if (!file.is_open()) - return -1; + { + return -1; + } /* Scan through file line by line */ while (std::getline(file, line_str)) @@ -129,7 +137,10 @@ int ini_parse(const char* filename, lineno++; int len_str = line_str.length(); const char* read_line = line_str.data(); - if (len_str > (MAX_LINE - 1)) len_str = MAX_LINE - 1; + if (len_str > (MAX_LINE - 1)) + { + len_str = MAX_LINE - 1; + } int i; for (i = 0; i < len_str; i++) { @@ -144,7 +155,9 @@ int ini_parse(const char* filename, /* Non-black line with leading whitespace, treat as continuation of previous name's value (as per Python ConfigParser). */ if (!handler(user, section, prev_name, start) && !error) - error = lineno; + { + error = lineno; + } } else #endif @@ -175,13 +188,17 @@ int ini_parse(const char* filename, value = lskip(end + 1); end = find_char_or_comment(value, ';'); if (*end == ';') - *end = '\0'; + { + *end = '\0'; + } rstrip(value); /* Valid name=value pair found, call handler */ strncpy0(prev_name, name, sizeof(prev_name)); if (!handler(user, section, name, value) && !error) - error = lineno; + { + error = lineno; + } } else if (!error) { diff --git a/src/core/libs/supl/CMakeLists.txt b/src/core/libs/supl/CMakeLists.txt index e8e1e69a6..449c49b48 100644 --- a/src/core/libs/supl/CMakeLists.txt +++ b/src/core/libs/supl/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -25,25 +25,35 @@ set(SUPL_SOURCES supl.c ) -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${GNUTLS_INCLUDE_DIR} -) - if(CMAKE_C_COMPILER_ID MATCHES "Clang") if(CMAKE_BUILD_TYPE MATCHES "Release") set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality") endif() endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}") -add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) -target_link_libraries(supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters) -set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C) +add_library(core_libs_supl STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES}) + +if(OPENSSL_FOUND) + target_compile_definitions(core_libs_supl PUBLIC -DUSE_OPENSSL_FALLBACK=1) +endif() + +target_link_libraries(core_libs_supl + PUBLIC + ${GNUTLS_LIBRARIES} + ${GNUTLS_OPENSSL_LIBRARY} +) + +target_include_directories(core_libs_supl + PUBLIC + ${GNUTLS_INCLUDE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl + ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp +) + +set_target_properties(core_libs_supl PROPERTIES + LINKER_LANGUAGE C + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl;${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp;${GNUTLS_INCLUDE_DIR}" +) diff --git a/src/core/libs/supl/asn-rrlp/Accuracy.c b/src/core/libs/supl/asn-rrlp/Accuracy.c index b3609c7ef..a51a2e12c 100644 --- a/src/core/libs/supl/asn-rrlp/Accuracy.c +++ b/src/core/libs/supl/asn-rrlp/Accuracy.c @@ -111,7 +111,7 @@ Accuracy_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_Accuracy_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ACCURACY_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_Accuracy = { asn_DEF_Accuracy_tags_1, /* Same as above */ sizeof(asn_DEF_Accuracy_tags_1) /sizeof(asn_DEF_Accuracy_tags_1[0]), /* 1 */ - &asn_PER_type_Accuracy_constr_1, + &ASN_PER_TYPE_ACCURACY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/AcquisElement.c b/src/core/libs/supl/asn-rrlp/AcquisElement.c index 506e7ad3a..a3fd8b936 100644 --- a/src/core/libs/supl/asn-rrlp/AcquisElement.c +++ b/src/core/libs/supl/asn-rrlp/AcquisElement.c @@ -131,27 +131,27 @@ memb_codePhaseSearchWindow_constraint_1(asn_TYPE_descriptor_t *td, const void *s } } -static asn_per_constraints_t asn_PER_memb_doppler0_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER0_CONSTR_3 = { { APC_CONSTRAINED, 12, 12, -2048, 2047 } /* (-2048..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhase_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_CONSTR_5 = { { APC_CONSTRAINED, 10, 10, 0, 1022 } /* (0..1022) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_intCodePhase_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_INT_CODE_PHASE_CONSTR_6 = { { APC_CONSTRAINED, 5, 5, 0, 19 } /* (0..19) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_gpsBitNumber_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_BIT_NUMBER_CONSTR_7 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhaseSearchWindow_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_SEARCH_WINDOW_CONSTR_8 = { { APC_CONSTRAINED, 4, 4, 0, 15 } /* (0..15) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -171,7 +171,7 @@ static asn_TYPE_member_t asn_MBR_AcquisElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler0_constraint_1, - &asn_PER_memb_doppler0_constr_3, + &ASN_PER_MEMB_DOPPLER0_CONSTR_3, 0, "doppler0" }, @@ -189,7 +189,7 @@ static asn_TYPE_member_t asn_MBR_AcquisElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhase_constraint_1, - &asn_PER_memb_codePhase_constr_5, + &ASN_PER_MEMB_CODE_PHASE_CONSTR_5, 0, "codePhase" }, @@ -198,7 +198,7 @@ static asn_TYPE_member_t asn_MBR_AcquisElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_intCodePhase_constraint_1, - &asn_PER_memb_intCodePhase_constr_6, + &ASN_PER_MEMB_INT_CODE_PHASE_CONSTR_6, 0, "intCodePhase" }, @@ -207,7 +207,7 @@ static asn_TYPE_member_t asn_MBR_AcquisElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsBitNumber_constraint_1, - &asn_PER_memb_gpsBitNumber_constr_7, + &ASN_PER_MEMB_GPS_BIT_NUMBER_CONSTR_7, 0, "gpsBitNumber" }, @@ -216,7 +216,7 @@ static asn_TYPE_member_t asn_MBR_AcquisElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhaseSearchWindow_constraint_1, - &asn_PER_memb_codePhaseSearchWindow_constr_8, + &ASN_PER_MEMB_CODE_PHASE_SEARCH_WINDOW_CONSTR_8, 0, "codePhaseSearchWindow" }, diff --git a/src/core/libs/supl/asn-rrlp/AddionalAngleFields.c b/src/core/libs/supl/asn-rrlp/AddionalAngleFields.c index 5de86fe61..d7a16c0a0 100644 --- a/src/core/libs/supl/asn-rrlp/AddionalAngleFields.c +++ b/src/core/libs/supl/asn-rrlp/AddionalAngleFields.c @@ -56,12 +56,12 @@ memb_elevation_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_azimuth_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_AZIMUTH_CONSTR_2 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_elevation_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_ELEVATION_CONSTR_3 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_AddionalAngleFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_azimuth_constraint_1, - &asn_PER_memb_azimuth_constr_2, + &ASN_PER_MEMB_AZIMUTH_CONSTR_2, 0, "azimuth" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_AddionalAngleFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_elevation_constraint_1, - &asn_PER_memb_elevation_constr_3, + &ASN_PER_MEMB_ELEVATION_CONSTR_3, 0, "elevation" }, diff --git a/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.c b/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.c index 4b0b58a30..69f732dbb 100644 --- a/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.c +++ b/src/core/libs/supl/asn-rrlp/AddionalDopplerFields.c @@ -56,12 +56,12 @@ memb_dopplerUncertainty_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr } } -static asn_per_constraints_t asn_PER_memb_doppler1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER1_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_dopplerUncertainty_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER_UNCERTAINTY_CONSTR_3 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_AddionalDopplerFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler1_constraint_1, - &asn_PER_memb_doppler1_constr_2, + &ASN_PER_MEMB_DOPPLER1_CONSTR_2, 0, "doppler1" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_AddionalDopplerFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_dopplerUncertainty_constraint_1, - &asn_PER_memb_dopplerUncertainty_constr_3, + &ASN_PER_MEMB_DOPPLER_UNCERTAINTY_CONSTR_3, 0, "dopplerUncertainty" }, diff --git a/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.c b/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.c index e62840073..3dbce8753 100644 --- a/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.c +++ b/src/core/libs/supl/asn-rrlp/AdditionalDopplerFields.c @@ -56,12 +56,12 @@ memb_dopplerUncertainty_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr } } -static asn_per_constraints_t asn_PER_memb_doppler1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER1_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_dopplerUncertainty_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER_UNCERTAINTY_CONSTR_3 = { { APC_CONSTRAINED, 3, 3, 0, 4 } /* (0..4) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_AdditionalDopplerFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler1_constraint_1, - &asn_PER_memb_doppler1_constr_2, + &ASN_PER_MEMB_DOPPLER1_CONSTR_2, 0, "doppler1" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_AdditionalDopplerFields_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_dopplerUncertainty_constraint_1, - &asn_PER_memb_dopplerUncertainty_constr_3, + &ASN_PER_MEMB_DOPPLER_UNCERTAINTY_CONSTR_3, 0, "dopplerUncertainty" }, diff --git a/src/core/libs/supl/asn-rrlp/AlertFlag.c b/src/core/libs/supl/asn-rrlp/AlertFlag.c index 52eaeeadb..a7c3f41eb 100644 --- a/src/core/libs/supl/asn-rrlp/AlertFlag.c +++ b/src/core/libs/supl/asn-rrlp/AlertFlag.c @@ -111,7 +111,7 @@ AlertFlag_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_AlertFlag_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ALERT_FLAG_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_AlertFlag = { asn_DEF_AlertFlag_tags_1, /* Same as above */ sizeof(asn_DEF_AlertFlag_tags_1) /sizeof(asn_DEF_AlertFlag_tags_1[0]), /* 1 */ - &asn_PER_type_AlertFlag_constr_1, + &ASN_PER_TYPE_ALERT_FLAG_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.c b/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.c index c63036c97..2093a44e6 100644 --- a/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.c +++ b/src/core/libs/supl/asn-rrlp/Almanac-KeplerianSet.c @@ -256,52 +256,52 @@ memb_kepAlmanacAF1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_kepAlmanacE_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_E_CONSTR_2 = { { APC_CONSTRAINED, 11, 11, 0, 2047 } /* (0..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacDeltaI_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_DELTA_I_CONSTR_3 = { { APC_CONSTRAINED, 11, 11, -1024, 1023 } /* (-1024..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacOmegaDot_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_OMEGA_DOT_CONSTR_4 = { { APC_CONSTRAINED, 11, 11, -1024, 1023 } /* (-1024..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepSVHealth_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_SV_HEALTH_CONSTR_5 = { { APC_CONSTRAINED, 4, 4, 0, 15 } /* (0..15) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacAPowerHalf_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_A_POWER_HALF_CONSTR_6 = { { APC_CONSTRAINED, 17, -1, -65536, 65535 } /* (-65536..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacOmega0_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_OMEGA0_CONSTR_7 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacW_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_W_CONSTR_8 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacM0_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_M0_CONSTR_9 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacAF0_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_A_F0_CONSTR_10 = { { APC_CONSTRAINED, 14, 14, -8192, 8191 } /* (-8192..8191) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_kepAlmanacAF1_constr_11 = { +static asn_per_constraints_t ASN_PER_MEMB_KEP_ALMANAC_A_F1_CONSTR_11 = { { APC_CONSTRAINED, 11, 11, -1024, 1023 } /* (-1024..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -312,7 +312,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacE_constraint_1, - &asn_PER_memb_kepAlmanacE_constr_2, + &ASN_PER_MEMB_KEP_ALMANAC_E_CONSTR_2, 0, "kepAlmanacE" }, @@ -321,7 +321,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacDeltaI_constraint_1, - &asn_PER_memb_kepAlmanacDeltaI_constr_3, + &ASN_PER_MEMB_KEP_ALMANAC_DELTA_I_CONSTR_3, 0, "kepAlmanacDeltaI" }, @@ -330,7 +330,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacOmegaDot_constraint_1, - &asn_PER_memb_kepAlmanacOmegaDot_constr_4, + &ASN_PER_MEMB_KEP_ALMANAC_OMEGA_DOT_CONSTR_4, 0, "kepAlmanacOmegaDot" }, @@ -339,7 +339,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepSVHealth_constraint_1, - &asn_PER_memb_kepSVHealth_constr_5, + &ASN_PER_MEMB_KEP_SV_HEALTH_CONSTR_5, 0, "kepSVHealth" }, @@ -348,7 +348,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacAPowerHalf_constraint_1, - &asn_PER_memb_kepAlmanacAPowerHalf_constr_6, + &ASN_PER_MEMB_KEP_ALMANAC_A_POWER_HALF_CONSTR_6, 0, "kepAlmanacAPowerHalf" }, @@ -357,7 +357,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacOmega0_constraint_1, - &asn_PER_memb_kepAlmanacOmega0_constr_7, + &ASN_PER_MEMB_KEP_ALMANAC_OMEGA0_CONSTR_7, 0, "kepAlmanacOmega0" }, @@ -366,7 +366,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacW_constraint_1, - &asn_PER_memb_kepAlmanacW_constr_8, + &ASN_PER_MEMB_KEP_ALMANAC_W_CONSTR_8, 0, "kepAlmanacW" }, @@ -375,7 +375,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacM0_constraint_1, - &asn_PER_memb_kepAlmanacM0_constr_9, + &ASN_PER_MEMB_KEP_ALMANAC_M0_CONSTR_9, 0, "kepAlmanacM0" }, @@ -384,7 +384,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacAF0_constraint_1, - &asn_PER_memb_kepAlmanacAF0_constr_10, + &ASN_PER_MEMB_KEP_ALMANAC_A_F0_CONSTR_10, 0, "kepAlmanacAF0" }, @@ -393,7 +393,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_kepAlmanacAF1_constraint_1, - &asn_PER_memb_kepAlmanacAF1_constr_11, + &ASN_PER_MEMB_KEP_ALMANAC_A_F1_CONSTR_11, 0, "kepAlmanacAF1" }, diff --git a/src/core/libs/supl/asn-rrlp/Almanac.c b/src/core/libs/supl/asn-rrlp/Almanac.c index a886c36b9..7f829283d 100644 --- a/src/core/libs/supl/asn-rrlp/Almanac.c +++ b/src/core/libs/supl/asn-rrlp/Almanac.c @@ -31,7 +31,7 @@ memb_alamanacWNa_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_alamanacWNa_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_ALAMANAC_W_NA_CONSTR_2 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_Almanac_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alamanacWNa_constraint_1, - &asn_PER_memb_alamanacWNa_constr_2, + &ASN_PER_MEMB_ALAMANAC_W_NA_CONSTR_2, 0, "alamanacWNa" }, diff --git a/src/core/libs/supl/asn-rrlp/AlmanacElement.c b/src/core/libs/supl/asn-rrlp/AlmanacElement.c index 702107187..848ba0af8 100644 --- a/src/core/libs/supl/asn-rrlp/AlmanacElement.c +++ b/src/core/libs/supl/asn-rrlp/AlmanacElement.c @@ -281,57 +281,57 @@ memb_almanacAF1_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_almanacE_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_E_CONSTR_3 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_alamanacToa_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_ALAMANAC_TOA_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacKsii_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_KSII_CONSTR_5 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacOmegaDot_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_OMEGA_DOT_CONSTR_6 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacSVhealth_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_S_VHEALTH_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacAPowerHalf_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_POWER_HALF_CONSTR_8 = { { APC_CONSTRAINED, 24, -1, 0, 16777215 } /* (0..16777215) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacOmega0_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_OMEGA0_CONSTR_9 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacW_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_W_CONSTR_10 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacM0_constr_11 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_M0_CONSTR_11 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacAF0_constr_12 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_F0_CONSTR_12 = { { APC_CONSTRAINED, 11, 11, -1024, 1023 } /* (-1024..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_almanacAF1_constr_13 = { +static asn_per_constraints_t ASN_PER_MEMB_ALMANAC_A_F1_CONSTR_13 = { { APC_CONSTRAINED, 11, 11, -1024, 1023 } /* (-1024..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -351,7 +351,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacE_constraint_1, - &asn_PER_memb_almanacE_constr_3, + &ASN_PER_MEMB_ALMANAC_E_CONSTR_3, 0, "almanacE" }, @@ -360,7 +360,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alamanacToa_constraint_1, - &asn_PER_memb_alamanacToa_constr_4, + &ASN_PER_MEMB_ALAMANAC_TOA_CONSTR_4, 0, "alamanacToa" }, @@ -369,7 +369,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacKsii_constraint_1, - &asn_PER_memb_almanacKsii_constr_5, + &ASN_PER_MEMB_ALMANAC_KSII_CONSTR_5, 0, "almanacKsii" }, @@ -378,7 +378,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacOmegaDot_constraint_1, - &asn_PER_memb_almanacOmegaDot_constr_6, + &ASN_PER_MEMB_ALMANAC_OMEGA_DOT_CONSTR_6, 0, "almanacOmegaDot" }, @@ -387,7 +387,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacSVhealth_constraint_1, - &asn_PER_memb_almanacSVhealth_constr_7, + &ASN_PER_MEMB_ALMANAC_S_VHEALTH_CONSTR_7, 0, "almanacSVhealth" }, @@ -396,7 +396,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacAPowerHalf_constraint_1, - &asn_PER_memb_almanacAPowerHalf_constr_8, + &ASN_PER_MEMB_ALMANAC_A_POWER_HALF_CONSTR_8, 0, "almanacAPowerHalf" }, @@ -405,7 +405,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacOmega0_constraint_1, - &asn_PER_memb_almanacOmega0_constr_9, + &ASN_PER_MEMB_ALMANAC_OMEGA0_CONSTR_9, 0, "almanacOmega0" }, @@ -414,7 +414,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacW_constraint_1, - &asn_PER_memb_almanacW_constr_10, + &ASN_PER_MEMB_ALMANAC_W_CONSTR_10, 0, "almanacW" }, @@ -423,7 +423,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacM0_constraint_1, - &asn_PER_memb_almanacM0_constr_11, + &ASN_PER_MEMB_ALMANAC_M0_CONSTR_11, 0, "almanacM0" }, @@ -432,7 +432,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacAF0_constraint_1, - &asn_PER_memb_almanacAF0_constr_12, + &ASN_PER_MEMB_ALMANAC_A_F0_CONSTR_12, 0, "almanacAF0" }, @@ -441,7 +441,7 @@ static asn_TYPE_member_t asn_MBR_AlmanacElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_almanacAF1_constraint_1, - &asn_PER_memb_almanacAF1_constr_13, + &ASN_PER_MEMB_ALMANAC_A_F1_CONSTR_13, 0, "almanacAF1" }, diff --git a/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.c b/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.c index 5b1d648b8..353a6d2c9 100644 --- a/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.c +++ b/src/core/libs/supl/asn-rrlp/AntiSpoofFlag.c @@ -111,7 +111,7 @@ AntiSpoofFlag_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_AntiSpoofFlag_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ANTI_SPOOF_FLAG_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_AntiSpoofFlag = { asn_DEF_AntiSpoofFlag_tags_1, /* Same as above */ sizeof(asn_DEF_AntiSpoofFlag_tags_1) /sizeof(asn_DEF_AntiSpoofFlag_tags_1[0]), /* 1 */ - &asn_PER_type_AntiSpoofFlag_constr_1, + &ASN_PER_TYPE_ANTI_SPOOF_FLAG_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/BCCHCarrier.c b/src/core/libs/supl/asn-rrlp/BCCHCarrier.c index 72388ca5b..b6e340cfb 100644 --- a/src/core/libs/supl/asn-rrlp/BCCHCarrier.c +++ b/src/core/libs/supl/asn-rrlp/BCCHCarrier.c @@ -111,7 +111,7 @@ BCCHCarrier_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_BCCHCarrier_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_BCCH_CARRIER_CONSTR_1 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_BCCHCarrier = { asn_DEF_BCCHCarrier_tags_1, /* Same as above */ sizeof(asn_DEF_BCCHCarrier_tags_1) /sizeof(asn_DEF_BCCHCarrier_tags_1[0]), /* 1 */ - &asn_PER_type_BCCHCarrier_constr_1, + &ASN_PER_TYPE_BCCH_CARRIER_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/BSIC.c b/src/core/libs/supl/asn-rrlp/BSIC.c index 378aac7ab..de1ed2b8f 100644 --- a/src/core/libs/supl/asn-rrlp/BSIC.c +++ b/src/core/libs/supl/asn-rrlp/BSIC.c @@ -111,7 +111,7 @@ BSIC_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_BSIC_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_BSIC_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_BSIC = { asn_DEF_BSIC_tags_1, /* Same as above */ sizeof(asn_DEF_BSIC_tags_1) /sizeof(asn_DEF_BSIC_tags_1[0]), /* 1 */ - &asn_PER_type_BSIC_constr_1, + &ASN_PER_TYPE_BSIC_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/BadSignalElement.c b/src/core/libs/supl/asn-rrlp/BadSignalElement.c index b0ff80566..e162e0b3d 100644 --- a/src/core/libs/supl/asn-rrlp/BadSignalElement.c +++ b/src/core/libs/supl/asn-rrlp/BadSignalElement.c @@ -31,7 +31,7 @@ memb_badSignalID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_badSignalID_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_BAD_SIGNAL_ID_CONSTR_3 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -51,7 +51,7 @@ static asn_TYPE_member_t asn_MBR_BadSignalElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_badSignalID_constraint_1, - &asn_PER_memb_badSignalID_constr_3, + &ASN_PER_MEMB_BAD_SIGNAL_ID_CONSTR_3, 0, "badSignalID" }, diff --git a/src/core/libs/supl/asn-rrlp/BitNumber.c b/src/core/libs/supl/asn-rrlp/BitNumber.c index 36c17f637..0a430f9fa 100644 --- a/src/core/libs/supl/asn-rrlp/BitNumber.c +++ b/src/core/libs/supl/asn-rrlp/BitNumber.c @@ -111,7 +111,7 @@ BitNumber_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_BitNumber_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_BIT_NUMBER_CONSTR_1 = { { APC_CONSTRAINED, 8, 8, 0, 156 } /* (0..156) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_BitNumber = { asn_DEF_BitNumber_tags_1, /* Same as above */ sizeof(asn_DEF_BitNumber_tags_1) /sizeof(asn_DEF_BitNumber_tags_1[0]), /* 1 */ - &asn_PER_type_BitNumber_constr_1, + &ASN_PER_TYPE_BIT_NUMBER_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/CellID.c b/src/core/libs/supl/asn-rrlp/CellID.c index a66eca167..e412b5ff6 100644 --- a/src/core/libs/supl/asn-rrlp/CellID.c +++ b/src/core/libs/supl/asn-rrlp/CellID.c @@ -111,7 +111,7 @@ CellID_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_CellID_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CELL_ID_CONSTR_1 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_CellID = { asn_DEF_CellID_tags_1, /* Same as above */ sizeof(asn_DEF_CellID_tags_1) /sizeof(asn_DEF_CellID_tags_1[0]), /* 1 */ - &asn_PER_type_CellID_constr_1, + &ASN_PER_TYPE_CELL_ID_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.c b/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.c index 96fd70a6e..8da024839 100644 --- a/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.c +++ b/src/core/libs/supl/asn-rrlp/DGANSSSgnElement.c @@ -106,22 +106,22 @@ memb_rangeRateCor_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_iod_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_IOD_CONSTR_3 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_udre_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_UDRE_CONSTR_4 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_pseudoRangeCor_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_PSEUDO_RANGE_COR_CONSTR_5 = { { APC_CONSTRAINED, 12, 12, -2047, 2047 } /* (-2047..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_rangeRateCor_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_RANGE_RATE_COR_CONSTR_6 = { { APC_CONSTRAINED, 8, 8, -127, 127 } /* (-127..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_DGANSSSgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_iod_constraint_1, - &asn_PER_memb_iod_constr_3, + &ASN_PER_MEMB_IOD_CONSTR_3, 0, "iod" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_DGANSSSgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_udre_constraint_1, - &asn_PER_memb_udre_constr_4, + &ASN_PER_MEMB_UDRE_CONSTR_4, 0, "udre" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_DGANSSSgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_pseudoRangeCor_constraint_1, - &asn_PER_memb_pseudoRangeCor_constr_5, + &ASN_PER_MEMB_PSEUDO_RANGE_COR_CONSTR_5, 0, "pseudoRangeCor" }, @@ -168,7 +168,7 @@ static asn_TYPE_member_t asn_MBR_DGANSSSgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_rangeRateCor_constraint_1, - &asn_PER_memb_rangeRateCor_constr_6, + &ASN_PER_MEMB_RANGE_RATE_COR_CONSTR_6, 0, "rangeRateCor" }, diff --git a/src/core/libs/supl/asn-rrlp/DGPSCorrections.c b/src/core/libs/supl/asn-rrlp/DGPSCorrections.c index 781d41f61..7fa907db6 100644 --- a/src/core/libs/supl/asn-rrlp/DGPSCorrections.c +++ b/src/core/libs/supl/asn-rrlp/DGPSCorrections.c @@ -56,12 +56,12 @@ memb_status_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_gpsTOW_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_TOW_CONSTR_2 = { { APC_CONSTRAINED, 20, -1, 0, 604799 } /* (0..604799) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_status_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_STATUS_CONSTR_3 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_DGPSCorrections_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsTOW_constraint_1, - &asn_PER_memb_gpsTOW_constr_2, + &ASN_PER_MEMB_GPS_TOW_CONSTR_2, 0, "gpsTOW" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_DGPSCorrections_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_status_constraint_1, - &asn_PER_memb_status_constr_3, + &ASN_PER_MEMB_STATUS_CONSTR_3, 0, "status" }, diff --git a/src/core/libs/supl/asn-rrlp/EOTDQuality.c b/src/core/libs/supl/asn-rrlp/EOTDQuality.c index 17fcacfe8..8e4454834 100644 --- a/src/core/libs/supl/asn-rrlp/EOTDQuality.c +++ b/src/core/libs/supl/asn-rrlp/EOTDQuality.c @@ -56,12 +56,12 @@ memb_stdOfEOTD_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_nbrOfMeasurements_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_NBR_OF_MEASUREMENTS_CONSTR_2 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stdOfEOTD_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_STD_OF_EOTD_CONSTR_3 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_EOTDQuality_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_nbrOfMeasurements_constraint_1, - &asn_PER_memb_nbrOfMeasurements_constr_2, + &ASN_PER_MEMB_NBR_OF_MEASUREMENTS_CONSTR_2, 0, "nbrOfMeasurements" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_EOTDQuality_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stdOfEOTD_constraint_1, - &asn_PER_memb_stdOfEOTD_constr_3, + &ASN_PER_MEMB_STD_OF_EOTD_CONSTR_3, 0, "stdOfEOTD" }, diff --git a/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.c b/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.c index d3d05c10f..18e996518 100644 --- a/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.c +++ b/src/core/libs/supl/asn-rrlp/EnvironmentCharacter.c @@ -94,7 +94,7 @@ EnvironmentCharacter_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_EnvironmentCharacter_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ENVIRONMENT_CHARACTER_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -142,7 +142,7 @@ asn_TYPE_descriptor_t asn_DEF_EnvironmentCharacter = { asn_DEF_EnvironmentCharacter_tags_1, /* Same as above */ sizeof(asn_DEF_EnvironmentCharacter_tags_1) /sizeof(asn_DEF_EnvironmentCharacter_tags_1[0]), /* 1 */ - &asn_PER_type_EnvironmentCharacter_constr_1, + &ASN_PER_TYPE_ENVIRONMENT_CHARACTER_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_EnvironmentCharacter_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.c b/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.c index 5177a8615..00025f2af 100644 --- a/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.c +++ b/src/core/libs/supl/asn-rrlp/EphemerisSubframe1Reserved.c @@ -106,22 +106,22 @@ memb_reserved4_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_reserved1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_RESERVED1_CONSTR_2 = { { APC_CONSTRAINED, 23, -1, 0, 8388607 } /* (0..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_reserved2_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_RESERVED2_CONSTR_3 = { { APC_CONSTRAINED, 24, -1, 0, 16777215 } /* (0..16777215) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_reserved3_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_RESERVED3_CONSTR_4 = { { APC_CONSTRAINED, 24, -1, 0, 16777215 } /* (0..16777215) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_reserved4_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_RESERVED4_CONSTR_5 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -132,7 +132,7 @@ static asn_TYPE_member_t asn_MBR_EphemerisSubframe1Reserved_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_reserved1_constraint_1, - &asn_PER_memb_reserved1_constr_2, + &ASN_PER_MEMB_RESERVED1_CONSTR_2, 0, "reserved1" }, @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_EphemerisSubframe1Reserved_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_reserved2_constraint_1, - &asn_PER_memb_reserved2_constr_3, + &ASN_PER_MEMB_RESERVED2_CONSTR_3, 0, "reserved2" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_EphemerisSubframe1Reserved_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_reserved3_constraint_1, - &asn_PER_memb_reserved3_constr_4, + &ASN_PER_MEMB_RESERVED3_CONSTR_4, 0, "reserved3" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_EphemerisSubframe1Reserved_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_reserved4_constraint_1, - &asn_PER_memb_reserved4_constr_5, + &ASN_PER_MEMB_RESERVED4_CONSTR_5, 0, "reserved4" }, diff --git a/src/core/libs/supl/asn-rrlp/ErrorCodes.c b/src/core/libs/supl/asn-rrlp/ErrorCodes.c index d8b61e5d2..f8def1e38 100644 --- a/src/core/libs/supl/asn-rrlp/ErrorCodes.c +++ b/src/core/libs/supl/asn-rrlp/ErrorCodes.c @@ -94,7 +94,7 @@ ErrorCodes_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_ErrorCodes_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ERROR_CODES_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 5 } /* (0..5,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -148,7 +148,7 @@ asn_TYPE_descriptor_t asn_DEF_ErrorCodes = { asn_DEF_ErrorCodes_tags_1, /* Same as above */ sizeof(asn_DEF_ErrorCodes_tags_1) /sizeof(asn_DEF_ErrorCodes_tags_1[0]), /* 1 */ - &asn_PER_type_ErrorCodes_constr_1, + &ASN_PER_TYPE_ERROR_CODES_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_ErrorCodes_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.c b/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.c index ff557e3d1..3f35cbf60 100644 --- a/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.c +++ b/src/core/libs/supl/asn-rrlp/ExpOTDUncertainty.c @@ -111,7 +111,7 @@ ExpOTDUncertainty_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_ExpOTDUncertainty_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_EXP_OTD_UNCERTAINTY_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_ExpOTDUncertainty = { asn_DEF_ExpOTDUncertainty_tags_1, /* Same as above */ sizeof(asn_DEF_ExpOTDUncertainty_tags_1) /sizeof(asn_DEF_ExpOTDUncertainty_tags_1[0]), /* 1 */ - &asn_PER_type_ExpOTDUncertainty_constr_1, + &ASN_PER_TYPE_EXP_OTD_UNCERTAINTY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/ExpectedOTD.c b/src/core/libs/supl/asn-rrlp/ExpectedOTD.c index 947c22734..7b14272b0 100644 --- a/src/core/libs/supl/asn-rrlp/ExpectedOTD.c +++ b/src/core/libs/supl/asn-rrlp/ExpectedOTD.c @@ -111,7 +111,7 @@ ExpectedOTD_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_ExpectedOTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_EXPECTED_OTD_CONSTR_1 = { { APC_CONSTRAINED, 11, 11, 0, 1250 } /* (0..1250) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_ExpectedOTD = { asn_DEF_ExpectedOTD_tags_1, /* Same as above */ sizeof(asn_DEF_ExpectedOTD_tags_1) /sizeof(asn_DEF_ExpectedOTD_tags_1[0]), /* 1 */ - &asn_PER_type_ExpectedOTD_constr_1, + &ASN_PER_TYPE_EXPECTED_OTD_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.c b/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.c index 9df50f61d..4007fc852 100644 --- a/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.c +++ b/src/core/libs/supl/asn-rrlp/Ext-GeographicalInformation.c @@ -112,7 +112,7 @@ Ext_GeographicalInformation_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_Ext_GeographicalInformation_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_EXT_GEOGRAPHICAL_INFORMATION_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 20 } /* (SIZE(1..20)) */, 0, 0 /* No PER value map */ @@ -139,7 +139,7 @@ asn_TYPE_descriptor_t asn_DEF_Ext_GeographicalInformation = { asn_DEF_Ext_GeographicalInformation_tags_1, /* Same as above */ sizeof(asn_DEF_Ext_GeographicalInformation_tags_1) /sizeof(asn_DEF_Ext_GeographicalInformation_tags_1[0]), /* 1 */ - &asn_PER_type_Ext_GeographicalInformation_constr_1, + &ASN_PER_TYPE_EXT_GEOGRAPHICAL_INFORMATION_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/Extended-reference.c b/src/core/libs/supl/asn-rrlp/Extended-reference.c index 12ca01ebe..198fbffe3 100644 --- a/src/core/libs/supl/asn-rrlp/Extended-reference.c +++ b/src/core/libs/supl/asn-rrlp/Extended-reference.c @@ -56,12 +56,12 @@ memb_transaction_ID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_smlc_code_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_SMLC_CODE_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_transaction_ID_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_TRANSACTION_ID_CONSTR_3 = { { APC_CONSTRAINED, 18, -1, 0, 262143 } /* (0..262143) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_Extended_reference_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_smlc_code_constraint_1, - &asn_PER_memb_smlc_code_constr_2, + &ASN_PER_MEMB_SMLC_CODE_CONSTR_2, 0, "smlc-code" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_Extended_reference_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_transaction_ID_constraint_1, - &asn_PER_memb_transaction_ID_constr_3, + &ASN_PER_MEMB_TRANSACTION_ID_CONSTR_3, 0, "transaction-ID" }, diff --git a/src/core/libs/supl/asn-rrlp/FineRTD.c b/src/core/libs/supl/asn-rrlp/FineRTD.c index 6a31fa718..a692cc908 100644 --- a/src/core/libs/supl/asn-rrlp/FineRTD.c +++ b/src/core/libs/supl/asn-rrlp/FineRTD.c @@ -111,7 +111,7 @@ FineRTD_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FineRTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FINE_RTD_CONSTR_1 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_FineRTD = { asn_DEF_FineRTD_tags_1, /* Same as above */ sizeof(asn_DEF_FineRTD_tags_1) /sizeof(asn_DEF_FineRTD_tags_1[0]), /* 1 */ - &asn_PER_type_FineRTD_constr_1, + &ASN_PER_TYPE_FINE_RTD_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/FixType.c b/src/core/libs/supl/asn-rrlp/FixType.c index d413f29c7..17c34842b 100644 --- a/src/core/libs/supl/asn-rrlp/FixType.c +++ b/src/core/libs/supl/asn-rrlp/FixType.c @@ -111,7 +111,7 @@ FixType_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FixType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FIX_TYPE_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_FixType = { asn_DEF_FixType_tags_1, /* Same as above */ sizeof(asn_DEF_FixType_tags_1) /sizeof(asn_DEF_FixType_tags_1[0]), /* 1 */ - &asn_PER_type_FixType_constr_1, + &ASN_PER_TYPE_FIX_TYPE_CONSTR_1, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/FrameDrift.c b/src/core/libs/supl/asn-rrlp/FrameDrift.c index 0a0238c9f..ae533e585 100644 --- a/src/core/libs/supl/asn-rrlp/FrameDrift.c +++ b/src/core/libs/supl/asn-rrlp/FrameDrift.c @@ -111,7 +111,7 @@ FrameDrift_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FrameDrift_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FRAME_DRIFT_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, -64, 63 } /* (-64..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_FrameDrift = { asn_DEF_FrameDrift_tags_1, /* Same as above */ sizeof(asn_DEF_FrameDrift_tags_1) /sizeof(asn_DEF_FrameDrift_tags_1[0]), /* 1 */ - &asn_PER_type_FrameDrift_constr_1, + &ASN_PER_TYPE_FRAME_DRIFT_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/FrameNumber.c b/src/core/libs/supl/asn-rrlp/FrameNumber.c index b8778f7f8..b028e5903 100644 --- a/src/core/libs/supl/asn-rrlp/FrameNumber.c +++ b/src/core/libs/supl/asn-rrlp/FrameNumber.c @@ -111,7 +111,7 @@ FrameNumber_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FrameNumber_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FRAME_NUMBER_CONSTR_1 = { { APC_CONSTRAINED, 21, -1, 0, 2097151 } /* (0..2097151) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_FrameNumber = { asn_DEF_FrameNumber_tags_1, /* Same as above */ sizeof(asn_DEF_FrameNumber_tags_1) /sizeof(asn_DEF_FrameNumber_tags_1[0]), /* 1 */ - &asn_PER_type_FrameNumber_constr_1, + &ASN_PER_TYPE_FRAME_NUMBER_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.c b/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.c index 229783ca8..f6cf5ba0f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSS-MsrSetElement.c @@ -31,7 +31,7 @@ memb_deltaGNASSTOD_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_deltaGNASSTOD_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_GNASSTOD_CONSTR_4 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -60,7 +60,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_MsrSetElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaGNASSTOD_constraint_1, - &asn_PER_memb_deltaGNASSTOD_constr_4, + &ASN_PER_MEMB_DELTA_GNASSTOD_CONSTR_4, 0, "deltaGNASSTOD" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.c b/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.c index 6f31ab9b9..302a2fc62 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSS-SgnElement.c @@ -181,37 +181,37 @@ memb_adr_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_cNo_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_C_NO_CONSTR_3 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_carrierQualityInd_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_CARRIER_QUALITY_IND_CONSTR_5 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhase_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_CONSTR_6 = { { APC_CONSTRAINED, 21, -1, 0, 2097151 } /* (0..2097151) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_integerCodePhase_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_INTEGER_CODE_PHASE_CONSTR_7 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhaseRMSError_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_RMS_ERROR_CONSTR_8 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_doppler_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER_CONSTR_9 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_adr_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_ADR_CONSTR_10 = { { APC_CONSTRAINED, 25, -1, 0, 33554431 } /* (0..33554431) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -231,7 +231,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_cNo_constraint_1, - &asn_PER_memb_cNo_constr_3, + &ASN_PER_MEMB_C_NO_CONSTR_3, 0, "cNo" }, @@ -249,7 +249,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_carrierQualityInd_constraint_1, - &asn_PER_memb_carrierQualityInd_constr_5, + &ASN_PER_MEMB_CARRIER_QUALITY_IND_CONSTR_5, 0, "carrierQualityInd" }, @@ -258,7 +258,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhase_constraint_1, - &asn_PER_memb_codePhase_constr_6, + &ASN_PER_MEMB_CODE_PHASE_CONSTR_6, 0, "codePhase" }, @@ -267,7 +267,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_integerCodePhase_constraint_1, - &asn_PER_memb_integerCodePhase_constr_7, + &ASN_PER_MEMB_INTEGER_CODE_PHASE_CONSTR_7, 0, "integerCodePhase" }, @@ -276,7 +276,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhaseRMSError_constraint_1, - &asn_PER_memb_codePhaseRMSError_constr_8, + &ASN_PER_MEMB_CODE_PHASE_RMS_ERROR_CONSTR_8, 0, "codePhaseRMSError" }, @@ -285,7 +285,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler_constraint_1, - &asn_PER_memb_doppler_constr_9, + &ASN_PER_MEMB_DOPPLER_CONSTR_9, 0, "doppler" }, @@ -294,7 +294,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_adr_constraint_1, - &asn_PER_memb_adr_constr_10, + &ASN_PER_MEMB_ADR_CONSTR_10, 0, "adr" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.c b/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.c index cffb812c8..fce8af4e8 100644 --- a/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSS-SgnTypeElement.c @@ -31,7 +31,7 @@ memb_ganssSignalID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssSignalID_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_SIGNAL_ID_CONSTR_2 = { { APC_CONSTRAINED, 4, 4, 0, 15 } /* (0..15) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_GANSS_SgnTypeElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssSignalID_constraint_1, - &asn_PER_memb_ganssSignalID_constr_2, + &ASN_PER_MEMB_GANSS_SIGNAL_ID_CONSTR_2, 0, "ganssSignalID" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.c b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.c index c41627282..906260ab4 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSSAlmanacElement.c @@ -6,7 +6,7 @@ #include "GANSSAlmanacElement.h" -static asn_per_constraints_t asn_PER_type_GANSSAlmanacElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_ALMANAC_ELEMENT_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -52,7 +52,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSAlmanacElement = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_GANSSAlmanacElement_constr_1, + &ASN_PER_TYPE_GANSS_ALMANAC_ELEMENT_CONSTR_1, asn_MBR_GANSSAlmanacElement_1, 1, /* Elements count */ &asn_SPC_GANSSAlmanacElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.c b/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.c index 3fb9dff20..77630b337 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSAlmanacModel.c @@ -81,17 +81,17 @@ memb_ioda_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_weekNumber_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_WEEK_NUMBER_CONSTR_2 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_toa_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_TOA_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ioda_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_IODA_CONSTR_5 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_GANSSAlmanacModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_weekNumber_constraint_1, - &asn_PER_memb_weekNumber_constr_2, + &ASN_PER_MEMB_WEEK_NUMBER_CONSTR_2, 0, "weekNumber" }, @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_GANSSAlmanacModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_toa_constraint_1, - &asn_PER_memb_toa_constr_4, + &ASN_PER_MEMB_TOA_CONSTR_4, 0, "toa" }, @@ -129,7 +129,7 @@ static asn_TYPE_member_t asn_MBR_GANSSAlmanacModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ioda_constraint_1, - &asn_PER_memb_ioda_constr_5, + &ASN_PER_MEMB_IODA_CONSTR_5, 0, "ioda" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.c b/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.c index dbf9340b3..8d6fda870 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.c +++ b/src/core/libs/supl/asn-rrlp/GANSSAssistanceData.c @@ -112,7 +112,7 @@ GANSSAssistanceData_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSAssistanceData_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_ASSISTANCE_DATA_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 40 } /* (SIZE(1..40)) */, 0, 0 /* No PER value map */ @@ -139,7 +139,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSAssistanceData = { asn_DEF_GANSSAssistanceData_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSAssistanceData_tags_1) /sizeof(asn_DEF_GANSSAssistanceData_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSAssistanceData_constr_1, + &ASN_PER_TYPE_GANSS_ASSISTANCE_DATA_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSClockModel.c b/src/core/libs/supl/asn-rrlp/GANSSClockModel.c index 3dd4501e7..bfe58654d 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSClockModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSClockModel.c @@ -6,7 +6,7 @@ #include "GANSSClockModel.h" -static asn_per_constraints_t asn_PER_type_GANSSClockModel_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_CLOCK_MODEL_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -52,7 +52,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSClockModel = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_GANSSClockModel_constr_1, + &ASN_PER_TYPE_GANSS_CLOCK_MODEL_CONSTR_1, asn_MBR_GANSSClockModel_1, 1, /* Elements count */ &asn_SPC_GANSSClockModel_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/GANSSDataBit.c b/src/core/libs/supl/asn-rrlp/GANSSDataBit.c index 67e8a5f0a..5f1ab2f6a 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDataBit.c +++ b/src/core/libs/supl/asn-rrlp/GANSSDataBit.c @@ -111,7 +111,7 @@ GANSSDataBit_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSDataBit_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_DATA_BIT_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSDataBit = { asn_DEF_GANSSDataBit_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSDataBit_tags_1) /sizeof(asn_DEF_GANSSDataBit_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSDataBit_constr_1, + &ASN_PER_TYPE_GANSS_DATA_BIT_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.c b/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.c index 83aae91c6..29945a448 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.c +++ b/src/core/libs/supl/asn-rrlp/GANSSDataBitAssist.c @@ -56,12 +56,12 @@ memb_ganssDataTypeID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssTOD_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_TOD_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 59 } /* (0..59) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssDataTypeID_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_DATA_TYPE_ID_CONSTR_4 = { { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_GANSSDataBitAssist_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssTOD_constraint_1, - &asn_PER_memb_ganssTOD_constr_2, + &ASN_PER_MEMB_GANSS_TOD_CONSTR_2, 0, "ganssTOD" }, @@ -90,7 +90,7 @@ static asn_TYPE_member_t asn_MBR_GANSSDataBitAssist_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssDataTypeID_constraint_1, - &asn_PER_memb_ganssDataTypeID_constr_4, + &ASN_PER_MEMB_GANSS_DATA_TYPE_ID_CONSTR_4, 0, "ganssDataTypeID" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.c b/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.c index 4492d1eba..ded9c4b2f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.c +++ b/src/core/libs/supl/asn-rrlp/GANSSDiffCorrections.c @@ -31,7 +31,7 @@ memb_dganssRefTime_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_dganssRefTime_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_DGANSS_REF_TIME_CONSTR_2 = { { APC_CONSTRAINED, 7, 7, 0, 119 } /* (0..119) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_GANSSDiffCorrections_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_dganssRefTime_constraint_1, - &asn_PER_memb_dganssRefTime_constr_2, + &ASN_PER_MEMB_DGANSS_REF_TIME_CONSTR_2, 0, "dganssRefTime" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.c b/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.c index f9ee75d4f..abc4c3225 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSSGenericAssistDataElement.c @@ -31,7 +31,7 @@ memb_ganssID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssID_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_ID_CONSTR_2 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_GANSSGenericAssistDataElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssID_constraint_1, - &asn_PER_memb_ganssID_constr_2, + &ASN_PER_MEMB_GANSS_ID_CONSTR_2, 0, "ganssID" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.c b/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.c index 9f5ad93bc..0ca6bbf45 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.c +++ b/src/core/libs/supl/asn-rrlp/GANSSIonoStormFlags.c @@ -131,27 +131,27 @@ memb_ionoStormFlag5_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ionoStormFlag1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_IONO_STORM_FLAG1_CONSTR_2 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ionoStormFlag2_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_IONO_STORM_FLAG2_CONSTR_3 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ionoStormFlag3_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_IONO_STORM_FLAG3_CONSTR_4 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ionoStormFlag4_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_IONO_STORM_FLAG4_CONSTR_5 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ionoStormFlag5_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_IONO_STORM_FLAG5_CONSTR_6 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -162,7 +162,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonoStormFlags_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ionoStormFlag1_constraint_1, - &asn_PER_memb_ionoStormFlag1_constr_2, + &ASN_PER_MEMB_IONO_STORM_FLAG1_CONSTR_2, 0, "ionoStormFlag1" }, @@ -171,7 +171,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonoStormFlags_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ionoStormFlag2_constraint_1, - &asn_PER_memb_ionoStormFlag2_constr_3, + &ASN_PER_MEMB_IONO_STORM_FLAG2_CONSTR_3, 0, "ionoStormFlag2" }, @@ -180,7 +180,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonoStormFlags_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ionoStormFlag3_constraint_1, - &asn_PER_memb_ionoStormFlag3_constr_4, + &ASN_PER_MEMB_IONO_STORM_FLAG3_CONSTR_4, 0, "ionoStormFlag3" }, @@ -189,7 +189,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonoStormFlags_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ionoStormFlag4_constraint_1, - &asn_PER_memb_ionoStormFlag4_constr_5, + &ASN_PER_MEMB_IONO_STORM_FLAG4_CONSTR_5, 0, "ionoStormFlag4" }, @@ -198,7 +198,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonoStormFlags_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ionoStormFlag5_constraint_1, - &asn_PER_memb_ionoStormFlag5_constr_6, + &ASN_PER_MEMB_IONO_STORM_FLAG5_CONSTR_6, 0, "ionoStormFlag5" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.c b/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.c index 10e7c67f0..5390b0def 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSIonosphereModel.c @@ -81,17 +81,17 @@ memb_ai2_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ai0_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_AI0_CONSTR_2 = { { APC_CONSTRAINED, 12, 12, 0, 4095 } /* (0..4095) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ai1_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_AI1_CONSTR_3 = { { APC_CONSTRAINED, 12, 12, 0, 4095 } /* (0..4095) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ai2_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_AI2_CONSTR_4 = { { APC_CONSTRAINED, 12, 12, 0, 4095 } /* (0..4095) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonosphereModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ai0_constraint_1, - &asn_PER_memb_ai0_constr_2, + &ASN_PER_MEMB_AI0_CONSTR_2, 0, "ai0" }, @@ -111,7 +111,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonosphereModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ai1_constraint_1, - &asn_PER_memb_ai1_constr_3, + &ASN_PER_MEMB_AI1_CONSTR_3, 0, "ai1" }, @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_GANSSIonosphereModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ai2_constraint_1, - &asn_PER_memb_ai2_constr_4, + &ASN_PER_MEMB_AI2_CONSTR_4, 0, "ai2" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.c b/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.c index c98360895..3dbae18cf 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.c +++ b/src/core/libs/supl/asn-rrlp/GANSSLocationInfo.c @@ -81,17 +81,17 @@ memb_stationaryIndication_constraint_1(asn_TYPE_descriptor_t *td, const void *sp } } -static asn_per_constraints_t asn_PER_memb_ganssTODFrac_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_TOD_FRAC_CONSTR_4 = { { APC_CONSTRAINED, 15, 15, 0, 16384 } /* (0..16384) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssTimeID_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_TIME_ID_CONSTR_6 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stationaryIndication_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_STATIONARY_INDICATION_CONSTR_9 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_GANSSLocationInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssTODFrac_constraint_1, - &asn_PER_memb_ganssTODFrac_constr_4, + &ASN_PER_MEMB_GANSS_TOD_FRAC_CONSTR_4, 0, "ganssTODFrac" }, @@ -138,7 +138,7 @@ static asn_TYPE_member_t asn_MBR_GANSSLocationInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssTimeID_constraint_1, - &asn_PER_memb_ganssTimeID_constr_6, + &ASN_PER_MEMB_GANSS_TIME_ID_CONSTR_6, 0, "ganssTimeID" }, @@ -165,7 +165,7 @@ static asn_TYPE_member_t asn_MBR_GANSSLocationInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stationaryIndication_constraint_1, - &asn_PER_memb_stationaryIndication_constr_9, + &ASN_PER_MEMB_STATIONARY_INDICATION_CONSTR_9, 0, "stationaryIndication" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSNavModel.c b/src/core/libs/supl/asn-rrlp/GANSSNavModel.c index 46c7cc984..1d9b2cb66 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSNavModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSNavModel.c @@ -106,22 +106,22 @@ memb_sqrtAMBS_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_nonBroadcastIndFlag_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_NON_BROADCAST_IND_FLAG_CONSTR_2 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_toeMSB_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_TOE_MSB_CONSTR_3 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_eMSB_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_E_MSB_CONSTR_4 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_sqrtAMBS_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_SQRT_AMBS_CONSTR_5 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -132,7 +132,7 @@ static asn_TYPE_member_t asn_MBR_GANSSNavModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_nonBroadcastIndFlag_constraint_1, - &asn_PER_memb_nonBroadcastIndFlag_constr_2, + &ASN_PER_MEMB_NON_BROADCAST_IND_FLAG_CONSTR_2, 0, "nonBroadcastIndFlag" }, @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_GANSSNavModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_toeMSB_constraint_1, - &asn_PER_memb_toeMSB_constr_3, + &ASN_PER_MEMB_TOE_MSB_CONSTR_3, 0, "toeMSB" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_GANSSNavModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_eMSB_constraint_1, - &asn_PER_memb_eMSB_constr_4, + &ASN_PER_MEMB_E_MSB_CONSTR_4, 0, "eMSB" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_GANSSNavModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_sqrtAMBS_constraint_1, - &asn_PER_memb_sqrtAMBS_constr_5, + &ASN_PER_MEMB_SQRT_AMBS_CONSTR_5, 0, "sqrtAMBS" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.c b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.c index 5bd45837a..ff3bba79c 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSOrbitModel.c @@ -6,7 +6,7 @@ #include "GANSSOrbitModel.h" -static asn_per_constraints_t asn_PER_type_GANSSOrbitModel_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_ORBIT_MODEL_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 0, 0, 0, 0 } /* (0..0,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -52,7 +52,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSOrbitModel = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_GANSSOrbitModel_constr_1, + &ASN_PER_TYPE_GANSS_ORBIT_MODEL_CONSTR_1, asn_MBR_GANSSOrbitModel_1, 1, /* Elements count */ &asn_SPC_GANSSOrbitModel_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.c b/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.c index aaff620c7..77f16b6d7 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.c +++ b/src/core/libs/supl/asn-rrlp/GANSSPositioningMethod.c @@ -117,7 +117,7 @@ GANSSPositioningMethod_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSPositioningMethod_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_POSITIONING_METHOD_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 2, 16 } /* (SIZE(2..16)) */, 0, 0 /* No PER value map */ @@ -144,7 +144,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSPositioningMethod = { asn_DEF_GANSSPositioningMethod_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSPositioningMethod_tags_1) /sizeof(asn_DEF_GANSSPositioningMethod_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSPositioningMethod_constr_1, + &ASN_PER_TYPE_GANSS_POSITIONING_METHOD_CONSTR_1, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.c b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.c index 9a5a09290..28f7fb4ed 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.c +++ b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementAssist.c @@ -31,7 +31,7 @@ memb_ganssSignalID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssSignalID_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_SIGNAL_ID_CONSTR_2 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefMeasurementAssist_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssSignalID_constraint_1, - &asn_PER_memb_ganssSignalID_constr_2, + &ASN_PER_MEMB_GANSS_SIGNAL_ID_CONSTR_2, 0, "ganssSignalID" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.c b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.c index f67633244..c527baf5a 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSSRefMeasurementElement.c @@ -106,22 +106,22 @@ memb_codePhaseSearchWindow_constraint_1(asn_TYPE_descriptor_t *td, const void *s } } -static asn_per_constraints_t asn_PER_memb_doppler0_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER0_CONSTR_3 = { { APC_CONSTRAINED, 12, 12, -2048, 2047 } /* (-2048..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhase_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_CONSTR_5 = { { APC_CONSTRAINED, 10, 10, 0, 1022 } /* (0..1022) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_intCodePhase_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_INT_CODE_PHASE_CONSTR_6 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_codePhaseSearchWindow_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_CODE_PHASE_SEARCH_WINDOW_CONSTR_7 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefMeasurementElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler0_constraint_1, - &asn_PER_memb_doppler0_constr_3, + &ASN_PER_MEMB_DOPPLER0_CONSTR_3, 0, "doppler0" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefMeasurementElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhase_constraint_1, - &asn_PER_memb_codePhase_constr_5, + &ASN_PER_MEMB_CODE_PHASE_CONSTR_5, 0, "codePhase" }, @@ -168,7 +168,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefMeasurementElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_intCodePhase_constraint_1, - &asn_PER_memb_intCodePhase_constr_6, + &ASN_PER_MEMB_INT_CODE_PHASE_CONSTR_6, 0, "intCodePhase" }, @@ -177,7 +177,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefMeasurementElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_codePhaseSearchWindow_constraint_1, - &asn_PER_memb_codePhaseSearchWindow_constr_7, + &ASN_PER_MEMB_CODE_PHASE_SEARCH_WINDOW_CONSTR_7, 0, "codePhaseSearchWindow" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.c b/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.c index 406523ba9..c1bd034fe 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.c +++ b/src/core/libs/supl/asn-rrlp/GANSSRefTimeInfo.c @@ -56,12 +56,12 @@ memb_ganssTimeID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssDay_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_DAY_CONSTR_2 = { { APC_CONSTRAINED, 13, 13, 0, 8191 } /* (0..8191) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssTimeID_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_TIME_ID_CONSTR_5 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefTimeInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssDay_constraint_1, - &asn_PER_memb_ganssDay_constr_2, + &ASN_PER_MEMB_GANSS_DAY_CONSTR_2, 0, "ganssDay" }, @@ -99,7 +99,7 @@ static asn_TYPE_member_t asn_MBR_GANSSRefTimeInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssTimeID_constraint_1, - &asn_PER_memb_ganssTimeID_constr_5, + &ASN_PER_MEMB_GANSS_TIME_ID_CONSTR_5, 0, "ganssTimeID" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.c b/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.c index d32e86bf5..67367ff6f 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSSSatelliteElement.c @@ -56,12 +56,12 @@ memb_iod_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_svHealth_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_SV_HEALTH_CONSTR_3 = { { APC_CONSTRAINED, 5, 5, -7, 13 } /* (-7..13) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_iod_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_IOD_CONSTR_4 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_GANSSSatelliteElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_svHealth_constraint_1, - &asn_PER_memb_svHealth_constr_3, + &ASN_PER_MEMB_SV_HEALTH_CONSTR_3, 0, "svHealth" }, @@ -90,7 +90,7 @@ static asn_TYPE_member_t asn_MBR_GANSSSatelliteElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_iod_constraint_1, - &asn_PER_memb_iod_constr_4, + &ASN_PER_MEMB_IOD_CONSTR_4, 0, "iod" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSSignalID.c b/src/core/libs/supl/asn-rrlp/GANSSSignalID.c index dfcdb15da..05ddb3db6 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSSignalID.c +++ b/src/core/libs/supl/asn-rrlp/GANSSSignalID.c @@ -111,7 +111,7 @@ GANSSSignalID_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSSignalID_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSS_SIGNAL_ID_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSSignalID = { asn_DEF_GANSSSignalID_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSSignalID_tags_1) /sizeof(asn_DEF_GANSSSignalID_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSSignalID_constr_1, + &ASN_PER_TYPE_GANSS_SIGNAL_ID_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSTOD.c b/src/core/libs/supl/asn-rrlp/GANSSTOD.c index b2007aaa9..5022d5bd3 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTOD.c +++ b/src/core/libs/supl/asn-rrlp/GANSSTOD.c @@ -111,7 +111,7 @@ GANSSTOD_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSTOD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSSTOD_CONSTR_1 = { { APC_CONSTRAINED, 17, -1, 0, 86399 } /* (0..86399) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSTOD = { asn_DEF_GANSSTOD_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSTOD_tags_1) /sizeof(asn_DEF_GANSSTOD_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSTOD_constr_1, + &ASN_PER_TYPE_GANSSTOD_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.c b/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.c index a07695911..72519d28c 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.c +++ b/src/core/libs/supl/asn-rrlp/GANSSTODUncertainty.c @@ -111,7 +111,7 @@ GANSSTODUncertainty_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSTODUncertainty_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSSTOD_UNCERTAINTY_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSTODUncertainty = { asn_DEF_GANSSTODUncertainty_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSTODUncertainty_tags_1) /sizeof(asn_DEF_GANSSTODUncertainty_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSTODUncertainty_constr_1, + &ASN_PER_TYPE_GANSSTOD_UNCERTAINTY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSTODm.c b/src/core/libs/supl/asn-rrlp/GANSSTODm.c index 02a84dfe7..2bc765980 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTODm.c +++ b/src/core/libs/supl/asn-rrlp/GANSSTODm.c @@ -111,7 +111,7 @@ GANSSTODm_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GANSSTODm_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GANSSTO_DM_CONSTR_1 = { { APC_CONSTRAINED, 22, -1, 0, 3599999 } /* (0..3599999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GANSSTODm = { asn_DEF_GANSSTODm_tags_1, /* Same as above */ sizeof(asn_DEF_GANSSTODm_tags_1) /sizeof(asn_DEF_GANSSTODm_tags_1[0]), /* 1 */ - &asn_PER_type_GANSSTODm_constr_1, + &ASN_PER_TYPE_GANSSTO_DM_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.c b/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.c index 6ba69bb30..cd993b5e5 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.c +++ b/src/core/libs/supl/asn-rrlp/GANSSTimeModelElement.c @@ -81,17 +81,17 @@ memb_weekNumber_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssTimeModelRefTime_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_TIME_MODEL_REF_TIME_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_gnssTOID_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_GNSS_TOID_CONSTR_6 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_weekNumber_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_WEEK_NUMBER_CONSTR_7 = { { APC_CONSTRAINED, 13, 13, 0, 8191 } /* (0..8191) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_GANSSTimeModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssTimeModelRefTime_constraint_1, - &asn_PER_memb_ganssTimeModelRefTime_constr_2, + &ASN_PER_MEMB_GANSS_TIME_MODEL_REF_TIME_CONSTR_2, 0, "ganssTimeModelRefTime" }, @@ -138,7 +138,7 @@ static asn_TYPE_member_t asn_MBR_GANSSTimeModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gnssTOID_constraint_1, - &asn_PER_memb_gnssTOID_constr_6, + &ASN_PER_MEMB_GNSS_TOID_CONSTR_6, 0, "gnssTOID" }, @@ -147,7 +147,7 @@ static asn_TYPE_member_t asn_MBR_GANSSTimeModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_weekNumber_constraint_1, - &asn_PER_memb_weekNumber_constr_7, + &ASN_PER_MEMB_WEEK_NUMBER_CONSTR_7, 0, "weekNumber" }, diff --git a/src/core/libs/supl/asn-rrlp/GANSSUTCModel.c b/src/core/libs/supl/asn-rrlp/GANSSUTCModel.c index 5366ea85d..8d37ddc7a 100644 --- a/src/core/libs/supl/asn-rrlp/GANSSUTCModel.c +++ b/src/core/libs/supl/asn-rrlp/GANSSUTCModel.c @@ -206,42 +206,42 @@ memb_ganssUtcDeltaTlsf_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssUtcA1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_A1_CONSTR_2 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcA0_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_A0_CONSTR_3 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcTot_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_TOT_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcWNt_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_W_NT_CONSTR_5 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcDeltaTls_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_DELTA_TLS_CONSTR_6 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcWNlsf_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_W_NLSF_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcDN_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_DN_CONSTR_8 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ganssUtcDeltaTlsf_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_UTC_DELTA_TLSF_CONSTR_9 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -252,7 +252,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcA1_constraint_1, - &asn_PER_memb_ganssUtcA1_constr_2, + &ASN_PER_MEMB_GANSS_UTC_A1_CONSTR_2, 0, "ganssUtcA1" }, @@ -261,7 +261,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcA0_constraint_1, - &asn_PER_memb_ganssUtcA0_constr_3, + &ASN_PER_MEMB_GANSS_UTC_A0_CONSTR_3, 0, "ganssUtcA0" }, @@ -270,7 +270,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcTot_constraint_1, - &asn_PER_memb_ganssUtcTot_constr_4, + &ASN_PER_MEMB_GANSS_UTC_TOT_CONSTR_4, 0, "ganssUtcTot" }, @@ -279,7 +279,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcWNt_constraint_1, - &asn_PER_memb_ganssUtcWNt_constr_5, + &ASN_PER_MEMB_GANSS_UTC_W_NT_CONSTR_5, 0, "ganssUtcWNt" }, @@ -288,7 +288,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcDeltaTls_constraint_1, - &asn_PER_memb_ganssUtcDeltaTls_constr_6, + &ASN_PER_MEMB_GANSS_UTC_DELTA_TLS_CONSTR_6, 0, "ganssUtcDeltaTls" }, @@ -297,7 +297,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcWNlsf_constraint_1, - &asn_PER_memb_ganssUtcWNlsf_constr_7, + &ASN_PER_MEMB_GANSS_UTC_W_NLSF_CONSTR_7, 0, "ganssUtcWNlsf" }, @@ -306,7 +306,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcDN_constraint_1, - &asn_PER_memb_ganssUtcDN_constr_8, + &ASN_PER_MEMB_GANSS_UTC_DN_CONSTR_8, 0, "ganssUtcDN" }, @@ -315,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_GANSSUTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssUtcDeltaTlsf_constraint_1, - &asn_PER_memb_ganssUtcDeltaTlsf_constr_9, + &ASN_PER_MEMB_GANSS_UTC_DELTA_TLSF_CONSTR_9, 0, "ganssUtcDeltaTlsf" }, diff --git a/src/core/libs/supl/asn-rrlp/GPS-MsrElement.c b/src/core/libs/supl/asn-rrlp/GPS-MsrElement.c index 96d4d1de7..756a7f54e 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-MsrElement.c +++ b/src/core/libs/supl/asn-rrlp/GPS-MsrElement.c @@ -131,27 +131,27 @@ memb_pseuRangeRMSErr_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_cNo_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_C_NO_CONSTR_3 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_doppler_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_DOPPLER_CONSTR_4 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_wholeChips_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_WHOLE_CHIPS_CONSTR_5 = { { APC_CONSTRAINED, 10, 10, 0, 1022 } /* (0..1022) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_fracChips_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_FRAC_CHIPS_CONSTR_6 = { { APC_CONSTRAINED, 11, 11, 0, 1024 } /* (0..1024) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_pseuRangeRMSErr_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_PSEU_RANGE_RMS_ERR_CONSTR_8 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -171,7 +171,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_cNo_constraint_1, - &asn_PER_memb_cNo_constr_3, + &ASN_PER_MEMB_C_NO_CONSTR_3, 0, "cNo" }, @@ -180,7 +180,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_doppler_constraint_1, - &asn_PER_memb_doppler_constr_4, + &ASN_PER_MEMB_DOPPLER_CONSTR_4, 0, "doppler" }, @@ -189,7 +189,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_wholeChips_constraint_1, - &asn_PER_memb_wholeChips_constr_5, + &ASN_PER_MEMB_WHOLE_CHIPS_CONSTR_5, 0, "wholeChips" }, @@ -198,7 +198,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_fracChips_constraint_1, - &asn_PER_memb_fracChips_constr_6, + &ASN_PER_MEMB_FRAC_CHIPS_CONSTR_6, 0, "fracChips" }, @@ -216,7 +216,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_pseuRangeRMSErr_constraint_1, - &asn_PER_memb_pseuRangeRMSErr_constr_8, + &ASN_PER_MEMB_PSEU_RANGE_RMS_ERR_CONSTR_8, 0, "pseuRangeRMSErr" }, diff --git a/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.c b/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.c index 91c0ce711..c1aec7065 100644 --- a/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.c +++ b/src/core/libs/supl/asn-rrlp/GPS-MsrSetElement.c @@ -31,7 +31,7 @@ memb_refFrame_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refFrame_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_FRAME_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_GPS_MsrSetElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refFrame_constraint_1, - &asn_PER_memb_refFrame_constr_2, + &ASN_PER_MEMB_REF_FRAME_CONSTR_2, 0, "refFrame" }, diff --git a/src/core/libs/supl/asn-rrlp/GPSAssistanceData.c b/src/core/libs/supl/asn-rrlp/GPSAssistanceData.c index f2604dbcf..6f93d65f3 100644 --- a/src/core/libs/supl/asn-rrlp/GPSAssistanceData.c +++ b/src/core/libs/supl/asn-rrlp/GPSAssistanceData.c @@ -112,7 +112,7 @@ GPSAssistanceData_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GPSAssistanceData_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPS_ASSISTANCE_DATA_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 40 } /* (SIZE(1..40)) */, 0, 0 /* No PER value map */ @@ -139,7 +139,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSAssistanceData = { asn_DEF_GPSAssistanceData_tags_1, /* Same as above */ sizeof(asn_DEF_GPSAssistanceData_tags_1) /sizeof(asn_DEF_GPSAssistanceData_tags_1[0]), /* 1 */ - &asn_PER_type_GPSAssistanceData_constr_1, + &ASN_PER_TYPE_GPS_ASSISTANCE_DATA_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.c b/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.c index 1250731f0..c80de1dad 100644 --- a/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.c +++ b/src/core/libs/supl/asn-rrlp/GPSReferenceTimeUncertainty.c @@ -111,7 +111,7 @@ GPSReferenceTimeUncertainty_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GPSReferenceTimeUncertainty_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPS_REFERENCE_TIME_UNCERTAINTY_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSReferenceTimeUncertainty = { asn_DEF_GPSReferenceTimeUncertainty_tags_1, /* Same as above */ sizeof(asn_DEF_GPSReferenceTimeUncertainty_tags_1) /sizeof(asn_DEF_GPSReferenceTimeUncertainty_tags_1[0]), /* 1 */ - &asn_PER_type_GPSReferenceTimeUncertainty_constr_1, + &ASN_PER_TYPE_GPS_REFERENCE_TIME_UNCERTAINTY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GPSTOW23b.c b/src/core/libs/supl/asn-rrlp/GPSTOW23b.c index 8ad2591cb..fe1c9d773 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOW23b.c +++ b/src/core/libs/supl/asn-rrlp/GPSTOW23b.c @@ -111,7 +111,7 @@ GPSTOW23b_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GPSTOW23b_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPSTO_W23B_CONSTR_1 = { { APC_CONSTRAINED, 23, -1, 0, 7559999 } /* (0..7559999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSTOW23b = { asn_DEF_GPSTOW23b_tags_1, /* Same as above */ sizeof(asn_DEF_GPSTOW23b_tags_1) /sizeof(asn_DEF_GPSTOW23b_tags_1[0]), /* 1 */ - &asn_PER_type_GPSTOW23b_constr_1, + &ASN_PER_TYPE_GPSTO_W23B_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GPSTOW24b.c b/src/core/libs/supl/asn-rrlp/GPSTOW24b.c index 6a110adac..805fe2577 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOW24b.c +++ b/src/core/libs/supl/asn-rrlp/GPSTOW24b.c @@ -111,7 +111,7 @@ GPSTOW24b_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GPSTOW24b_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPSTO_W24B_CONSTR_1 = { { APC_CONSTRAINED, 24, -1, 0, 14399999 } /* (0..14399999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSTOW24b = { asn_DEF_GPSTOW24b_tags_1, /* Same as above */ sizeof(asn_DEF_GPSTOW24b_tags_1) /sizeof(asn_DEF_GPSTOW24b_tags_1[0]), /* 1 */ - &asn_PER_type_GPSTOW24b_constr_1, + &ASN_PER_TYPE_GPSTO_W24B_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/GPSTOWAssist.c b/src/core/libs/supl/asn-rrlp/GPSTOWAssist.c index aac3de697..0ce4905d9 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTOWAssist.c +++ b/src/core/libs/supl/asn-rrlp/GPSTOWAssist.c @@ -6,7 +6,7 @@ #include "GPSTOWAssist.h" -static asn_per_constraints_t asn_PER_type_GPSTOWAssist_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPSTOW_ASSIST_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 12 } /* (SIZE(1..12)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSTOWAssist = { asn_DEF_GPSTOWAssist_tags_1, /* Same as above */ sizeof(asn_DEF_GPSTOWAssist_tags_1) /sizeof(asn_DEF_GPSTOWAssist_tags_1[0]), /* 1 */ - &asn_PER_type_GPSTOWAssist_constr_1, + &ASN_PER_TYPE_GPSTOW_ASSIST_CONSTR_1, asn_MBR_GPSTOWAssist_1, 1, /* Single element */ &asn_SPC_GPSTOWAssist_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.c b/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.c index 6e7fe01d8..67ef9b1a3 100644 --- a/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.c +++ b/src/core/libs/supl/asn-rrlp/GPSTimeAssistanceMeasurements.c @@ -81,17 +81,17 @@ memb_deltaTow_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_referenceFrameMSB_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REFERENCE_FRAME_MSB_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_gpsTowSubms_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_TOW_SUBMS_CONSTR_3 = { { APC_CONSTRAINED, 14, 14, 0, 9999 } /* (0..9999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_deltaTow_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_TOW_CONSTR_4 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_GPSTimeAssistanceMeasurements_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_referenceFrameMSB_constraint_1, - &asn_PER_memb_referenceFrameMSB_constr_2, + &ASN_PER_MEMB_REFERENCE_FRAME_MSB_CONSTR_2, 0, "referenceFrameMSB" }, @@ -111,7 +111,7 @@ static asn_TYPE_member_t asn_MBR_GPSTimeAssistanceMeasurements_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsTowSubms_constraint_1, - &asn_PER_memb_gpsTowSubms_constr_3, + &ASN_PER_MEMB_GPS_TOW_SUBMS_CONSTR_3, 0, "gpsTowSubms" }, @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_GPSTimeAssistanceMeasurements_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaTow_constraint_1, - &asn_PER_memb_deltaTow_constr_4, + &ASN_PER_MEMB_DELTA_TOW_CONSTR_4, 0, "deltaTow" }, diff --git a/src/core/libs/supl/asn-rrlp/GPSWeek.c b/src/core/libs/supl/asn-rrlp/GPSWeek.c index 33cb12809..0b312cb38 100644 --- a/src/core/libs/supl/asn-rrlp/GPSWeek.c +++ b/src/core/libs/supl/asn-rrlp/GPSWeek.c @@ -111,7 +111,7 @@ GPSWeek_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_GPSWeek_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_GPS_WEEK_CONSTR_1 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_GPSWeek = { asn_DEF_GPSWeek_tags_1, /* Same as above */ sizeof(asn_DEF_GPSWeek_tags_1) /sizeof(asn_DEF_GPSWeek_tags_1[0]), /* 1 */ - &asn_PER_type_GPSWeek_constr_1, + &ASN_PER_TYPE_GPS_WEEK_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/IonosphericModel.c b/src/core/libs/supl/asn-rrlp/IonosphericModel.c index 552004de2..bafe72b87 100644 --- a/src/core/libs/supl/asn-rrlp/IonosphericModel.c +++ b/src/core/libs/supl/asn-rrlp/IonosphericModel.c @@ -206,42 +206,42 @@ memb_beta3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_alfa0_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_ALFA0_CONSTR_2 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_alfa1_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_ALFA1_CONSTR_3 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_alfa2_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_ALFA2_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_alfa3_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_ALFA3_CONSTR_5 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_beta0_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_BETA0_CONSTR_6 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_beta1_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_BETA1_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_beta2_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_BETA2_CONSTR_8 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_beta3_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_BETA3_CONSTR_9 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -252,7 +252,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alfa0_constraint_1, - &asn_PER_memb_alfa0_constr_2, + &ASN_PER_MEMB_ALFA0_CONSTR_2, 0, "alfa0" }, @@ -261,7 +261,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alfa1_constraint_1, - &asn_PER_memb_alfa1_constr_3, + &ASN_PER_MEMB_ALFA1_CONSTR_3, 0, "alfa1" }, @@ -270,7 +270,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alfa2_constraint_1, - &asn_PER_memb_alfa2_constr_4, + &ASN_PER_MEMB_ALFA2_CONSTR_4, 0, "alfa2" }, @@ -279,7 +279,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_alfa3_constraint_1, - &asn_PER_memb_alfa3_constr_5, + &ASN_PER_MEMB_ALFA3_CONSTR_5, 0, "alfa3" }, @@ -288,7 +288,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_beta0_constraint_1, - &asn_PER_memb_beta0_constr_6, + &ASN_PER_MEMB_BETA0_CONSTR_6, 0, "beta0" }, @@ -297,7 +297,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_beta1_constraint_1, - &asn_PER_memb_beta1_constr_7, + &ASN_PER_MEMB_BETA1_CONSTR_7, 0, "beta1" }, @@ -306,7 +306,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_beta2_constraint_1, - &asn_PER_memb_beta2_constr_8, + &ASN_PER_MEMB_BETA2_CONSTR_8, 0, "beta2" }, @@ -315,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_IonosphericModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_beta3_constraint_1, - &asn_PER_memb_beta3_constr_9, + &ASN_PER_MEMB_BETA3_CONSTR_9, 0, "beta3" }, diff --git a/src/core/libs/supl/asn-rrlp/LAC.c b/src/core/libs/supl/asn-rrlp/LAC.c index e15942e24..d6de9a0ae 100644 --- a/src/core/libs/supl/asn-rrlp/LAC.c +++ b/src/core/libs/supl/asn-rrlp/LAC.c @@ -111,7 +111,7 @@ LAC_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_LAC_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_LAC_CONSTR_1 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_LAC = { asn_DEF_LAC_tags_1, /* Same as above */ sizeof(asn_DEF_LAC_tags_1) /sizeof(asn_DEF_LAC_tags_1[0]), /* 1 */ - &asn_PER_type_LAC_constr_1, + &ASN_PER_TYPE_LAC_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/LocErrorReason.c b/src/core/libs/supl/asn-rrlp/LocErrorReason.c index 2d98516db..217112048 100644 --- a/src/core/libs/supl/asn-rrlp/LocErrorReason.c +++ b/src/core/libs/supl/asn-rrlp/LocErrorReason.c @@ -94,7 +94,7 @@ LocErrorReason_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_LocErrorReason_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_LOC_ERROR_REASON_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 0, 10 } /* (0..10,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -164,7 +164,7 @@ asn_TYPE_descriptor_t asn_DEF_LocErrorReason = { asn_DEF_LocErrorReason_tags_1, /* Same as above */ sizeof(asn_DEF_LocErrorReason_tags_1) /sizeof(asn_DEF_LocErrorReason_tags_1[0]), /* 1 */ - &asn_PER_type_LocErrorReason_constr_1, + &ASN_PER_TYPE_LOC_ERROR_REASON_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_LocErrorReason_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/LocationInfo.c b/src/core/libs/supl/asn-rrlp/LocationInfo.c index 92d0990f6..53a747679 100644 --- a/src/core/libs/supl/asn-rrlp/LocationInfo.c +++ b/src/core/libs/supl/asn-rrlp/LocationInfo.c @@ -56,12 +56,12 @@ memb_gpsTOW_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refFrame_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_FRAME_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_gpsTOW_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_TOW_CONSTR_3 = { { APC_CONSTRAINED, 24, -1, 0, 14399999 } /* (0..14399999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_LocationInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refFrame_constraint_1, - &asn_PER_memb_refFrame_constr_2, + &ASN_PER_MEMB_REF_FRAME_CONSTR_2, 0, "refFrame" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_LocationInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsTOW_constraint_1, - &asn_PER_memb_gpsTOW_constr_3, + &ASN_PER_MEMB_GPS_TOW_CONSTR_3, 0, "gpsTOW" }, diff --git a/src/core/libs/supl/asn-rrlp/MeasureResponseTime.c b/src/core/libs/supl/asn-rrlp/MeasureResponseTime.c index 808aef74c..f46280af2 100644 --- a/src/core/libs/supl/asn-rrlp/MeasureResponseTime.c +++ b/src/core/libs/supl/asn-rrlp/MeasureResponseTime.c @@ -111,7 +111,7 @@ MeasureResponseTime_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_MeasureResponseTime_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MEASURE_RESPONSE_TIME_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_MeasureResponseTime = { asn_DEF_MeasureResponseTime_tags_1, /* Same as above */ sizeof(asn_DEF_MeasureResponseTime_tags_1) /sizeof(asn_DEF_MeasureResponseTime_tags_1[0]), /* 1 */ - &asn_PER_type_MeasureResponseTime_constr_1, + &ASN_PER_TYPE_MEASURE_RESPONSE_TIME_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/MethodType.c b/src/core/libs/supl/asn-rrlp/MethodType.c index 7a2b9ecfa..dc7782e8e 100644 --- a/src/core/libs/supl/asn-rrlp/MethodType.c +++ b/src/core/libs/supl/asn-rrlp/MethodType.c @@ -6,7 +6,7 @@ #include "MethodType.h" -static asn_per_constraints_t asn_PER_type_MethodType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_METHOD_TYPE_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -82,7 +82,7 @@ asn_TYPE_descriptor_t asn_DEF_MethodType = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_MethodType_constr_1, + &ASN_PER_TYPE_METHOD_TYPE_CONSTR_1, asn_MBR_MethodType_1, 4, /* Elements count */ &asn_SPC_MethodType_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.c b/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.c index bf42ed64a..b14a2967f 100644 --- a/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.c +++ b/src/core/libs/supl/asn-rrlp/ModuloTimeSlot.c @@ -111,7 +111,7 @@ ModuloTimeSlot_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_ModuloTimeSlot_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MODULO_TIME_SLOT_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_ModuloTimeSlot = { asn_DEF_ModuloTimeSlot_tags_1, /* Same as above */ sizeof(asn_DEF_ModuloTimeSlot_tags_1) /sizeof(asn_DEF_ModuloTimeSlot_tags_1[0]), /* 1 */ - &asn_PER_type_ModuloTimeSlot_constr_1, + &ASN_PER_TYPE_MODULO_TIME_SLOT_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.c b/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.c index b2a849cb5..dd107752c 100644 --- a/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.c +++ b/src/core/libs/supl/asn-rrlp/MoreAssDataToBeSent.c @@ -94,7 +94,7 @@ MoreAssDataToBeSent_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_MoreAssDataToBeSent_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MORE_ASS_DATA_TO_BE_SENT_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_MoreAssDataToBeSent = { asn_DEF_MoreAssDataToBeSent_tags_1, /* Same as above */ sizeof(asn_DEF_MoreAssDataToBeSent_tags_1) /sizeof(asn_DEF_MoreAssDataToBeSent_tags_1[0]), /* 1 */ - &asn_PER_type_MoreAssDataToBeSent_constr_1, + &ASN_PER_TYPE_MORE_ASS_DATA_TO_BE_SENT_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_MoreAssDataToBeSent_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/MpathIndic.c b/src/core/libs/supl/asn-rrlp/MpathIndic.c index 8a1a0a280..67e26d4b0 100644 --- a/src/core/libs/supl/asn-rrlp/MpathIndic.c +++ b/src/core/libs/supl/asn-rrlp/MpathIndic.c @@ -94,7 +94,7 @@ MpathIndic_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_MpathIndic_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MPATH_INDIC_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -142,7 +142,7 @@ asn_TYPE_descriptor_t asn_DEF_MpathIndic = { asn_DEF_MpathIndic_tags_1, /* Same as above */ sizeof(asn_DEF_MpathIndic_tags_1) /sizeof(asn_DEF_MpathIndic_tags_1[0]), /* 1 */ - &asn_PER_type_MpathIndic_constr_1, + &ASN_PER_TYPE_MPATH_INDIC_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_MpathIndic_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/MultiFrameOffset.c b/src/core/libs/supl/asn-rrlp/MultiFrameOffset.c index 8d9149817..297d81b3f 100644 --- a/src/core/libs/supl/asn-rrlp/MultiFrameOffset.c +++ b/src/core/libs/supl/asn-rrlp/MultiFrameOffset.c @@ -111,7 +111,7 @@ MultiFrameOffset_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_MultiFrameOffset_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MULTI_FRAME_OFFSET_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 0, 51 } /* (0..51) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_MultiFrameOffset = { asn_DEF_MultiFrameOffset_tags_1, /* Same as above */ sizeof(asn_DEF_MultiFrameOffset_tags_1) /sizeof(asn_DEF_MultiFrameOffset_tags_1[0]), /* 1 */ - &asn_PER_type_MultiFrameOffset_constr_1, + &ASN_PER_TYPE_MULTI_FRAME_OFFSET_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/MultipleSets.c b/src/core/libs/supl/asn-rrlp/MultipleSets.c index cce55bd21..7199ac11d 100644 --- a/src/core/libs/supl/asn-rrlp/MultipleSets.c +++ b/src/core/libs/supl/asn-rrlp/MultipleSets.c @@ -56,12 +56,12 @@ memb_nbrOfReferenceBTSs_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr } } -static asn_per_constraints_t asn_PER_memb_nbrOfSets_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_NBR_OF_SETS_CONSTR_2 = { { APC_CONSTRAINED, 1, 1, 2, 3 } /* (2..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_nbrOfReferenceBTSs_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_NBR_OF_REFERENCE_BT_SS_CONSTR_3 = { { APC_CONSTRAINED, 2, 2, 1, 3 } /* (1..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_MultipleSets_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_nbrOfSets_constraint_1, - &asn_PER_memb_nbrOfSets_constr_2, + &ASN_PER_MEMB_NBR_OF_SETS_CONSTR_2, 0, "nbrOfSets" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_MultipleSets_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_nbrOfReferenceBTSs_constraint_1, - &asn_PER_memb_nbrOfReferenceBTSs_constr_3, + &ASN_PER_MEMB_NBR_OF_REFERENCE_BT_SS_CONSTR_3, 0, "nbrOfReferenceBTSs" }, diff --git a/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.c b/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.c index 1b2ae3a79..4dcb8a6ec 100644 --- a/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.c +++ b/src/core/libs/supl/asn-rrlp/NavModel-KeplerianSet.c @@ -406,82 +406,82 @@ memb_keplerCuc_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_keplerToeLSB_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_TOE_LSB_CONSTR_2 = { { APC_CONSTRAINED, 9, 9, 0, 511 } /* (0..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerW_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_W_CONSTR_3 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerDeltaN_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_DELTA_N_CONSTR_4 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerM0_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_M0_CONSTR_5 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerOmegaDot_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_OMEGA_DOT_CONSTR_6 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerELSB_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_ELSB_CONSTR_7 = { { APC_CONSTRAINED, 25, -1, 0, 33554431 } /* (0..33554431) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerIDot_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_I_DOT_CONSTR_8 = { { APC_CONSTRAINED, 14, 14, -8192, 8191 } /* (-8192..8191) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerAPowerHalfLSB_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_A_POWER_HALF_LSB_CONSTR_9 = { { APC_CONSTRAINED, 26, -1, 0, 67108863 } /* (0..67108863) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerI0_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_I0_CONSTR_10 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerOmega0_constr_11 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_OMEGA0_CONSTR_11 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCrs_constr_12 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CRS_CONSTR_12 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCis_constr_13 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CIS_CONSTR_13 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCus_constr_14 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CUS_CONSTR_14 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCrc_constr_15 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CRC_CONSTR_15 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCic_constr_16 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CIC_CONSTR_16 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_keplerCuc_constr_17 = { +static asn_per_constraints_t ASN_PER_MEMB_KEPLER_CUC_CONSTR_17 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -492,7 +492,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerToeLSB_constraint_1, - &asn_PER_memb_keplerToeLSB_constr_2, + &ASN_PER_MEMB_KEPLER_TOE_LSB_CONSTR_2, 0, "keplerToeLSB" }, @@ -501,7 +501,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerW_constraint_1, - &asn_PER_memb_keplerW_constr_3, + &ASN_PER_MEMB_KEPLER_W_CONSTR_3, 0, "keplerW" }, @@ -510,7 +510,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerDeltaN_constraint_1, - &asn_PER_memb_keplerDeltaN_constr_4, + &ASN_PER_MEMB_KEPLER_DELTA_N_CONSTR_4, 0, "keplerDeltaN" }, @@ -519,7 +519,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerM0_constraint_1, - &asn_PER_memb_keplerM0_constr_5, + &ASN_PER_MEMB_KEPLER_M0_CONSTR_5, 0, "keplerM0" }, @@ -528,7 +528,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerOmegaDot_constraint_1, - &asn_PER_memb_keplerOmegaDot_constr_6, + &ASN_PER_MEMB_KEPLER_OMEGA_DOT_CONSTR_6, 0, "keplerOmegaDot" }, @@ -537,7 +537,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerELSB_constraint_1, - &asn_PER_memb_keplerELSB_constr_7, + &ASN_PER_MEMB_KEPLER_ELSB_CONSTR_7, 0, "keplerELSB" }, @@ -546,7 +546,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerIDot_constraint_1, - &asn_PER_memb_keplerIDot_constr_8, + &ASN_PER_MEMB_KEPLER_I_DOT_CONSTR_8, 0, "keplerIDot" }, @@ -555,7 +555,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerAPowerHalfLSB_constraint_1, - &asn_PER_memb_keplerAPowerHalfLSB_constr_9, + &ASN_PER_MEMB_KEPLER_A_POWER_HALF_LSB_CONSTR_9, 0, "keplerAPowerHalfLSB" }, @@ -564,7 +564,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerI0_constraint_1, - &asn_PER_memb_keplerI0_constr_10, + &ASN_PER_MEMB_KEPLER_I0_CONSTR_10, 0, "keplerI0" }, @@ -573,7 +573,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerOmega0_constraint_1, - &asn_PER_memb_keplerOmega0_constr_11, + &ASN_PER_MEMB_KEPLER_OMEGA0_CONSTR_11, 0, "keplerOmega0" }, @@ -582,7 +582,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCrs_constraint_1, - &asn_PER_memb_keplerCrs_constr_12, + &ASN_PER_MEMB_KEPLER_CRS_CONSTR_12, 0, "keplerCrs" }, @@ -591,7 +591,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCis_constraint_1, - &asn_PER_memb_keplerCis_constr_13, + &ASN_PER_MEMB_KEPLER_CIS_CONSTR_13, 0, "keplerCis" }, @@ -600,7 +600,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCus_constraint_1, - &asn_PER_memb_keplerCus_constr_14, + &ASN_PER_MEMB_KEPLER_CUS_CONSTR_14, 0, "keplerCus" }, @@ -609,7 +609,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCrc_constraint_1, - &asn_PER_memb_keplerCrc_constr_15, + &ASN_PER_MEMB_KEPLER_CRC_CONSTR_15, 0, "keplerCrc" }, @@ -618,7 +618,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCic_constraint_1, - &asn_PER_memb_keplerCic_constr_16, + &ASN_PER_MEMB_KEPLER_CIC_CONSTR_16, 0, "keplerCic" }, @@ -627,7 +627,7 @@ static asn_TYPE_member_t asn_MBR_NavModel_KeplerianSet_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_keplerCuc_constraint_1, - &asn_PER_memb_keplerCuc_constr_17, + &ASN_PER_MEMB_KEPLER_CUC_CONSTR_17, 0, "keplerCuc" }, diff --git a/src/core/libs/supl/asn-rrlp/NeighborIdentity.c b/src/core/libs/supl/asn-rrlp/NeighborIdentity.c index 624b5cec2..4c6a649bb 100644 --- a/src/core/libs/supl/asn-rrlp/NeighborIdentity.c +++ b/src/core/libs/supl/asn-rrlp/NeighborIdentity.c @@ -6,7 +6,7 @@ #include "NeighborIdentity.h" -static asn_per_constraints_t asn_PER_type_NeighborIdentity_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_NEIGHBOR_IDENTITY_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 5 } /* (0..5) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ asn_TYPE_descriptor_t asn_DEF_NeighborIdentity = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_NeighborIdentity_constr_1, + &ASN_PER_TYPE_NEIGHBOR_IDENTITY_CONSTR_1, asn_MBR_NeighborIdentity_1, 6, /* Elements count */ &asn_SPC_NeighborIdentity_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/NumOfMeasurements.c b/src/core/libs/supl/asn-rrlp/NumOfMeasurements.c index 1f748f2cc..047b97557 100644 --- a/src/core/libs/supl/asn-rrlp/NumOfMeasurements.c +++ b/src/core/libs/supl/asn-rrlp/NumOfMeasurements.c @@ -111,7 +111,7 @@ NumOfMeasurements_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_NumOfMeasurements_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_NUM_OF_MEASUREMENTS_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_NumOfMeasurements = { asn_DEF_NumOfMeasurements_tags_1, /* Same as above */ sizeof(asn_DEF_NumOfMeasurements_tags_1) /sizeof(asn_DEF_NumOfMeasurements_tags_1[0]), /* 1 */ - &asn_PER_type_NumOfMeasurements_constr_1, + &ASN_PER_TYPE_NUM_OF_MEASUREMENTS_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/OCTET_STRING.c b/src/core/libs/supl/asn-rrlp/OCTET_STRING.c index bd2d1d845..98aebb3bf 100644 --- a/src/core/libs/supl/asn-rrlp/OCTET_STRING.c +++ b/src/core/libs/supl/asn-rrlp/OCTET_STRING.c @@ -19,7 +19,7 @@ static asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = { offsetof(OCTET_STRING_t, _asn_ctx), ASN_OSUBV_STR }; -static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = { +static asn_per_constraints_t ASN_DEF_OCTET_STRING_CONSTRAINTS = { { APC_CONSTRAINED, 8, 8, 0, 255 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, 0, 0 @@ -1351,8 +1351,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, cval = &pc->value; csiz = &pc->size; } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; } switch(specs->subvariant) { @@ -1400,8 +1400,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, int inext = per_get_few_bits(pd, 1); if(inext < 0) RETURN(RC_WMORE); if(inext) { - csiz = &asn_DEF_OCTET_STRING_constraints.size; - cval = &asn_DEF_OCTET_STRING_constraints.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; unit_bits = canonical_unit_bits; } } @@ -1526,8 +1526,8 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, cval = &pc->value; csiz = &pc->size; } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; } ct_extensible = csiz->flags & APC_EXTENSIBLE; @@ -1577,8 +1577,8 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, if((int)sizeinunits < csiz->lower_bound || (int)sizeinunits > csiz->upper_bound) { if(ct_extensible) { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; unit_bits = canonical_unit_bits; inext = 1; } else diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.c b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.c index 5a55a2d96..a61d02dc6 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.c +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrElementFirst.c @@ -56,12 +56,12 @@ memb_taCorrection_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refFrameNumber_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_FRAME_NUMBER_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 42431 } /* (0..42431) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_taCorrection_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_TA_CORRECTION_CONSTR_6 = { { APC_CONSTRAINED, 10, 10, 0, 960 } /* (0..960) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_OTD_MsrElementFirst_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refFrameNumber_constraint_1, - &asn_PER_memb_refFrameNumber_constr_2, + &ASN_PER_MEMB_REF_FRAME_NUMBER_CONSTR_2, 0, "refFrameNumber" }, @@ -108,7 +108,7 @@ static asn_TYPE_member_t asn_MBR_OTD_MsrElementFirst_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_taCorrection_constraint_1, - &asn_PER_memb_taCorrection_constr_6, + &ASN_PER_MEMB_TA_CORRECTION_CONSTR_6, 0, "taCorrection" }, diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.c b/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.c index d779dab1d..ad523960e 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.c +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrElementRest.c @@ -56,12 +56,12 @@ memb_taCorrection_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refFrameNumber_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_FRAME_NUMBER_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 42431 } /* (0..42431) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_taCorrection_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_TA_CORRECTION_CONSTR_6 = { { APC_CONSTRAINED, 10, 10, 0, 960 } /* (0..960) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_OTD_MsrElementRest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refFrameNumber_constraint_1, - &asn_PER_memb_refFrameNumber_constr_2, + &ASN_PER_MEMB_REF_FRAME_NUMBER_CONSTR_2, 0, "refFrameNumber" }, @@ -108,7 +108,7 @@ static asn_TYPE_member_t asn_MBR_OTD_MsrElementRest_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_taCorrection_constraint_1, - &asn_PER_memb_taCorrection_constr_6, + &ASN_PER_MEMB_TA_CORRECTION_CONSTR_6, 0, "taCorrection" }, diff --git a/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.c b/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.c index a331cc268..d018129ab 100644 --- a/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.c +++ b/src/core/libs/supl/asn-rrlp/OTD-MsrsOfOtherSets.c @@ -6,7 +6,7 @@ #include "OTD-MsrsOfOtherSets.h" -static asn_per_constraints_t asn_PER_type_OTD_MsrsOfOtherSets_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_OTD_MSRS_OF_OTHER_SETS_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_OTD_MsrsOfOtherSets = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_OTD_MsrsOfOtherSets_constr_1, + &ASN_PER_TYPE_OTD_MSRS_OF_OTHER_SETS_CONSTR_1, asn_MBR_OTD_MsrsOfOtherSets_1, 2, /* Elements count */ &asn_SPC_OTD_MsrsOfOtherSets_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/OTDValue.c b/src/core/libs/supl/asn-rrlp/OTDValue.c index 28ae50d85..4f837f8c9 100644 --- a/src/core/libs/supl/asn-rrlp/OTDValue.c +++ b/src/core/libs/supl/asn-rrlp/OTDValue.c @@ -111,7 +111,7 @@ OTDValue_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_OTDValue_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_OTD_VALUE_CONSTR_1 = { { APC_CONSTRAINED, 16, 16, 0, 39999 } /* (0..39999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_OTDValue = { asn_DEF_OTDValue_tags_1, /* Same as above */ sizeof(asn_DEF_OTDValue_tags_1) /sizeof(asn_DEF_OTDValue_tags_1[0]), /* 1 */ - &asn_PER_type_OTDValue_constr_1, + &ASN_PER_TYPE_OTD_VALUE_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/PDU.c b/src/core/libs/supl/asn-rrlp/PDU.c index ae0cceeed..bf4708ddd 100644 --- a/src/core/libs/supl/asn-rrlp/PDU.c +++ b/src/core/libs/supl/asn-rrlp/PDU.c @@ -31,7 +31,7 @@ memb_referenceNumber_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_referenceNumber_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REFERENCE_NUMBER_CONSTR_2 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_PDU_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_referenceNumber_constraint_1, - &asn_PER_memb_referenceNumber_constr_2, + &ASN_PER_MEMB_REFERENCE_NUMBER_CONSTR_2, 0, "referenceNumber" }, diff --git a/src/core/libs/supl/asn-rrlp/PositionData.c b/src/core/libs/supl/asn-rrlp/PositionData.c index 7f53011b8..249c4bf46 100644 --- a/src/core/libs/supl/asn-rrlp/PositionData.c +++ b/src/core/libs/supl/asn-rrlp/PositionData.c @@ -117,7 +117,7 @@ PositionData_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_PositionData_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_POSITION_DATA_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 3, 16 } /* (SIZE(3..16)) */, 0, 0 /* No PER value map */ @@ -144,7 +144,7 @@ asn_TYPE_descriptor_t asn_DEF_PositionData = { asn_DEF_PositionData_tags_1, /* Same as above */ sizeof(asn_DEF_PositionData_tags_1) /sizeof(asn_DEF_PositionData_tags_1[0]), /* 1 */ - &asn_PER_type_PositionData_constr_1, + &ASN_PER_TYPE_POSITION_DATA_CONSTR_1, 0, 0, /* Defined elsewhere */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/PositionMethod.c b/src/core/libs/supl/asn-rrlp/PositionMethod.c index 07e07f2a3..b1c3df488 100644 --- a/src/core/libs/supl/asn-rrlp/PositionMethod.c +++ b/src/core/libs/supl/asn-rrlp/PositionMethod.c @@ -94,7 +94,7 @@ PositionMethod_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_PositionMethod_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_POSITION_METHOD_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -140,7 +140,7 @@ asn_TYPE_descriptor_t asn_DEF_PositionMethod = { asn_DEF_PositionMethod_tags_1, /* Same as above */ sizeof(asn_DEF_PositionMethod_tags_1) /sizeof(asn_DEF_PositionMethod_tags_1[0]), /* 1 */ - &asn_PER_type_PositionMethod_constr_1, + &ASN_PER_TYPE_POSITION_METHOD_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_PositionMethod_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/RRLP-Component.c b/src/core/libs/supl/asn-rrlp/RRLP-Component.c index e587f7de4..fe8f448a7 100644 --- a/src/core/libs/supl/asn-rrlp/RRLP-Component.c +++ b/src/core/libs/supl/asn-rrlp/RRLP-Component.c @@ -6,7 +6,7 @@ #include "RRLP-Component.h" -static asn_per_constraints_t asn_PER_type_RRLP_Component_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_RRLP_COMPONENT_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 4 } /* (0..4,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -92,7 +92,7 @@ asn_TYPE_descriptor_t asn_DEF_RRLP_Component = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_RRLP_Component_constr_1, + &ASN_PER_TYPE_RRLP_COMPONENT_CONSTR_1, asn_MBR_RRLP_Component_1, 5, /* Elements count */ &asn_SPC_RRLP_Component_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/RefQuality.c b/src/core/libs/supl/asn-rrlp/RefQuality.c index f64877ef4..0b4fd5c23 100644 --- a/src/core/libs/supl/asn-rrlp/RefQuality.c +++ b/src/core/libs/supl/asn-rrlp/RefQuality.c @@ -111,7 +111,7 @@ RefQuality_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RefQuality_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REF_QUALITY_CONSTR_1 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RefQuality = { asn_DEF_RefQuality_tags_1, /* Same as above */ sizeof(asn_DEF_RefQuality_tags_1) /sizeof(asn_DEF_RefQuality_tags_1[0]), /* 1 */ - &asn_PER_type_RefQuality_constr_1, + &ASN_PER_TYPE_REF_QUALITY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/ReferenceFrame.c b/src/core/libs/supl/asn-rrlp/ReferenceFrame.c index 56c1bbc50..96d482637 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceFrame.c +++ b/src/core/libs/supl/asn-rrlp/ReferenceFrame.c @@ -56,12 +56,12 @@ memb_referenceFNMSB_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_referenceFN_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REFERENCE_FN_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_referenceFNMSB_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_REFERENCE_FNMSB_CONSTR_3 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_ReferenceFrame_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_referenceFN_constraint_1, - &asn_PER_memb_referenceFN_constr_2, + &ASN_PER_MEMB_REFERENCE_FN_CONSTR_2, 0, "referenceFN" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_ReferenceFrame_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_referenceFNMSB_constraint_1, - &asn_PER_memb_referenceFNMSB_constr_3, + &ASN_PER_MEMB_REFERENCE_FNMSB_CONSTR_3, 0, "referenceFNMSB" }, diff --git a/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.c b/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.c index d36515591..95e47ecb4 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.c +++ b/src/core/libs/supl/asn-rrlp/ReferenceIdentityType.c @@ -6,7 +6,7 @@ #include "ReferenceIdentityType.h" -static asn_per_constraints_t asn_PER_type_ReferenceIdentityType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REFERENCE_IDENTITY_TYPE_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 4 } /* (0..4) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -92,7 +92,7 @@ asn_TYPE_descriptor_t asn_DEF_ReferenceIdentityType = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_ReferenceIdentityType_constr_1, + &ASN_PER_TYPE_REFERENCE_IDENTITY_TYPE_CONSTR_1, asn_MBR_ReferenceIdentityType_1, 5, /* Elements count */ &asn_SPC_ReferenceIdentityType_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/ReferenceRelation.c b/src/core/libs/supl/asn-rrlp/ReferenceRelation.c index 931e2c477..c4497a860 100644 --- a/src/core/libs/supl/asn-rrlp/ReferenceRelation.c +++ b/src/core/libs/supl/asn-rrlp/ReferenceRelation.c @@ -94,7 +94,7 @@ ReferenceRelation_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_ReferenceRelation_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REFERENCE_RELATION_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -140,7 +140,7 @@ asn_TYPE_descriptor_t asn_DEF_ReferenceRelation = { asn_DEF_ReferenceRelation_tags_1, /* Same as above */ sizeof(asn_DEF_ReferenceRelation_tags_1) /sizeof(asn_DEF_ReferenceRelation_tags_1[0]), /* 1 */ - &asn_PER_type_ReferenceRelation_constr_1, + &ASN_PER_TYPE_REFERENCE_RELATION_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_ReferenceRelation_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/RelDistance.c b/src/core/libs/supl/asn-rrlp/RelDistance.c index a444e3f70..8273278e4 100644 --- a/src/core/libs/supl/asn-rrlp/RelDistance.c +++ b/src/core/libs/supl/asn-rrlp/RelDistance.c @@ -111,7 +111,7 @@ RelDistance_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RelDistance_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REL_DISTANCE_CONSTR_1 = { { APC_CONSTRAINED, 19, -1, -200000, 200000 } /* (-200000..200000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RelDistance = { asn_DEF_RelDistance_tags_1, /* Same as above */ sizeof(asn_DEF_RelDistance_tags_1) /sizeof(asn_DEF_RelDistance_tags_1[0]), /* 1 */ - &asn_PER_type_RelDistance_constr_1, + &ASN_PER_TYPE_REL_DISTANCE_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/RelativeAlt.c b/src/core/libs/supl/asn-rrlp/RelativeAlt.c index c65d44aa1..78cc612e4 100644 --- a/src/core/libs/supl/asn-rrlp/RelativeAlt.c +++ b/src/core/libs/supl/asn-rrlp/RelativeAlt.c @@ -111,7 +111,7 @@ RelativeAlt_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RelativeAlt_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_RELATIVE_ALT_CONSTR_1 = { { APC_CONSTRAINED, 13, 13, -4000, 4000 } /* (-4000..4000) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RelativeAlt = { asn_DEF_RelativeAlt_tags_1, /* Same as above */ sizeof(asn_DEF_RelativeAlt_tags_1) /sizeof(asn_DEF_RelativeAlt_tags_1[0]), /* 1 */ - &asn_PER_type_RelativeAlt_constr_1, + &ASN_PER_TYPE_RELATIVE_ALT_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/RequestIndex.c b/src/core/libs/supl/asn-rrlp/RequestIndex.c index 6d481f20f..f238a32f6 100644 --- a/src/core/libs/supl/asn-rrlp/RequestIndex.c +++ b/src/core/libs/supl/asn-rrlp/RequestIndex.c @@ -111,7 +111,7 @@ RequestIndex_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RequestIndex_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REQUEST_INDEX_CONSTR_1 = { { APC_CONSTRAINED, 4, 4, 1, 16 } /* (1..16) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RequestIndex = { asn_DEF_RequestIndex_tags_1, /* Same as above */ sizeof(asn_DEF_RequestIndex_tags_1) /sizeof(asn_DEF_RequestIndex_tags_1[0]), /* 1 */ - &asn_PER_type_RequestIndex_constr_1, + &ASN_PER_TYPE_REQUEST_INDEX_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/RequiredResponseTime.c b/src/core/libs/supl/asn-rrlp/RequiredResponseTime.c index 52aff059d..89fd8b230 100644 --- a/src/core/libs/supl/asn-rrlp/RequiredResponseTime.c +++ b/src/core/libs/supl/asn-rrlp/RequiredResponseTime.c @@ -111,7 +111,7 @@ RequiredResponseTime_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RequiredResponseTime_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_REQUIRED_RESPONSE_TIME_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 1, 128 } /* (1..128) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RequiredResponseTime = { asn_DEF_RequiredResponseTime_tags_1, /* Same as above */ sizeof(asn_DEF_RequiredResponseTime_tags_1) /sizeof(asn_DEF_RequiredResponseTime_tags_1[0]), /* 1 */ - &asn_PER_type_RequiredResponseTime_constr_1, + &ASN_PER_TYPE_REQUIRED_RESPONSE_TIME_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/RoughRTD.c b/src/core/libs/supl/asn-rrlp/RoughRTD.c index db420b619..d9222b869 100644 --- a/src/core/libs/supl/asn-rrlp/RoughRTD.c +++ b/src/core/libs/supl/asn-rrlp/RoughRTD.c @@ -111,7 +111,7 @@ RoughRTD_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_RoughRTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ROUGH_RTD_CONSTR_1 = { { APC_CONSTRAINED, 11, 11, 0, 1250 } /* (0..1250) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_RoughRTD = { asn_DEF_RoughRTD_tags_1, /* Same as above */ sizeof(asn_DEF_RoughRTD_tags_1) /sizeof(asn_DEF_RoughRTD_tags_1[0]), /* 1 */ - &asn_PER_type_RoughRTD_constr_1, + &ASN_PER_TYPE_ROUGH_RTD_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/SVID.c b/src/core/libs/supl/asn-rrlp/SVID.c index 5a9adbd3a..ab082f9c0 100644 --- a/src/core/libs/supl/asn-rrlp/SVID.c +++ b/src/core/libs/supl/asn-rrlp/SVID.c @@ -111,7 +111,7 @@ SVID_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_SVID_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SVID_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_SVID = { asn_DEF_SVID_tags_1, /* Same as above */ sizeof(asn_DEF_SVID_tags_1) /sizeof(asn_DEF_SVID_tags_1[0]), /* 1 */ - &asn_PER_type_SVID_constr_1, + &ASN_PER_TYPE_SVID_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/SVIDMASK.c b/src/core/libs/supl/asn-rrlp/SVIDMASK.c index 7c2c1a590..9791443d6 100644 --- a/src/core/libs/supl/asn-rrlp/SVIDMASK.c +++ b/src/core/libs/supl/asn-rrlp/SVIDMASK.c @@ -117,7 +117,7 @@ SVIDMASK_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_SVIDMASK_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SVIDMASK_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 36 } /* (SIZE(1..36)) */, 0, 0 /* No PER value map */ @@ -144,7 +144,7 @@ asn_TYPE_descriptor_t asn_DEF_SVIDMASK = { asn_DEF_SVIDMASK_tags_1, /* Same as above */ sizeof(asn_DEF_SVIDMASK_tags_1) /sizeof(asn_DEF_SVIDMASK_tags_1[0]), /* 1 */ - &asn_PER_type_SVIDMASK_constr_1, + &ASN_PER_TYPE_SVIDMASK_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/SatElement.c b/src/core/libs/supl/asn-rrlp/SatElement.c index 5a3eaf8e1..bab8b9de3 100644 --- a/src/core/libs/supl/asn-rrlp/SatElement.c +++ b/src/core/libs/supl/asn-rrlp/SatElement.c @@ -206,42 +206,42 @@ memb_deltaRangeRateCor3_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr } } -static asn_per_constraints_t asn_PER_memb_iode_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_IODE_CONSTR_3 = { { APC_CONSTRAINED, 8, 8, 0, 239 } /* (0..239) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_udre_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_UDRE_CONSTR_4 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_pseudoRangeCor_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_PSEUDO_RANGE_COR_CONSTR_5 = { { APC_CONSTRAINED, 12, 12, -2047, 2047 } /* (-2047..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_rangeRateCor_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_RANGE_RATE_COR_CONSTR_6 = { { APC_CONSTRAINED, 8, 8, -127, 127 } /* (-127..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_deltaPseudoRangeCor2_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_PSEUDO_RANGE_COR2_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, -127, 127 } /* (-127..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_deltaRangeRateCor2_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_RANGE_RATE_COR2_CONSTR_8 = { { APC_CONSTRAINED, 4, 4, -7, 7 } /* (-7..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_deltaPseudoRangeCor3_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_PSEUDO_RANGE_COR3_CONSTR_9 = { { APC_CONSTRAINED, 8, 8, -127, 127 } /* (-127..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_deltaRangeRateCor3_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_DELTA_RANGE_RATE_COR3_CONSTR_10 = { { APC_CONSTRAINED, 4, 4, -7, 7 } /* (-7..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -261,7 +261,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_iode_constraint_1, - &asn_PER_memb_iode_constr_3, + &ASN_PER_MEMB_IODE_CONSTR_3, 0, "iode" }, @@ -270,7 +270,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_udre_constraint_1, - &asn_PER_memb_udre_constr_4, + &ASN_PER_MEMB_UDRE_CONSTR_4, 0, "udre" }, @@ -279,7 +279,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_pseudoRangeCor_constraint_1, - &asn_PER_memb_pseudoRangeCor_constr_5, + &ASN_PER_MEMB_PSEUDO_RANGE_COR_CONSTR_5, 0, "pseudoRangeCor" }, @@ -288,7 +288,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_rangeRateCor_constraint_1, - &asn_PER_memb_rangeRateCor_constr_6, + &ASN_PER_MEMB_RANGE_RATE_COR_CONSTR_6, 0, "rangeRateCor" }, @@ -297,7 +297,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaPseudoRangeCor2_constraint_1, - &asn_PER_memb_deltaPseudoRangeCor2_constr_7, + &ASN_PER_MEMB_DELTA_PSEUDO_RANGE_COR2_CONSTR_7, 0, "deltaPseudoRangeCor2" }, @@ -306,7 +306,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaRangeRateCor2_constraint_1, - &asn_PER_memb_deltaRangeRateCor2_constr_8, + &ASN_PER_MEMB_DELTA_RANGE_RATE_COR2_CONSTR_8, 0, "deltaRangeRateCor2" }, @@ -315,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaPseudoRangeCor3_constraint_1, - &asn_PER_memb_deltaPseudoRangeCor3_constr_9, + &ASN_PER_MEMB_DELTA_PSEUDO_RANGE_COR3_CONSTR_9, 0, "deltaPseudoRangeCor3" }, @@ -324,7 +324,7 @@ static asn_TYPE_member_t asn_MBR_SatElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_deltaRangeRateCor3_constraint_1, - &asn_PER_memb_deltaRangeRateCor3_constr_10, + &ASN_PER_MEMB_DELTA_RANGE_RATE_COR3_CONSTR_10, 0, "deltaRangeRateCor3" }, diff --git a/src/core/libs/supl/asn-rrlp/SatStatus.c b/src/core/libs/supl/asn-rrlp/SatStatus.c index b92afe853..4f7306873 100644 --- a/src/core/libs/supl/asn-rrlp/SatStatus.c +++ b/src/core/libs/supl/asn-rrlp/SatStatus.c @@ -6,7 +6,7 @@ #include "SatStatus.h" -static asn_per_constraints_t asn_PER_type_SatStatus_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SAT_STATUS_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ asn_TYPE_descriptor_t asn_DEF_SatStatus = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SatStatus_constr_1, + &ASN_PER_TYPE_SAT_STATUS_CONSTR_1, asn_MBR_SatStatus_1, 3, /* Elements count */ &asn_SPC_SatStatus_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SatelliteID.c b/src/core/libs/supl/asn-rrlp/SatelliteID.c index 84951ec1a..9d95fda67 100644 --- a/src/core/libs/supl/asn-rrlp/SatelliteID.c +++ b/src/core/libs/supl/asn-rrlp/SatelliteID.c @@ -111,7 +111,7 @@ SatelliteID_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_SatelliteID_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SATELLITE_ID_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_SatelliteID = { asn_DEF_SatelliteID_tags_1, /* Same as above */ sizeof(asn_DEF_SatelliteID_tags_1) /sizeof(asn_DEF_SatelliteID_tags_1[0]), /* 1 */ - &asn_PER_type_SatelliteID_constr_1, + &ASN_PER_TYPE_SATELLITE_ID_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.c b/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.c index 7425bba8d..867b4dbae 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.c +++ b/src/core/libs/supl/asn-rrlp/SeqOf-BadSatelliteSet.c @@ -6,7 +6,7 @@ #include "SeqOf-BadSatelliteSet.h" -static asn_per_constraints_t asn_PER_type_SeqOf_BadSatelliteSet_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_BAD_SATELLITE_SET_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOf_BadSatelliteSet = { asn_DEF_SeqOf_BadSatelliteSet_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOf_BadSatelliteSet_tags_1) /sizeof(asn_DEF_SeqOf_BadSatelliteSet_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOf_BadSatelliteSet_constr_1, + &ASN_PER_TYPE_SEQ_OF_BAD_SATELLITE_SET_CONSTR_1, asn_MBR_SeqOf_BadSatelliteSet_1, 1, /* Single element */ &asn_SPC_SeqOf_BadSatelliteSet_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.c b/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.c index 2347dbef1..c613f6ea8 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.c +++ b/src/core/libs/supl/asn-rrlp/SeqOf-GANSSDataBits.c @@ -6,7 +6,7 @@ #include "SeqOf-GANSSDataBits.h" -static asn_per_constraints_t asn_PER_type_SeqOf_GANSSDataBits_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_DATA_BITS_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 10, 10, 1, 1024 } /* (SIZE(1..1024)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOf_GANSSDataBits = { asn_DEF_SeqOf_GANSSDataBits_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOf_GANSSDataBits_tags_1) /sizeof(asn_DEF_SeqOf_GANSSDataBits_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOf_GANSSDataBits_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_DATA_BITS_CONSTR_1, asn_MBR_SeqOf_GANSSDataBits_1, 1, /* Single element */ &asn_SPC_SeqOf_GANSSDataBits_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.c b/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.c index 4084ecaf0..a52a77112 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfAcquisElement.c @@ -6,7 +6,7 @@ #include "SeqOfAcquisElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfAcquisElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_ACQUIS_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfAcquisElement = { asn_DEF_SeqOfAcquisElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfAcquisElement_tags_1) /sizeof(asn_DEF_SeqOfAcquisElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfAcquisElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_ACQUIS_ELEMENT_CONSTR_1, asn_MBR_SeqOfAcquisElement_1, 1, /* Single element */ &asn_SPC_SeqOfAcquisElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.c b/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.c index 33843ff27..3d030ddc1 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfAlmanacElement.c @@ -6,7 +6,7 @@ #include "SeqOfAlmanacElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfAlmanacElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_ALMANAC_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 64 } /* (SIZE(1..64)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfAlmanacElement = { asn_DEF_SeqOfAlmanacElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfAlmanacElement_tags_1) /sizeof(asn_DEF_SeqOfAlmanacElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfAlmanacElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_ALMANAC_ELEMENT_CONSTR_1, asn_MBR_SeqOfAlmanacElement_1, 1, /* Single element */ &asn_SPC_SeqOfAlmanacElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.c b/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.c index 1e77ca7ff..61e5d3c6f 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfBadSignalElement.c @@ -6,7 +6,7 @@ #include "SeqOfBadSignalElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfBadSignalElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_BAD_SIGNAL_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfBadSignalElement = { asn_DEF_SeqOfBadSignalElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfBadSignalElement_tags_1) /sizeof(asn_DEF_SeqOfBadSignalElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfBadSignalElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_BAD_SIGNAL_ELEMENT_CONSTR_1, asn_MBR_SeqOfBadSignalElement_1, 1, /* Single element */ &asn_SPC_SeqOfBadSignalElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.c b/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.c index e65dcad05..d53e83fe1 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfDGANSSSgnElement.c @@ -6,7 +6,7 @@ #include "SeqOfDGANSSSgnElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfDGANSSSgnElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_DGANSS_SGN_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfDGANSSSgnElement = { asn_DEF_SeqOfDGANSSSgnElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfDGANSSSgnElement_tags_1) /sizeof(asn_DEF_SeqOfDGANSSSgnElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfDGANSSSgnElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_DGANSS_SGN_ELEMENT_CONSTR_1, asn_MBR_SeqOfDGANSSSgnElement_1, 1, /* Single element */ &asn_SPC_SeqOfDGANSSSgnElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.c index 689475fdd..066acec5a 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-MsrSetElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSS-MsrSetElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSS_MsrSetElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_MSR_SET_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 3 } /* (SIZE(1..3)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_MsrSetElement = { asn_DEF_SeqOfGANSS_MsrSetElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSS_MsrSetElement_tags_1) /sizeof(asn_DEF_SeqOfGANSS_MsrSetElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSS_MsrSetElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_MSR_SET_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSS_MsrSetElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSS_MsrSetElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.c index 8543904c5..e77545690 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSS-SgnElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSS_SgnElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_SGN_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnElement = { asn_DEF_SeqOfGANSS_SgnElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSS_SgnElement_tags_1) /sizeof(asn_DEF_SeqOfGANSS_SgnElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSS_SgnElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_SGN_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSS_SgnElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSS_SgnElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.c index 706d36493..4144d9ae6 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSS-SgnTypeElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSS-SgnTypeElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSS_SgnTypeElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_SGN_TYPE_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 3, 3, 1, 6 } /* (SIZE(1..6)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSS_SgnTypeElement = { asn_DEF_SeqOfGANSS_SgnTypeElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSS_SgnTypeElement_tags_1) /sizeof(asn_DEF_SeqOfGANSS_SgnTypeElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSS_SgnTypeElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_SGN_TYPE_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSS_SgnTypeElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSS_SgnTypeElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.c index 1b6a339f8..18eb57152 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSAlmanacElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSSAlmanacElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSSAlmanacElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_ALMANAC_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 36 } /* (SIZE(1..36)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSAlmanacElement = { asn_DEF_SeqOfGANSSAlmanacElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSSAlmanacElement_tags_1) /sizeof(asn_DEF_SeqOfGANSSAlmanacElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSSAlmanacElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_ALMANAC_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSSAlmanacElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSSAlmanacElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.c index 737ab2623..56bdf4074 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSGenericAssistDataElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSSGenericAssistDataElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSSGenericAssistDataElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_GENERIC_ASSIST_DATA_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 3, 3, 1, 8 } /* (SIZE(1..8)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSGenericAssistDataElement = { asn_DEF_SeqOfGANSSGenericAssistDataElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSSGenericAssistDataElement_tags_1) /sizeof(asn_DEF_SeqOfGANSSGenericAssistDataElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSSGenericAssistDataElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_GENERIC_ASSIST_DATA_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSSGenericAssistDataElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSSGenericAssistDataElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.c index 8e9a1bf16..f38140eec 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSRefMeasurementElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSSRefMeasurementElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSSRefMeasurementElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_REF_MEASUREMENT_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSRefMeasurementElement = { asn_DEF_SeqOfGANSSRefMeasurementElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSSRefMeasurementElement_tags_1) /sizeof(asn_DEF_SeqOfGANSSRefMeasurementElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSSRefMeasurementElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_REF_MEASUREMENT_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSSRefMeasurementElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSSRefMeasurementElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.c index 5c9c95fa5..21c130866 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSSatelliteElement.c @@ -6,7 +6,7 @@ #include "SeqOfGANSSSatelliteElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSSSatelliteElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_SATELLITE_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSSatelliteElement = { asn_DEF_SeqOfGANSSSatelliteElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSSSatelliteElement_tags_1) /sizeof(asn_DEF_SeqOfGANSSSatelliteElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSSSatelliteElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_SATELLITE_ELEMENT_CONSTR_1, asn_MBR_SeqOfGANSSSatelliteElement_1, 1, /* Single element */ &asn_SPC_SeqOfGANSSSatelliteElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.c b/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.c index d3a923f23..e3341bd4d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGANSSTimeModel.c @@ -6,7 +6,7 @@ #include "SeqOfGANSSTimeModel.h" -static asn_per_constraints_t asn_PER_type_SeqOfGANSSTimeModel_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GANSS_TIME_MODEL_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 3, 3, 1, 7 } /* (SIZE(1..7)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGANSSTimeModel = { asn_DEF_SeqOfGANSSTimeModel_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGANSSTimeModel_tags_1) /sizeof(asn_DEF_SeqOfGANSSTimeModel_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGANSSTimeModel_constr_1, + &ASN_PER_TYPE_SEQ_OF_GANSS_TIME_MODEL_CONSTR_1, asn_MBR_SeqOfGANSSTimeModel_1, 1, /* Single element */ &asn_SPC_SeqOfGANSSTimeModel_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.c index c66328606..16637c8b6 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrElement.c @@ -6,7 +6,7 @@ #include "SeqOfGPS-MsrElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGPS_MsrElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GPS_MSR_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrElement = { asn_DEF_SeqOfGPS_MsrElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGPS_MsrElement_tags_1) /sizeof(asn_DEF_SeqOfGPS_MsrElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGPS_MsrElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GPS_MSR_ELEMENT_CONSTR_1, asn_MBR_SeqOfGPS_MsrElement_1, 1, /* Single element */ &asn_SPC_SeqOfGPS_MsrElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.c b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.c index b9f6297a5..ab5c3a559 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfGPS-MsrSetElement.c @@ -6,7 +6,7 @@ #include "SeqOfGPS-MsrSetElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfGPS_MsrSetElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_GPS_MSR_SET_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 3 } /* (SIZE(1..3)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfGPS_MsrSetElement = { asn_DEF_SeqOfGPS_MsrSetElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfGPS_MsrSetElement_tags_1) /sizeof(asn_DEF_SeqOfGPS_MsrSetElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfGPS_MsrSetElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_GPS_MSR_SET_ELEMENT_CONSTR_1, asn_MBR_SeqOfGPS_MsrSetElement_1, 1, /* Single element */ &asn_SPC_SeqOfGPS_MsrSetElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.c b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.c index 15f1cefff..60bd0348d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS-R98-ExpOTD.c @@ -6,7 +6,7 @@ #include "SeqOfMsrAssistBTS-R98-ExpOTD.h" -static asn_per_constraints_t asn_PER_type_SeqOfMsrAssistBTS_R98_ExpOTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_MSR_ASSIST_BTS_R98_EXP_OTD_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 15 } /* (SIZE(1..15)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD = { asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD_tags_1) /sizeof(asn_DEF_SeqOfMsrAssistBTS_R98_ExpOTD_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfMsrAssistBTS_R98_ExpOTD_constr_1, + &ASN_PER_TYPE_SEQ_OF_MSR_ASSIST_BTS_R98_EXP_OTD_CONSTR_1, asn_MBR_SeqOfMsrAssistBTS_R98_ExpOTD_1, 1, /* Single element */ &asn_SPC_SeqOfMsrAssistBTS_R98_ExpOTD_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.c b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.c index fb1b5638e..27bff4abf 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfMsrAssistBTS.c @@ -6,7 +6,7 @@ #include "SeqOfMsrAssistBTS.h" -static asn_per_constraints_t asn_PER_type_SeqOfMsrAssistBTS_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_MSR_ASSIST_BTS_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 15 } /* (SIZE(1..15)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfMsrAssistBTS = { asn_DEF_SeqOfMsrAssistBTS_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfMsrAssistBTS_tags_1) /sizeof(asn_DEF_SeqOfMsrAssistBTS_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfMsrAssistBTS_constr_1, + &ASN_PER_TYPE_SEQ_OF_MSR_ASSIST_BTS_CONSTR_1, asn_MBR_SeqOfMsrAssistBTS_1, 1, /* Single element */ &asn_SPC_SeqOfMsrAssistBTS_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.c b/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.c index d28ec04a2..1606f1a20 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfNavModelElement.c @@ -6,7 +6,7 @@ #include "SeqOfNavModelElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfNavModelElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_NAV_MODEL_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfNavModelElement = { asn_DEF_SeqOfNavModelElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfNavModelElement_tags_1) /sizeof(asn_DEF_SeqOfNavModelElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfNavModelElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_NAV_MODEL_ELEMENT_CONSTR_1, asn_MBR_SeqOfNavModelElement_1, 1, /* Single element */ &asn_SPC_SeqOfNavModelElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.c b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.c index ace76ee1a..5e2bb795d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs-R98-Ext.c @@ -6,7 +6,7 @@ #include "SeqOfOTD-FirstSetMsrs-R98-Ext.h" -static asn_per_constraints_t asn_PER_type_SeqOfOTD_FirstSetMsrs_R98_Ext_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_OTD_FIRST_SET_MSRS_R98_EXT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 3, 3, 1, 5 } /* (SIZE(1..5)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext = { asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext_tags_1) /sizeof(asn_DEF_SeqOfOTD_FirstSetMsrs_R98_Ext_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfOTD_FirstSetMsrs_R98_Ext_constr_1, + &ASN_PER_TYPE_SEQ_OF_OTD_FIRST_SET_MSRS_R98_EXT_CONSTR_1, asn_MBR_SeqOfOTD_FirstSetMsrs_R98_Ext_1, 1, /* Single element */ &asn_SPC_SeqOfOTD_FirstSetMsrs_R98_Ext_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.c b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.c index d3f9263f8..bfebd113d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-FirstSetMsrs.c @@ -6,7 +6,7 @@ #include "SeqOfOTD-FirstSetMsrs.h" -static asn_per_constraints_t asn_PER_type_SeqOfOTD_FirstSetMsrs_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_OTD_FIRST_SET_MSRS_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 10 } /* (SIZE(1..10)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_FirstSetMsrs = { asn_DEF_SeqOfOTD_FirstSetMsrs_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfOTD_FirstSetMsrs_tags_1) /sizeof(asn_DEF_SeqOfOTD_FirstSetMsrs_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfOTD_FirstSetMsrs_constr_1, + &ASN_PER_TYPE_SEQ_OF_OTD_FIRST_SET_MSRS_CONSTR_1, asn_MBR_SeqOfOTD_FirstSetMsrs_1, 1, /* Single element */ &asn_SPC_SeqOfOTD_FirstSetMsrs_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.c b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.c index 27c86b0a5..dae155d61 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrElementRest.c @@ -6,7 +6,7 @@ #include "SeqOfOTD-MsrElementRest.h" -static asn_per_constraints_t asn_PER_type_SeqOfOTD_MsrElementRest_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_OTD_MSR_ELEMENT_REST_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrElementRest = { asn_DEF_SeqOfOTD_MsrElementRest_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfOTD_MsrElementRest_tags_1) /sizeof(asn_DEF_SeqOfOTD_MsrElementRest_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfOTD_MsrElementRest_constr_1, + &ASN_PER_TYPE_SEQ_OF_OTD_MSR_ELEMENT_REST_CONSTR_1, asn_MBR_SeqOfOTD_MsrElementRest_1, 1, /* Single element */ &asn_SPC_SeqOfOTD_MsrElementRest_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.c b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.c index 51b804707..2c7b3b47d 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfOTD-MsrsOfOtherSets.c @@ -6,7 +6,7 @@ #include "SeqOfOTD-MsrsOfOtherSets.h" -static asn_per_constraints_t asn_PER_type_SeqOfOTD_MsrsOfOtherSets_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_OTD_MSRS_OF_OTHER_SETS_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 10 } /* (SIZE(1..10)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfOTD_MsrsOfOtherSets = { asn_DEF_SeqOfOTD_MsrsOfOtherSets_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfOTD_MsrsOfOtherSets_tags_1) /sizeof(asn_DEF_SeqOfOTD_MsrsOfOtherSets_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfOTD_MsrsOfOtherSets_constr_1, + &ASN_PER_TYPE_SEQ_OF_OTD_MSRS_OF_OTHER_SETS_CONSTR_1, asn_MBR_SeqOfOTD_MsrsOfOtherSets_1, 1, /* Single element */ &asn_SPC_SeqOfOTD_MsrsOfOtherSets_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.c b/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.c index e02edb83c..9e55174be 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfReferenceIdentityType.c @@ -6,7 +6,7 @@ #include "SeqOfReferenceIdentityType.h" -static asn_per_constraints_t asn_PER_type_SeqOfReferenceIdentityType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_REFERENCE_IDENTITY_TYPE_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 3 } /* (SIZE(1..3)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfReferenceIdentityType = { asn_DEF_SeqOfReferenceIdentityType_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfReferenceIdentityType_tags_1) /sizeof(asn_DEF_SeqOfReferenceIdentityType_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfReferenceIdentityType_constr_1, + &ASN_PER_TYPE_SEQ_OF_REFERENCE_IDENTITY_TYPE_CONSTR_1, asn_MBR_SeqOfReferenceIdentityType_1, 1, /* Single element */ &asn_SPC_SeqOfReferenceIdentityType_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSatElement.c b/src/core/libs/supl/asn-rrlp/SeqOfSatElement.c index c70089990..2e8aaa42c 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSatElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfSatElement.c @@ -6,7 +6,7 @@ #include "SeqOfSatElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfSatElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_SAT_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfSatElement = { asn_DEF_SeqOfSatElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfSatElement_tags_1) /sizeof(asn_DEF_SeqOfSatElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfSatElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_SAT_ELEMENT_CONSTR_1, asn_MBR_SeqOfSatElement_1, 1, /* Single element */ &asn_SPC_SeqOfSatElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.c b/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.c index 36a8f243a..23920f7fc 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfSgnTypeElement.c @@ -6,7 +6,7 @@ #include "SeqOfSgnTypeElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfSgnTypeElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_SGN_TYPE_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 3 } /* (SIZE(1..3)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfSgnTypeElement = { asn_DEF_SeqOfSgnTypeElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfSgnTypeElement_tags_1) /sizeof(asn_DEF_SeqOfSgnTypeElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfSgnTypeElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_SGN_TYPE_ELEMENT_CONSTR_1, asn_MBR_SeqOfSgnTypeElement_1, 1, /* Single element */ &asn_SPC_SeqOfSgnTypeElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.c b/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.c index 4ecbbcbb7..43c0778d7 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfStandardClockModelElement.c @@ -6,7 +6,7 @@ #include "SeqOfStandardClockModelElement.h" -static asn_per_constraints_t asn_PER_type_SeqOfStandardClockModelElement_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_STANDARD_CLOCK_MODEL_ELEMENT_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfStandardClockModelElement = { asn_DEF_SeqOfStandardClockModelElement_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfStandardClockModelElement_tags_1) /sizeof(asn_DEF_SeqOfStandardClockModelElement_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfStandardClockModelElement_constr_1, + &ASN_PER_TYPE_SEQ_OF_STANDARD_CLOCK_MODEL_ELEMENT_CONSTR_1, asn_MBR_SeqOfStandardClockModelElement_1, 1, /* Single element */ &asn_SPC_SeqOfStandardClockModelElement_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.c b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.c index ae77b5fee..0f53a336b 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS-R98-ExpOTD.c @@ -6,7 +6,7 @@ #include "SeqOfSystemInfoAssistBTS-R98-ExpOTD.h" -static asn_per_constraints_t asn_PER_type_SeqOfSystemInfoAssistBTS_R98_ExpOTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_SYSTEM_INFO_ASSIST_BTS_R98_EXP_OTD_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD = { asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD_tags_1) /sizeof(asn_DEF_SeqOfSystemInfoAssistBTS_R98_ExpOTD_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfSystemInfoAssistBTS_R98_ExpOTD_constr_1, + &ASN_PER_TYPE_SEQ_OF_SYSTEM_INFO_ASSIST_BTS_R98_EXP_OTD_CONSTR_1, asn_MBR_SeqOfSystemInfoAssistBTS_R98_ExpOTD_1, 1, /* Single element */ &asn_SPC_SeqOfSystemInfoAssistBTS_R98_ExpOTD_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.c b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.c index a728a3bde..9a0af489a 100644 --- a/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.c +++ b/src/core/libs/supl/asn-rrlp/SeqOfSystemInfoAssistBTS.c @@ -6,7 +6,7 @@ #include "SeqOfSystemInfoAssistBTS.h" -static asn_per_constraints_t asn_PER_type_SeqOfSystemInfoAssistBTS_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SEQ_OF_SYSTEM_INFO_ASSIST_BTS_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SeqOfSystemInfoAssistBTS = { asn_DEF_SeqOfSystemInfoAssistBTS_tags_1, /* Same as above */ sizeof(asn_DEF_SeqOfSystemInfoAssistBTS_tags_1) /sizeof(asn_DEF_SeqOfSystemInfoAssistBTS_tags_1[0]), /* 1 */ - &asn_PER_type_SeqOfSystemInfoAssistBTS_constr_1, + &ASN_PER_TYPE_SEQ_OF_SYSTEM_INFO_ASSIST_BTS_CONSTR_1, asn_MBR_SeqOfSystemInfoAssistBTS_1, 1, /* Single element */ &asn_SPC_SeqOfSystemInfoAssistBTS_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SgnTypeElement.c b/src/core/libs/supl/asn-rrlp/SgnTypeElement.c index fa49b6689..946abbe38 100644 --- a/src/core/libs/supl/asn-rrlp/SgnTypeElement.c +++ b/src/core/libs/supl/asn-rrlp/SgnTypeElement.c @@ -31,7 +31,7 @@ memb_ganssStatusHealth_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ganssStatusHealth_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_GANSS_STATUS_HEALTH_CONSTR_3 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -51,7 +51,7 @@ static asn_TYPE_member_t asn_MBR_SgnTypeElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ganssStatusHealth_constraint_1, - &asn_PER_memb_ganssStatusHealth_constr_3, + &ASN_PER_MEMB_GANSS_STATUS_HEALTH_CONSTR_3, 0, "ganssStatusHealth" }, diff --git a/src/core/libs/supl/asn-rrlp/StandardClockModelElement.c b/src/core/libs/supl/asn-rrlp/StandardClockModelElement.c index e04f2b6c0..2e17a8a54 100644 --- a/src/core/libs/supl/asn-rrlp/StandardClockModelElement.c +++ b/src/core/libs/supl/asn-rrlp/StandardClockModelElement.c @@ -156,32 +156,32 @@ memb_stanModelID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_stanClockTocLSB_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_CLOCK_TOC_LSB_CONSTR_2 = { { APC_CONSTRAINED, 9, 9, 0, 511 } /* (0..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stanClockAF2_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_CLOCK_A_F2_CONSTR_3 = { { APC_CONSTRAINED, 12, 12, -2048, 2047 } /* (-2048..2047) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stanClockAF1_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_CLOCK_A_F1_CONSTR_4 = { { APC_CONSTRAINED, 18, -1, -131072, 131071 } /* (-131072..131071) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stanClockAF0_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_CLOCK_A_F0_CONSTR_5 = { { APC_CONSTRAINED, 28, -1, -134217728, 134217727 } /* (-134217728..134217727) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stanClockTgd_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_CLOCK_TGD_CONSTR_6 = { { APC_CONSTRAINED, 10, 10, -512, 511 } /* (-512..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_stanModelID_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_STAN_MODEL_ID_CONSTR_7 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -192,7 +192,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanClockTocLSB_constraint_1, - &asn_PER_memb_stanClockTocLSB_constr_2, + &ASN_PER_MEMB_STAN_CLOCK_TOC_LSB_CONSTR_2, 0, "stanClockTocLSB" }, @@ -201,7 +201,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanClockAF2_constraint_1, - &asn_PER_memb_stanClockAF2_constr_3, + &ASN_PER_MEMB_STAN_CLOCK_A_F2_CONSTR_3, 0, "stanClockAF2" }, @@ -210,7 +210,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanClockAF1_constraint_1, - &asn_PER_memb_stanClockAF1_constr_4, + &ASN_PER_MEMB_STAN_CLOCK_A_F1_CONSTR_4, 0, "stanClockAF1" }, @@ -219,7 +219,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanClockAF0_constraint_1, - &asn_PER_memb_stanClockAF0_constr_5, + &ASN_PER_MEMB_STAN_CLOCK_A_F0_CONSTR_5, 0, "stanClockAF0" }, @@ -228,7 +228,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanClockTgd_constraint_1, - &asn_PER_memb_stanClockTgd_constr_6, + &ASN_PER_MEMB_STAN_CLOCK_TGD_CONSTR_6, 0, "stanClockTgd" }, @@ -237,7 +237,7 @@ static asn_TYPE_member_t asn_MBR_StandardClockModelElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_stanModelID_constraint_1, - &asn_PER_memb_stanModelID_constr_7, + &ASN_PER_MEMB_STAN_MODEL_ID_CONSTR_7, 0, "stanModelID" }, diff --git a/src/core/libs/supl/asn-rrlp/StdResolution.c b/src/core/libs/supl/asn-rrlp/StdResolution.c index b5dd33517..574f0af9a 100644 --- a/src/core/libs/supl/asn-rrlp/StdResolution.c +++ b/src/core/libs/supl/asn-rrlp/StdResolution.c @@ -111,7 +111,7 @@ StdResolution_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_StdResolution_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_STD_RESOLUTION_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_StdResolution = { asn_DEF_StdResolution_tags_1, /* Same as above */ sizeof(asn_DEF_StdResolution_tags_1) /sizeof(asn_DEF_StdResolution_tags_1[0]), /* 1 */ - &asn_PER_type_StdResolution_constr_1, + &ASN_PER_TYPE_STD_RESOLUTION_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.c b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.c index a7e14dce0..e0d73b1ff 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.c +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS-R98-ExpOTD.c @@ -6,7 +6,7 @@ #include "SystemInfoAssistBTS-R98-ExpOTD.h" -static asn_per_constraints_t asn_PER_type_SystemInfoAssistBTS_R98_ExpOTD_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SYSTEM_INFO_ASSIST_BTS_R98_EXP_OTD_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS_R98_ExpOTD = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SystemInfoAssistBTS_R98_ExpOTD_constr_1, + &ASN_PER_TYPE_SYSTEM_INFO_ASSIST_BTS_R98_EXP_OTD_CONSTR_1, asn_MBR_SystemInfoAssistBTS_R98_ExpOTD_1, 2, /* Elements count */ &asn_SPC_SystemInfoAssistBTS_R98_ExpOTD_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.c b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.c index 30a007816..3b7d17674 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.c +++ b/src/core/libs/supl/asn-rrlp/SystemInfoAssistBTS.c @@ -6,7 +6,7 @@ #include "SystemInfoAssistBTS.h" -static asn_per_constraints_t asn_PER_type_SystemInfoAssistBTS_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SYSTEM_INFO_ASSIST_BTS_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_SystemInfoAssistBTS = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SystemInfoAssistBTS_constr_1, + &ASN_PER_TYPE_SYSTEM_INFO_ASSIST_BTS_CONSTR_1, asn_MBR_SystemInfoAssistBTS_1, 2, /* Elements count */ &asn_SPC_SystemInfoAssistBTS_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-rrlp/SystemInfoIndex.c b/src/core/libs/supl/asn-rrlp/SystemInfoIndex.c index 713303193..68c0b86bd 100644 --- a/src/core/libs/supl/asn-rrlp/SystemInfoIndex.c +++ b/src/core/libs/supl/asn-rrlp/SystemInfoIndex.c @@ -111,7 +111,7 @@ SystemInfoIndex_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_SystemInfoIndex_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SYSTEM_INFO_INDEX_CONSTR_1 = { { APC_CONSTRAINED, 5, 5, 1, 32 } /* (1..32) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_SystemInfoIndex = { asn_DEF_SystemInfoIndex_tags_1, /* Same as above */ sizeof(asn_DEF_SystemInfoIndex_tags_1) /sizeof(asn_DEF_SystemInfoIndex_tags_1[0]), /* 1 */ - &asn_PER_type_SystemInfoIndex_constr_1, + &ASN_PER_TYPE_SYSTEM_INFO_INDEX_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TA0.c b/src/core/libs/supl/asn-rrlp/TA0.c index c6e6e0a14..1879f9e19 100644 --- a/src/core/libs/supl/asn-rrlp/TA0.c +++ b/src/core/libs/supl/asn-rrlp/TA0.c @@ -111,7 +111,7 @@ TA0_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TA0_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_T_A0_CONSTR_1 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TA0 = { asn_DEF_TA0_tags_1, /* Same as above */ sizeof(asn_DEF_TA0_tags_1) /sizeof(asn_DEF_TA0_tags_1[0]), /* 1 */ - &asn_PER_type_TA0_constr_1, + &ASN_PER_TYPE_T_A0_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TA1.c b/src/core/libs/supl/asn-rrlp/TA1.c index d118cab48..43b3fb216 100644 --- a/src/core/libs/supl/asn-rrlp/TA1.c +++ b/src/core/libs/supl/asn-rrlp/TA1.c @@ -111,7 +111,7 @@ TA1_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TA1_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_T_A1_CONSTR_1 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TA1 = { asn_DEF_TA1_tags_1, /* Same as above */ sizeof(asn_DEF_TA1_tags_1) /sizeof(asn_DEF_TA1_tags_1[0]), /* 1 */ - &asn_PER_type_TA1_constr_1, + &ASN_PER_TYPE_T_A1_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TA2.c b/src/core/libs/supl/asn-rrlp/TA2.c index 9d4ba1f9d..f86657377 100644 --- a/src/core/libs/supl/asn-rrlp/TA2.c +++ b/src/core/libs/supl/asn-rrlp/TA2.c @@ -111,7 +111,7 @@ TA2_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TA2_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_T_A2_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, -64, 63 } /* (-64..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TA2 = { asn_DEF_TA2_tags_1, /* Same as above */ sizeof(asn_DEF_TA2_tags_1) /sizeof(asn_DEF_TA2_tags_1[0]), /* 1 */ - &asn_PER_type_TA2_constr_1, + &ASN_PER_TYPE_T_A2_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TLMReservedBits.c b/src/core/libs/supl/asn-rrlp/TLMReservedBits.c index 5493ac422..cac6e5f46 100644 --- a/src/core/libs/supl/asn-rrlp/TLMReservedBits.c +++ b/src/core/libs/supl/asn-rrlp/TLMReservedBits.c @@ -111,7 +111,7 @@ TLMReservedBits_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TLMReservedBits_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TLM_RESERVED_BITS_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TLMReservedBits = { asn_DEF_TLMReservedBits_tags_1, /* Same as above */ sizeof(asn_DEF_TLMReservedBits_tags_1) /sizeof(asn_DEF_TLMReservedBits_tags_1[0]), /* 1 */ - &asn_PER_type_TLMReservedBits_constr_1, + &ASN_PER_TYPE_TLM_RESERVED_BITS_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TLMWord.c b/src/core/libs/supl/asn-rrlp/TLMWord.c index 08495fde8..1bd83baaf 100644 --- a/src/core/libs/supl/asn-rrlp/TLMWord.c +++ b/src/core/libs/supl/asn-rrlp/TLMWord.c @@ -111,7 +111,7 @@ TLMWord_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TLMWord_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TLM_WORD_CONSTR_1 = { { APC_CONSTRAINED, 14, 14, 0, 16383 } /* (0..16383) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TLMWord = { asn_DEF_TLMWord_tags_1, /* Same as above */ sizeof(asn_DEF_TLMWord_tags_1) /sizeof(asn_DEF_TLMWord_tags_1[0]), /* 1 */ - &asn_PER_type_TLMWord_constr_1, + &ASN_PER_TYPE_TLM_WORD_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TimeSlot.c b/src/core/libs/supl/asn-rrlp/TimeSlot.c index f879e587c..e9f8728d7 100644 --- a/src/core/libs/supl/asn-rrlp/TimeSlot.c +++ b/src/core/libs/supl/asn-rrlp/TimeSlot.c @@ -111,7 +111,7 @@ TimeSlot_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TimeSlot_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TIME_SLOT_CONSTR_1 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TimeSlot = { asn_DEF_TimeSlot_tags_1, /* Same as above */ sizeof(asn_DEF_TimeSlot_tags_1) /sizeof(asn_DEF_TimeSlot_tags_1[0]), /* 1 */ - &asn_PER_type_TimeSlot_constr_1, + &ASN_PER_TYPE_TIME_SLOT_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-rrlp/TimeSlotScheme.c b/src/core/libs/supl/asn-rrlp/TimeSlotScheme.c index dc0d3ca0f..347b073f7 100644 --- a/src/core/libs/supl/asn-rrlp/TimeSlotScheme.c +++ b/src/core/libs/supl/asn-rrlp/TimeSlotScheme.c @@ -94,7 +94,7 @@ TimeSlotScheme_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TimeSlotScheme_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TIME_SLOT_SCHEME_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TimeSlotScheme = { asn_DEF_TimeSlotScheme_tags_1, /* Same as above */ sizeof(asn_DEF_TimeSlotScheme_tags_1) /sizeof(asn_DEF_TimeSlotScheme_tags_1[0]), /* 1 */ - &asn_PER_type_TimeSlotScheme_constr_1, + &ASN_PER_TYPE_TIME_SLOT_SCHEME_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_TimeSlotScheme_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/UTCModel.c b/src/core/libs/supl/asn-rrlp/UTCModel.c index 73a0520d6..a8d0557e1 100644 --- a/src/core/libs/supl/asn-rrlp/UTCModel.c +++ b/src/core/libs/supl/asn-rrlp/UTCModel.c @@ -206,42 +206,42 @@ memb_utcDeltaTlsf_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_utcA1_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_A1_CONSTR_2 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcA0_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_A0_CONSTR_3 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcTot_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_TOT_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcWNt_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_W_NT_CONSTR_5 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcDeltaTls_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_DELTA_TLS_CONSTR_6 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcWNlsf_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_W_NLSF_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcDN_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_DN_CONSTR_8 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_utcDeltaTlsf_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_UTC_DELTA_TLSF_CONSTR_9 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -252,7 +252,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcA1_constraint_1, - &asn_PER_memb_utcA1_constr_2, + &ASN_PER_MEMB_UTC_A1_CONSTR_2, 0, "utcA1" }, @@ -261,7 +261,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcA0_constraint_1, - &asn_PER_memb_utcA0_constr_3, + &ASN_PER_MEMB_UTC_A0_CONSTR_3, 0, "utcA0" }, @@ -270,7 +270,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcTot_constraint_1, - &asn_PER_memb_utcTot_constr_4, + &ASN_PER_MEMB_UTC_TOT_CONSTR_4, 0, "utcTot" }, @@ -279,7 +279,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcWNt_constraint_1, - &asn_PER_memb_utcWNt_constr_5, + &ASN_PER_MEMB_UTC_W_NT_CONSTR_5, 0, "utcWNt" }, @@ -288,7 +288,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcDeltaTls_constraint_1, - &asn_PER_memb_utcDeltaTls_constr_6, + &ASN_PER_MEMB_UTC_DELTA_TLS_CONSTR_6, 0, "utcDeltaTls" }, @@ -297,7 +297,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcWNlsf_constraint_1, - &asn_PER_memb_utcWNlsf_constr_7, + &ASN_PER_MEMB_UTC_W_NLSF_CONSTR_7, 0, "utcWNlsf" }, @@ -306,7 +306,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcDN_constraint_1, - &asn_PER_memb_utcDN_constr_8, + &ASN_PER_MEMB_UTC_DN_CONSTR_8, 0, "utcDN" }, @@ -315,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_UTCModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_utcDeltaTlsf_constraint_1, - &asn_PER_memb_utcDeltaTlsf_constr_9, + &ASN_PER_MEMB_UTC_DELTA_TLSF_CONSTR_9, 0, "utcDeltaTlsf" }, diff --git a/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.c b/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.c index 9b2c5278c..28d2189fc 100644 --- a/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.c +++ b/src/core/libs/supl/asn-rrlp/UlPseudoSegInd.c @@ -94,7 +94,7 @@ UlPseudoSegInd_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_UlPseudoSegInd_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_UL_PSEUDO_SEG_IND_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_UlPseudoSegInd = { asn_DEF_UlPseudoSegInd_tags_1, /* Same as above */ sizeof(asn_DEF_UlPseudoSegInd_tags_1) /sizeof(asn_DEF_UlPseudoSegInd_tags_1[0]), /* 1 */ - &asn_PER_type_UlPseudoSegInd_constr_1, + &ASN_PER_TYPE_UL_PSEUDO_SEG_IND_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_UlPseudoSegInd_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.c b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.c index 07896a408..c367db368 100644 --- a/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.c +++ b/src/core/libs/supl/asn-rrlp/UncompressedEphemeris.c @@ -888,152 +888,152 @@ memb_ephemIDot_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_type_ephemE_constr_17 = { +static asn_per_constraints_t ASN_PER_TYPE_EPHEM_E_CONSTR_17 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_type_ephemAPowerHalf_constr_19 = { +static asn_per_constraints_t ASN_PER_TYPE_EPHEM_A_POWER_HALF_CONSTR_19 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCodeOnL2_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CODE_ON_L2_CONSTR_2 = { { APC_CONSTRAINED, 2, 2, 0, 3 } /* (0..3) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemURA_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_URA_CONSTR_3 = { { APC_CONSTRAINED, 4, 4, 0, 15 } /* (0..15) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemSVhealth_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_S_VHEALTH_CONSTR_4 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemIODC_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_IODC_CONSTR_5 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemL2Pflag_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_L2_PFLAG_CONSTR_6 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemTgd_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_TGD_CONSTR_8 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemToc_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_TOC_CONSTR_9 = { { APC_CONSTRAINED, 16, 16, 0, 37799 } /* (0..37799) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemAF2_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_A_F2_CONSTR_10 = { { APC_CONSTRAINED, 8, 8, -128, 127 } /* (-128..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemAF1_constr_11 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_A_F1_CONSTR_11 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemAF0_constr_12 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_A_F0_CONSTR_12 = { { APC_CONSTRAINED, 22, -1, -2097152, 2097151 } /* (-2097152..2097151) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCrs_constr_13 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CRS_CONSTR_13 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemDeltaN_constr_14 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_DELTA_N_CONSTR_14 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemM0_constr_15 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_M0_CONSTR_15 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCuc_constr_16 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CUC_CONSTR_16 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemE_constr_17 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_E_CONSTR_17 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCus_constr_18 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CUS_CONSTR_18 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemAPowerHalf_constr_19 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_A_POWER_HALF_CONSTR_19 = { { APC_CONSTRAINED, 32, -1, 0, 4294967295 } /* (0..4294967295) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemToe_constr_20 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_TOE_CONSTR_20 = { { APC_CONSTRAINED, 16, 16, 0, 37799 } /* (0..37799) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemFitFlag_constr_21 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_FIT_FLAG_CONSTR_21 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemAODA_constr_22 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_AODA_CONSTR_22 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCic_constr_23 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CIC_CONSTR_23 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemOmegaA0_constr_24 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_OMEGA_A0_CONSTR_24 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCis_constr_25 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CIS_CONSTR_25 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemI0_constr_26 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_I0_CONSTR_26 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemCrc_constr_27 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_CRC_CONSTR_27 = { { APC_CONSTRAINED, 16, 16, -32768, 32767 } /* (-32768..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemW_constr_28 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_W_CONSTR_28 = { { APC_CONSTRAINED, 32, -1, (-2147483647L - 1), 2147483647 } /* (-2147483648..2147483647) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemOmegaADot_constr_29 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_OMEGA_A_DOT_CONSTR_29 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ephemIDot_constr_30 = { +static asn_per_constraints_t ASN_PER_MEMB_EPHEM_I_DOT_CONSTR_30 = { { APC_CONSTRAINED, 14, 14, -8192, 8191 } /* (-8192..8191) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -1067,7 +1067,7 @@ asn_TYPE_descriptor_t asn_DEF_ephemE_17 = { asn_DEF_ephemE_tags_17, /* Same as above */ sizeof(asn_DEF_ephemE_tags_17) /sizeof(asn_DEF_ephemE_tags_17[0]), /* 2 */ - &asn_PER_type_ephemE_constr_17, + &ASN_PER_TYPE_EPHEM_E_CONSTR_17, 0, 0, /* No members */ &asn_SPC_ephemE_specs_17 /* Additional specs */ }; @@ -1101,7 +1101,7 @@ asn_TYPE_descriptor_t asn_DEF_ephemAPowerHalf_19 = { asn_DEF_ephemAPowerHalf_tags_19, /* Same as above */ sizeof(asn_DEF_ephemAPowerHalf_tags_19) /sizeof(asn_DEF_ephemAPowerHalf_tags_19[0]), /* 2 */ - &asn_PER_type_ephemAPowerHalf_constr_19, + &ASN_PER_TYPE_EPHEM_A_POWER_HALF_CONSTR_19, 0, 0, /* No members */ &asn_SPC_ephemAPowerHalf_specs_19 /* Additional specs */ }; @@ -1112,7 +1112,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCodeOnL2_constraint_1, - &asn_PER_memb_ephemCodeOnL2_constr_2, + &ASN_PER_MEMB_EPHEM_CODE_ON_L2_CONSTR_2, 0, "ephemCodeOnL2" }, @@ -1121,7 +1121,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemURA_constraint_1, - &asn_PER_memb_ephemURA_constr_3, + &ASN_PER_MEMB_EPHEM_URA_CONSTR_3, 0, "ephemURA" }, @@ -1130,7 +1130,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemSVhealth_constraint_1, - &asn_PER_memb_ephemSVhealth_constr_4, + &ASN_PER_MEMB_EPHEM_S_VHEALTH_CONSTR_4, 0, "ephemSVhealth" }, @@ -1139,7 +1139,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemIODC_constraint_1, - &asn_PER_memb_ephemIODC_constr_5, + &ASN_PER_MEMB_EPHEM_IODC_CONSTR_5, 0, "ephemIODC" }, @@ -1148,7 +1148,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemL2Pflag_constraint_1, - &asn_PER_memb_ephemL2Pflag_constr_6, + &ASN_PER_MEMB_EPHEM_L2_PFLAG_CONSTR_6, 0, "ephemL2Pflag" }, @@ -1166,7 +1166,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemTgd_constraint_1, - &asn_PER_memb_ephemTgd_constr_8, + &ASN_PER_MEMB_EPHEM_TGD_CONSTR_8, 0, "ephemTgd" }, @@ -1175,7 +1175,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemToc_constraint_1, - &asn_PER_memb_ephemToc_constr_9, + &ASN_PER_MEMB_EPHEM_TOC_CONSTR_9, 0, "ephemToc" }, @@ -1184,7 +1184,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemAF2_constraint_1, - &asn_PER_memb_ephemAF2_constr_10, + &ASN_PER_MEMB_EPHEM_A_F2_CONSTR_10, 0, "ephemAF2" }, @@ -1193,7 +1193,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemAF1_constraint_1, - &asn_PER_memb_ephemAF1_constr_11, + &ASN_PER_MEMB_EPHEM_A_F1_CONSTR_11, 0, "ephemAF1" }, @@ -1202,7 +1202,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemAF0_constraint_1, - &asn_PER_memb_ephemAF0_constr_12, + &ASN_PER_MEMB_EPHEM_A_F0_CONSTR_12, 0, "ephemAF0" }, @@ -1211,7 +1211,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCrs_constraint_1, - &asn_PER_memb_ephemCrs_constr_13, + &ASN_PER_MEMB_EPHEM_CRS_CONSTR_13, 0, "ephemCrs" }, @@ -1220,7 +1220,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemDeltaN_constraint_1, - &asn_PER_memb_ephemDeltaN_constr_14, + &ASN_PER_MEMB_EPHEM_DELTA_N_CONSTR_14, 0, "ephemDeltaN" }, @@ -1229,7 +1229,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemM0_constraint_1, - &asn_PER_memb_ephemM0_constr_15, + &ASN_PER_MEMB_EPHEM_M0_CONSTR_15, 0, "ephemM0" }, @@ -1238,7 +1238,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCuc_constraint_1, - &asn_PER_memb_ephemCuc_constr_16, + &ASN_PER_MEMB_EPHEM_CUC_CONSTR_16, 0, "ephemCuc" }, @@ -1247,7 +1247,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ephemE_17, memb_ephemE_constraint_1, - &asn_PER_memb_ephemE_constr_17, + &ASN_PER_MEMB_EPHEM_E_CONSTR_17, 0, "ephemE" }, @@ -1256,7 +1256,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCus_constraint_1, - &asn_PER_memb_ephemCus_constr_18, + &ASN_PER_MEMB_EPHEM_CUS_CONSTR_18, 0, "ephemCus" }, @@ -1265,7 +1265,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_ephemAPowerHalf_19, memb_ephemAPowerHalf_constraint_1, - &asn_PER_memb_ephemAPowerHalf_constr_19, + &ASN_PER_MEMB_EPHEM_A_POWER_HALF_CONSTR_19, 0, "ephemAPowerHalf" }, @@ -1274,7 +1274,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemToe_constraint_1, - &asn_PER_memb_ephemToe_constr_20, + &ASN_PER_MEMB_EPHEM_TOE_CONSTR_20, 0, "ephemToe" }, @@ -1283,7 +1283,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemFitFlag_constraint_1, - &asn_PER_memb_ephemFitFlag_constr_21, + &ASN_PER_MEMB_EPHEM_FIT_FLAG_CONSTR_21, 0, "ephemFitFlag" }, @@ -1292,7 +1292,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemAODA_constraint_1, - &asn_PER_memb_ephemAODA_constr_22, + &ASN_PER_MEMB_EPHEM_AODA_CONSTR_22, 0, "ephemAODA" }, @@ -1301,7 +1301,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCic_constraint_1, - &asn_PER_memb_ephemCic_constr_23, + &ASN_PER_MEMB_EPHEM_CIC_CONSTR_23, 0, "ephemCic" }, @@ -1310,7 +1310,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemOmegaA0_constraint_1, - &asn_PER_memb_ephemOmegaA0_constr_24, + &ASN_PER_MEMB_EPHEM_OMEGA_A0_CONSTR_24, 0, "ephemOmegaA0" }, @@ -1319,7 +1319,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCis_constraint_1, - &asn_PER_memb_ephemCis_constr_25, + &ASN_PER_MEMB_EPHEM_CIS_CONSTR_25, 0, "ephemCis" }, @@ -1328,7 +1328,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemI0_constraint_1, - &asn_PER_memb_ephemI0_constr_26, + &ASN_PER_MEMB_EPHEM_I0_CONSTR_26, 0, "ephemI0" }, @@ -1337,7 +1337,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemCrc_constraint_1, - &asn_PER_memb_ephemCrc_constr_27, + &ASN_PER_MEMB_EPHEM_CRC_CONSTR_27, 0, "ephemCrc" }, @@ -1346,7 +1346,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemW_constraint_1, - &asn_PER_memb_ephemW_constr_28, + &ASN_PER_MEMB_EPHEM_W_CONSTR_28, 0, "ephemW" }, @@ -1355,7 +1355,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemOmegaADot_constraint_1, - &asn_PER_memb_ephemOmegaADot_constr_29, + &ASN_PER_MEMB_EPHEM_OMEGA_A_DOT_CONSTR_29, 0, "ephemOmegaADot" }, @@ -1364,7 +1364,7 @@ static asn_TYPE_member_t asn_MBR_UncompressedEphemeris_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_ephemIDot_constraint_1, - &asn_PER_memb_ephemIDot_constr_30, + &ASN_PER_MEMB_EPHEM_I_DOT_CONSTR_30, 0, "ephemIDot" }, diff --git a/src/core/libs/supl/asn-rrlp/UseMultipleSets.c b/src/core/libs/supl/asn-rrlp/UseMultipleSets.c index 59c95ffc7..35b9b1164 100644 --- a/src/core/libs/supl/asn-rrlp/UseMultipleSets.c +++ b/src/core/libs/supl/asn-rrlp/UseMultipleSets.c @@ -94,7 +94,7 @@ UseMultipleSets_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_UseMultipleSets_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_USE_MULTIPLE_SETS_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_UseMultipleSets = { asn_DEF_UseMultipleSets_tags_1, /* Same as above */ sizeof(asn_DEF_UseMultipleSets_tags_1) /sizeof(asn_DEF_UseMultipleSets_tags_1[0]), /* 1 */ - &asn_PER_type_UseMultipleSets_constr_1, + &ASN_PER_TYPE_USE_MULTIPLE_SETS_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_UseMultipleSets_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c index 75903fde7..1bf467254 100644 --- a/src/core/libs/supl/asn-rrlp/constr_CHOICE.c +++ b/src/core/libs/supl/asn-rrlp/constr_CHOICE.c @@ -63,8 +63,8 @@ /* * See the definitions. */ -static int _fetch_present_idx(const void *struct_ptr, int off, int size); -static void _set_present_idx(void *sptr, int offset, int size, int pres); +static int _fetch_present_idx(const void *struct_ptr, int pres_offset, int size); +static void _set_present_idx(void *struct_ptr, int offset, int size, int pres); /* * Tags are canonically sorted in the tag to member table. diff --git a/src/core/libs/supl/asn-rrlp/converter-sample.c b/src/core/libs/supl/asn-rrlp/converter-sample.c index 46136ebb3..af980a1d6 100644 --- a/src/core/libs/supl/asn-rrlp/converter-sample.c +++ b/src/core/libs/supl/asn-rrlp/converter-sample.c @@ -34,7 +34,7 @@ extern asn_TYPE_descriptor_t *asn_pdu_collection[]; /* * Open file and parse its contens. */ -static void *data_decode_from_file(asn_TYPE_descriptor_t *asnTypeOfPDU, +static void *data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *name, ssize_t suggested_bufsize, int first_pdu); static int write_out(const void *buffer, size_t size, void *key); static FILE *argument_to_file(char *av[], int idx); diff --git a/src/core/libs/supl/asn-supl/AltitudeInfo.c b/src/core/libs/supl/asn-supl/AltitudeInfo.c index 70f48f49c..531988546 100644 --- a/src/core/libs/supl/asn-supl/AltitudeInfo.c +++ b/src/core/libs/supl/asn-supl/AltitudeInfo.c @@ -144,17 +144,17 @@ memb_altUncertainty_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_type_altitudeDirection_constr_2 = { +static asn_per_constraints_t ASN_PER_TYPE_ALTITUDE_DIRECTION_CONSTR_2 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_altitude_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_ALTITUDE_CONSTR_5 = { { APC_CONSTRAINED, 15, 15, 0, 32767 } /* (0..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_altUncertainty_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_ALT_UNCERTAINTY_CONSTR_6 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -200,7 +200,7 @@ asn_TYPE_descriptor_t asn_DEF_altitudeDirection_2 = { asn_DEF_altitudeDirection_tags_2, /* Same as above */ sizeof(asn_DEF_altitudeDirection_tags_2) /sizeof(asn_DEF_altitudeDirection_tags_2[0]), /* 2 */ - &asn_PER_type_altitudeDirection_constr_2, + &ASN_PER_TYPE_ALTITUDE_DIRECTION_CONSTR_2, 0, 0, /* Defined elsewhere */ &asn_SPC_altitudeDirection_specs_2 /* Additional specs */ }; @@ -220,7 +220,7 @@ static asn_TYPE_member_t asn_MBR_AltitudeInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_altitude_constraint_1, - &asn_PER_memb_altitude_constr_5, + &ASN_PER_MEMB_ALTITUDE_CONSTR_5, 0, "altitude" }, @@ -229,7 +229,7 @@ static asn_TYPE_member_t asn_MBR_AltitudeInfo_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_altUncertainty_constraint_1, - &asn_PER_memb_altUncertainty_constr_6, + &ASN_PER_MEMB_ALT_UNCERTAINTY_CONSTR_6, 0, "altUncertainty" }, diff --git a/src/core/libs/supl/asn-supl/CPICH-Ec-N0.c b/src/core/libs/supl/asn-supl/CPICH-Ec-N0.c index 0445a22cb..3ccbebf84 100644 --- a/src/core/libs/supl/asn-supl/CPICH-Ec-N0.c +++ b/src/core/libs/supl/asn-supl/CPICH-Ec-N0.c @@ -111,7 +111,7 @@ CPICH_Ec_N0_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_CPICH_Ec_N0_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CPICH_EC_N0_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_CPICH_Ec_N0 = { asn_DEF_CPICH_Ec_N0_tags_1, /* Same as above */ sizeof(asn_DEF_CPICH_Ec_N0_tags_1) /sizeof(asn_DEF_CPICH_Ec_N0_tags_1[0]), /* 1 */ - &asn_PER_type_CPICH_Ec_N0_constr_1, + &ASN_PER_TYPE_CPICH_EC_N0_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/CPICH-RSCP.c b/src/core/libs/supl/asn-supl/CPICH-RSCP.c index 81726e708..92e525704 100644 --- a/src/core/libs/supl/asn-supl/CPICH-RSCP.c +++ b/src/core/libs/supl/asn-supl/CPICH-RSCP.c @@ -111,7 +111,7 @@ CPICH_RSCP_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_CPICH_RSCP_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CPICH_RSCP_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_CPICH_RSCP = { asn_DEF_CPICH_RSCP_tags_1, /* Same as above */ sizeof(asn_DEF_CPICH_RSCP_tags_1) /sizeof(asn_DEF_CPICH_RSCP_tags_1[0]), /* 1 */ - &asn_PER_type_CPICH_RSCP_constr_1, + &ASN_PER_TYPE_CPICH_RSCP_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/CdmaCellInformation.c b/src/core/libs/supl/asn-supl/CdmaCellInformation.c index d08ecc007..aba676872 100644 --- a/src/core/libs/supl/asn-supl/CdmaCellInformation.c +++ b/src/core/libs/supl/asn-supl/CdmaCellInformation.c @@ -206,42 +206,42 @@ memb_refSeconds_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refNID_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_NID_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refSID_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_SID_CONSTR_3 = { { APC_CONSTRAINED, 15, 15, 0, 32767 } /* (0..32767) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refBASEID_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_BASEID_CONSTR_4 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refBASELAT_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_BASELAT_CONSTR_5 = { { APC_CONSTRAINED, 22, -1, 0, 4194303 } /* (0..4194303) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_reBASELONG_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_RE_BASELONG_CONSTR_6 = { { APC_CONSTRAINED, 23, -1, 0, 8388607 } /* (0..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refREFPN_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_REFPN_CONSTR_7 = { { APC_CONSTRAINED, 9, 9, 0, 511 } /* (0..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refWeekNumber_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_WEEK_NUMBER_CONSTR_8 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refSeconds_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_SECONDS_CONSTR_9 = { { APC_CONSTRAINED, 22, -1, 0, 4194303 } /* (0..4194303) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -252,7 +252,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refNID_constraint_1, - &asn_PER_memb_refNID_constr_2, + &ASN_PER_MEMB_REF_NID_CONSTR_2, 0, "refNID" }, @@ -261,7 +261,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refSID_constraint_1, - &asn_PER_memb_refSID_constr_3, + &ASN_PER_MEMB_REF_SID_CONSTR_3, 0, "refSID" }, @@ -270,7 +270,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refBASEID_constraint_1, - &asn_PER_memb_refBASEID_constr_4, + &ASN_PER_MEMB_REF_BASEID_CONSTR_4, 0, "refBASEID" }, @@ -279,7 +279,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refBASELAT_constraint_1, - &asn_PER_memb_refBASELAT_constr_5, + &ASN_PER_MEMB_REF_BASELAT_CONSTR_5, 0, "refBASELAT" }, @@ -288,7 +288,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_reBASELONG_constraint_1, - &asn_PER_memb_reBASELONG_constr_6, + &ASN_PER_MEMB_RE_BASELONG_CONSTR_6, 0, "reBASELONG" }, @@ -297,7 +297,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refREFPN_constraint_1, - &asn_PER_memb_refREFPN_constr_7, + &ASN_PER_MEMB_REF_REFPN_CONSTR_7, 0, "refREFPN" }, @@ -306,7 +306,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refWeekNumber_constraint_1, - &asn_PER_memb_refWeekNumber_constr_8, + &ASN_PER_MEMB_REF_WEEK_NUMBER_CONSTR_8, 0, "refWeekNumber" }, @@ -315,7 +315,7 @@ static asn_TYPE_member_t asn_MBR_CdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refSeconds_constraint_1, - &asn_PER_memb_refSeconds_constr_9, + &ASN_PER_MEMB_REF_SECONDS_CONSTR_9, 0, "refSeconds" }, diff --git a/src/core/libs/supl/asn-supl/CellInfo.c b/src/core/libs/supl/asn-supl/CellInfo.c index 77eb080ba..469d624c3 100644 --- a/src/core/libs/supl/asn-supl/CellInfo.c +++ b/src/core/libs/supl/asn-supl/CellInfo.c @@ -6,7 +6,7 @@ #include "CellInfo.h" -static asn_per_constraints_t asn_PER_type_CellInfo_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CELL_INFO_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ asn_TYPE_descriptor_t asn_DEF_CellInfo = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_CellInfo_constr_1, + &ASN_PER_TYPE_CELL_INFO_CONSTR_1, asn_MBR_CellInfo_1, 3, /* Elements count */ &asn_SPC_CellInfo_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/CellMeasuredResults.c b/src/core/libs/supl/asn-supl/CellMeasuredResults.c index 0b1a9f7c1..10760d310 100644 --- a/src/core/libs/supl/asn-supl/CellMeasuredResults.c +++ b/src/core/libs/supl/asn-supl/CellMeasuredResults.c @@ -31,12 +31,12 @@ memb_cellIdentity_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_type_modeSpecificInfo_constr_3 = { +static asn_per_constraints_t ASN_PER_TYPE_MODE_SPECIFIC_INFO_CONSTR_3 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_cellIdentity_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_CELL_IDENTITY_CONSTR_2 = { { APC_CONSTRAINED, 28, -1, 0, 268435455 } /* (0..268435455) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -273,7 +273,7 @@ asn_TYPE_descriptor_t asn_DEF_modeSpecificInfo_3 = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_modeSpecificInfo_constr_3, + &ASN_PER_TYPE_MODE_SPECIFIC_INFO_CONSTR_3, asn_MBR_modeSpecificInfo_3, 2, /* Elements count */ &asn_SPC_modeSpecificInfo_specs_3 /* Additional specs */ @@ -285,7 +285,7 @@ static asn_TYPE_member_t asn_MBR_CellMeasuredResults_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_cellIdentity_constraint_1, - &asn_PER_memb_cellIdentity_constr_2, + &ASN_PER_MEMB_CELL_IDENTITY_CONSTR_2, 0, "cellIdentity" }, diff --git a/src/core/libs/supl/asn-supl/CellMeasuredResultsList.c b/src/core/libs/supl/asn-supl/CellMeasuredResultsList.c index 567dcf35f..ecbb9da57 100644 --- a/src/core/libs/supl/asn-supl/CellMeasuredResultsList.c +++ b/src/core/libs/supl/asn-supl/CellMeasuredResultsList.c @@ -6,7 +6,7 @@ #include "CellMeasuredResultsList.h" -static asn_per_constraints_t asn_PER_type_CellMeasuredResultsList_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CELL_MEASURED_RESULTS_LIST_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_CellMeasuredResultsList = { asn_DEF_CellMeasuredResultsList_tags_1, /* Same as above */ sizeof(asn_DEF_CellMeasuredResultsList_tags_1) /sizeof(asn_DEF_CellMeasuredResultsList_tags_1[0]), /* 1 */ - &asn_PER_type_CellMeasuredResultsList_constr_1, + &ASN_PER_TYPE_CELL_MEASURED_RESULTS_LIST_CONSTR_1, asn_MBR_CellMeasuredResultsList_1, 1, /* Single element */ &asn_SPC_CellMeasuredResultsList_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/CellParametersID.c b/src/core/libs/supl/asn-supl/CellParametersID.c index 4092e8585..8cc4a66b3 100644 --- a/src/core/libs/supl/asn-supl/CellParametersID.c +++ b/src/core/libs/supl/asn-supl/CellParametersID.c @@ -111,7 +111,7 @@ CellParametersID_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_CellParametersID_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_CELL_PARAMETERS_ID_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_CellParametersID = { asn_DEF_CellParametersID_tags_1, /* Same as above */ sizeof(asn_DEF_CellParametersID_tags_1) /sizeof(asn_DEF_CellParametersID_tags_1[0]), /* 1 */ - &asn_PER_type_CellParametersID_constr_1, + &ASN_PER_TYPE_CELL_PARAMETERS_ID_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/EncodingType.c b/src/core/libs/supl/asn-supl/EncodingType.c index ff25bfa80..db0ad1ea7 100644 --- a/src/core/libs/supl/asn-supl/EncodingType.c +++ b/src/core/libs/supl/asn-supl/EncodingType.c @@ -94,7 +94,7 @@ EncodingType_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_EncodingType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ENCODING_TYPE_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -142,7 +142,7 @@ asn_TYPE_descriptor_t asn_DEF_EncodingType = { asn_DEF_EncodingType_tags_1, /* Same as above */ sizeof(asn_DEF_EncodingType_tags_1) /sizeof(asn_DEF_EncodingType_tags_1[0]), /* 1 */ - &asn_PER_type_EncodingType_constr_1, + &ASN_PER_TYPE_ENCODING_TYPE_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_EncodingType_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/FQDN.c b/src/core/libs/supl/asn-supl/FQDN.c index 84c9d1f0a..1d4f501a2 100644 --- a/src/core/libs/supl/asn-supl/FQDN.c +++ b/src/core/libs/supl/asn-supl/FQDN.c @@ -155,7 +155,7 @@ FQDN_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FQDN_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FQDN_CONSTR_1 = { { APC_CONSTRAINED, 6, 6, 45, 122 } /* (45..122) */, { APC_CONSTRAINED, 8, 8, 1, 255 } /* (SIZE(1..255)) */, asn_PER_MAP_FQDN_1_v2c, /* Value to PER code map */ @@ -183,7 +183,7 @@ asn_TYPE_descriptor_t asn_DEF_FQDN = { asn_DEF_FQDN_tags_1, /* Same as above */ sizeof(asn_DEF_FQDN_tags_1) /sizeof(asn_DEF_FQDN_tags_1[0]), /* 1 */ - &asn_PER_type_FQDN_constr_1, + &ASN_PER_TYPE_FQDN_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/FormatIndicator.c b/src/core/libs/supl/asn-supl/FormatIndicator.c index 9a17c684c..61c2ce2b8 100644 --- a/src/core/libs/supl/asn-supl/FormatIndicator.c +++ b/src/core/libs/supl/asn-supl/FormatIndicator.c @@ -94,7 +94,7 @@ FormatIndicator_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_FormatIndicator_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_FORMAT_INDICATOR_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 7 } /* (0..7,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -152,7 +152,7 @@ asn_TYPE_descriptor_t asn_DEF_FormatIndicator = { asn_DEF_FormatIndicator_tags_1, /* Same as above */ sizeof(asn_DEF_FormatIndicator_tags_1) /sizeof(asn_DEF_FormatIndicator_tags_1[0]), /* 1 */ - &asn_PER_type_FormatIndicator_constr_1, + &ASN_PER_TYPE_FORMAT_INDICATOR_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_FormatIndicator_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/FrequencyInfo.c b/src/core/libs/supl/asn-supl/FrequencyInfo.c index 6aa75a010..d0ebd64fb 100644 --- a/src/core/libs/supl/asn-supl/FrequencyInfo.c +++ b/src/core/libs/supl/asn-supl/FrequencyInfo.c @@ -6,7 +6,7 @@ #include "FrequencyInfo.h" -static asn_per_constraints_t asn_PER_type_fmodeSpecificInfo_constr_2 = { +static asn_per_constraints_t ASN_PER_TYPE_FMODE_SPECIFIC_INFO_CONSTR_2 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -63,7 +63,7 @@ asn_TYPE_descriptor_t asn_DEF_fmodeSpecificInfo_2 = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_fmodeSpecificInfo_constr_2, + &ASN_PER_TYPE_FMODE_SPECIFIC_INFO_CONSTR_2, asn_MBR_fmodeSpecificInfo_2, 2, /* Elements count */ &asn_SPC_fmodeSpecificInfo_specs_2 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.c b/src/core/libs/supl/asn-supl/GeneralizedTime.c index 3007af94e..ec23c6836 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.c +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.c @@ -152,7 +152,7 @@ static ber_tlv_tag_t asn_DEF_GeneralizedTime_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; -static asn_per_constraints_t asn_DEF_GeneralizedTime_constraints = { +static asn_per_constraints_t ASN_DEF_GENERALIZED_TIME_CONSTRAINTS = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 @@ -176,7 +176,7 @@ asn_TYPE_descriptor_t asn_DEF_GeneralizedTime = { asn_DEF_GeneralizedTime_tags, sizeof(asn_DEF_GeneralizedTime_tags) / sizeof(asn_DEF_GeneralizedTime_tags[0]), - &asn_DEF_GeneralizedTime_constraints, + &ASN_DEF_GENERALIZED_TIME_CONSTRAINTS, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/GeneralizedTime.h b/src/core/libs/supl/asn-supl/GeneralizedTime.h index 9e9583c7a..3867820e3 100644 --- a/src/core/libs/supl/asn-supl/GeneralizedTime.h +++ b/src/core/libs/supl/asn-supl/GeneralizedTime.h @@ -34,22 +34,22 @@ extern "C" * instead of default local one. * On error returns -1 and errno set to EINVAL */ - time_t asn_GT2time(const GeneralizedTime_t *, struct tm *_optional_tm4fill, + time_t asn_GT2time(const GeneralizedTime_t * /*st*/, struct tm *ret_tm, int as_gmt); /* A version of the above function also returning the fractions of seconds */ - time_t asn_GT2time_frac(const GeneralizedTime_t *, + time_t asn_GT2time_frac(const GeneralizedTime_t * /*st*/, int *frac_value, int *frac_digits, /* (value / (10 ^ digits)) */ - struct tm *_optional_tm4fill, int as_gmt); + struct tm *ret_tm, int as_gmt); /* * Another version returning fractions with defined precision * For example, parsing of the time ending with ".1" seconds * with frac_digits=3 (msec) would yield frac_value = 100. */ - time_t asn_GT2time_prec(const GeneralizedTime_t *, + time_t asn_GT2time_prec(const GeneralizedTime_t * /*st*/, int *frac_value, int frac_digits, - struct tm *_optional_tm4fill, int as_gmt); + struct tm *ret_tm, int as_gmt); /* * Convert a struct tm into GeneralizedTime. @@ -58,10 +58,10 @@ extern "C" * into a GMT time zone (encoding ends with a "Z"). * On error, this function returns 0 and sets errno. */ - GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *_optional_gt, - const struct tm *, int force_gmt); - GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *_optional_gt, - const struct tm *, int frac_value, int frac_digits, int force_gmt); + GeneralizedTime_t *asn_time2GT(GeneralizedTime_t *opt_gt, + const struct tm * /*tm*/, int force_gmt); + GeneralizedTime_t *asn_time2GT_frac(GeneralizedTime_t *opt_gt, + const struct tm * /*tm*/, int frac_value, int frac_digits, int force_gmt); #ifdef __cplusplus } diff --git a/src/core/libs/supl/asn-supl/GsmCellInformation.c b/src/core/libs/supl/asn-supl/GsmCellInformation.c index 14aed828a..f43919e0f 100644 --- a/src/core/libs/supl/asn-supl/GsmCellInformation.c +++ b/src/core/libs/supl/asn-supl/GsmCellInformation.c @@ -131,27 +131,27 @@ memb_tA_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_refMCC_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_MCC_CONSTR_2 = { { APC_CONSTRAINED, 10, 10, 0, 999 } /* (0..999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refMNC_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_MNC_CONSTR_3 = { { APC_CONSTRAINED, 10, 10, 0, 999 } /* (0..999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refLAC_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_LAC_CONSTR_4 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refCI_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_CI_CONSTR_5 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_tA_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_T_A_CONSTR_7 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -162,7 +162,7 @@ static asn_TYPE_member_t asn_MBR_GsmCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refMCC_constraint_1, - &asn_PER_memb_refMCC_constr_2, + &ASN_PER_MEMB_REF_MCC_CONSTR_2, 0, "refMCC" }, @@ -171,7 +171,7 @@ static asn_TYPE_member_t asn_MBR_GsmCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refMNC_constraint_1, - &asn_PER_memb_refMNC_constr_3, + &ASN_PER_MEMB_REF_MNC_CONSTR_3, 0, "refMNC" }, @@ -180,7 +180,7 @@ static asn_TYPE_member_t asn_MBR_GsmCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refLAC_constraint_1, - &asn_PER_memb_refLAC_constr_4, + &ASN_PER_MEMB_REF_LAC_CONSTR_4, 0, "refLAC" }, @@ -189,7 +189,7 @@ static asn_TYPE_member_t asn_MBR_GsmCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refCI_constraint_1, - &asn_PER_memb_refCI_constr_5, + &ASN_PER_MEMB_REF_CI_CONSTR_5, 0, "refCI" }, @@ -207,7 +207,7 @@ static asn_TYPE_member_t asn_MBR_GsmCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_tA_constraint_1, - &asn_PER_memb_tA_constr_7, + &ASN_PER_MEMB_T_A_CONSTR_7, 0, "tA" }, diff --git a/src/core/libs/supl/asn-supl/Horandveruncert.c b/src/core/libs/supl/asn-supl/Horandveruncert.c index a73928d71..73ba2b860 100644 --- a/src/core/libs/supl/asn-supl/Horandveruncert.c +++ b/src/core/libs/supl/asn-supl/Horandveruncert.c @@ -240,32 +240,32 @@ memb_veruncertspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_verdirect_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_VERDIRECT_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 1, 1} /* (SIZE(1..1)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_bearing_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_BEARING_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 9, 9} /* (SIZE(9..9)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_horspeed_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_HORSPEED_CONSTR_4 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 16, 16} /* (SIZE(16..16)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_verspeed_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_VERSPEED_CONSTR_5 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_horuncertspeed_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_HORUNCERTSPEED_CONSTR_6 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_veruncertspeed_constr_7 = { +static asn_per_constraints_t ASN_PER_MEMB_VERUNCERTSPEED_CONSTR_7 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ @@ -276,7 +276,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_verdirect_constraint_1, - &asn_PER_memb_verdirect_constr_2, + &ASN_PER_MEMB_VERDIRECT_CONSTR_2, 0, "verdirect"}, {ATF_NOFLAGS, 0, offsetof(struct Horandveruncert, bearing), @@ -284,7 +284,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_bearing_constraint_1, - &asn_PER_memb_bearing_constr_3, + &ASN_PER_MEMB_BEARING_CONSTR_3, 0, "bearing"}, {ATF_NOFLAGS, 0, offsetof(struct Horandveruncert, horspeed), @@ -292,7 +292,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_horspeed_constraint_1, - &asn_PER_memb_horspeed_constr_4, + &ASN_PER_MEMB_HORSPEED_CONSTR_4, 0, "horspeed"}, {ATF_NOFLAGS, 0, offsetof(struct Horandveruncert, verspeed), @@ -300,7 +300,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_verspeed_constraint_1, - &asn_PER_memb_verspeed_constr_5, + &ASN_PER_MEMB_VERSPEED_CONSTR_5, 0, "verspeed"}, {ATF_NOFLAGS, 0, offsetof(struct Horandveruncert, horuncertspeed), @@ -308,7 +308,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_horuncertspeed_constraint_1, - &asn_PER_memb_horuncertspeed_constr_6, + &ASN_PER_MEMB_HORUNCERTSPEED_CONSTR_6, 0, "horuncertspeed"}, {ATF_NOFLAGS, 0, offsetof(struct Horandveruncert, veruncertspeed), @@ -316,7 +316,7 @@ static asn_TYPE_member_t asn_MBR_Horandveruncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_veruncertspeed_constraint_1, - &asn_PER_memb_veruncertspeed_constr_7, + &ASN_PER_MEMB_VERUNCERTSPEED_CONSTR_7, 0, "veruncertspeed"}, }; diff --git a/src/core/libs/supl/asn-supl/Horandvervel.c b/src/core/libs/supl/asn-supl/Horandvervel.c index b91d072e1..6f8b3bc5c 100644 --- a/src/core/libs/supl/asn-supl/Horandvervel.c +++ b/src/core/libs/supl/asn-supl/Horandvervel.c @@ -162,22 +162,22 @@ memb_verspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_verdirect_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_VERDIRECT_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 1, 1} /* (SIZE(1..1)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_bearing_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_BEARING_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 9, 9} /* (SIZE(9..9)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_horspeed_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_HORSPEED_CONSTR_4 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 16, 16} /* (SIZE(16..16)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_verspeed_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_VERSPEED_CONSTR_5 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ @@ -188,7 +188,7 @@ static asn_TYPE_member_t asn_MBR_Horandvervel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_verdirect_constraint_1, - &asn_PER_memb_verdirect_constr_2, + &ASN_PER_MEMB_VERDIRECT_CONSTR_2, 0, "verdirect"}, {ATF_NOFLAGS, 0, offsetof(struct Horandvervel, bearing), @@ -196,7 +196,7 @@ static asn_TYPE_member_t asn_MBR_Horandvervel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_bearing_constraint_1, - &asn_PER_memb_bearing_constr_3, + &ASN_PER_MEMB_BEARING_CONSTR_3, 0, "bearing"}, {ATF_NOFLAGS, 0, offsetof(struct Horandvervel, horspeed), @@ -204,7 +204,7 @@ static asn_TYPE_member_t asn_MBR_Horandvervel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_horspeed_constraint_1, - &asn_PER_memb_horspeed_constr_4, + &ASN_PER_MEMB_HORSPEED_CONSTR_4, 0, "horspeed"}, {ATF_NOFLAGS, 0, offsetof(struct Horandvervel, verspeed), @@ -212,7 +212,7 @@ static asn_TYPE_member_t asn_MBR_Horandvervel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_verspeed_constraint_1, - &asn_PER_memb_verspeed_constr_5, + &ASN_PER_MEMB_VERSPEED_CONSTR_5, 0, "verspeed"}, }; diff --git a/src/core/libs/supl/asn-supl/Horvel.c b/src/core/libs/supl/asn-supl/Horvel.c index 7c2080fff..fb8f8502c 100644 --- a/src/core/libs/supl/asn-supl/Horvel.c +++ b/src/core/libs/supl/asn-supl/Horvel.c @@ -84,12 +84,12 @@ memb_horspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_bearing_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_BEARING_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 9, 9} /* (SIZE(9..9)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_horspeed_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_HORSPEED_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 16, 16} /* (SIZE(16..16)) */, 0, 0 /* No PER value map */ @@ -100,7 +100,7 @@ static asn_TYPE_member_t asn_MBR_Horvel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_bearing_constraint_1, - &asn_PER_memb_bearing_constr_2, + &ASN_PER_MEMB_BEARING_CONSTR_2, 0, "bearing"}, {ATF_NOFLAGS, 0, offsetof(struct Horvel, horspeed), @@ -108,7 +108,7 @@ static asn_TYPE_member_t asn_MBR_Horvel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_horspeed_constraint_1, - &asn_PER_memb_horspeed_constr_3, + &ASN_PER_MEMB_HORSPEED_CONSTR_3, 0, "horspeed"}, }; diff --git a/src/core/libs/supl/asn-supl/Horveluncert.c b/src/core/libs/supl/asn-supl/Horveluncert.c index b3983f3f6..3e00aee15 100644 --- a/src/core/libs/supl/asn-supl/Horveluncert.c +++ b/src/core/libs/supl/asn-supl/Horveluncert.c @@ -123,17 +123,17 @@ memb_uncertspeed_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_bearing_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_BEARING_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 9, 9} /* (SIZE(9..9)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_horspeed_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_HORSPEED_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 16, 16} /* (SIZE(16..16)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_uncertspeed_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_UNCERTSPEED_CONSTR_4 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ @@ -144,7 +144,7 @@ static asn_TYPE_member_t asn_MBR_Horveluncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_bearing_constraint_1, - &asn_PER_memb_bearing_constr_2, + &ASN_PER_MEMB_BEARING_CONSTR_2, 0, "bearing"}, {ATF_NOFLAGS, 0, offsetof(struct Horveluncert, horspeed), @@ -152,7 +152,7 @@ static asn_TYPE_member_t asn_MBR_Horveluncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_horspeed_constraint_1, - &asn_PER_memb_horspeed_constr_3, + &ASN_PER_MEMB_HORSPEED_CONSTR_3, 0, "horspeed"}, {ATF_NOFLAGS, 0, offsetof(struct Horveluncert, uncertspeed), @@ -160,7 +160,7 @@ static asn_TYPE_member_t asn_MBR_Horveluncert_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_uncertspeed_constraint_1, - &asn_PER_memb_uncertspeed_constr_4, + &ASN_PER_MEMB_UNCERTSPEED_CONSTR_4, 0, "uncertspeed"}, }; diff --git a/src/core/libs/supl/asn-supl/IA5String.c b/src/core/libs/supl/asn-supl/IA5String.c index 02ecd3ee7..c404406d4 100644 --- a/src/core/libs/supl/asn-supl/IA5String.c +++ b/src/core/libs/supl/asn-supl/IA5String.c @@ -12,7 +12,7 @@ static ber_tlv_tag_t asn_DEF_IA5String_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; -static asn_per_constraints_t asn_DEF_IA5String_constraints = { +static asn_per_constraints_t ASN_DEF_I_A5_STRING_CONSTRAINTS = { { APC_CONSTRAINED, 7, 7, 0, 0x7f }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 @@ -36,7 +36,7 @@ asn_TYPE_descriptor_t asn_DEF_IA5String = { asn_DEF_IA5String_tags, sizeof(asn_DEF_IA5String_tags) / sizeof(asn_DEF_IA5String_tags[0]), - &asn_DEF_IA5String_constraints, + &ASN_DEF_I_A5_STRING_CONSTRAINTS, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/INTEGER.h b/src/core/libs/supl/asn-supl/INTEGER.h index 2acd13ab9..e389e6b43 100644 --- a/src/core/libs/supl/asn-supl/INTEGER.h +++ b/src/core/libs/supl/asn-supl/INTEGER.h @@ -57,8 +57,8 @@ extern "C" */ int asn_INTEGER2long(const INTEGER_t *i, long *l); int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); - int asn_long2INTEGER(INTEGER_t *i, long l); - int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); + int asn_long2INTEGER(INTEGER_t *st, long value); + int asn_ulong2INTEGER(INTEGER_t *st, unsigned long value); /* * Convert the integer value into the corresponding enumeration map entry. diff --git a/src/core/libs/supl/asn-supl/IPAddress.c b/src/core/libs/supl/asn-supl/IPAddress.c index f1861adac..1da24fbd8 100644 --- a/src/core/libs/supl/asn-supl/IPAddress.c +++ b/src/core/libs/supl/asn-supl/IPAddress.c @@ -68,17 +68,17 @@ memb_ipv6Address_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_ipv4Address_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_IPV4_ADDRESS_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 4, 4} /* (SIZE(4..4)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_ipv6Address_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_IPV6_ADDRESS_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 16, 16} /* (SIZE(16..16)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_type_IPAddress_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_IP_ADDRESS_CONSTR_1 = { {APC_CONSTRAINED, 1, 1, 0, 1} /* (0..1) */, {APC_UNCONSTRAINED, -1, -1, 0, 0}, 0, 0 /* No PER value map */ @@ -89,7 +89,7 @@ static asn_TYPE_member_t asn_MBR_IPAddress_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_ipv4Address_constraint_1, - &asn_PER_memb_ipv4Address_constr_2, + &ASN_PER_MEMB_IPV4_ADDRESS_CONSTR_2, 0, "ipv4Address"}, {ATF_NOFLAGS, 0, offsetof(struct IPAddress, choice.ipv6Address), @@ -97,7 +97,7 @@ static asn_TYPE_member_t asn_MBR_IPAddress_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_ipv6Address_constraint_1, - &asn_PER_memb_ipv6Address_constr_3, + &ASN_PER_MEMB_IPV6_ADDRESS_CONSTR_3, 0, "ipv6Address"}, }; @@ -132,7 +132,7 @@ asn_TYPE_descriptor_t asn_DEF_IPAddress = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_IPAddress_constr_1, + &ASN_PER_TYPE_IP_ADDRESS_CONSTR_1, asn_MBR_IPAddress_1, 2, /* Elements count */ &asn_SPC_IPAddress_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/KeyIdentity.c b/src/core/libs/supl/asn-supl/KeyIdentity.c index 49104664a..cb4081683 100644 --- a/src/core/libs/supl/asn-supl/KeyIdentity.c +++ b/src/core/libs/supl/asn-supl/KeyIdentity.c @@ -131,7 +131,7 @@ KeyIdentity_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_KeyIdentity_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_KEY_IDENTITY_CONSTR_1 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 128, 128} /* (SIZE(128..128)) */, 0, 0 /* No PER value map */ @@ -155,7 +155,7 @@ asn_TYPE_descriptor_t asn_DEF_KeyIdentity = { sizeof(asn_DEF_KeyIdentity_tags_1) / sizeof(asn_DEF_KeyIdentity_tags_1[0]), /* 1 */ asn_DEF_KeyIdentity_tags_1, /* Same as above */ sizeof(asn_DEF_KeyIdentity_tags_1) / sizeof(asn_DEF_KeyIdentity_tags_1[0]), /* 1 */ - &asn_PER_type_KeyIdentity_constr_1, + &ASN_PER_TYPE_KEY_IDENTITY_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/KeyIdentity4.c b/src/core/libs/supl/asn-supl/KeyIdentity4.c index ef652c319..55c90f14e 100644 --- a/src/core/libs/supl/asn-supl/KeyIdentity4.c +++ b/src/core/libs/supl/asn-supl/KeyIdentity4.c @@ -131,7 +131,7 @@ KeyIdentity4_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_KeyIdentity4_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_KEY_IDENTITY4_CONSTR_1 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 128, 128} /* (SIZE(128..128)) */, 0, 0 /* No PER value map */ @@ -155,7 +155,7 @@ asn_TYPE_descriptor_t asn_DEF_KeyIdentity4 = { sizeof(asn_DEF_KeyIdentity4_tags_1) / sizeof(asn_DEF_KeyIdentity4_tags_1[0]), /* 1 */ asn_DEF_KeyIdentity4_tags_1, /* Same as above */ sizeof(asn_DEF_KeyIdentity4_tags_1) / sizeof(asn_DEF_KeyIdentity4_tags_1[0]), /* 1 */ - &asn_PER_type_KeyIdentity4_constr_1, + &ASN_PER_TYPE_KEY_IDENTITY4_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/MAC.c b/src/core/libs/supl/asn-supl/MAC.c index 5592eaf53..2fe9de455 100644 --- a/src/core/libs/supl/asn-supl/MAC.c +++ b/src/core/libs/supl/asn-supl/MAC.c @@ -131,7 +131,7 @@ MAC_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_MAC_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MAC_CONSTR_1 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 64, 64} /* (SIZE(64..64)) */, 0, 0 /* No PER value map */ @@ -155,7 +155,7 @@ asn_TYPE_descriptor_t asn_DEF_MAC = { sizeof(asn_DEF_MAC_tags_1) / sizeof(asn_DEF_MAC_tags_1[0]), /* 1 */ asn_DEF_MAC_tags_1, /* Same as above */ sizeof(asn_DEF_MAC_tags_1) / sizeof(asn_DEF_MAC_tags_1[0]), /* 1 */ - &asn_PER_type_MAC_constr_1, + &ASN_PER_TYPE_MAC_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/MeasuredResultsList.c b/src/core/libs/supl/asn-supl/MeasuredResultsList.c index 1108ef45e..dd653c7a2 100644 --- a/src/core/libs/supl/asn-supl/MeasuredResultsList.c +++ b/src/core/libs/supl/asn-supl/MeasuredResultsList.c @@ -6,7 +6,7 @@ #include "MeasuredResultsList.h" -static asn_per_constraints_t asn_PER_type_MeasuredResultsList_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_MEASURED_RESULTS_LIST_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 3, 3, 1, 8 } /* (SIZE(1..8)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_MeasuredResultsList = { asn_DEF_MeasuredResultsList_tags_1, /* Same as above */ sizeof(asn_DEF_MeasuredResultsList_tags_1) /sizeof(asn_DEF_MeasuredResultsList_tags_1[0]), /* 1 */ - &asn_PER_type_MeasuredResultsList_constr_1, + &ASN_PER_TYPE_MEASURED_RESULTS_LIST_CONSTR_1, asn_MBR_MeasuredResultsList_1, 1, /* Single element */ &asn_SPC_MeasuredResultsList_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/NMR.c b/src/core/libs/supl/asn-supl/NMR.c index f64caffbe..f9fff612e 100644 --- a/src/core/libs/supl/asn-supl/NMR.c +++ b/src/core/libs/supl/asn-supl/NMR.c @@ -6,7 +6,7 @@ #include "NMR.h" -static asn_per_constraints_t asn_PER_type_NMR_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_NMR_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 15 } /* (SIZE(1..15)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_NMR = { asn_DEF_NMR_tags_1, /* Same as above */ sizeof(asn_DEF_NMR_tags_1) /sizeof(asn_DEF_NMR_tags_1[0]), /* 1 */ - &asn_PER_type_NMR_constr_1, + &ASN_PER_TYPE_NMR_CONSTR_1, asn_MBR_NMR_1, 1, /* Single element */ &asn_SPC_NMR_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/NMRelement.c b/src/core/libs/supl/asn-supl/NMRelement.c index 79d122d82..ae64a2e78 100644 --- a/src/core/libs/supl/asn-supl/NMRelement.c +++ b/src/core/libs/supl/asn-supl/NMRelement.c @@ -81,17 +81,17 @@ memb_rxLev_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_aRFCN_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_A_RFCN_CONSTR_2 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_bSIC_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_B_SIC_CONSTR_3 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_rxLev_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_RX_LEV_CONSTR_4 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_NMRelement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_aRFCN_constraint_1, - &asn_PER_memb_aRFCN_constr_2, + &ASN_PER_MEMB_A_RFCN_CONSTR_2, 0, "aRFCN" }, @@ -111,7 +111,7 @@ static asn_TYPE_member_t asn_MBR_NMRelement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_bSIC_constraint_1, - &asn_PER_memb_bSIC_constr_3, + &ASN_PER_MEMB_B_SIC_CONSTR_3, 0, "bSIC" }, @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_NMRelement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_rxLev_constraint_1, - &asn_PER_memb_rxLev_constr_4, + &ASN_PER_MEMB_RX_LEV_CONSTR_4, 0, "rxLev" }, diff --git a/src/core/libs/supl/asn-supl/Notification.c b/src/core/libs/supl/asn-supl/Notification.c index 7643e9048..c8d4c280e 100644 --- a/src/core/libs/supl/asn-supl/Notification.c +++ b/src/core/libs/supl/asn-supl/Notification.c @@ -58,12 +58,12 @@ memb_clientName_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_requestorId_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_REQUESTOR_ID_CONSTR_4 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 50 } /* (SIZE(1..50)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_clientName_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_CLIENT_NAME_CONSTR_6 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 6, 6, 1, 50 } /* (SIZE(1..50)) */, 0, 0 /* No PER value map */ @@ -92,7 +92,7 @@ static asn_TYPE_member_t asn_MBR_Notification_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_requestorId_constraint_1, - &asn_PER_memb_requestorId_constr_4, + &ASN_PER_MEMB_REQUESTOR_ID_CONSTR_4, 0, "requestorId" }, @@ -110,7 +110,7 @@ static asn_TYPE_member_t asn_MBR_Notification_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_clientName_constraint_1, - &asn_PER_memb_clientName_constr_6, + &ASN_PER_MEMB_CLIENT_NAME_CONSTR_6, 0, "clientName" }, diff --git a/src/core/libs/supl/asn-supl/NotificationType.c b/src/core/libs/supl/asn-supl/NotificationType.c index 8c1178a98..e6b591c40 100644 --- a/src/core/libs/supl/asn-supl/NotificationType.c +++ b/src/core/libs/supl/asn-supl/NotificationType.c @@ -94,7 +94,7 @@ NotificationType_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_NotificationType_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_NOTIFICATION_TYPE_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 4 } /* (0..4,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -146,7 +146,7 @@ asn_TYPE_descriptor_t asn_DEF_NotificationType = { asn_DEF_NotificationType_tags_1, /* Same as above */ sizeof(asn_DEF_NotificationType_tags_1) /sizeof(asn_DEF_NotificationType_tags_1[0]), /* 1 */ - &asn_PER_type_NotificationType_constr_1, + &ASN_PER_TYPE_NOTIFICATION_TYPE_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_NotificationType_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/OCTET_STRING.c b/src/core/libs/supl/asn-supl/OCTET_STRING.c index bd2d1d845..98aebb3bf 100644 --- a/src/core/libs/supl/asn-supl/OCTET_STRING.c +++ b/src/core/libs/supl/asn-supl/OCTET_STRING.c @@ -19,7 +19,7 @@ static asn_OCTET_STRING_specifics_t asn_DEF_OCTET_STRING_specs = { offsetof(OCTET_STRING_t, _asn_ctx), ASN_OSUBV_STR }; -static asn_per_constraints_t asn_DEF_OCTET_STRING_constraints = { +static asn_per_constraints_t ASN_DEF_OCTET_STRING_CONSTRAINTS = { { APC_CONSTRAINED, 8, 8, 0, 255 }, { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, 0, 0 @@ -1351,8 +1351,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, cval = &pc->value; csiz = &pc->size; } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; } switch(specs->subvariant) { @@ -1400,8 +1400,8 @@ OCTET_STRING_decode_uper(asn_codec_ctx_t *opt_codec_ctx, int inext = per_get_few_bits(pd, 1); if(inext < 0) RETURN(RC_WMORE); if(inext) { - csiz = &asn_DEF_OCTET_STRING_constraints.size; - cval = &asn_DEF_OCTET_STRING_constraints.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; unit_bits = canonical_unit_bits; } } @@ -1526,8 +1526,8 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, cval = &pc->value; csiz = &pc->size; } else { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; } ct_extensible = csiz->flags & APC_EXTENSIBLE; @@ -1577,8 +1577,8 @@ OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, if((int)sizeinunits < csiz->lower_bound || (int)sizeinunits > csiz->upper_bound) { if(ct_extensible) { - cval = &asn_DEF_OCTET_STRING_constraints.value; - csiz = &asn_DEF_OCTET_STRING_constraints.size; + cval = &ASN_DEF_OCTET_STRING_CONSTRAINTS.value; + csiz = &ASN_DEF_OCTET_STRING_CONSTRAINTS.size; unit_bits = canonical_unit_bits; inext = 1; } else diff --git a/src/core/libs/supl/asn-supl/OCTET_STRING.h b/src/core/libs/supl/asn-supl/OCTET_STRING.h index 124fde559..9387a4d4b 100644 --- a/src/core/libs/supl/asn-supl/OCTET_STRING.h +++ b/src/core/libs/supl/asn-supl/OCTET_STRING.h @@ -48,7 +48,7 @@ extern "C" * current contents of the OCTET STRING. * Returns 0 if it was possible to perform operation, -1 otherwise. */ - int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int size); + int OCTET_STRING_fromBuf(OCTET_STRING_t *s, const char *str, int len); /* Handy conversion from the C string into the OCTET STRING. */ #define OCTET_STRING_fromString(s, str) OCTET_STRING_fromBuf(s, str, -1) @@ -59,7 +59,7 @@ extern "C" * empty OCTET STRING. */ OCTET_STRING_t *OCTET_STRING_new_fromBuf(asn_TYPE_descriptor_t *td, - const char *str, int size); + const char *str, int len); /**************************** * Internally useful stuff. * diff --git a/src/core/libs/supl/asn-supl/Pathloss.c b/src/core/libs/supl/asn-supl/Pathloss.c index 3bbec50fb..ddeca35b9 100644 --- a/src/core/libs/supl/asn-supl/Pathloss.c +++ b/src/core/libs/supl/asn-supl/Pathloss.c @@ -111,7 +111,7 @@ Pathloss_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_Pathloss_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_PATHLOSS_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 46, 173 } /* (46..173) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_Pathloss = { asn_DEF_Pathloss_tags_1, /* Same as above */ sizeof(asn_DEF_Pathloss_tags_1) /sizeof(asn_DEF_Pathloss_tags_1[0]), /* 1 */ - &asn_PER_type_Pathloss_constr_1, + &ASN_PER_TYPE_PATHLOSS_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/PosMethod.c b/src/core/libs/supl/asn-supl/PosMethod.c index d65c13b6f..b720df296 100644 --- a/src/core/libs/supl/asn-supl/PosMethod.c +++ b/src/core/libs/supl/asn-supl/PosMethod.c @@ -94,7 +94,7 @@ PosMethod_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_PosMethod_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_POS_METHOD_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 0, 9 } /* (0..9,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -156,7 +156,7 @@ asn_TYPE_descriptor_t asn_DEF_PosMethod = { asn_DEF_PosMethod_tags_1, /* Same as above */ sizeof(asn_DEF_PosMethod_tags_1) /sizeof(asn_DEF_PosMethod_tags_1[0]), /* 1 */ - &asn_PER_type_PosMethod_constr_1, + &ASN_PER_TYPE_POS_METHOD_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_PosMethod_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/PosPayLoad.c b/src/core/libs/supl/asn-supl/PosPayLoad.c index b12f05e74..ebb173c43 100644 --- a/src/core/libs/supl/asn-supl/PosPayLoad.c +++ b/src/core/libs/supl/asn-supl/PosPayLoad.c @@ -84,22 +84,22 @@ memb_rrlpPayload_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_tia801payload_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_TIA801PAYLOAD_CONSTR_2 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 13, 13, 1, 8192 } /* (SIZE(1..8192)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_rrcPayload_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_RRC_PAYLOAD_CONSTR_3 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 13, 13, 1, 8192 } /* (SIZE(1..8192)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_rrlpPayload_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_RRLP_PAYLOAD_CONSTR_4 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 13, 13, 1, 8192 } /* (SIZE(1..8192)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_type_PosPayLoad_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_POS_PAY_LOAD_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -110,7 +110,7 @@ static asn_TYPE_member_t asn_MBR_PosPayLoad_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_tia801payload_constraint_1, - &asn_PER_memb_tia801payload_constr_2, + &ASN_PER_MEMB_TIA801PAYLOAD_CONSTR_2, 0, "tia801payload" }, @@ -119,7 +119,7 @@ static asn_TYPE_member_t asn_MBR_PosPayLoad_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_rrcPayload_constraint_1, - &asn_PER_memb_rrcPayload_constr_3, + &ASN_PER_MEMB_RRC_PAYLOAD_CONSTR_3, 0, "rrcPayload" }, @@ -128,7 +128,7 @@ static asn_TYPE_member_t asn_MBR_PosPayLoad_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_rrlpPayload_constraint_1, - &asn_PER_memb_rrlpPayload_constr_4, + &ASN_PER_MEMB_RRLP_PAYLOAD_CONSTR_4, 0, "rrlpPayload" }, @@ -165,7 +165,7 @@ asn_TYPE_descriptor_t asn_DEF_PosPayLoad = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_PosPayLoad_constr_1, + &ASN_PER_TYPE_POS_PAY_LOAD_CONSTR_1, asn_MBR_PosPayLoad_1, 3, /* Elements count */ &asn_SPC_PosPayLoad_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/PositionEstimate.c b/src/core/libs/supl/asn-supl/PositionEstimate.c index 4b7367af2..ee44b7a11 100644 --- a/src/core/libs/supl/asn-supl/PositionEstimate.c +++ b/src/core/libs/supl/asn-supl/PositionEstimate.c @@ -244,37 +244,37 @@ memb_confidence_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_type_latitudeSign_constr_2 = { +static asn_per_constraints_t ASN_PER_TYPE_LATITUDE_SIGN_CONSTR_2 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_uncertaintySemiMajor_constr_8 = { +static asn_per_constraints_t ASN_PER_MEMB_UNCERTAINTY_SEMI_MAJOR_CONSTR_8 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_uncertaintySemiMinor_constr_9 = { +static asn_per_constraints_t ASN_PER_MEMB_UNCERTAINTY_SEMI_MINOR_CONSTR_9 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_orientationMajorAxis_constr_10 = { +static asn_per_constraints_t ASN_PER_MEMB_ORIENTATION_MAJOR_AXIS_CONSTR_10 = { { APC_CONSTRAINED, 8, 8, 0, 180 } /* (0..180) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_latitude_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_LATITUDE_CONSTR_5 = { { APC_CONSTRAINED, 23, -1, 0, 8388607 } /* (0..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_longitude_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_LONGITUDE_CONSTR_6 = { { APC_CONSTRAINED, 24, -1, -8388608, 8388607 } /* (-8388608..8388607) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_confidence_constr_11 = { +static asn_per_constraints_t ASN_PER_MEMB_CONFIDENCE_CONSTR_11 = { { APC_CONSTRAINED, 7, 7, 0, 100 } /* (0..100) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -320,7 +320,7 @@ asn_TYPE_descriptor_t asn_DEF_latitudeSign_2 = { asn_DEF_latitudeSign_tags_2, /* Same as above */ sizeof(asn_DEF_latitudeSign_tags_2) /sizeof(asn_DEF_latitudeSign_tags_2[0]), /* 2 */ - &asn_PER_type_latitudeSign_constr_2, + &ASN_PER_TYPE_LATITUDE_SIGN_CONSTR_2, 0, 0, /* Defined elsewhere */ &asn_SPC_latitudeSign_specs_2 /* Additional specs */ }; @@ -331,7 +331,7 @@ static asn_TYPE_member_t asn_MBR_uncertainty_7[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_uncertaintySemiMajor_constraint_7, - &asn_PER_memb_uncertaintySemiMajor_constr_8, + &ASN_PER_MEMB_UNCERTAINTY_SEMI_MAJOR_CONSTR_8, 0, "uncertaintySemiMajor" }, @@ -340,7 +340,7 @@ static asn_TYPE_member_t asn_MBR_uncertainty_7[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_uncertaintySemiMinor_constraint_7, - &asn_PER_memb_uncertaintySemiMinor_constr_9, + &ASN_PER_MEMB_UNCERTAINTY_SEMI_MINOR_CONSTR_9, 0, "uncertaintySemiMinor" }, @@ -349,7 +349,7 @@ static asn_TYPE_member_t asn_MBR_uncertainty_7[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_orientationMajorAxis_constraint_7, - &asn_PER_memb_orientationMajorAxis_constr_10, + &ASN_PER_MEMB_ORIENTATION_MAJOR_AXIS_CONSTR_10, 0, "orientationMajorAxis" }, @@ -413,7 +413,7 @@ static asn_TYPE_member_t asn_MBR_PositionEstimate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_latitude_constraint_1, - &asn_PER_memb_latitude_constr_5, + &ASN_PER_MEMB_LATITUDE_CONSTR_5, 0, "latitude" }, @@ -422,7 +422,7 @@ static asn_TYPE_member_t asn_MBR_PositionEstimate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_longitude_constraint_1, - &asn_PER_memb_longitude_constr_6, + &ASN_PER_MEMB_LONGITUDE_CONSTR_6, 0, "longitude" }, @@ -440,7 +440,7 @@ static asn_TYPE_member_t asn_MBR_PositionEstimate_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_confidence_constraint_1, - &asn_PER_memb_confidence_constr_11, + &ASN_PER_MEMB_CONFIDENCE_CONSTR_11, 0, "confidence" }, diff --git a/src/core/libs/supl/asn-supl/PrefMethod.c b/src/core/libs/supl/asn-supl/PrefMethod.c index 3949a64ec..e07280a8f 100644 --- a/src/core/libs/supl/asn-supl/PrefMethod.c +++ b/src/core/libs/supl/asn-supl/PrefMethod.c @@ -94,7 +94,7 @@ PrefMethod_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_PrefMethod_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_PREF_METHOD_CONSTR_1 = { { APC_CONSTRAINED, 2, 2, 0, 2 } /* (0..2) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -140,7 +140,7 @@ asn_TYPE_descriptor_t asn_DEF_PrefMethod = { asn_DEF_PrefMethod_tags_1, /* Same as above */ sizeof(asn_DEF_PrefMethod_tags_1) /sizeof(asn_DEF_PrefMethod_tags_1[0]), /* 1 */ - &asn_PER_type_PrefMethod_constr_1, + &ASN_PER_TYPE_PREF_METHOD_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_PrefMethod_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.c b/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.c index ea2ce5877..1c7d91177 100644 --- a/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.c +++ b/src/core/libs/supl/asn-supl/PrimaryCCPCH-RSCP.c @@ -111,7 +111,7 @@ PrimaryCCPCH_RSCP_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_PrimaryCCPCH_RSCP_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_PRIMARY_CCPCH_RSCP_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_PrimaryCCPCH_RSCP = { asn_DEF_PrimaryCCPCH_RSCP_tags_1, /* Same as above */ sizeof(asn_DEF_PrimaryCCPCH_RSCP_tags_1) /sizeof(asn_DEF_PrimaryCCPCH_RSCP_tags_1[0]), /* 1 */ - &asn_PER_type_PrimaryCCPCH_RSCP_constr_1, + &ASN_PER_TYPE_PRIMARY_CCPCH_RSCP_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.c b/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.c index 62efe3f10..f7afc5b7c 100644 --- a/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.c +++ b/src/core/libs/supl/asn-supl/PrimaryCPICH-Info.c @@ -31,7 +31,7 @@ memb_primaryScramblingCode_constraint_1(asn_TYPE_descriptor_t *td, const void *s } } -static asn_per_constraints_t asn_PER_memb_primaryScramblingCode_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_PRIMARY_SCRAMBLING_CODE_CONSTR_2 = { { APC_CONSTRAINED, 9, 9, 0, 511 } /* (0..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_PrimaryCPICH_Info_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_primaryScramblingCode_constraint_1, - &asn_PER_memb_primaryScramblingCode_constr_2, + &ASN_PER_MEMB_PRIMARY_SCRAMBLING_CODE_CONSTR_2, 0, "primaryScramblingCode" }, diff --git a/src/core/libs/supl/asn-supl/QoP.c b/src/core/libs/supl/asn-supl/QoP.c index 5591c9f49..9bc7e6372 100644 --- a/src/core/libs/supl/asn-supl/QoP.c +++ b/src/core/libs/supl/asn-supl/QoP.c @@ -106,22 +106,22 @@ memb_delay_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_horacc_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_HORACC_CONSTR_2 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_veracc_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_VERACC_CONSTR_3 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_maxLocAge_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_MAX_LOC_AGE_CONSTR_4 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_delay_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_DELAY_CONSTR_5 = { { APC_CONSTRAINED, 3, 3, 0, 7 } /* (0..7) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -132,7 +132,7 @@ static asn_TYPE_member_t asn_MBR_QoP_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_horacc_constraint_1, - &asn_PER_memb_horacc_constr_2, + &ASN_PER_MEMB_HORACC_CONSTR_2, 0, "horacc" }, @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_QoP_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_veracc_constraint_1, - &asn_PER_memb_veracc_constr_3, + &ASN_PER_MEMB_VERACC_CONSTR_3, 0, "veracc" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_QoP_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_maxLocAge_constraint_1, - &asn_PER_memb_maxLocAge_constr_4, + &ASN_PER_MEMB_MAX_LOC_AGE_CONSTR_4, 0, "maxLocAge" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_QoP_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_delay_constraint_1, - &asn_PER_memb_delay_constr_5, + &ASN_PER_MEMB_DELAY_CONSTR_5, 0, "delay" }, diff --git a/src/core/libs/supl/asn-supl/SETAuthKey.c b/src/core/libs/supl/asn-supl/SETAuthKey.c index 3069866a2..7918881de 100644 --- a/src/core/libs/supl/asn-supl/SETAuthKey.c +++ b/src/core/libs/supl/asn-supl/SETAuthKey.c @@ -84,17 +84,17 @@ memb_longKey_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_shortKey_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_SHORT_KEY_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 128, 128} /* (SIZE(128..128)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_longKey_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_LONG_KEY_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 256, 256} /* (SIZE(256..256)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_type_SETAuthKey_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SET_AUTH_KEY_CONSTR_1 = { {APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1} /* (0..1,...) */, {APC_UNCONSTRAINED, -1, -1, 0, 0}, 0, 0 /* No PER value map */ @@ -105,7 +105,7 @@ static asn_TYPE_member_t asn_MBR_SETAuthKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_shortKey_constraint_1, - &asn_PER_memb_shortKey_constr_2, + &ASN_PER_MEMB_SHORT_KEY_CONSTR_2, 0, "shortKey"}, {ATF_NOFLAGS, 0, offsetof(struct SETAuthKey, choice.longKey), @@ -113,7 +113,7 @@ static asn_TYPE_member_t asn_MBR_SETAuthKey_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_longKey_constraint_1, - &asn_PER_memb_longKey_constr_3, + &ASN_PER_MEMB_LONG_KEY_CONSTR_3, 0, "longKey"}, }; @@ -148,7 +148,7 @@ asn_TYPE_descriptor_t asn_DEF_SETAuthKey = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SETAuthKey_constr_1, + &ASN_PER_TYPE_SET_AUTH_KEY_CONSTR_1, asn_MBR_SETAuthKey_1, 2, /* Elements count */ &asn_SPC_SETAuthKey_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/SETId.c b/src/core/libs/supl/asn-supl/SETId.c index 93a635e23..ec2936fb5 100644 --- a/src/core/libs/supl/asn-supl/SETId.c +++ b/src/core/libs/supl/asn-supl/SETId.c @@ -184,32 +184,32 @@ memb_nai_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_msisdn_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_MSISDN_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_mdn_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_MDN_CONSTR_3 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_min_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_MIN_CONSTR_4 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 34, 34} /* (SIZE(34..34)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_imsi_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_IMSI_CONSTR_5 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 8, 8} /* (SIZE(8..8)) */, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_nai_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_NAI_CONSTR_6 = { {APC_CONSTRAINED, 7, 7, 0, 127} /* (0..127) */, {APC_CONSTRAINED, 10, 10, 1, 1000} /* (SIZE(1..1000)) */, 0, 0 /* No PER character map necessary */ }; -static asn_per_constraints_t asn_PER_type_SETId_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SET_ID_CONSTR_1 = { {APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 5} /* (0..5,...) */, {APC_UNCONSTRAINED, -1, -1, 0, 0}, 0, 0 /* No PER value map */ @@ -220,7 +220,7 @@ static asn_TYPE_member_t asn_MBR_SETId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_msisdn_constraint_1, - &asn_PER_memb_msisdn_constr_2, + &ASN_PER_MEMB_MSISDN_CONSTR_2, 0, "msisdn"}, {ATF_NOFLAGS, 0, offsetof(struct SETId, choice.mdn), @@ -228,7 +228,7 @@ static asn_TYPE_member_t asn_MBR_SETId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_mdn_constraint_1, - &asn_PER_memb_mdn_constr_3, + &ASN_PER_MEMB_MDN_CONSTR_3, 0, "mdn"}, {ATF_NOFLAGS, 0, offsetof(struct SETId, choice.min), @@ -236,7 +236,7 @@ static asn_TYPE_member_t asn_MBR_SETId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_BIT_STRING, memb_min_constraint_1, - &asn_PER_memb_min_constr_4, + &ASN_PER_MEMB_MIN_CONSTR_4, 0, "min"}, {ATF_NOFLAGS, 0, offsetof(struct SETId, choice.imsi), @@ -244,7 +244,7 @@ static asn_TYPE_member_t asn_MBR_SETId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_imsi_constraint_1, - &asn_PER_memb_imsi_constr_5, + &ASN_PER_MEMB_IMSI_CONSTR_5, 0, "imsi"}, {ATF_NOFLAGS, 0, offsetof(struct SETId, choice.nai), @@ -252,7 +252,7 @@ static asn_TYPE_member_t asn_MBR_SETId_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_IA5String, memb_nai_constraint_1, - &asn_PER_memb_nai_constr_6, + &ASN_PER_MEMB_NAI_CONSTR_6, 0, "nai"}, {ATF_NOFLAGS, 0, offsetof(struct SETId, choice.iPAddress), @@ -299,7 +299,7 @@ asn_TYPE_descriptor_t asn_DEF_SETId = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SETId_constr_1, + &ASN_PER_TYPE_SET_ID_CONSTR_1, asn_MBR_SETId_1, 6, /* Elements count */ &asn_SPC_SETId_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/SLPAddress.c b/src/core/libs/supl/asn-supl/SLPAddress.c index d123057c7..ece16a747 100644 --- a/src/core/libs/supl/asn-supl/SLPAddress.c +++ b/src/core/libs/supl/asn-supl/SLPAddress.c @@ -6,7 +6,7 @@ #include "SLPAddress.h" -static asn_per_constraints_t asn_PER_type_SLPAddress_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SLP_ADDRESS_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 1, 1, 0, 1 } /* (0..1,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -62,7 +62,7 @@ asn_TYPE_descriptor_t asn_DEF_SLPAddress = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_SLPAddress_constr_1, + &ASN_PER_TYPE_SLP_ADDRESS_CONSTR_1, asn_MBR_SLPAddress_1, 2, /* Elements count */ &asn_SPC_SLPAddress_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/SLPMode.c b/src/core/libs/supl/asn-supl/SLPMode.c index f01e1f89a..79bf7a835 100644 --- a/src/core/libs/supl/asn-supl/SLPMode.c +++ b/src/core/libs/supl/asn-supl/SLPMode.c @@ -94,7 +94,7 @@ SLPMode_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_SLPMode_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SLP_MODE_CONSTR_1 = { { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_SLPMode = { asn_DEF_SLPMode_tags_1, /* Same as above */ sizeof(asn_DEF_SLPMode_tags_1) /sizeof(asn_DEF_SLPMode_tags_1[0]), /* 1 */ - &asn_PER_type_SLPMode_constr_1, + &ASN_PER_TYPE_SLP_MODE_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_SLPMode_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/SatelliteInfo.c b/src/core/libs/supl/asn-supl/SatelliteInfo.c index b32a55b86..428a1c2a0 100644 --- a/src/core/libs/supl/asn-supl/SatelliteInfo.c +++ b/src/core/libs/supl/asn-supl/SatelliteInfo.c @@ -6,7 +6,7 @@ #include "SatelliteInfo.h" -static asn_per_constraints_t asn_PER_type_SatelliteInfo_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_SATELLITE_INFO_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 5, 5, 1, 31 } /* (SIZE(1..31)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_SatelliteInfo = { asn_DEF_SatelliteInfo_tags_1, /* Same as above */ sizeof(asn_DEF_SatelliteInfo_tags_1) /sizeof(asn_DEF_SatelliteInfo_tags_1[0]), /* 1 */ - &asn_PER_type_SatelliteInfo_constr_1, + &ASN_PER_TYPE_SATELLITE_INFO_CONSTR_1, asn_MBR_SatelliteInfo_1, 1, /* Single element */ &asn_SPC_SatelliteInfo_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/SatelliteInfoElement.c b/src/core/libs/supl/asn-supl/SatelliteInfoElement.c index 0590d6e3b..3580d65e4 100644 --- a/src/core/libs/supl/asn-supl/SatelliteInfoElement.c +++ b/src/core/libs/supl/asn-supl/SatelliteInfoElement.c @@ -56,12 +56,12 @@ memb_iODE_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_satId_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_SAT_ID_CONSTR_2 = { { APC_CONSTRAINED, 6, 6, 0, 63 } /* (0..63) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_iODE_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_I_ODE_CONSTR_3 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -72,7 +72,7 @@ static asn_TYPE_member_t asn_MBR_SatelliteInfoElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_satId_constraint_1, - &asn_PER_memb_satId_constr_2, + &ASN_PER_MEMB_SAT_ID_CONSTR_2, 0, "satId" }, @@ -81,7 +81,7 @@ static asn_TYPE_member_t asn_MBR_SatelliteInfoElement_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_iODE_constraint_1, - &asn_PER_memb_iODE_constr_3, + &ASN_PER_MEMB_I_ODE_CONSTR_3, 0, "iODE" }, diff --git a/src/core/libs/supl/asn-supl/SetSessionID.c b/src/core/libs/supl/asn-supl/SetSessionID.c index 5adf6d09e..11a122d2b 100644 --- a/src/core/libs/supl/asn-supl/SetSessionID.c +++ b/src/core/libs/supl/asn-supl/SetSessionID.c @@ -31,7 +31,7 @@ memb_sessionId_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_sessionId_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_SESSION_ID_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_SetSessionID_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_sessionId_constraint_1, - &asn_PER_memb_sessionId_constr_2, + &ASN_PER_MEMB_SESSION_ID_CONSTR_2, 0, "sessionId" }, diff --git a/src/core/libs/supl/asn-supl/SlpSessionID.c b/src/core/libs/supl/asn-supl/SlpSessionID.c index 0e52d2d34..aed350daa 100644 --- a/src/core/libs/supl/asn-supl/SlpSessionID.c +++ b/src/core/libs/supl/asn-supl/SlpSessionID.c @@ -37,7 +37,7 @@ memb_sessionID_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_sessionID_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_SESSION_ID_CONSTR_2 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 4, 4} /* (SIZE(4..4)) */, 0, 0 /* No PER value map */ @@ -48,7 +48,7 @@ static asn_TYPE_member_t asn_MBR_SlpSessionID_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_OCTET_STRING, memb_sessionID_constraint_1, - &asn_PER_memb_sessionID_constr_2, + &ASN_PER_MEMB_SESSION_ID_CONSTR_2, 0, "sessionID"}, {ATF_NOFLAGS, 0, offsetof(struct SlpSessionID, slpId), diff --git a/src/core/libs/supl/asn-supl/Status.c b/src/core/libs/supl/asn-supl/Status.c index 5637fd918..acb84c342 100644 --- a/src/core/libs/supl/asn-supl/Status.c +++ b/src/core/libs/supl/asn-supl/Status.c @@ -94,7 +94,7 @@ Status_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_Status_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_STATUS_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -142,7 +142,7 @@ asn_TYPE_descriptor_t asn_DEF_Status = { asn_DEF_Status_tags_1, /* Same as above */ sizeof(asn_DEF_Status_tags_1) /sizeof(asn_DEF_Status_tags_1[0]), /* 1 */ - &asn_PER_type_Status_constr_1, + &ASN_PER_TYPE_STATUS_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_Status_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/StatusCode.c b/src/core/libs/supl/asn-supl/StatusCode.c index 3edb52a21..e4828f47f 100644 --- a/src/core/libs/supl/asn-supl/StatusCode.c +++ b/src/core/libs/supl/asn-supl/StatusCode.c @@ -94,7 +94,7 @@ StatusCode_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_StatusCode_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_STATUS_CODE_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 5, 5, 0, 19 } /* (0..19,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -176,7 +176,7 @@ asn_TYPE_descriptor_t asn_DEF_StatusCode = { asn_DEF_StatusCode_tags_1, /* Same as above */ sizeof(asn_DEF_StatusCode_tags_1) /sizeof(asn_DEF_StatusCode_tags_1[0]), /* 1 */ - &asn_PER_type_StatusCode_constr_1, + &ASN_PER_TYPE_STATUS_CODE_CONSTR_1, 0, 0, /* Defined elsewhere */ &asn_SPC_StatusCode_specs_1 /* Additional specs */ }; diff --git a/src/core/libs/supl/asn-supl/TGSN.c b/src/core/libs/supl/asn-supl/TGSN.c index 2da645c36..36f840d4e 100644 --- a/src/core/libs/supl/asn-supl/TGSN.c +++ b/src/core/libs/supl/asn-supl/TGSN.c @@ -111,7 +111,7 @@ TGSN_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TGSN_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TGSN_CONSTR_1 = { { APC_CONSTRAINED, 4, 4, 0, 14 } /* (0..14) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TGSN = { asn_DEF_TGSN_tags_1, /* Same as above */ sizeof(asn_DEF_TGSN_tags_1) /sizeof(asn_DEF_TGSN_tags_1[0]), /* 1 */ - &asn_PER_type_TGSN_constr_1, + &ASN_PER_TYPE_TGSN_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/TimeslotISCP-List.c b/src/core/libs/supl/asn-supl/TimeslotISCP-List.c index cd5e6bd0f..02831de49 100644 --- a/src/core/libs/supl/asn-supl/TimeslotISCP-List.c +++ b/src/core/libs/supl/asn-supl/TimeslotISCP-List.c @@ -6,7 +6,7 @@ #include "TimeslotISCP-List.h" -static asn_per_constraints_t asn_PER_type_TimeslotISCP_List_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TIMESLOT_ISCP_LIST_CONSTR_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 14 } /* (SIZE(1..14)) */, 0, 0 /* No PER value map */ @@ -49,7 +49,7 @@ asn_TYPE_descriptor_t asn_DEF_TimeslotISCP_List = { asn_DEF_TimeslotISCP_List_tags_1, /* Same as above */ sizeof(asn_DEF_TimeslotISCP_List_tags_1) /sizeof(asn_DEF_TimeslotISCP_List_tags_1[0]), /* 1 */ - &asn_PER_type_TimeslotISCP_List_constr_1, + &ASN_PER_TYPE_TIMESLOT_ISCP_LIST_CONSTR_1, asn_MBR_TimeslotISCP_List_1, 1, /* Single element */ &asn_SPC_TimeslotISCP_List_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/TimeslotISCP.c b/src/core/libs/supl/asn-supl/TimeslotISCP.c index d0a155752..411f73f71 100644 --- a/src/core/libs/supl/asn-supl/TimeslotISCP.c +++ b/src/core/libs/supl/asn-supl/TimeslotISCP.c @@ -111,7 +111,7 @@ TimeslotISCP_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_TimeslotISCP_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_TIMESLOT_ISCP_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_TimeslotISCP = { asn_DEF_TimeslotISCP_tags_1, /* Same as above */ sizeof(asn_DEF_TimeslotISCP_tags_1) /sizeof(asn_DEF_TimeslotISCP_tags_1[0]), /* 1 */ - &asn_PER_type_TimeslotISCP_constr_1, + &ASN_PER_TYPE_TIMESLOT_ISCP_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/UARFCN.c b/src/core/libs/supl/asn-supl/UARFCN.c index 5a703b7ce..96bd38dbd 100644 --- a/src/core/libs/supl/asn-supl/UARFCN.c +++ b/src/core/libs/supl/asn-supl/UARFCN.c @@ -111,7 +111,7 @@ UARFCN_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_UARFCN_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_UARFCN_CONSTR_1 = { { APC_CONSTRAINED, 14, 14, 0, 16383 } /* (0..16383) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_UARFCN = { asn_DEF_UARFCN_tags_1, /* Same as above */ sizeof(asn_DEF_UARFCN_tags_1) /sizeof(asn_DEF_UARFCN_tags_1[0]), /* 1 */ - &asn_PER_type_UARFCN_constr_1, + &ASN_PER_TYPE_UARFCN_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/ULP-PDU.c b/src/core/libs/supl/asn-supl/ULP-PDU.c index 75ac7fab2..a96fee787 100644 --- a/src/core/libs/supl/asn-supl/ULP-PDU.c +++ b/src/core/libs/supl/asn-supl/ULP-PDU.c @@ -31,7 +31,7 @@ memb_length_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_length_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_LENGTH_CONSTR_2 = { { APC_CONSTRAINED, 16, 16, 0, 65535 } /* (0..65535) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -42,7 +42,7 @@ static asn_TYPE_member_t asn_MBR_ULP_PDU_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_length_constraint_1, - &asn_PER_memb_length_constr_2, + &ASN_PER_MEMB_LENGTH_CONSTR_2, 0, "length" }, diff --git a/src/core/libs/supl/asn-supl/UTCTime.c b/src/core/libs/supl/asn-supl/UTCTime.c index 0abe1db74..a3d73e337 100644 --- a/src/core/libs/supl/asn-supl/UTCTime.c +++ b/src/core/libs/supl/asn-supl/UTCTime.c @@ -23,7 +23,7 @@ static ber_tlv_tag_t asn_DEF_UTCTime_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; -static asn_per_constraints_t asn_DEF_UTCTime_constraints = { +static asn_per_constraints_t ASN_DEF_UTC_TIME_CONSTRAINTS = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 @@ -47,7 +47,7 @@ asn_TYPE_descriptor_t asn_DEF_UTCTime = { asn_DEF_UTCTime_tags, sizeof(asn_DEF_UTCTime_tags) / sizeof(asn_DEF_UTCTime_tags[0]), - &asn_DEF_UTCTime_constraints, + &ASN_DEF_UTC_TIME_CONSTRAINTS, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/UTCTime.h b/src/core/libs/supl/asn-supl/UTCTime.h index 53517fde6..c8e73785c 100644 --- a/src/core/libs/supl/asn-supl/UTCTime.h +++ b/src/core/libs/supl/asn-supl/UTCTime.h @@ -27,10 +27,10 @@ extern "C" struct tm; /* */ /* See asn_GT2time() in GeneralizedTime.h */ - time_t asn_UT2time(const UTCTime_t *, struct tm *_optional_tm4fill, int as_gmt); + time_t asn_UT2time(const UTCTime_t * /*st*/, struct tm *_tm, int as_gmt); /* See asn_time2GT() in GeneralizedTime.h */ - UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm *, int force_gmt); + UTCTime_t *asn_time2UT(UTCTime_t *__opt_ut, const struct tm * /*tm*/, int force_gmt); #ifdef __cplusplus } diff --git a/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.c b/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.c index 77b24d619..9c735eee3 100644 --- a/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.c +++ b/src/core/libs/supl/asn-supl/UTRA-CarrierRSSI.c @@ -111,7 +111,7 @@ UTRA_CarrierRSSI_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_UTRA_CarrierRSSI_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_UTRA_CARRIER_RSSI_CONSTR_1 = { { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -138,7 +138,7 @@ asn_TYPE_descriptor_t asn_DEF_UTRA_CarrierRSSI = { asn_DEF_UTRA_CarrierRSSI_tags_1, /* Same as above */ sizeof(asn_DEF_UTRA_CarrierRSSI_tags_1) /sizeof(asn_DEF_UTRA_CarrierRSSI_tags_1[0]), /* 1 */ - &asn_PER_type_UTRA_CarrierRSSI_constr_1, + &ASN_PER_TYPE_UTRA_CARRIER_RSSI_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/UlpMessage.c b/src/core/libs/supl/asn-supl/UlpMessage.c index d27e05d04..8953cf17a 100644 --- a/src/core/libs/supl/asn-supl/UlpMessage.c +++ b/src/core/libs/supl/asn-supl/UlpMessage.c @@ -6,7 +6,7 @@ #include "UlpMessage.h" -static asn_per_constraints_t asn_PER_type_UlpMessage_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_ULP_MESSAGE_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 3, 3, 0, 7 } /* (0..7,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -122,7 +122,7 @@ asn_TYPE_descriptor_t asn_DEF_UlpMessage = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_UlpMessage_constr_1, + &ASN_PER_TYPE_ULP_MESSAGE_CONSTR_1, asn_MBR_UlpMessage_1, 8, /* Elements count */ &asn_SPC_UlpMessage_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/Velocity.c b/src/core/libs/supl/asn-supl/Velocity.c index 67e4e4c66..59d08fb55 100644 --- a/src/core/libs/supl/asn-supl/Velocity.c +++ b/src/core/libs/supl/asn-supl/Velocity.c @@ -6,7 +6,7 @@ #include "Velocity.h" -static asn_per_constraints_t asn_PER_type_Velocity_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_VELOCITY_CONSTR_1 = { { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 3 } /* (0..3,...) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -82,7 +82,7 @@ asn_TYPE_descriptor_t asn_DEF_Velocity = { 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ - &asn_PER_type_Velocity_constr_1, + &ASN_PER_TYPE_VELOCITY_CONSTR_1, asn_MBR_Velocity_1, 4, /* Elements count */ &asn_SPC_Velocity_specs_1 /* Additional specs */ diff --git a/src/core/libs/supl/asn-supl/Ver.c b/src/core/libs/supl/asn-supl/Ver.c index 5c99a89fc..13a139987 100644 --- a/src/core/libs/supl/asn-supl/Ver.c +++ b/src/core/libs/supl/asn-supl/Ver.c @@ -131,7 +131,7 @@ Ver_encode_uper(asn_TYPE_descriptor_t *td, return td->uper_encoder(td, constraints, structure, per_out); } -static asn_per_constraints_t asn_PER_type_Ver_constr_1 = { +static asn_per_constraints_t ASN_PER_TYPE_VER_CONSTR_1 = { {APC_UNCONSTRAINED, -1, -1, 0, 0}, {APC_CONSTRAINED, 0, 0, 64, 64} /* (SIZE(64..64)) */, 0, 0 /* No PER value map */ @@ -155,7 +155,7 @@ asn_TYPE_descriptor_t asn_DEF_Ver = { sizeof(asn_DEF_Ver_tags_1) / sizeof(asn_DEF_Ver_tags_1[0]), /* 1 */ asn_DEF_Ver_tags_1, /* Same as above */ sizeof(asn_DEF_Ver_tags_1) / sizeof(asn_DEF_Ver_tags_1[0]), /* 1 */ - &asn_PER_type_Ver_constr_1, + &ASN_PER_TYPE_VER_CONSTR_1, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/Version.c b/src/core/libs/supl/asn-supl/Version.c index 3f5d9b753..ebde033d9 100644 --- a/src/core/libs/supl/asn-supl/Version.c +++ b/src/core/libs/supl/asn-supl/Version.c @@ -81,17 +81,17 @@ memb_servind_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_maj_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_MAJ_CONSTR_2 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_min_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_MIN_CONSTR_3 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_servind_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_SERVIND_CONSTR_4 = { { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -102,7 +102,7 @@ static asn_TYPE_member_t asn_MBR_Version_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_maj_constraint_1, - &asn_PER_memb_maj_constr_2, + &ASN_PER_MEMB_MAJ_CONSTR_2, 0, "maj" }, @@ -111,7 +111,7 @@ static asn_TYPE_member_t asn_MBR_Version_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_min_constraint_1, - &asn_PER_memb_min_constr_3, + &ASN_PER_MEMB_MIN_CONSTR_3, 0, "min" }, @@ -120,7 +120,7 @@ static asn_TYPE_member_t asn_MBR_Version_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_servind_constraint_1, - &asn_PER_memb_servind_constr_4, + &ASN_PER_MEMB_SERVIND_CONSTR_4, 0, "servind" }, diff --git a/src/core/libs/supl/asn-supl/VisibleString.c b/src/core/libs/supl/asn-supl/VisibleString.c index 3487b6f93..8ef827f35 100644 --- a/src/core/libs/supl/asn-supl/VisibleString.c +++ b/src/core/libs/supl/asn-supl/VisibleString.c @@ -12,7 +12,7 @@ static ber_tlv_tag_t asn_DEF_VisibleString_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */ }; -static asn_per_constraints_t asn_DEF_VisibleString_constraints = { +static asn_per_constraints_t ASN_DEF_VISIBLE_STRING_CONSTRAINTS = { { APC_CONSTRAINED, 7, 7, 0x20, 0x7e }, /* Value */ { APC_SEMI_CONSTRAINED, -1, -1, 0, 0 }, /* Size */ 0, 0 @@ -36,7 +36,7 @@ asn_TYPE_descriptor_t asn_DEF_VisibleString = { asn_DEF_VisibleString_tags, sizeof(asn_DEF_VisibleString_tags) / sizeof(asn_DEF_VisibleString_tags[0]), - &asn_DEF_VisibleString_constraints, + &ASN_DEF_VISIBLE_STRING_CONSTRAINTS, 0, 0, /* No members */ 0 /* No specifics */ }; diff --git a/src/core/libs/supl/asn-supl/WcdmaCellInformation.c b/src/core/libs/supl/asn-supl/WcdmaCellInformation.c index d4561099c..bc5b17d0f 100644 --- a/src/core/libs/supl/asn-supl/WcdmaCellInformation.c +++ b/src/core/libs/supl/asn-supl/WcdmaCellInformation.c @@ -106,22 +106,22 @@ memb_primaryScramblingCode_constraint_1(asn_TYPE_descriptor_t *td, const void *s } } -static asn_per_constraints_t asn_PER_memb_refMCC_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_MCC_CONSTR_2 = { { APC_CONSTRAINED, 10, 10, 0, 999 } /* (0..999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refMNC_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_MNC_CONSTR_3 = { { APC_CONSTRAINED, 10, 10, 0, 999 } /* (0..999) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_refUC_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_REF_UC_CONSTR_4 = { { APC_CONSTRAINED, 28, -1, 0, 268435455 } /* (0..268435455) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_primaryScramblingCode_constr_6 = { +static asn_per_constraints_t ASN_PER_MEMB_PRIMARY_SCRAMBLING_CODE_CONSTR_6 = { { APC_CONSTRAINED, 9, 9, 0, 511 } /* (0..511) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -132,7 +132,7 @@ static asn_TYPE_member_t asn_MBR_WcdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refMCC_constraint_1, - &asn_PER_memb_refMCC_constr_2, + &ASN_PER_MEMB_REF_MCC_CONSTR_2, 0, "refMCC" }, @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_WcdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refMNC_constraint_1, - &asn_PER_memb_refMNC_constr_3, + &ASN_PER_MEMB_REF_MNC_CONSTR_3, 0, "refMNC" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_WcdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_refUC_constraint_1, - &asn_PER_memb_refUC_constr_4, + &ASN_PER_MEMB_REF_UC_CONSTR_4, 0, "refUC" }, @@ -168,7 +168,7 @@ static asn_TYPE_member_t asn_MBR_WcdmaCellInformation_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_primaryScramblingCode_constraint_1, - &asn_PER_memb_primaryScramblingCode_constr_6, + &ASN_PER_MEMB_PRIMARY_SCRAMBLING_CODE_CONSTR_6, 0, "primaryScramblingCode" }, diff --git a/src/core/libs/supl/asn-supl/XNavigationModel.c b/src/core/libs/supl/asn-supl/XNavigationModel.c index 4440f2557..9af4d5b13 100644 --- a/src/core/libs/supl/asn-supl/XNavigationModel.c +++ b/src/core/libs/supl/asn-supl/XNavigationModel.c @@ -106,22 +106,22 @@ memb_toeLimit_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, } } -static asn_per_constraints_t asn_PER_memb_gpsWeek_constr_2 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_WEEK_CONSTR_2 = { { APC_CONSTRAINED, 10, 10, 0, 1023 } /* (0..1023) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_gpsToe_constr_3 = { +static asn_per_constraints_t ASN_PER_MEMB_GPS_TOE_CONSTR_3 = { { APC_CONSTRAINED, 8, 8, 0, 167 } /* (0..167) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_nSAT_constr_4 = { +static asn_per_constraints_t ASN_PER_MEMB_N_SAT_CONSTR_4 = { { APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; -static asn_per_constraints_t asn_PER_memb_toeLimit_constr_5 = { +static asn_per_constraints_t ASN_PER_MEMB_TOE_LIMIT_CONSTR_5 = { { APC_CONSTRAINED, 4, 4, 0, 10 } /* (0..10) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ @@ -132,7 +132,7 @@ static asn_TYPE_member_t asn_MBR_XNavigationModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsWeek_constraint_1, - &asn_PER_memb_gpsWeek_constr_2, + &ASN_PER_MEMB_GPS_WEEK_CONSTR_2, 0, "gpsWeek" }, @@ -141,7 +141,7 @@ static asn_TYPE_member_t asn_MBR_XNavigationModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_gpsToe_constraint_1, - &asn_PER_memb_gpsToe_constr_3, + &ASN_PER_MEMB_GPS_TOE_CONSTR_3, 0, "gpsToe" }, @@ -150,7 +150,7 @@ static asn_TYPE_member_t asn_MBR_XNavigationModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_nSAT_constraint_1, - &asn_PER_memb_nSAT_constr_4, + &ASN_PER_MEMB_N_SAT_CONSTR_4, 0, "nSAT" }, @@ -159,7 +159,7 @@ static asn_TYPE_member_t asn_MBR_XNavigationModel_1[] = { -1, /* IMPLICIT tag at current level */ &asn_DEF_NativeInteger, memb_toeLimit_constraint_1, - &asn_PER_memb_toeLimit_constr_5, + &ASN_PER_MEMB_TOE_LIMIT_CONSTR_5, 0, "toeLimit" }, diff --git a/src/core/libs/supl/asn-supl/asn_codecs_prim.h b/src/core/libs/supl/asn-supl/asn_codecs_prim.h index cb8c37937..6ebaefb87 100644 --- a/src/core/libs/supl/asn-supl/asn_codecs_prim.h +++ b/src/core/libs/supl/asn-supl/asn_codecs_prim.h @@ -41,8 +41,8 @@ extern "C" * Also see xer_decode_general() in xer_decoder.h */ asn_dec_rval_t xer_decode_primitive(asn_codec_ctx_t *opt_codec_ctx, - asn_TYPE_descriptor_t *type_descriptor, - void **struct_ptr, size_t struct_size, + asn_TYPE_descriptor_t *td, + void **sptr, size_t struct_size, const char *opt_mname, const void *buf_ptr, size_t size, xer_primitive_body_decoder_f *prim_body_decoder); diff --git a/src/core/libs/supl/asn-supl/ber_decoder.h b/src/core/libs/supl/asn-supl/ber_decoder.h index 6a87fc23f..629aff043 100644 --- a/src/core/libs/supl/asn-supl/ber_decoder.h +++ b/src/core/libs/supl/asn-supl/ber_decoder.h @@ -23,7 +23,7 @@ extern "C" asn_dec_rval_t ber_decode(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, /* Pointer to a target structure's pointer */ - const void *buffer, /* Data to be decoded */ + const void *ptr, /* Data to be decoded */ size_t size /* Size of that buffer */ ); @@ -49,7 +49,7 @@ extern "C" */ asn_dec_rval_t ber_check_tags( struct asn_codec_ctx_s *opt_codec_ctx, /* codec options */ - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, asn_struct_ctx_t *opt_ctx, /* saved decoding context */ const void *ptr, size_t size, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ diff --git a/src/core/libs/supl/asn-supl/ber_tlv_tag.h b/src/core/libs/supl/asn-supl/ber_tlv_tag.h index 31b634345..fa4c7321c 100644 --- a/src/core/libs/supl/asn-supl/ber_tlv_tag.h +++ b/src/core/libs/supl/asn-supl/ber_tlv_tag.h @@ -33,8 +33,8 @@ extern "C" * (i.e. "[PRIVATE 0]"). * Return values correspond to their libc counterparts (if any). */ - ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t buflen); - ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE *); + ssize_t ber_tlv_tag_snprint(ber_tlv_tag_t tag, char *buf, size_t size); + ssize_t ber_tlv_tag_fwrite(ber_tlv_tag_t tag, FILE * /*f*/); char *ber_tlv_tag_string(ber_tlv_tag_t tag); diff --git a/src/core/libs/supl/asn-supl/constr_CHOICE.c b/src/core/libs/supl/asn-supl/constr_CHOICE.c index 75903fde7..1bf467254 100644 --- a/src/core/libs/supl/asn-supl/constr_CHOICE.c +++ b/src/core/libs/supl/asn-supl/constr_CHOICE.c @@ -63,8 +63,8 @@ /* * See the definitions. */ -static int _fetch_present_idx(const void *struct_ptr, int off, int size); -static void _set_present_idx(void *sptr, int offset, int size, int pres); +static int _fetch_present_idx(const void *struct_ptr, int pres_offset, int size); +static void _set_present_idx(void *struct_ptr, int offset, int size, int pres); /* * Tags are canonically sorted in the tag to member table. diff --git a/src/core/libs/supl/asn-supl/der_encoder.h b/src/core/libs/supl/asn-supl/der_encoder.h index 3eafbc281..059e83f70 100644 --- a/src/core/libs/supl/asn-supl/der_encoder.h +++ b/src/core/libs/supl/asn-supl/der_encoder.h @@ -53,7 +53,7 @@ extern "C" * Write out leading TL[v] sequence according to the type definition. */ ssize_t der_write_tags( - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *sd, size_t struct_length, int tag_mode, /* {-1,0,1}: IMPLICIT, no, EXPLICIT */ int last_tag_form, /* {0,!0}: prim, constructed */ diff --git a/src/core/libs/supl/asn-supl/per_decoder.h b/src/core/libs/supl/asn-supl/per_decoder.h index a28509464..4e410c5b2 100644 --- a/src/core/libs/supl/asn-supl/per_decoder.h +++ b/src/core/libs/supl/asn-supl/per_decoder.h @@ -20,8 +20,8 @@ extern "C" * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3. */ asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ + struct asn_TYPE_descriptor_s *td, /* Type to decode */ + void **sptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ ); @@ -31,8 +31,8 @@ extern "C" * WARNING: This call returns the number of BITS read from the stream. Beware. */ asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */ - void **struct_ptr, /* Pointer to a target structure's pointer */ + struct asn_TYPE_descriptor_s *td, /* Type to decode */ + void **sptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size, /* Size of data buffer */ int skip_bits, /* Number of unused leading bits, 0..7 */ diff --git a/src/core/libs/supl/asn-supl/per_encoder.h b/src/core/libs/supl/asn-supl/per_encoder.h index 896013095..3f931769d 100644 --- a/src/core/libs/supl/asn-supl/per_encoder.h +++ b/src/core/libs/supl/asn-supl/per_encoder.h @@ -21,8 +21,8 @@ extern "C" * field of the return value. Use the following formula to convert to bytes: * bytes = ((.encoded + 7) / 8) */ - asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + asn_enc_rval_t uper_encode(struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ asn_app_consume_bytes_f *consume_bytes_cb, /* Data collector */ void *app_key /* Arbitrary callback argument */ ); @@ -33,8 +33,8 @@ extern "C" * field of the return value. */ asn_enc_rval_t uper_encode_to_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ void *buffer, /* Pre-allocated buffer */ size_t buffer_size /* Initial buffer size (max) */ ); @@ -47,9 +47,9 @@ extern "C" * encoding of uper_encode() and uper_encode_to_buffer(). */ ssize_t uper_encode_to_new_buffer( - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, asn_per_constraints_t *constraints, - void *struct_ptr, /* Structure to be encoded */ + void *sptr, /* Structure to be encoded */ void **buffer_r /* Buffer allocated and returned */ ); diff --git a/src/core/libs/supl/asn-supl/per_support.h b/src/core/libs/supl/asn-supl/per_support.h index c99f12291..7ea76d331 100644 --- a/src/core/libs/supl/asn-supl/per_support.h +++ b/src/core/libs/supl/asn-supl/per_support.h @@ -56,24 +56,24 @@ extern "C" * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ - int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits); + int32_t per_get_few_bits(asn_per_data_t *pd, int get_nbits); /* Undo the immediately preceeding "get_few_bits" operation */ - void per_get_undo(asn_per_data_t *per_data, int get_nbits); + void per_get_undo(asn_per_data_t *pd, int get_nbits); /* * Extract a large number of bits from the specified PER data pointer. * This function returns -1 if the specified number of bits could not be * extracted due to EOD or other conditions. */ - int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align, + int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int alright, int get_nbits); /* * Get the length "n" from the Unaligned PER stream. */ ssize_t uper_get_length(asn_per_data_t *pd, - int effective_bound_bits, + int ebits, int *repeat); /* @@ -87,7 +87,7 @@ extern "C" ssize_t uper_get_nsnnwn(asn_per_data_t *pd); /* X.691-2008/11, #11.5.6 */ - int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *v, int nbits); + int uper_get_constrained_whole_number(asn_per_data_t *pd, unsigned long *out_value, int nbits); /* Non-thread-safe debugging function, don't use it */ char *per_data_string(asn_per_data_t *pd); @@ -107,7 +107,7 @@ extern "C" } asn_per_outp_t; /* Output a small number of bits (<= 31) */ - int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits); + int per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits); /* Output a large number of bits */ int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits); diff --git a/src/core/libs/supl/asn-supl/xer_decoder.h b/src/core/libs/supl/asn-supl/xer_decoder.h index 52444af51..02f62a0e1 100644 --- a/src/core/libs/supl/asn-supl/xer_decoder.h +++ b/src/core/libs/supl/asn-supl/xer_decoder.h @@ -18,7 +18,7 @@ extern "C" * The XER decoder of any ASN.1 type. May be invoked by the application. */ asn_dec_rval_t xer_decode(struct asn_codec_ctx_s *opt_codec_ctx, - struct asn_TYPE_descriptor_s *type_descriptor, + struct asn_TYPE_descriptor_s *td, void **struct_ptr, /* Pointer to a target structure's pointer */ const void *buffer, /* Data to be decoded */ size_t size /* Size of data buffer */ diff --git a/src/core/libs/supl/asn-supl/xer_encoder.h b/src/core/libs/supl/asn-supl/xer_encoder.h index 5b640d425..9cbd08102 100644 --- a/src/core/libs/supl/asn-supl/xer_encoder.h +++ b/src/core/libs/supl/asn-supl/xer_encoder.h @@ -25,8 +25,8 @@ extern "C" /* * The XER encoder of any type. May be invoked by the application. */ - asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *type_descriptor, - void *struct_ptr, /* Structure to be encoded */ + asn_enc_rval_t xer_encode(struct asn_TYPE_descriptor_s *td, + void *sptr, /* Structure to be encoded */ enum xer_encoder_flags_e xer_flags, asn_app_consume_bytes_f *consume_bytes_cb, void *app_key /* Arbitrary callback argument */ diff --git a/src/core/libs/supl/asn-supl/xer_support.h b/src/core/libs/supl/asn-supl/xer_support.h index 13d8bbd06..e28316d59 100644 --- a/src/core/libs/supl/asn-supl/xer_support.h +++ b/src/core/libs/supl/asn-supl/xer_support.h @@ -47,7 +47,7 @@ extern "C" * It will always be lesser than or equal to the specified _size. * The next invocation of this function must account the difference. */ - ssize_t pxml_parse(int *_stateContext, const void *_buf, size_t _size, + ssize_t pxml_parse(int *_stateContext, const void *xmlbuf, size_t _size, pxml_callback_f *cb, void *_key); #ifdef __cplusplus diff --git a/src/core/libs/supl/supl.c b/src/core/libs/supl/supl.c index 3722d1af0..0184f35ac 100644 --- a/src/core/libs/supl/supl.c +++ b/src/core/libs/supl/supl.c @@ -9,29 +9,29 @@ */ #include "supl.h" -#include +#include #include #include -#include +#include +#include +#include +#include #include #include -#include -#include -#include - #define PARAM_GSM_CELL_CURRENT 1 #define PARAM_GSM_CELL_KNOWN 2 #define PARAM_WCDMA_CELL_CURRENT 4 -#define OPTIONAL_MISSING ((void*)0) +#define OPTIONAL_MISSING ((void *)0) #ifdef SUPL_DEBUG -static struct supl_debug_s { - FILE *log; - int verbose_rrlp, verbose_supl, debug; - int sent,recv, out_msg, in_msg; +static struct supl_debug_s +{ + FILE *log; + int verbose_rrlp, verbose_supl, debug; + int sent, recv, out_msg, in_msg; } debug; #endif @@ -42,201 +42,242 @@ static int pdu_make_ulp_rrlp_ack(supl_ctx_t *ctx, supl_ulp_t *pdu, PDU_t *rrlp); static int supl_more_rrlp(PDU_t *rrlp); static int supl_response_harvest(supl_ctx_t *ctx, supl_ulp_t *pdu); -int EXPORT supl_ulp_decode(supl_ulp_t *pdu) { - ULP_PDU_t *ulp; - asn_codec_ctx_t ctx; - asn_dec_rval_t rval; +int EXPORT supl_ulp_decode(supl_ulp_t *pdu) +{ + ULP_PDU_t *ulp; + asn_codec_ctx_t ctx; + asn_dec_rval_t rval; - ulp = calloc(1, sizeof(ULP_PDU_t)); - pdu->pdu = ulp; + ulp = calloc(1, sizeof(ULP_PDU_t)); + pdu->pdu = ulp; - ctx.max_stack_size = 0; - rval = uper_decode_complete(&ctx, &asn_DEF_ULP_PDU, (void **)&ulp, pdu->buffer, pdu->size); - if (rval.code == RC_OK) { - return 0; - } + ctx.max_stack_size = 0; + rval = uper_decode_complete(&ctx, &asn_DEF_ULP_PDU, (void **)&ulp, pdu->buffer, pdu->size); + if (rval.code == RC_OK) + { + return 0; + } - free(ulp); - pdu->pdu = 0; + free(ulp); + pdu->pdu = 0; - return E_SUPL_DECODE; + return E_SUPL_DECODE; } -int EXPORT supl_ulp_encode(supl_ulp_t *pdu) { - asn_enc_rval_t ret; - int pdu_len; - ret = uper_encode_to_buffer(&asn_DEF_ULP_PDU, pdu->pdu, pdu->buffer, sizeof(pdu->buffer)); - if (ret.encoded != -1) { - memset(pdu->buffer, 0, sizeof(pdu->buffer)); - - pdu_len = (ret.encoded + 7) >> 3; - ((ULP_PDU_t *)pdu->pdu)->length = pdu_len; +int EXPORT supl_ulp_encode(supl_ulp_t *pdu) +{ + asn_enc_rval_t ret; + int pdu_len; ret = uper_encode_to_buffer(&asn_DEF_ULP_PDU, pdu->pdu, pdu->buffer, sizeof(pdu->buffer)); - if (ret.encoded > 0) { - int len = (ret.encoded + 7) >> 3; + if (ret.encoded != -1) + { + memset(pdu->buffer, 0, sizeof(pdu->buffer)); - if (len == pdu_len) { - pdu->size = pdu_len; - return 0; - } - } - } + pdu_len = (ret.encoded + 7) >> 3; + ((ULP_PDU_t *)pdu->pdu)->length = pdu_len; - return E_SUPL_ENCODE; + ret = uper_encode_to_buffer(&asn_DEF_ULP_PDU, pdu->pdu, pdu->buffer, sizeof(pdu->buffer)); + if (ret.encoded > 0) + { + int len = (ret.encoded + 7) >> 3; + + if (len == pdu_len) + { + pdu->size = pdu_len; + return 0; + } + } + } + + return E_SUPL_ENCODE; } -void EXPORT supl_ulp_free(supl_ulp_t *pdu) { - asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, pdu->pdu, 0); + +void EXPORT supl_ulp_free(supl_ulp_t *pdu) +{ + asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, pdu->pdu, 0); } -int EXPORT supl_ulp_send(supl_ctx_t *ctx, supl_ulp_t *pdu) { - int err; + +int EXPORT supl_ulp_send(supl_ctx_t *ctx, supl_ulp_t *pdu) +{ + int err; #if SUPL_DEBUG - if (debug.verbose_supl) { - fprintf(debug.log, "Send %lu bytes\n", pdu->size); - xer_fprint(debug.log, &asn_DEF_ULP_PDU, pdu->pdu); - } + if (debug.verbose_supl) + { + fprintf(debug.log, "Send %lu bytes\n", pdu->size); + xer_fprint(debug.log, &asn_DEF_ULP_PDU, pdu->pdu); + } #endif - err = SSL_write(ctx->ssl, pdu->buffer, pdu->size); - if (err <= 0) { + err = SSL_write(ctx->ssl, pdu->buffer, pdu->size); + if (err <= 0) + { #if SUPL_DEBUG - if (debug.debug) fprintf(debug.log, "Error: SSL_write error: %s\n", strerror(errno)); + if (debug.debug) fprintf(debug.log, "Error: SSL_write error: %s\n", strerror(errno)); #endif - return E_SUPL_WRITE; - } + return E_SUPL_WRITE; + } #ifdef SUPL_DEBUG - debug.sent += pdu->size; - debug.out_msg++; + debug.sent += pdu->size; + debug.out_msg++; #endif - return 0; -} - -int EXPORT supl_ulp_recv(supl_ctx_t *ctx, supl_ulp_t *pdu) { - int err; - int n; - asn_dec_rval_t rval; - ULP_PDU_t *length; - - err = SSL_read(ctx->ssl, pdu->buffer, sizeof(pdu->buffer)); - if (err <= 0) { -#ifdef SUPL_DEBUG - if (debug.debug) fprintf(debug.log, "Error: SSL_read error: %s\n", strerror(errno)); -#endif - return E_SUPL_READ; - } - n = err; - - length = calloc(1, sizeof(ULP_PDU_t)); - // decode the very first bytes of the ULP_PDU message, just enough to the get message length - rval = uper_decode_complete(0, &asn_DEF_ULP_PDU, (void **)&length, pdu->buffer, n < 6 ? n : 6); - if (rval.code == RC_WMORE) { - // read the missing data - for (n = err; n < length->length; n += err) { -#ifdef SUPL_DEBUG - if (debug.debug) fprintf(debug.log, "SSL_read got %u bytes (total %lu)\n", n, length->length); -#endif - err = SSL_read(ctx->ssl, &pdu->buffer[n], sizeof(pdu->buffer)-n); - if (err <= 0) { -#ifdef SUPL_DEBUG - if (debug.debug) fprintf(debug.log, "Error: SSL_read (again) error: %s\n", strerror(errno)); -#endif - return E_SUPL_READ; - } - } - } - - asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, length, 0); - - pdu->size = n; - - if (supl_ulp_decode(pdu)) { - return E_SUPL_DECODE; - } - -#ifdef SUPL_DEBUG - if (debug.verbose_supl) { - fprintf(debug.log, "Recv %lu bytes\n", pdu->size); - xer_fprint(debug.log, &asn_DEF_ULP_PDU, pdu->pdu); - } -#endif - -#ifdef SUPL_DEBUG - debug.recv += err; - debug.in_msg++; -#endif - - return 0; -} - -int EXPORT supl_decode_rrlp(supl_ulp_t *ulp_pdu, PDU_t **ret_rrlp) { - asn_dec_rval_t rval; - OCTET_STRING_t *rrlp_pdu; - PDU_t *rrlp; - ULP_PDU_t *ulp; - - ulp = ulp_pdu->pdu; - - if (!(ulp->message.present == UlpMessage_PR_msSUPLPOS && - ulp->message.choice.msSUPLPOS.posPayLoad.present == PosPayLoad_PR_rrlpPayload)) { return 0; - } - rrlp_pdu = &ulp->message.choice.msSUPLPOS.posPayLoad.choice.rrlpPayload; - - rrlp = calloc(1, sizeof(PDU_t)); - rval = uper_decode_complete(0, &asn_DEF_PDU, (void **)&rrlp, rrlp_pdu->buf, rrlp_pdu->size); - switch (rval.code) { - case RC_OK: -#ifdef SUPL_DEBUG - if (rval.consumed != rrlp_pdu->size) { - if (debug.debug) fprintf(debug.log, "Warning: %lu bytes left over in RRLP decoding\n", rval.consumed); - } -#endif - - *ret_rrlp = rrlp; - return 0; - - case RC_WMORE: - asn_DEF_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); - ret_rrlp = 0; - return E_SUPL_DECODE_RRLP; - - default: - asn_DEF_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); - ret_rrlp = 0; - return E_SUPL_DECODE_RRLP; - } - - return E_SUPL_INTERNAL; } -int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) { - int err; - SSL_METHOD *meth; - SSLeay_add_ssl_algorithms(); - // meth = TLSv1_client_method(); - meth = (SSL_METHOD*)SSLv23_client_method(); - SSL_load_error_strings(); - ctx->ssl_ctx = SSL_CTX_new(meth); - if (!ctx->ssl_ctx) return E_SUPL_CONNECT; +int EXPORT supl_ulp_recv(supl_ctx_t *ctx, supl_ulp_t *pdu) +{ + int err; + int n; + asn_dec_rval_t rval; + ULP_PDU_t *length; - ctx->ssl = SSL_new(ctx->ssl_ctx); - if (!ctx->ssl) return E_SUPL_CONNECT; + err = SSL_read(ctx->ssl, pdu->buffer, sizeof(pdu->buffer)); + if (err <= 0) + { +#ifdef SUPL_DEBUG + if (debug.debug) fprintf(debug.log, "Error: SSL_read error: %s\n", strerror(errno)); +#endif + return E_SUPL_READ; + } + n = err; - if (server) { - ctx->fd = server_connect(server); - if (ctx->fd == -1) return E_SUPL_CONNECT; - } + length = calloc(1, sizeof(ULP_PDU_t)); + // decode the very first bytes of the ULP_PDU message, just enough to the get message length + rval = uper_decode_complete(0, &asn_DEF_ULP_PDU, (void **)&length, pdu->buffer, n < 6 ? n : 6); + if (rval.code == RC_WMORE) + { + // read the missing data + for (n = err; n < length->length; n += err) + { +#ifdef SUPL_DEBUG + if (debug.debug) fprintf(debug.log, "SSL_read got %u bytes (total %lu)\n", n, length->length); +#endif + err = SSL_read(ctx->ssl, &pdu->buffer[n], sizeof(pdu->buffer) - n); + if (err <= 0) + { +#ifdef SUPL_DEBUG + if (debug.debug) fprintf(debug.log, "Error: SSL_read (again) error: %s\n", strerror(errno)); +#endif + return E_SUPL_READ; + } + } + } - SSL_set_fd(ctx->ssl, ctx->fd); - err = SSL_connect(ctx->ssl); - if (err == -1) return E_SUPL_CONNECT; + asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, length, 0); + + pdu->size = n; + + if (supl_ulp_decode(pdu)) + { + return E_SUPL_DECODE; + } + +#ifdef SUPL_DEBUG + if (debug.verbose_supl) + { + fprintf(debug.log, "Recv %lu bytes\n", pdu->size); + xer_fprint(debug.log, &asn_DEF_ULP_PDU, pdu->pdu); + } +#endif + +#ifdef SUPL_DEBUG + debug.recv += err; + debug.in_msg++; +#endif + + return 0; +} + + +int EXPORT supl_decode_rrlp(supl_ulp_t *ulp_pdu, PDU_t **ret_rrlp) +{ + asn_dec_rval_t rval; + OCTET_STRING_t *rrlp_pdu; + PDU_t *rrlp; + ULP_PDU_t *ulp; + + ulp = ulp_pdu->pdu; + + if (!(ulp->message.present == UlpMessage_PR_msSUPLPOS && + ulp->message.choice.msSUPLPOS.posPayLoad.present == PosPayLoad_PR_rrlpPayload)) + { + return 0; + } + rrlp_pdu = &ulp->message.choice.msSUPLPOS.posPayLoad.choice.rrlpPayload; + + rrlp = calloc(1, sizeof(PDU_t)); + rval = uper_decode_complete(0, &asn_DEF_PDU, (void **)&rrlp, rrlp_pdu->buf, rrlp_pdu->size); + switch (rval.code) + { + case RC_OK: +#ifdef SUPL_DEBUG + if (rval.consumed != rrlp_pdu->size) + { + if (debug.debug) fprintf(debug.log, "Warning: %lu bytes left over in RRLP decoding\n", rval.consumed); + } +#endif + + *ret_rrlp = rrlp; + return 0; + + case RC_WMORE: + asn_DEF_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); + ret_rrlp = 0; + return E_SUPL_DECODE_RRLP; + + default: + asn_DEF_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); + ret_rrlp = 0; + return E_SUPL_DECODE_RRLP; + } + + return E_SUPL_INTERNAL; +} + + +int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) +{ + int err; + SSL_METHOD *meth; + + SSLeay_add_ssl_algorithms(); + // meth = TLSv1_client_method(); + meth = (SSL_METHOD *)SSLv23_client_method(); + SSL_load_error_strings(); + ctx->ssl_ctx = SSL_CTX_new(meth); + if (!ctx->ssl_ctx) + { + return E_SUPL_CONNECT; + } + + ctx->ssl = SSL_new(ctx->ssl_ctx); + if (!ctx->ssl) + { + return E_SUPL_CONNECT; + } + + if (server) + { + ctx->fd = server_connect(server); + if (ctx->fd == -1) + { + return E_SUPL_CONNECT; + } + } + + SSL_set_fd(ctx->ssl, ctx->fd); + err = SSL_connect(ctx->ssl); + if (err == -1) + { + return E_SUPL_CONNECT; + } #if 0 { @@ -249,314 +290,351 @@ int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server) { } #endif - return 0; -} - -void EXPORT supl_close(supl_ctx_t *ctx) { - SSL_shutdown(ctx->ssl); - SSL_free(ctx->ssl); - SSL_CTX_free(ctx->ssl_ctx); - close(ctx->fd); + return 0; } -static int server_connect(char *server) { - int fd = -1; - struct addrinfo *ailist, *aip; - struct addrinfo hint; - int err; - - memset(&hint, 0, sizeof(struct addrinfo)); - hint.ai_socktype = SOCK_STREAM; - err = getaddrinfo(server, SUPL_PORT, &hint, &ailist); - if (err != 0) { - return -1; - } - - for (aip = ailist; aip; aip = aip->ai_next) { - if ((fd = socket(aip->ai_family, SOCK_STREAM, 0)) < 0) { - err = errno; - } - if (connect(fd, aip->ai_addr, aip->ai_addrlen) != 0) { - return -1; - } - break; - } - - return fd; +void EXPORT supl_close(supl_ctx_t *ctx) +{ + SSL_shutdown(ctx->ssl); + SSL_free(ctx->ssl); + SSL_CTX_free(ctx->ssl_ctx); + close(ctx->fd); } -static int pdu_make_ulp_start(supl_ctx_t *ctx, supl_ulp_t *pdu) { - ULP_PDU_t *ulp; - SetSessionID_t *session_id; - int err; - ulp = calloc(1, sizeof(ULP_PDU_t)); - session_id = calloc(1, sizeof(SetSessionID_t)); +static int server_connect(char *server) +{ + int fd = -1; + struct addrinfo *ailist, *aip; + struct addrinfo hint; + int err; - ulp->length = 0; - ulp->version.maj = 1; - ulp->version.min = 0; - ulp->version.servind = 0; + memset(&hint, 0, sizeof(struct addrinfo)); + hint.ai_socktype = SOCK_STREAM; + err = getaddrinfo(server, SUPL_PORT, &hint, &ailist); + if (err != 0) + { + return -1; + } - session_id->sessionId = 1; - // session_id->setId.present = SETId_PR_msisdn; - // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); - session_id->setId.present = SETId_PR_imsi; - (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); + for (aip = ailist; aip; aip = aip->ai_next) + { + if ((fd = socket(aip->ai_family, SOCK_STREAM, 0)) < 0) + { + err = errno; + } + if (connect(fd, aip->ai_addr, aip->ai_addrlen) != 0) + { + return -1; + } + break; + } - ulp->sessionID.setSessionID = session_id; - ulp->sessionID.slpSessionID = OPTIONAL_MISSING; - - ulp->message.present = UlpMessage_PR_msSUPLSTART; - ulp->message.choice.msSUPLSTART.sETCapabilities.posTechnology.agpsSETBased = 1; - // (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.sETCapabilities.prefMethod, PrefMethod_noPreference); - (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.sETCapabilities.prefMethod, PrefMethod_agpsSETBasedPreferred); - ulp->message.choice.msSUPLSTART.sETCapabilities.posProtocol.rrlp = 1; - - if (ctx->p.set & PARAM_GSM_CELL_CURRENT) { - ulp->message.choice.msSUPLSTART.locationId.cellInfo.present = CellInfo_PR_gsmCell; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refMCC = ctx->p.gsm.mcc; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refMNC = ctx->p.gsm.mnc; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refLAC = ctx->p.gsm.lac; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refCI = ctx->p.gsm.ci; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.nMR = OPTIONAL_MISSING; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.tA = OPTIONAL_MISSING; - } else if (ctx->p.set & PARAM_WCDMA_CELL_CURRENT) { - ulp->message.choice.msSUPLSTART.locationId.cellInfo.present = CellInfo_PR_wcdmaCell; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refMCC = ctx->p.wcdma.mcc; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refMNC = ctx->p.wcdma.mnc; - ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refUC = ctx->p.wcdma.uc; - } - - (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.locationId.status, Status_current); - - ulp->message.choice.msSUPLSTART.qoP = OPTIONAL_MISSING; - - pdu->pdu = ulp; - - err = supl_ulp_encode(pdu); - if (err < 0) { - asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, ulp, 0); - return err; - } - - return 0; + return fd; } + +static int pdu_make_ulp_start(supl_ctx_t *ctx, supl_ulp_t *pdu) +{ + ULP_PDU_t *ulp; + SetSessionID_t *session_id; + int err; + + ulp = calloc(1, sizeof(ULP_PDU_t)); + session_id = calloc(1, sizeof(SetSessionID_t)); + + ulp->length = 0; + ulp->version.maj = 1; + ulp->version.min = 0; + ulp->version.servind = 0; + + session_id->sessionId = 1; + // session_id->setId.present = SETId_PR_msisdn; + // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); + session_id->setId.present = SETId_PR_imsi; + (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); + + ulp->sessionID.setSessionID = session_id; + ulp->sessionID.slpSessionID = OPTIONAL_MISSING; + + ulp->message.present = UlpMessage_PR_msSUPLSTART; + ulp->message.choice.msSUPLSTART.sETCapabilities.posTechnology.agpsSETBased = 1; + // (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.sETCapabilities.prefMethod, PrefMethod_noPreference); + (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.sETCapabilities.prefMethod, PrefMethod_agpsSETBasedPreferred); + ulp->message.choice.msSUPLSTART.sETCapabilities.posProtocol.rrlp = 1; + + if (ctx->p.set & PARAM_GSM_CELL_CURRENT) + { + ulp->message.choice.msSUPLSTART.locationId.cellInfo.present = CellInfo_PR_gsmCell; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refMCC = ctx->p.gsm.mcc; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refMNC = ctx->p.gsm.mnc; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refLAC = ctx->p.gsm.lac; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.refCI = ctx->p.gsm.ci; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.nMR = OPTIONAL_MISSING; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.gsmCell.tA = OPTIONAL_MISSING; + } + else if (ctx->p.set & PARAM_WCDMA_CELL_CURRENT) + { + ulp->message.choice.msSUPLSTART.locationId.cellInfo.present = CellInfo_PR_wcdmaCell; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refMCC = ctx->p.wcdma.mcc; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refMNC = ctx->p.wcdma.mnc; + ulp->message.choice.msSUPLSTART.locationId.cellInfo.choice.wcdmaCell.refUC = ctx->p.wcdma.uc; + } + + (void)asn_long2INTEGER(&ulp->message.choice.msSUPLSTART.locationId.status, Status_current); + + ulp->message.choice.msSUPLSTART.qoP = OPTIONAL_MISSING; + + pdu->pdu = ulp; + + err = supl_ulp_encode(pdu); + if (err < 0) + { + asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, ulp, 0); + return err; + } + + return 0; +} + + // get slpSessionID from SUPLRESPONSE pdu if preset -static int supl_response_harvest(supl_ctx_t *ctx, supl_ulp_t *pdu) { - int ret; - ULP_PDU_t *ulp = pdu->pdu; - void *buf; +static int supl_response_harvest(supl_ctx_t *ctx, supl_ulp_t *pdu) +{ + int ret; + ULP_PDU_t *ulp = pdu->pdu; + void *buf; - ctx->slp_session_id.buf = 0; + ctx->slp_session_id.buf = 0; - ret = uper_encode_to_new_buffer(&asn_DEF_SlpSessionID, 0, (void *)ulp->sessionID.slpSessionID, &buf); - if (ret == -1) return -1; + ret = uper_encode_to_new_buffer(&asn_DEF_SlpSessionID, 0, (void *)ulp->sessionID.slpSessionID, &buf); + if (ret == -1) + { + return -1; + } - ctx->slp_session_id.buf = buf; - ctx->slp_session_id.size = ret; + ctx->slp_session_id.buf = buf; + ctx->slp_session_id.size = ret; - return 0; + return 0; } -static int pdu_make_ulp_pos_init(supl_ctx_t *ctx, supl_ulp_t *pdu) { - int err; - ULP_PDU_t *ulp; - SetSessionID_t *session_id; - RequestedAssistData_t *req_adata; - ulp = calloc(1, sizeof(ULP_PDU_t)); - session_id = calloc(1, sizeof(SetSessionID_t)); - req_adata = calloc(1, sizeof(RequestedAssistData_t)); +static int pdu_make_ulp_pos_init(supl_ctx_t *ctx, supl_ulp_t *pdu) +{ + int err; + ULP_PDU_t *ulp; + SetSessionID_t *session_id; + RequestedAssistData_t *req_adata; - ulp->length = 0; - ulp->version.maj = 1; - ulp->version.min = 0; - ulp->version.servind = 0; + ulp = calloc(1, sizeof(ULP_PDU_t)); + session_id = calloc(1, sizeof(SetSessionID_t)); + req_adata = calloc(1, sizeof(RequestedAssistData_t)); - session_id->sessionId = 1; - // session_id->setId.present = SETId_PR_msisdn; - // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); - session_id->setId.present = SETId_PR_imsi; - (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); + ulp->length = 0; + ulp->version.maj = 1; + ulp->version.min = 0; + ulp->version.servind = 0; - ulp->sessionID.setSessionID = session_id; - // ulp->sessionID.slpSessionID = OPTIONAL_MISSING; - if (ctx->slp_session_id.buf) { - (void)uper_decode_complete(0, &asn_DEF_SlpSessionID, (void **)&ulp->sessionID.slpSessionID, ctx->slp_session_id.buf, ctx->slp_session_id.size); - } else { - ulp->sessionID.slpSessionID = OPTIONAL_MISSING; - } + session_id->sessionId = 1; + // session_id->setId.present = SETId_PR_msisdn; + // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); + session_id->setId.present = SETId_PR_imsi; + (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); - ulp->message.present = UlpMessage_PR_msSUPLPOSINIT; - ulp->message.choice.msSUPLPOSINIT.sETCapabilities.posTechnology.agpsSETBased = 1; - // (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.sETCapabilities.prefMethod, PrefMethod_noPreference); - (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.sETCapabilities.prefMethod, PrefMethod_agpsSETBasedPreferred); - ulp->message.choice.msSUPLPOSINIT.sETCapabilities.posProtocol.rrlp = 1; + ulp->sessionID.setSessionID = session_id; + // ulp->sessionID.slpSessionID = OPTIONAL_MISSING; + if (ctx->slp_session_id.buf) + { + (void)uper_decode_complete(0, &asn_DEF_SlpSessionID, (void **)&ulp->sessionID.slpSessionID, ctx->slp_session_id.buf, ctx->slp_session_id.size); + } + else + { + ulp->sessionID.slpSessionID = OPTIONAL_MISSING; + } - //GNSS-SDR mod - // Use ctx->p.request to swith between a pre-defined set of assistence data request - // reason: Some SUPL servers do not respond to Acquisition assistance depending on the status of other assistance flags + ulp->message.present = UlpMessage_PR_msSUPLPOSINIT; + ulp->message.choice.msSUPLPOSINIT.sETCapabilities.posTechnology.agpsSETBased = 1; + // (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.sETCapabilities.prefMethod, PrefMethod_noPreference); + (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.sETCapabilities.prefMethod, PrefMethod_agpsSETBasedPreferred); + ulp->message.choice.msSUPLPOSINIT.sETCapabilities.posProtocol.rrlp = 1; - switch (ctx->p.request) - { - case 0: //request almanac, time, and cell positions - req_adata->acquisitionAssistanceRequested = 0; // 1 - req_adata->navigationModelRequested = 0; // 1 - req_adata->referenceTimeRequested = 1; - req_adata->utcModelRequested = 1; //1 - req_adata->ionosphericModelRequested = 1; // 1 - req_adata->referenceLocationRequested = 1; - req_adata->almanacRequested = 1; - req_adata->realTimeIntegrityRequested = 1; // 1 - break; - case 1: // request Navigation Model (Ephemeris) - req_adata->acquisitionAssistanceRequested = 0; // 1 - req_adata->navigationModelRequested = 1; // 1 - req_adata->referenceTimeRequested = 1; - req_adata->utcModelRequested = 0; //1 - req_adata->ionosphericModelRequested = 0; // 1 - req_adata->referenceLocationRequested = 0; - req_adata->almanacRequested = 0; - req_adata->realTimeIntegrityRequested = 0; // 1 - break; - case 2: //request Acquisition assistance (Doppler assistance) - req_adata->acquisitionAssistanceRequested = 1; // 1 - req_adata->navigationModelRequested = 0; // 1 - req_adata->referenceTimeRequested = 1; - req_adata->utcModelRequested = 1; //1 - req_adata->ionosphericModelRequested = 1; // 1 - req_adata->referenceLocationRequested = 1; - req_adata->almanacRequested = 1; - req_adata->realTimeIntegrityRequested = 1; // 1 - break; - default: - req_adata->acquisitionAssistanceRequested = 0; // 1 - req_adata->navigationModelRequested = 0; // 1 - req_adata->referenceTimeRequested = 1; - req_adata->utcModelRequested = 1; //1 - req_adata->ionosphericModelRequested = 1; // 1 - req_adata->referenceLocationRequested = 1; - req_adata->almanacRequested = 1; - req_adata->realTimeIntegrityRequested = 1; // 1 - break; - } + //GNSS-SDR mod + // Use ctx->p.request to swith between a pre-defined set of assistence data request + // reason: Some SUPL servers do not respond to Acquisition assistance depending on the status of other assistance flags - ulp->message.choice.msSUPLPOSINIT.requestedAssistData = req_adata; + switch (ctx->p.request) + { + case 0: //request almanac, time, and cell positions + req_adata->acquisitionAssistanceRequested = 0; // 1 + req_adata->navigationModelRequested = 0; // 1 + req_adata->referenceTimeRequested = 1; + req_adata->utcModelRequested = 1; //1 + req_adata->ionosphericModelRequested = 1; // 1 + req_adata->referenceLocationRequested = 1; + req_adata->almanacRequested = 1; + req_adata->realTimeIntegrityRequested = 1; // 1 + break; + case 1: // request Navigation Model (Ephemeris) + req_adata->acquisitionAssistanceRequested = 0; // 1 + req_adata->navigationModelRequested = 1; // 1 + req_adata->referenceTimeRequested = 1; + req_adata->utcModelRequested = 0; //1 + req_adata->ionosphericModelRequested = 0; // 1 + req_adata->referenceLocationRequested = 0; + req_adata->almanacRequested = 0; + req_adata->realTimeIntegrityRequested = 0; // 1 + break; + case 2: //request Acquisition assistance (Doppler assistance) + req_adata->acquisitionAssistanceRequested = 1; // 1 + req_adata->navigationModelRequested = 0; // 1 + req_adata->referenceTimeRequested = 1; + req_adata->utcModelRequested = 1; //1 + req_adata->ionosphericModelRequested = 1; // 1 + req_adata->referenceLocationRequested = 1; + req_adata->almanacRequested = 1; + req_adata->realTimeIntegrityRequested = 1; // 1 + break; + default: + req_adata->acquisitionAssistanceRequested = 0; // 1 + req_adata->navigationModelRequested = 0; // 1 + req_adata->referenceTimeRequested = 1; + req_adata->utcModelRequested = 1; //1 + req_adata->ionosphericModelRequested = 1; // 1 + req_adata->referenceLocationRequested = 1; + req_adata->almanacRequested = 1; + req_adata->realTimeIntegrityRequested = 1; // 1 + break; + } - if (ctx->p.set & PARAM_GSM_CELL_CURRENT) { - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.present = CellInfo_PR_gsmCell; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refMCC = ctx->p.gsm.mcc; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refMNC = ctx->p.gsm.mnc; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refLAC = ctx->p.gsm.lac; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refCI = ctx->p.gsm.ci; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.nMR = OPTIONAL_MISSING; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.tA = OPTIONAL_MISSING; - } else if (ctx->p.set & PARAM_WCDMA_CELL_CURRENT) { - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.present = CellInfo_PR_wcdmaCell; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refMCC = ctx->p.wcdma.mcc; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refMNC = ctx->p.wcdma.mnc; - ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refUC = ctx->p.wcdma.uc; - } + ulp->message.choice.msSUPLPOSINIT.requestedAssistData = req_adata; - if (ctx->p.set & PARAM_GSM_CELL_KNOWN) { - Position_t *pos = calloc(1, sizeof(Position_t)); - struct tm *tm; - time_t t; + if (ctx->p.set & PARAM_GSM_CELL_CURRENT) + { + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.present = CellInfo_PR_gsmCell; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refMCC = ctx->p.gsm.mcc; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refMNC = ctx->p.gsm.mnc; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refLAC = ctx->p.gsm.lac; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.refCI = ctx->p.gsm.ci; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.nMR = OPTIONAL_MISSING; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.gsmCell.tA = OPTIONAL_MISSING; + } + else if (ctx->p.set & PARAM_WCDMA_CELL_CURRENT) + { + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.present = CellInfo_PR_wcdmaCell; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refMCC = ctx->p.wcdma.mcc; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refMNC = ctx->p.wcdma.mnc; + ulp->message.choice.msSUPLPOSINIT.locationId.cellInfo.choice.wcdmaCell.refUC = ctx->p.wcdma.uc; + } - (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.locationId.status, Status_stale); + if (ctx->p.set & PARAM_GSM_CELL_KNOWN) + { + Position_t *pos = calloc(1, sizeof(Position_t)); + struct tm *tm; + time_t t; - t = time(0); - tm = gmtime(&t); - asn_UT2time(&pos->timestamp, tm ,1); - (void)asn_long2INTEGER(&pos->positionEstimate.latitudeSign, latitudeSign_north); - pos->positionEstimate.latitude = (1 << 23) / 90.0 * ctx->p.known.lat; - pos->positionEstimate.longitude = (1 << 24) / 360.0 * ctx->p.known.lon; - // TODO: set position estimate + (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.locationId.status, Status_stale); - ulp->message.choice.msSUPLPOSINIT.position = pos; - } else { - (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.locationId.status, Status_current); - ulp->message.choice.msSUPLPOSINIT.position = OPTIONAL_MISSING; - } + t = time(0); + tm = gmtime(&t); + asn_UT2time(&pos->timestamp, tm, 1); + (void)asn_long2INTEGER(&pos->positionEstimate.latitudeSign, latitudeSign_north); + pos->positionEstimate.latitude = (1 << 23) / 90.0 * ctx->p.known.lat; + pos->positionEstimate.longitude = (1 << 24) / 360.0 * ctx->p.known.lon; + // TODO: set position estimate - ulp->message.choice.msSUPLPOSINIT.sUPLPOS = OPTIONAL_MISSING; + ulp->message.choice.msSUPLPOSINIT.position = pos; + } + else + { + (void)asn_long2INTEGER(&ulp->message.choice.msSUPLPOSINIT.locationId.status, Status_current); + ulp->message.choice.msSUPLPOSINIT.position = OPTIONAL_MISSING; + } - ulp->message.choice.msSUPLPOSINIT.ver = OPTIONAL_MISSING; + ulp->message.choice.msSUPLPOSINIT.sUPLPOS = OPTIONAL_MISSING; - pdu->pdu = ulp; + ulp->message.choice.msSUPLPOSINIT.ver = OPTIONAL_MISSING; - err = supl_ulp_encode(pdu); - if (err < 0) { - asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, ulp, 0); - return err; - } + pdu->pdu = ulp; - return 0; + err = supl_ulp_encode(pdu); + if (err < 0) + { + asn_DEF_ULP_PDU.free_struct(&asn_DEF_ULP_PDU, ulp, 0); + return err; + } + + return 0; } -static int pdu_make_ulp_rrlp_ack(supl_ctx_t *ctx, supl_ulp_t *pdu, PDU_t *rrlp) { - int err; - PDU_t *rrlp_ack; - ULP_PDU_t *ulp; - SetSessionID_t *session_id; - asn_enc_rval_t ret; - int pdu_len; - char buffer[1024]; - rrlp_ack = calloc(1, sizeof(PDU_t)); +static int pdu_make_ulp_rrlp_ack(supl_ctx_t *ctx, supl_ulp_t *pdu, PDU_t *rrlp) +{ + int err; + PDU_t *rrlp_ack; + ULP_PDU_t *ulp; + SetSessionID_t *session_id; + asn_enc_rval_t ret; + int pdu_len; + char buffer[1024]; - /* create RRLP assistanceDataAck */ + rrlp_ack = calloc(1, sizeof(PDU_t)); - rrlp_ack->referenceNumber = rrlp->referenceNumber; - rrlp_ack->component.present = RRLP_Component_PR_assistanceDataAck; + /* create RRLP assistanceDataAck */ - ret = uper_encode_to_buffer(&asn_DEF_PDU, rrlp_ack, buffer, sizeof(buffer)); - asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp_ack, 0); - if (ret.encoded == -1) { - return E_SUPL_ENCODE_RRLP; - } - pdu_len = (ret.encoded + 7) >> 3; + rrlp_ack->referenceNumber = rrlp->referenceNumber; + rrlp_ack->component.present = RRLP_Component_PR_assistanceDataAck; - /* embedded it in SUPLPOS */ + ret = uper_encode_to_buffer(&asn_DEF_PDU, rrlp_ack, buffer, sizeof(buffer)); + asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp_ack, 0); + if (ret.encoded == -1) + { + return E_SUPL_ENCODE_RRLP; + } + pdu_len = (ret.encoded + 7) >> 3; - ulp = calloc(1, sizeof(ULP_PDU_t)); - session_id = calloc(1, sizeof(SetSessionID_t)); + /* embedded it in SUPLPOS */ - ulp->length = 0; - ulp->version.maj = 1; - ulp->version.min = 0; - ulp->version.servind = 0; + ulp = calloc(1, sizeof(ULP_PDU_t)); + session_id = calloc(1, sizeof(SetSessionID_t)); - session_id->sessionId = 1; - // session_id->setId.present = SETId_PR_msisdn; - // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); - session_id->setId.present = SETId_PR_imsi; - (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); + ulp->length = 0; + ulp->version.maj = 1; + ulp->version.min = 0; + ulp->version.servind = 0; - ulp->sessionID.setSessionID = session_id; - // ulp->sessionID.slpSessionID = OPTIONAL_MISSING; - if (ctx->slp_session_id.buf) { - (void)uper_decode_complete(0, &asn_DEF_SlpSessionID, (void **)&ulp->sessionID.slpSessionID, ctx->slp_session_id.buf, ctx->slp_session_id.size); - } else { - ulp->sessionID.slpSessionID = OPTIONAL_MISSING; - } + session_id->sessionId = 1; + // session_id->setId.present = SETId_PR_msisdn; + // (void)OCTET_STRING_fromBuf(&session_id->setId.choice.msisdn, ctx->p.msisdn, 8); + session_id->setId.present = SETId_PR_imsi; + (void)OCTET_STRING_fromBuf(&session_id->setId.choice.imsi, ctx->p.msisdn, 8); - ulp->message.present = UlpMessage_PR_msSUPLPOS; - ulp->message.choice.msSUPLPOS.posPayLoad.present = PosPayLoad_PR_rrlpPayload; - (void)OCTET_STRING_fromBuf(&ulp->message.choice.msSUPLPOS.posPayLoad.choice.rrlpPayload, buffer, pdu_len); + ulp->sessionID.setSessionID = session_id; + // ulp->sessionID.slpSessionID = OPTIONAL_MISSING; + if (ctx->slp_session_id.buf) + { + (void)uper_decode_complete(0, &asn_DEF_SlpSessionID, (void **)&ulp->sessionID.slpSessionID, ctx->slp_session_id.buf, ctx->slp_session_id.size); + } + else + { + ulp->sessionID.slpSessionID = OPTIONAL_MISSING; + } - pdu->pdu = ulp; + ulp->message.present = UlpMessage_PR_msSUPLPOS; + ulp->message.choice.msSUPLPOS.posPayLoad.present = PosPayLoad_PR_rrlpPayload; + (void)OCTET_STRING_fromBuf(&ulp->message.choice.msSUPLPOS.posPayLoad.choice.rrlpPayload, buffer, pdu_len); - err = supl_ulp_encode(pdu); - if (err < 0) { - supl_ulp_free(pdu); - return err; - } + pdu->pdu = ulp; - return 0; + err = supl_ulp_encode(pdu); + if (err < 0) + { + supl_ulp_free(pdu); + return err; + } + + return 0; } /* @@ -564,132 +642,161 @@ static int pdu_make_ulp_rrlp_ack(supl_ctx_t *ctx, supl_ulp_t *pdu, PDU_t *rrlp) ** */ -int EXPORT supl_collect_rrlp(supl_assist_t *assist, PDU_t *rrlp, struct timeval *t) { - ControlHeader_t *hdr; +int EXPORT supl_collect_rrlp(supl_assist_t *assist, PDU_t *rrlp, struct timeval *t) +{ + ControlHeader_t *hdr; - if (rrlp->component.present != RRLP_Component_PR_assistanceData) return 0; - if (!rrlp->component.choice.assistanceData.gps_AssistData) return 0; + if (rrlp->component.present != RRLP_Component_PR_assistanceData) + { + return 0; + } + if (!rrlp->component.choice.assistanceData.gps_AssistData) + { + return 0; + } - hdr = &rrlp->component.choice.assistanceData.gps_AssistData->controlHeader; + hdr = &rrlp->component.choice.assistanceData.gps_AssistData->controlHeader; - if (hdr->referenceTime) { - assist->set |= SUPL_RRLP_ASSIST_REFTIME; - assist->time.gps_tow = hdr->referenceTime->gpsTime.gpsTOW23b; - assist->time.gps_week = hdr->referenceTime->gpsTime.gpsWeek; - memcpy(&assist->time.stamp, t, sizeof(struct timeval)); - } + if (hdr->referenceTime) + { + assist->set |= SUPL_RRLP_ASSIST_REFTIME; + assist->time.gps_tow = hdr->referenceTime->gpsTime.gpsTOW23b; + assist->time.gps_week = hdr->referenceTime->gpsTime.gpsWeek; + memcpy(&assist->time.stamp, t, sizeof(struct timeval)); + } - if (hdr->refLocation) { - OCTET_STRING_t *loc; + if (hdr->refLocation) + { + OCTET_STRING_t *loc; - loc = &hdr->refLocation->threeDLocation; - if (loc->size == 14 && loc->buf[0] == 0x90) { - double lat, lon; - long l; + loc = &hdr->refLocation->threeDLocation; + if (loc->size == 14 && loc->buf[0] == 0x90) + { + double lat, lon; + long l; - /* from 3GPP TS 23.032 V4.0.0 (2001-04) */ + /* from 3GPP TS 23.032 V4.0.0 (2001-04) */ - l = (loc->buf[1] & 0x7f) << 16 | - (loc->buf[2] << 8) | - loc->buf[3]; - if (loc->buf[1] & 0x80) l *= -1; - lat = 90.0 / (1 << 23) * l; + l = (loc->buf[1] & 0x7f) << 16 | + (loc->buf[2] << 8) | + loc->buf[3]; + if (loc->buf[1] & 0x80) + { + l *= -1; + } + lat = 90.0 / (1 << 23) * l; - l = (loc->buf[4] << 16) | - (loc->buf[5] << 8) | - loc->buf[6]; - lon = 360.0 / (1 << 24) * l; + l = (loc->buf[4] << 16) | + (loc->buf[5] << 8) | + loc->buf[6]; + lon = 360.0 / (1 << 24) * l; - /* max of uncertainty ellipsoid axis */ - /* uncert in meters = 10 * (1.1 ^ l - 1) */ - /* l == 96 => 100 km uncertainty => not usable */ - l = loc->buf[9]; - if (loc->buf[10] > l) l = loc->buf[10]; + /* max of uncertainty ellipsoid axis */ + /* uncert in meters = 10 * (1.1 ^ l - 1) */ + /* l == 96 => 100 km uncertainty => not usable */ + l = loc->buf[9]; + if (loc->buf[10] > l) + { + l = loc->buf[10]; + } - assist->set |= SUPL_RRLP_ASSIST_REFLOC; - assist->pos.lat = lat; - assist->pos.lon = lon; - assist->pos.uncertainty = l; - } - } + assist->set |= SUPL_RRLP_ASSIST_REFLOC; + assist->pos.lat = lat; + assist->pos.lon = lon; + assist->pos.uncertainty = l; + } + } - if (hdr->acquisAssist) { - int n; + if (hdr->acquisAssist) + { + int n; - assist->acq_time = hdr->acquisAssist->timeRelation.gpsTOW; + assist->acq_time = hdr->acquisAssist->timeRelation.gpsTOW; - for (n = 0; n < hdr->acquisAssist->acquisList.list.count; n++) { - struct AcquisElement *e = hdr->acquisAssist->acquisList.list.array[n]; - int i = assist->cnt_acq++; + for (n = 0; n < hdr->acquisAssist->acquisList.list.count; n++) + { + struct AcquisElement *e = hdr->acquisAssist->acquisList.list.array[n]; + int i = assist->cnt_acq++; - assist->acq[i].prn = e->svid + 1; - assist->acq[i].parts = 0; - assist->acq[i].doppler0 = e->doppler0; + assist->acq[i].prn = e->svid + 1; + assist->acq[i].parts = 0; + assist->acq[i].doppler0 = e->doppler0; - if (e->addionalDoppler) { - assist->acq[i].parts |= SUPL_ACQUIS_DOPPLER; - assist->acq[i].doppler1 = e->addionalDoppler->doppler1; - assist->acq[i].d_win = e->addionalDoppler->dopplerUncertainty; - } + if (e->addionalDoppler) + { + assist->acq[i].parts |= SUPL_ACQUIS_DOPPLER; + assist->acq[i].doppler1 = e->addionalDoppler->doppler1; + assist->acq[i].d_win = e->addionalDoppler->dopplerUncertainty; + } - assist->acq[i].code_ph = e->codePhase; - assist->acq[i].code_ph_int = e->intCodePhase; - assist->acq[i].bit_num = e->gpsBitNumber; - assist->acq[i].code_ph_win = e->codePhaseSearchWindow; + assist->acq[i].code_ph = e->codePhase; + assist->acq[i].code_ph_int = e->intCodePhase; + assist->acq[i].bit_num = e->gpsBitNumber; + assist->acq[i].code_ph_win = e->codePhaseSearchWindow; - if (e->addionalAngle) { - assist->acq[i].parts |= SUPL_ACQUIS_ANGLE; - assist->acq[i].az = e->addionalAngle->azimuth; - assist->acq[i].el = e->addionalAngle->elevation; - } - } - } + if (e->addionalAngle) + { + assist->acq[i].parts |= SUPL_ACQUIS_ANGLE; + assist->acq[i].az = e->addionalAngle->azimuth; + assist->acq[i].el = e->addionalAngle->elevation; + } + } + } - if (hdr->almanac) { - int n; + if (hdr->almanac) + { + int n; - for (n = 0; n < hdr->almanac->almanacList.list.count; n++) { - struct AlmanacElement *e = hdr->almanac->almanacList.list.array[n]; - int i = assist->cnt_alm++; + for (n = 0; n < hdr->almanac->almanacList.list.count; n++) + { + struct AlmanacElement *e = hdr->almanac->almanacList.list.array[n]; + int i = assist->cnt_alm++; - assist->alm[i].prn = e->satelliteID + 1; - assist->alm[i].e = e->almanacE; - assist->alm[i].toa = e->alamanacToa; // nice touch 3gpp - assist->alm[i].Ksii = e->almanacKsii; - assist->alm[i].OMEGA_dot = e->almanacOmegaDot; - assist->alm[i].A_sqrt = e->almanacAPowerHalf; - assist->alm[i].OMEGA_0 = e->almanacOmega0; - assist->alm[i].w = e->almanacW; - assist->alm[i].M0 = e->almanacM0; - assist->alm[i].AF0 = e->almanacAF0; - assist->alm[i].AF1 = e->almanacAF1; - } - } + assist->alm[i].prn = e->satelliteID + 1; + assist->alm[i].e = e->almanacE; + assist->alm[i].toa = e->alamanacToa; // nice touch 3gpp + assist->alm[i].Ksii = e->almanacKsii; + assist->alm[i].OMEGA_dot = e->almanacOmegaDot; + assist->alm[i].A_sqrt = e->almanacAPowerHalf; + assist->alm[i].OMEGA_0 = e->almanacOmega0; + assist->alm[i].w = e->almanacW; + assist->alm[i].M0 = e->almanacM0; + assist->alm[i].AF0 = e->almanacAF0; + assist->alm[i].AF1 = e->almanacAF1; + } + } - if (hdr->navigationModel) { - UncompressedEphemeris_t *ue; - int n; + if (hdr->navigationModel) + { + UncompressedEphemeris_t *ue; + int n; - for (n = 0; n < hdr->navigationModel->navModelList.list.count; n++) { - struct NavModelElement *e = hdr->navigationModel->navModelList.list.array[n]; - int i = assist->cnt_eph++; + for (n = 0; n < hdr->navigationModel->navModelList.list.count; n++) + { + struct NavModelElement *e = hdr->navigationModel->navModelList.list.array[n]; + int i = assist->cnt_eph++; - assist->eph[i].prn = e->satelliteID + 1; + assist->eph[i].prn = e->satelliteID + 1; - /* what is the difference between these two */ - ue = 0; - if (e->satStatus.present == SatStatus_PR_newNaviModelUC) - ue = &e->satStatus.choice.newNaviModelUC; - if (e->satStatus.present == SatStatus_PR_newSatelliteAndModelUC) - ue = &e->satStatus.choice.newSatelliteAndModelUC; + /* what is the difference between these two */ + ue = 0; + if (e->satStatus.present == SatStatus_PR_newNaviModelUC) + { + ue = &e->satStatus.choice.newNaviModelUC; + } + if (e->satStatus.present == SatStatus_PR_newSatelliteAndModelUC) + { + ue = &e->satStatus.choice.newSatelliteAndModelUC; + } - if (ue) { + if (ue) + { #if 0 assist->eph_x[i].L2P = ue->ephemL2Pflag; assist->eph_x[i].fit = ue->ephemFitFlag; #endif - assist->eph[i].delta_n = ue->ephemDeltaN; - assist->eph[i].M0 = ue->ephemM0; + assist->eph[i].delta_n = ue->ephemDeltaN; + assist->eph[i].M0 = ue->ephemM0; #if 0 // this is needed for asn1c version 0.9.22 { @@ -700,252 +807,288 @@ int EXPORT supl_collect_rrlp(supl_assist_t *assist, PDU_t *rrlp, struct timeval assist->eph[i].e = v; } #else - assist->eph[i].e = ue->ephemE; - assist->eph[i].A_sqrt = ue->ephemAPowerHalf; + assist->eph[i].e = ue->ephemE; + assist->eph[i].A_sqrt = ue->ephemAPowerHalf; #endif - assist->eph[i].OMEGA_0 = ue->ephemOmegaA0; - assist->eph[i].i0 = ue->ephemI0; - assist->eph[i].w = ue->ephemW; - assist->eph[i].OMEGA_dot = ue->ephemOmegaADot; - assist->eph[i].i_dot = ue->ephemIDot; - assist->eph[i].Cuc = ue->ephemCuc; - assist->eph[i].Cus = ue->ephemCus; - assist->eph[i].Crc = ue->ephemCrc; - assist->eph[i].Crs = ue->ephemCrs; - assist->eph[i].Cic = ue->ephemCic; - assist->eph[i].Cis = ue->ephemCis; - assist->eph[i].toe = ue->ephemToe; - assist->eph[i].IODC = ue->ephemIODC; - assist->eph[i].toc = ue->ephemToc; - assist->eph[i].AF0 = ue->ephemAF0; - assist->eph[i].AF1 = ue->ephemAF1; - assist->eph[i].AF2 = ue->ephemAF2; + assist->eph[i].OMEGA_0 = ue->ephemOmegaA0; + assist->eph[i].i0 = ue->ephemI0; + assist->eph[i].w = ue->ephemW; + assist->eph[i].OMEGA_dot = ue->ephemOmegaADot; + assist->eph[i].i_dot = ue->ephemIDot; + assist->eph[i].Cuc = ue->ephemCuc; + assist->eph[i].Cus = ue->ephemCus; + assist->eph[i].Crc = ue->ephemCrc; + assist->eph[i].Crs = ue->ephemCrs; + assist->eph[i].Cic = ue->ephemCic; + assist->eph[i].Cis = ue->ephemCis; + assist->eph[i].toe = ue->ephemToe; + assist->eph[i].IODC = ue->ephemIODC; + assist->eph[i].toc = ue->ephemToc; + assist->eph[i].AF0 = ue->ephemAF0; + assist->eph[i].AF1 = ue->ephemAF1; + assist->eph[i].AF2 = ue->ephemAF2; - assist->eph[i].nav_model = 1; - assist->eph[i].bits = ue->ephemCodeOnL2; - assist->eph[i].ura = ue->ephemURA; - assist->eph[i].health = ue->ephemSVhealth; - assist->eph[i].AODA = ue->ephemAODA; - assist->eph[i].tgd = ue->ephemTgd; - } - } - } + assist->eph[i].nav_model = 1; + assist->eph[i].bits = ue->ephemCodeOnL2; + assist->eph[i].ura = ue->ephemURA; + assist->eph[i].health = ue->ephemSVhealth; + assist->eph[i].AODA = ue->ephemAODA; + assist->eph[i].tgd = ue->ephemTgd; + } + } + } - if (hdr->ionosphericModel) { - assist->set |= SUPL_RRLP_ASSIST_IONO; - assist->iono.a0 = hdr->ionosphericModel->alfa0; - assist->iono.a1 = hdr->ionosphericModel->alfa1; - assist->iono.a2 = hdr->ionosphericModel->alfa2; - assist->iono.a3 = hdr->ionosphericModel->alfa3; //missed in original supl client - assist->iono.b0 = hdr->ionosphericModel->beta0; - assist->iono.b1 = hdr->ionosphericModel->beta1; - assist->iono.b2 = hdr->ionosphericModel->beta2; - assist->iono.b3 = hdr->ionosphericModel->beta3; - } + if (hdr->ionosphericModel) + { + assist->set |= SUPL_RRLP_ASSIST_IONO; + assist->iono.a0 = hdr->ionosphericModel->alfa0; + assist->iono.a1 = hdr->ionosphericModel->alfa1; + assist->iono.a2 = hdr->ionosphericModel->alfa2; + assist->iono.a3 = hdr->ionosphericModel->alfa3; //missed in original supl client + assist->iono.b0 = hdr->ionosphericModel->beta0; + assist->iono.b1 = hdr->ionosphericModel->beta1; + assist->iono.b2 = hdr->ionosphericModel->beta2; + assist->iono.b3 = hdr->ionosphericModel->beta3; + } - if (hdr->utcModel) { - assist->set |= SUPL_RRLP_ASSIST_UTC; - assist->utc.a0 = hdr->utcModel->utcA0; - assist->utc.a1 = hdr->utcModel->utcA1; - assist->utc.tot = hdr->utcModel->utcTot; - assist->utc.wnt = hdr->utcModel->utcWNt; - assist->utc.delta_tls = hdr->utcModel->utcDeltaTls; - assist->utc.wnlsf = hdr->utcModel->utcWNlsf; - assist->utc.dn = hdr->utcModel->utcDN; - assist->utc.delta_tlsf = hdr->utcModel->utcDeltaTlsf; - } + if (hdr->utcModel) + { + assist->set |= SUPL_RRLP_ASSIST_UTC; + assist->utc.a0 = hdr->utcModel->utcA0; + assist->utc.a1 = hdr->utcModel->utcA1; + assist->utc.tot = hdr->utcModel->utcTot; + assist->utc.wnt = hdr->utcModel->utcWNt; + assist->utc.delta_tls = hdr->utcModel->utcDeltaTls; + assist->utc.wnlsf = hdr->utcModel->utcWNlsf; + assist->utc.dn = hdr->utcModel->utcDN; + assist->utc.delta_tlsf = hdr->utcModel->utcDeltaTlsf; + } - return 1; + return 1; } -int EXPORT supl_ctx_new(supl_ctx_t *ctx) { - memset(ctx, 0, sizeof(supl_ctx_t)); + +int EXPORT supl_ctx_new(supl_ctx_t *ctx) +{ + memset(ctx, 0, sizeof(supl_ctx_t)); #ifdef SUPL_DEBUG - memset(&debug, 0, sizeof(struct supl_debug_s)); + memset(&debug, 0, sizeof(struct supl_debug_s)); #endif - return 0; + return 0; } -int EXPORT supl_ctx_free(supl_ctx_t *ctx) { - if (ctx->slp_session_id.buf) { - free(ctx->slp_session_id.buf); - ctx->slp_session_id.buf = 0; - } - return 0; +int EXPORT supl_ctx_free(supl_ctx_t *ctx) +{ + if (ctx->slp_session_id.buf) + { + free(ctx->slp_session_id.buf); + ctx->slp_session_id.buf = 0; + } + + return 0; } -static int supl_more_rrlp(PDU_t *rrlp) { - long value; - return (rrlp->component.present == RRLP_Component_PR_assistanceData && - rrlp->component.choice.assistanceData.moreAssDataToBeSent && - asn_INTEGER2long((INTEGER_t *)rrlp->component.choice.assistanceData.moreAssDataToBeSent, &value) == 0 && - value == MoreAssDataToBeSent_moreMessagesOnTheWay); +static int supl_more_rrlp(PDU_t *rrlp) +{ + long value; + + return (rrlp->component.present == RRLP_Component_PR_assistanceData && + rrlp->component.choice.assistanceData.moreAssDataToBeSent && + asn_INTEGER2long((INTEGER_t *)rrlp->component.choice.assistanceData.moreAssDataToBeSent, &value) == 0 && + value == MoreAssDataToBeSent_moreMessagesOnTheWay); } -int EXPORT supl_get_assist(supl_ctx_t *ctx, char *server, supl_assist_t *assist) { - supl_ulp_t ulp; - // memcpy(ctx->p.msisdn, "\xde\xad\xbe\xef\xf0\x0b\xaa\x42", 8); - memcpy(ctx->p.msisdn, "\xFF\xFF\x91\x94\x48\x45\x83\x98", 8); +int EXPORT supl_get_assist(supl_ctx_t *ctx, char *server, supl_assist_t *assist) +{ + supl_ulp_t ulp; - /* + // memcpy(ctx->p.msisdn, "\xde\xad\xbe\xef\xf0\x0b\xaa\x42", 8); + memcpy(ctx->p.msisdn, "\xFF\xFF\x91\x94\x48\x45\x83\x98", 8); + + /* ** connect to server */ - if (supl_server_connect(ctx, server) < 0) return E_SUPL_CONNECT; + if (supl_server_connect(ctx, server) < 0) + { + return E_SUPL_CONNECT; + } - /* + /* ** send SUPL_START */ - if (pdu_make_ulp_start(ctx, &ulp) < 0) { - return E_SUPL_ENCODE_START; - } + if (pdu_make_ulp_start(ctx, &ulp) < 0) + { + return E_SUPL_ENCODE_START; + } - (void)supl_ulp_send(ctx, &ulp); - supl_ulp_free(&ulp); + (void)supl_ulp_send(ctx, &ulp); + supl_ulp_free(&ulp); - /* + /* ** should receive SUPL_RESPONSE back */ - if (supl_ulp_recv(ctx, &ulp) < 0) { - return E_SUPL_RECV_RESPONSE; - } + if (supl_ulp_recv(ctx, &ulp) < 0) + { + return E_SUPL_RECV_RESPONSE; + } + + if (ulp.pdu->message.present != UlpMessage_PR_msSUPLRESPONSE) + { + supl_ulp_free(&ulp); + return E_SUPL_SUPLRESPONSE; + } + + // get and copy slpSessionID if present + supl_response_harvest(ctx, &ulp); - if (ulp.pdu->message.present != UlpMessage_PR_msSUPLRESPONSE) { supl_ulp_free(&ulp); - return E_SUPL_SUPLRESPONSE; - } - // get and copy slpSessionID if present - supl_response_harvest(ctx, &ulp); - - supl_ulp_free(&ulp); - - /* + /* ** send SUPL_POS_INIT */ - if (pdu_make_ulp_pos_init(ctx, &ulp) < 0) { - return E_SUPL_ENCODE_POSINIT; - } + if (pdu_make_ulp_pos_init(ctx, &ulp) < 0) + { + return E_SUPL_ENCODE_POSINIT; + } - (void)supl_ulp_send(ctx, &ulp); + (void)supl_ulp_send(ctx, &ulp); - /* + /* ** should get SUPLPOS back - bounce back and forth until all messages have arrived */ - memset(assist, 0, sizeof(supl_assist_t)); + memset(assist, 0, sizeof(supl_assist_t)); - while (1) { - struct timeval t; - PDU_t *rrlp; + while (1) + { + struct timeval t; + PDU_t *rrlp; + + supl_ulp_free(&ulp); + + /* record packet recv time */ + gettimeofday(&t, 0); + + if (supl_ulp_recv(ctx, &ulp) < 0) + { + return E_SUPL_RECV_SUPLPOS; + } + + if (ulp.pdu->message.present == UlpMessage_PR_msSUPLEND) + { + break; + } + + if (ulp.pdu->message.present != UlpMessage_PR_msSUPLPOS) + { + supl_ulp_free(&ulp); + return E_SUPL_SUPLPOS; + } + + /* get the beef, the RRLP payload */ + + if (supl_decode_rrlp(&ulp, &rrlp) < 0) + { + supl_ulp_free(&ulp); + return E_SUPL_DECODE_RRLP; + } + +#ifdef SUPL_DEBUG + if (debug.verbose_rrlp) + { + fprintf(debug.log, "Embedded RRLP message\n"); + xer_fprint(debug.log, &asn_DEF_PDU, rrlp); + } +#endif + + /* remember important stuff from it */ + + supl_collect_rrlp(assist, rrlp, &t); + + if (!supl_more_rrlp(rrlp)) + { + asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); + break; + } + + /* More data coming in, send SUPLPOS + RRLP ACK */ + + if (pdu_make_ulp_rrlp_ack(ctx, &ulp, rrlp) < 0) + { + return E_SUPL_RRLP_ACK; + } + + supl_ulp_send(ctx, &ulp); + asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); + } supl_ulp_free(&ulp); - /* record packet recv time */ - gettimeofday(&t, 0); - - if (supl_ulp_recv(ctx, &ulp) < 0) { - return E_SUPL_RECV_SUPLPOS; - } - - if (ulp.pdu->message.present == UlpMessage_PR_msSUPLEND) { - break; - } - - if (ulp.pdu->message.present != UlpMessage_PR_msSUPLPOS) { - supl_ulp_free(&ulp); - return E_SUPL_SUPLPOS; - } - - /* get the beef, the RRLP payload */ - - if (supl_decode_rrlp(&ulp, &rrlp) < 0) { - supl_ulp_free(&ulp); - return E_SUPL_DECODE_RRLP; - } - -#ifdef SUPL_DEBUG - if (debug.verbose_rrlp) { - fprintf(debug.log, "Embedded RRLP message\n"); - xer_fprint(debug.log, &asn_DEF_PDU, rrlp); - } -#endif - - /* remember important stuff from it */ - - supl_collect_rrlp(assist, rrlp, &t); - - if (!supl_more_rrlp(rrlp)) { - asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); - break; - } - - /* More data coming in, send SUPLPOS + RRLP ACK */ - - if (pdu_make_ulp_rrlp_ack(ctx, &ulp, rrlp) < 0) { - return E_SUPL_RRLP_ACK; - } - - supl_ulp_send(ctx, &ulp); - asn_DEF_ULP_PDU.free_struct(&asn_DEF_PDU, rrlp, 0); - } - - supl_ulp_free(&ulp); - - /* + /* ** send SUPL_END (but who really cares) */ - supl_close(ctx); + supl_close(ctx); - return 0; + return 0; } -void EXPORT supl_set_gsm_cell(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci) { - ctx->p.set |= PARAM_GSM_CELL_CURRENT; - ctx->p.gsm.mcc = mcc; - ctx->p.gsm.mnc = mns; - ctx->p.gsm.lac = lac; - ctx->p.gsm.ci = ci; +void EXPORT supl_set_gsm_cell(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci) +{ + ctx->p.set |= PARAM_GSM_CELL_CURRENT; + + ctx->p.gsm.mcc = mcc; + ctx->p.gsm.mnc = mns; + ctx->p.gsm.lac = lac; + ctx->p.gsm.ci = ci; } -void EXPORT supl_set_gsm_cell_known(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci, double lat, double lon, int uncert) { - ctx->p.set |= PARAM_GSM_CELL_KNOWN; - ctx->p.known.mcc = mcc; - ctx->p.known.mnc = mns; - ctx->p.known.lac = lac; - ctx->p.known.ci = ci; - ctx->p.known.lat = lat; - ctx->p.known.lon = lon; - ctx->p.known.uncert = uncert; +void EXPORT supl_set_gsm_cell_known(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci, double lat, double lon, int uncert) +{ + ctx->p.set |= PARAM_GSM_CELL_KNOWN; + + ctx->p.known.mcc = mcc; + ctx->p.known.mnc = mns; + ctx->p.known.lac = lac; + ctx->p.known.ci = ci; + ctx->p.known.lat = lat; + ctx->p.known.lon = lon; + ctx->p.known.uncert = uncert; } -void EXPORT supl_set_wcdma_cell(supl_ctx_t *ctx, int mcc, int mns, int uc) { - ctx->p.set |= PARAM_WCDMA_CELL_CURRENT; - ctx->p.wcdma.mcc = mcc; - ctx->p.wcdma.mnc = mns; - ctx->p.wcdma.uc = uc; +void EXPORT supl_set_wcdma_cell(supl_ctx_t *ctx, int mcc, int mns, int uc) +{ + ctx->p.set |= PARAM_WCDMA_CELL_CURRENT; + + ctx->p.wcdma.mcc = mcc; + ctx->p.wcdma.mnc = mns; + ctx->p.wcdma.uc = uc; } -void EXPORT supl_request(supl_ctx_t *ctx, int request) { - ctx->p.request = request; + +void EXPORT supl_request(supl_ctx_t *ctx, int request) +{ + ctx->p.request = request; } -void EXPORT supl_set_debug(FILE *log, int flags) { + +void EXPORT supl_set_debug(FILE *log, int flags) +{ #ifdef SUPL_DEBUG - debug.log = log; - if (flags & SUPL_DEBUG_RRLP) debug.verbose_rrlp = 1; - if (flags & SUPL_DEBUG_SUPL) debug.verbose_supl = 1; - if (flags & SUPL_DEBUG_DEBUG) debug.debug = 1; + debug.log = log; + if (flags & SUPL_DEBUG_RRLP) debug.verbose_rrlp = 1; + if (flags & SUPL_DEBUG_SUPL) debug.verbose_supl = 1; + if (flags & SUPL_DEBUG_DEBUG) debug.debug = 1; #endif } diff --git a/src/core/libs/supl/supl.h b/src/core/libs/supl/supl.h index fc64e1ecd..2f997d6f3 100644 --- a/src/core/libs/supl/supl.h +++ b/src/core/libs/supl/supl.h @@ -243,7 +243,7 @@ void supl_set_wcdma_cell(supl_ctx_t *ctx, int mcc, int mns, int uc); void supl_set_gsm_cell_known(supl_ctx_t *ctx, int mcc, int mns, int lac, int ci, double lat, double lon, int uncert); void supl_set_server(supl_ctx_t *ctx, char *server); void supl_set_fd(supl_ctx_t *ctx, int fd); -void supl_request(supl_ctx_t *ctx, int flags); +void supl_request(supl_ctx_t *ctx, int request); int supl_get_assist(supl_ctx_t *ctx, char *server, supl_assist_t *assist); void supl_set_debug(FILE *log, int flags); diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index 54ee2a589..4549006c4 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -27,25 +27,45 @@ set(CORE_MONITOR_LIBS_HEADERS gnss_synchro_udp_sink.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) - list(SORT CORE_MONITOR_LIBS_HEADERS) list(SORT CORE_MONITOR_LIBS_SOURCES) -add_library(core_monitor_lib +source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) + +add_library(core_monitor ${CORE_MONITOR_LIBS_SOURCES} ${CORE_MONITOR_LIBS_HEADERS} ) -source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS}) +target_link_libraries(core_monitor + PUBLIC + Boost::serialization + Boost::system + Gnuradio::runtime + core_system_parameters + PRIVATE + Gnuradio::pmt +) -target_link_libraries(core_monitor_lib ${Boost_LIBRARIES}) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(core_monitor + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() -add_dependencies(core_monitor_lib glog-${glog_RELEASE}) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_monitor + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET core_monitor + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index 4f3918d8a..d52fb10d7 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -33,34 +33,31 @@ #include "gnss_synchro_monitor.h" #include "gnss_synchro.h" -#include #include #include - - -using google::LogMessage; +#include gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, - int output_rate_ms, + int decimation_factor, int udp_port, - std::vector udp_addresses) + const std::vector& udp_addresses) { return gnss_synchro_monitor_sptr(new gnss_synchro_monitor(n_channels, - output_rate_ms, + decimation_factor, udp_port, udp_addresses)); } gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, - int output_rate_ms, + int decimation_factor, int udp_port, - std::vector udp_addresses) : gr::sync_block("gnss_synchro_monitor", - gr::io_signature::make(n_channels, n_channels, sizeof(Gnss_Synchro)), - gr::io_signature::make(0, 0, 0)) + const std::vector& udp_addresses) : gr::sync_block("gnss_synchro_monitor", + gr::io_signature::make(n_channels, n_channels, sizeof(Gnss_Synchro)), + gr::io_signature::make(0, 0, 0)) { - d_output_rate_ms = output_rate_ms; + d_decimation_factor = decimation_factor; d_nchannels = n_channels; udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(udp_addresses, udp_port)); @@ -75,11 +72,11 @@ gnss_synchro_monitor::~gnss_synchro_monitor() = default; int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& input_items, gr_vector_void_star& output_items __attribute__((unused))) { - const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer + const auto** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer for (int epoch = 0; epoch < noutput_items; epoch++) { count++; - if (count >= d_output_rate_ms) + if (count >= d_decimation_factor) { for (unsigned int i = 0; i < d_nchannels; i++) { diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index db991a9ae..632fa72ed 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -34,22 +34,21 @@ #ifndef GNSS_SDR_GNSS_SYNCHRO_MONITOR_H #define GNSS_SDR_GNSS_SYNCHRO_MONITOR_H - #include "gnss_synchro_udp_sink.h" #include -#include +#include #include -#include +#include class gnss_synchro_monitor; -typedef boost::shared_ptr gnss_synchro_monitor_sptr; +using gnss_synchro_monitor_sptr = boost::shared_ptr; gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, - int output_rate_ms, + int decimation_factor, int udp_port, - std::vector udp_addresses); + const std::vector& udp_addresses); /*! * \brief This class implements a block that computes the PVT solution with Galileo E1 signals @@ -57,14 +56,14 @@ gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, class gnss_synchro_monitor : public gr::sync_block { private: - friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int nchannels, - int output_rate_ms, + friend gnss_synchro_monitor_sptr gnss_synchro_make_monitor(unsigned int n_channels, + int decimation_factor, int udp_port, - std::vector udp_addresses); + const std::vector& udp_addresses); unsigned int d_nchannels; - int d_output_rate_ms; + int d_decimation_factor; std::unique_ptr udp_sink_ptr; @@ -72,10 +71,10 @@ private: public: - gnss_synchro_monitor(unsigned int nchannels, - int output_rate_ms, + gnss_synchro_monitor(unsigned int n_channels, + int decimation_factor, int udp_port, - std::vector udp_addresses); + const std::vector& udp_addresses); ~gnss_synchro_monitor(); //!< Default destructor diff --git a/src/core/monitor/gnss_synchro_udp_sink.cc b/src/core/monitor/gnss_synchro_udp_sink.cc index 46b2d33c9..2978537ea 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.cc +++ b/src/core/monitor/gnss_synchro_udp_sink.cc @@ -37,21 +37,21 @@ Gnss_Synchro_Udp_Sink::Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t& port) : socket{io_service} { - for (auto address : addresses) + for (const auto& address : addresses) { boost::asio::ip::udp::endpoint endpoint(boost::asio::ip::address::from_string(address, error), port); endpoints.push_back(endpoint); } } -bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(std::vector stocks) +bool Gnss_Synchro_Udp_Sink::write_gnss_synchro(const std::vector& stocks) { std::ostringstream archive_stream; boost::archive::binary_oarchive oa{archive_stream}; oa << stocks; std::string outbound_data = archive_stream.str(); - for (auto endpoint : endpoints) + for (const auto& endpoint : endpoints) { socket.open(endpoint.protocol(), error); socket.connect(endpoint, error); diff --git a/src/core/monitor/gnss_synchro_udp_sink.h b/src/core/monitor/gnss_synchro_udp_sink.h index ebfb854a0..d72b2f18a 100644 --- a/src/core/monitor/gnss_synchro_udp_sink.h +++ b/src/core/monitor/gnss_synchro_udp_sink.h @@ -29,17 +29,21 @@ * ------------------------------------------------------------------------- */ -#ifndef GNSS_SYNCHRO_UDP_SINK_H_ -#define GNSS_SYNCHRO_UDP_SINK_H_ +#ifndef GNSS_SDR_GNSS_SYNCHRO_UDP_SINK_H_ +#define GNSS_SDR_GNSS_SYNCHRO_UDP_SINK_H_ #include "gnss_synchro.h" #include +#include +#include +#include + class Gnss_Synchro_Udp_Sink { public: - Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t &port); - bool write_gnss_synchro(std::vector stocks); + Gnss_Synchro_Udp_Sink(std::vector addresses, const uint16_t& port); + bool write_gnss_synchro(const std::vector& stocks); private: boost::asio::io_service io_service; @@ -50,4 +54,4 @@ private: }; -#endif /* GNSS_SYNCHRO_UDP_SINK_H_ */ +#endif /* GNSS_SDR_GNSS_SYNCHRO_UDP_SINK_H_ */ diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index 239e8cf00..a9225792d 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -40,137 +40,12 @@ set(GNSS_RECEIVER_HEADERS control_message.h ) -if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) - add_definitions(-DMODERN_GNURADIO=1) -endif() - if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) set(OPT_RECEIVER_INCLUDE_DIRS ${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS} ) endif() -if(ENABLE_FPGA) - add_definitions(-DENABLE_FPGA=1) -endif() - -if(ENABLE_RAW_UDP) - add_definitions(-DRAW_UDP=1) -endif() - -if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) -endif() - -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - -if(ENABLE_GN3S) - add_definitions(-DGN3S_DRIVER=1) -endif() - -if(ENABLE_ARRAY) - add_definitions(-DRAW_ARRAY_DRIVER=1) -endif() - -if(ENABLE_FLEXIBAND) - add_definitions(-DFLEXIBAND_DRIVER=1) -endif() - -if(ENABLE_OSMOSDR) - if(GROSMOSDR_FOUND) - add_definitions(-DOSMOSDR_DRIVER=1) - endif() -endif() - -if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) - add_definitions(-DUHD_DRIVER=1) -endif() - -#Enable OpenCL if found in the system -if(OPENCL_FOUND) - message(STATUS "Adding processing blocks implemented using OpenCL") - add_definitions(-DOPENCL_BLOCKS=1) -else() - add_definitions(-DOPENCL_BLOCKS=0) -endif() - -#enable SDR Hardware based on fmcomms2 -if(ENABLE_PLUTOSDR) - add_definitions(-DPLUTOSDR_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(ENABLE_FMCOMMS2) - add_definitions(-DFMCOMMS2_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(ENABLE_AD9361) - add_definitions(-DAD9361_DRIVER=1) - set(OPT_RECEIVER_INCLUDE_DIRS - ${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS} - ) -endif() - -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") - add_definitions(-DGR_GREATER_38=1) -endif() - - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${ARMADILLO_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${OPT_RECEIVER_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) @@ -187,38 +62,143 @@ set(GNSS_RECEIVER_INTERFACE_HEADERS list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) -add_library(gnss_rx +source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} + ${GNSS_RECEIVER_INTERFACE_HEADERS} +) + +add_library(core_receiver ${GNSS_RECEIVER_SOURCES} ${GNSS_RECEIVER_HEADERS} ${GNSS_RECEIVER_INTERFACE_HEADERS} ) -source_group(Headers FILES ${GNSS_RECEIVER_HEADERS} - ${GNSS_RECEIVER_INTERFACE_HEADERS}) +if(ENABLE_FPGA) + target_compile_definitions(core_receiver PUBLIC -DENABLE_FPGA=1) +endif() -target_link_libraries(gnss_rx - ${Boost_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - gnss_system_parameters - gnss_sp_libs - signal_source_adapters - datatype_adapters - input_filter_adapters - conditioner_adapters - resampler_adapters - acq_adapters - tracking_adapters - channel_adapters - telemetry_decoder_libswiftcnav - telemetry_decoder_lib - telemetry_decoder_adapters - obs_adapters - pvt_adapters - pvt_lib - rx_core_lib - core_monitor_lib +if(ENABLE_RAW_UDP) + target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1) +endif() + +if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) + target_compile_definitions(core_receiver PRIVATE -DMODERN_GNURADIO=1) +endif() + +if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") + target_compile_definitions(core_receiver PRIVATE -DGR_GREATER_38=1) +endif() + +if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) + target_compile_definitions(core_receiver PRIVATE -DUHD_DRIVER=1) +endif() + +if(ENABLE_PLUTOSDR) + target_compile_definitions(core_receiver PRIVATE -DPLUTOSDR_DRIVER=1) +endif() + +if(ENABLE_FMCOMMS2) + target_compile_definitions(core_receiver PRIVATE -DFMCOMMS2_DRIVER=1) +endif() + +if(ENABLE_AD9361) + target_compile_definitions(core_receiver PRIVATE -DAD9361_DRIVER=1) +endif() + +if(ENABLE_OSMOSDR) + if(GROSMOSDR_FOUND) + target_compile_definitions(core_receiver PRIVATE -DOSMOSDR_DRIVER=1) + endif() +endif() + +if(ENABLE_GN3S) + target_compile_definitions(core_receiver PRIVATE -DGN3S_DRIVER=1) +endif() + +if(ENABLE_ARRAY) + target_compile_definitions(core_receiver PRIVATE -DRAW_ARRAY_DRIVER=1) +endif() + +if(ENABLE_FLEXIBAND) + target_compile_definitions(core_receiver PRIVATE -DFLEXIBAND_DRIVER=1) +endif() + +if(OPENCL_FOUND) + message(STATUS "Adding processing blocks implemented using OpenCL") + target_compile_definitions(core_receiver PRIVATE -DOPENCL_BLOCKS=1) +else() + target_compile_definitions(core_receiver PRIVATE -DOPENCL_BLOCKS=0) +endif() + +if(ENABLE_CUDA) + target_compile_definitions(core_receiver PRIVATE -DCUDA_GPU_ACCEL=1) +endif() + + +target_link_libraries(core_receiver + PUBLIC + Armadillo::armadillo + Boost::boost + Boost::thread + Gnuradio::runtime + core_libs + core_monitor + PRIVATE + Gflags::gflags + Glog::glog + signal_source_adapters + data_type_adapters + input_filter_adapters + conditioner_adapters + resampler_adapters + acquisition_adapters + tracking_adapters + channel_adapters + telemetry_decoder_adapters + obs_adapters + pvt_adapters +) + +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # not AppleClang + target_compile_definitions(core_receiver + PUBLIC + -DBOOST_ASIO_HAS_STD_STRING_VIEW + ) + endif() +endif() + +if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND) + target_link_libraries(core_receiver + PRIVATE + Gnuradio::teleorbit + ) +endif() + +if(ENABLE_GN3S AND GRGN3S_FOUND) + target_link_libraries(core_receiver + PRIVATE + Gnuradio::gn3s + ) +endif() + +if(ENABLE_ARRAY AND GRDBFCTTC_FOUND) + target_link_libraries(core_receiver + PRIVATE + Gnuradio::dbfcttc + ) +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_receiver + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + +set_property(TARGET core_receiver APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ + $ + $ ) diff --git a/src/core/receiver/concurrent_map.h b/src/core/receiver/concurrent_map.h index 218030286..af3823bd1 100644 --- a/src/core/receiver/concurrent_map.h +++ b/src/core/receiver/concurrent_map.h @@ -43,7 +43,7 @@ template * \brief This class implements a thread-safe std::map * */ -class concurrent_map +class Concurrent_Map { typedef typename std::map::iterator Data_iterator; // iterator is scope dependent private: diff --git a/src/core/receiver/concurrent_queue.h b/src/core/receiver/concurrent_queue.h index 3a4e89190..02c6dd896 100644 --- a/src/core/receiver/concurrent_queue.h +++ b/src/core/receiver/concurrent_queue.h @@ -43,7 +43,7 @@ template * boost_thread to perform MUTEX based on the code available at * http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html */ -class concurrent_queue +class Concurrent_Queue { private: std::queue the_queue; diff --git a/src/core/receiver/control_message_factory.cc b/src/core/receiver/control_message_factory.cc index d2871d39e..435a9a6d6 100644 --- a/src/core/receiver/control_message_factory.cc +++ b/src/core/receiver/control_message_factory.cc @@ -53,7 +53,7 @@ gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsig } -std::shared_ptr>> ControlMessageFactory::GetControlMessages(const gr::message::sptr& queue_message) +std::shared_ptr>> ControlMessageFactory::GetControlMessages(const gr::message::sptr queue_message) // NOLINT(performance-unnecessary-value-param) { std::shared_ptr>> control_messages = std::make_shared>>(); unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage); diff --git a/src/core/receiver/control_message_factory.h b/src/core/receiver/control_message_factory.h index 3aac015a9..f8a4666f6 100644 --- a/src/core/receiver/control_message_factory.h +++ b/src/core/receiver/control_message_factory.h @@ -36,7 +36,7 @@ #include //! Message described by who sent it and what it says -typedef struct ControlMessage_ +typedef struct control_message { unsigned int who; unsigned int what; @@ -58,7 +58,7 @@ public: virtual ~ControlMessageFactory(); gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what); - std::shared_ptr>> GetControlMessages(const gr::message::sptr& queue_message); + std::shared_ptr>> GetControlMessages(const gr::message::sptr queue_message); // NOLINT(performance-unnecessary-value-param) }; #endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/ diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 5a2667052..0eba503e4 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -54,11 +54,11 @@ #include "rtklib_conversions.h" #include "rtklib_ephemeris.h" #include "rtklib_rtkcmn.h" -#include #include #include #include #include +#include #include #include #include @@ -70,15 +70,15 @@ #include -extern concurrent_map global_gps_acq_assist_map; -extern concurrent_queue global_gps_acq_assist_queue; +extern Concurrent_Map global_gps_acq_assist_map; +extern Concurrent_Queue global_gps_acq_assist_queue; using google::LogMessage; ControlThread::ControlThread() { - if (!FLAGS_c.compare("-")) + if (FLAGS_c == "-") { configuration_ = std::make_shared(FLAGS_config_file); } @@ -94,7 +94,7 @@ ControlThread::ControlThread() ControlThread::ControlThread(std::shared_ptr configuration) { - configuration_ = configuration; + configuration_ = std::move(configuration); delete_configuration_ = false; restart_ = false; init(); @@ -129,7 +129,7 @@ void ControlThread::init() std::string empty_string = ""; std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string); std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string); - if (ref_location_str.compare(empty_string) != 0) + if (ref_location_str != empty_string) { std::vector vect; std::stringstream ss(ref_location_str); @@ -138,7 +138,9 @@ void ControlThread::init() { vect.push_back(d); if ((ss.peek() == ',') or (ss.peek() == ' ')) - ss.ignore(); + { + ss.ignore(); + } } // fill agnss_ref_location_ if (vect.size() >= 2) @@ -156,7 +158,7 @@ void ControlThread::init() } } } - if (ref_time_str.compare(empty_string) == 0) + if (ref_time_str == empty_string) { // Make an educated guess time_t rawtime; @@ -191,7 +193,20 @@ void ControlThread::init() ControlThread::~ControlThread() // NOLINT(modernize-use-equals-default) { - if (msqid != -1) msgctl(msqid, IPC_RMID, NULL); + if (msqid != -1) + { + msgctl(msqid, IPC_RMID, nullptr); + } + + if (sysv_queue_thread_.joinable()) + { + sysv_queue_thread_.join(); + } + + if (cmd_interface_thread_.joinable()) + { + cmd_interface_thread_.detach(); + } } @@ -251,12 +266,12 @@ int ControlThread::run() // launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs assist_GNSS(); // start the keyboard_listener thread - keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); - sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); + keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this); + sysv_queue_thread_ = std::thread(&ControlThread::sysv_queue_listener, this); // start the telecommand listener thread cmd_interface_.set_pvt(flowgraph_->get_pvt()); - cmd_interface_thread_ = boost::thread(&ControlThread::telecommand_listener, this); + cmd_interface_thread_ = std::thread(&ControlThread::telecommand_listener, this); #ifdef ENABLE_FPGA // bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); @@ -272,13 +287,17 @@ int ControlThread::run() { //TODO re-enable the blocking read messages functions and fork the process read_control_messages(); - if (control_messages_ != 0) process_control_messages(); + if (control_messages_ != nullptr) + { + process_control_messages(); + } } std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; flowgraph_->stop(); stop_ = true; flowgraph_->disconnect(); + #ifdef ENABLE_FPGA // trigger a HW reset // The HW reset causes any HW accelerator module that is waiting for more samples to complete its calculations @@ -287,23 +306,30 @@ int ControlThread::run() flowgraph_->perform_hw_reset(); #endif -// Join keyboard thread -#ifdef OLD_BOOST - keyboard_thread_.timed_join(boost::posix_time::seconds(1)); - sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); - cmd_interface_thread_.timed_join(boost::posix_time::seconds(1)); -#ifdef ENABLE_FPGA -// if (enable_FPGA == true) -// { - fpga_helper_thread_.timed_join(boost::posix_time::seconds(1)); -// } -#endif +// <<<<<<< HEAD + +// Join keyboard thread +//#ifdef OLD_BOOST +// keyboard_thread_.timed_join(boost::posix_time::seconds(1)); +// sysv_queue_thread_.timed_join(boost::posix_time::seconds(1)); +// cmd_interface_thread_.timed_join(boost::posix_time::seconds(1)); +//#ifdef ENABLE_FPGA +//// if (enable_FPGA == true) +//// { +// fpga_helper_thread_.timed_join(boost::posix_time::seconds(1)); +//// } +//#endif +// +//#endif +//#ifndef OLD_BOOST +// keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); +// sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); +// cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); + + pthread_t id = keyboard_thread_.native_handle(); + keyboard_thread_.detach(); + pthread_cancel(id); -#endif -#ifndef OLD_BOOST - keyboard_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); - sysv_queue_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); - cmd_interface_thread_.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(1000)); #ifdef ENABLE_FPGA // if (enable_FPGA == true) // { @@ -311,9 +337,15 @@ int ControlThread::run() // } #endif - #endif +// #endif LOG(INFO) << "Flowgraph stopped"; +//======= +// // Terminate keyboard thread +// pthread_t id = keyboard_thread_.native_handle(); +// keyboard_thread_.detach(); +// pthread_cancel(id); +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 if (restart_) { @@ -324,14 +356,14 @@ int ControlThread::run() } -void ControlThread::set_control_queue(const gr::msg_queue::sptr &control_queue) +void ControlThread::set_control_queue(const gr::msg_queue::sptr control_queue) // NOLINT(performance-unnecessary-value-param) { if (flowgraph_->running()) { LOG(WARNING) << "Unable to set control queue while flowgraph is running"; return; } - control_queue_ = std::move(control_queue); + control_queue_ = control_queue; cmd_interface_.set_msg_queue(control_queue_); } @@ -794,7 +826,7 @@ void ControlThread::read_control_messages() { DLOG(INFO) << "Reading control messages from queue"; gr::message::sptr queue_message = control_queue_->delete_head(); - if (queue_message != 0) + if (queue_message != nullptr) { control_messages_ = control_message_factory_->GetControlMessages(queue_message); } @@ -808,20 +840,23 @@ void ControlThread::read_control_messages() // Apply the corresponding control actions void ControlThread::process_control_messages() { - for (unsigned int i = 0; i < control_messages_->size(); i++) + for (auto &i : *control_messages_) { - if (stop_) break; - if (control_messages_->at(i)->who == 200) + if (stop_) { - apply_action(control_messages_->at(i)->what); + break; + } + if (i->who == 200) + { + apply_action(i->what); } else { - if (control_messages_->at(i)->who == 300) // some TC commands require also actions from control_thread + if (i->who == 300) // some TC commands require also actions from control_thread { - apply_action(control_messages_->at(i)->what); + apply_action(i->what); } - flowgraph_->apply_action(control_messages_->at(i)->who, control_messages_->at(i)->what); + flowgraph_->apply_action(i->who, i->what); } processed_control_messages_++; } @@ -895,7 +930,7 @@ std::vector> ControlThread::get_visible_sats(time // 2. Compute rx GPS time from UTC time gtime_t utc_gtime; utc_gtime.time = rx_utc_time; - utc_gtime.sec = 0; + utc_gtime.sec = 0.0; gtime_t gps_gtime = utc2gpst(utc_gtime); // 3. loop through all the available ephemeris or almanac and compute satellite positions and elevations @@ -913,9 +948,9 @@ std::vector> ControlThread::get_visible_sats(time << "UTC, assuming RX position " << LLH(0) << " [deg], " << LLH(1) << " [deg], " << LLH(2) << " [m]" << std::endl; std::map gps_eph_map = pvt_ptr->get_gps_ephemeris(); - for (std::map::iterator it = gps_eph_map.begin(); it != gps_eph_map.end(); ++it) + for (auto &it : gps_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -928,17 +963,17 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using GPS Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); - visible_gps.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); + visible_gps.push_back(it.second.i_satellite_PRN); } } std::map gal_eph_map = pvt_ptr->get_galileo_ephemeris(); - for (std::map::iterator it = gal_eph_map.begin(); it != gal_eph_map.end(); ++it) + for (auto &it : gal_eph_map) { - eph_t rtklib_eph = eph_to_rtklib(it->second); + eph_t rtklib_eph = eph_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; double sat_pos_variance_m2; @@ -951,21 +986,22 @@ std::vector> ControlThread::get_visible_sats(time // push sat if (El > 0) { - std::cout << "Using Galileo Ephemeris: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Ephemeris: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); - visible_gal.push_back(it->second.i_satellite_PRN); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); + visible_gal.push_back(it.second.i_satellite_PRN); } } std::map gps_alm_map = pvt_ptr->get_gps_almanac(); - for (std::map::iterator it = gps_alm_map.begin(); it != gps_alm_map.end(); ++it) + for (auto &it : gps_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t aux_gtime; aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + aux_gtime.sec = 0.0; alm2pos(aux_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; @@ -975,24 +1011,25 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gps.begin(), visible_gps.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gps.begin(), visible_gps.end(), it.second.i_satellite_PRN); if (it2 == visible_gps.end()) { - std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using GPS Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("GPS"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("GPS"), it.second.i_satellite_PRN)))); } } } std::map gal_alm_map = pvt_ptr->get_galileo_almanac(); - for (std::map::iterator it = gal_alm_map.begin(); it != gal_alm_map.end(); ++it) + for (auto &it : gal_alm_map) { - alm_t rtklib_alm = alm_to_rtklib(it->second); + alm_t rtklib_alm = alm_to_rtklib(it.second); double r_sat[3]; double clock_bias_s; gtime_t gal_gtime; gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800); + gal_gtime.sec = 0.0; alm2pos(gal_gtime, &rtklib_alm, &r_sat[0], &clock_bias_s); double Az, El, dist_m; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; @@ -1002,12 +1039,12 @@ std::vector> ControlThread::get_visible_sats(time std::vector::iterator it2; if (El > 0) { - it2 = std::find(visible_gal.begin(), visible_gal.end(), it->second.i_satellite_PRN); + it2 = std::find(visible_gal.begin(), visible_gal.end(), it.second.i_satellite_PRN); if (it2 == visible_gal.end()) { - std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; + std::cout << "Using Galileo Almanac: Sat " << it.second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; available_satellites.push_back(std::pair(floor(El), - (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); + (Gnss_Satellite(std::string("Galileo"), it.second.i_satellite_PRN)))); } } } @@ -1030,7 +1067,10 @@ void ControlThread::gps_acq_assist_data_collector() while (stop_ == false) { global_gps_acq_assist_queue.wait_and_pop(gps_acq); - if (gps_acq.i_satellite_PRN == 0) break; + if (gps_acq.i_satellite_PRN == 0) + { + break; + } // DEBUG MESSAGE std::cout << "Acquisition assistance record has arrived from SAT ID " @@ -1058,7 +1098,7 @@ void ControlThread::sysv_queue_listener() { typedef struct { - long mtype; // required by SysV queue messaging + long mtype; // NOLINT(google-runtime-int) required by SysV queue messaging double stop_message; } stop_msgbuf; @@ -1112,6 +1152,6 @@ void ControlThread::keyboard_listener() } read_keys = false; } - usleep(500000); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); } } diff --git a/src/core/receiver/control_thread.h b/src/core/receiver/control_thread.h index 78bdf5c8a..c5cb3f647 100644 --- a/src/core/receiver/control_thread.h +++ b/src/core/receiver/control_thread.h @@ -44,9 +44,9 @@ #include "gnss_sdr_supl_client.h" #include "tcp_cmd_interface.h" #include -#include #include #include +#include #include @@ -93,7 +93,7 @@ public: * * \param[in] boost::shared_ptr control_queue */ - void set_control_queue(const gr::msg_queue::sptr& control_queue); + void set_control_queue(const gr::msg_queue::sptr control_queue); // NOLINT(performance-unnecessary-value-param) unsigned int processed_control_messages() @@ -120,10 +120,10 @@ private: //Telecommand TCP interface TcpCmdInterface cmd_interface_; void telecommand_listener(); - boost::thread cmd_interface_thread_; + std::thread cmd_interface_thread_; //SUPL assistance classes - gnss_sdr_supl_client supl_client_acquisition_; - gnss_sdr_supl_client supl_client_ephemeris_; + Gnss_Sdr_Supl_Client supl_client_acquisition_; + Gnss_Sdr_Supl_Client supl_client_ephemeris_; int supl_mcc; // Current network MCC (Mobile country code), 3 digits. int supl_mns; // Current network MNC (Mobile Network code), 2 or 3 digits. int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. @@ -168,10 +168,16 @@ private: bool delete_configuration_; unsigned int processed_control_messages_; unsigned int applied_actions_; - boost::thread keyboard_thread_; - boost::thread sysv_queue_thread_; - boost::thread gps_acq_assist_data_collector_thread_; +//<<<<<<< HEAD +// boost::thread keyboard_thread_; +// boost::thread sysv_queue_thread_; +// boost::thread gps_acq_assist_data_collector_thread_; boost::thread fpga_helper_thread_; +//======= + std::thread keyboard_thread_; + std::thread sysv_queue_thread_; + std::thread gps_acq_assist_data_collector_thread_; +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 void keyboard_listener(); void sysv_queue_listener(); diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 7caea97a2..dce01a732 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -169,6 +169,7 @@ #include #include #include +#include using google::LogMessage; @@ -181,7 +182,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default; std::unique_ptr GNSSBlockFactory::GetSignalSource( - std::shared_ptr configuration, gr::msg_queue::sptr queue, int ID) + const std::shared_ptr& configuration, const gr::msg_queue::sptr queue, int ID) // NOLINT(performance-unnecessary-value-param) { std::string default_implementation = "File_Signal_Source"; std::string role = "SignalSource"; //backwards compatibility for old conf files @@ -192,7 +193,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( role = "SignalSource" + std::to_string(ID); } } - catch (const std::exception &e) + catch (const std::exception& e) { LOG(WARNING) << e.what(); } @@ -203,7 +204,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalSource( std::unique_ptr GNSSBlockFactory::GetSignalConditioner( - std::shared_ptr configuration, int ID) + const std::shared_ptr& configuration, int ID) { std::string default_implementation = "Pass_Through"; //backwards compatibility for old conf files @@ -221,7 +222,7 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( role_resampler = "Resampler" + std::to_string(ID); } } - catch (const std::exception &e) + catch (const std::exception& e) { LOG(WARNING) << e.what(); } @@ -258,20 +259,18 @@ std::unique_ptr GNSSBlockFactory::GetSignalConditioner( role_conditioner, "Signal_Conditioner")); return conditioner_; } - else - { - //single-antenna version - std::unique_ptr conditioner_(new SignalConditioner(configuration.get(), - GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1), - GetBlock(configuration, role_inputfilter, input_filter, 1, 1), - GetBlock(configuration, role_resampler, resampler, 1, 1), - role_conditioner, "Signal_Conditioner")); - return conditioner_; - } + + //single-antenna version + std::unique_ptr conditioner_(new SignalConditioner(configuration.get(), + GetBlock(configuration, role_datatypeadapter, data_type_adapter, 1, 1), + GetBlock(configuration, role_inputfilter, input_filter, 1, 1), + GetBlock(configuration, role_resampler, resampler, 1, 1), + role_conditioner, "Signal_Conditioner")); + return conditioner_; } -std::unique_ptr GNSSBlockFactory::GetObservables(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetObservables(const std::shared_ptr& configuration) { std::string default_implementation = "Hybrid_Observables"; std::string implementation = configuration->property("Observables.implementation", default_implementation); @@ -298,7 +297,7 @@ std::unique_ptr GNSSBlockFactory::GetObservables(std::shared } -std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr configuration) +std::unique_ptr GNSSBlockFactory::GetPVT(const std::shared_ptr& configuration) { std::string default_implementation = "RTKLIB_PVT"; std::string implementation = configuration->property("PVT.implementation", default_implementation); @@ -318,8 +317,8 @@ std::unique_ptr GNSSBlockFactory::GetPVT(std::shared_ptr GNSSBlockFactory::GetChannel_1C( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { //"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters @@ -378,7 +377,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1C", queue)); + "Channel", "1C", std::move(queue))); return channel_; } @@ -386,8 +385,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1C( //********* GPS L2C (M) CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2S( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: " @@ -442,7 +441,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2S", queue)); + "Channel", "2S", std::move(queue))); return channel_; } @@ -450,8 +449,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2S( //********* GALILEO E1 B CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1B( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -509,7 +508,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1B", queue)); + "Channel", "1B", std::move(queue))); return channel_; } @@ -517,8 +516,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1B( //********* GALILEO E5a CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_5X( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -576,7 +575,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "5X", queue)); + "Channel", "5X", std::move(queue))); return channel_; } @@ -584,8 +583,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_5X( //********* GLONASS L1 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_1G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -644,7 +643,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "1G", queue)); + "Channel", "1G", std::move(queue))); return channel_; } @@ -652,8 +651,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_1G( //********* GLONASS L2 C/A CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_2G( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue) { std::stringstream stream; @@ -712,7 +711,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "2G", queue)); + "Channel", "2G", std::move(queue))); return channel_; } @@ -720,8 +719,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_2G( //********* GPS L5 CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_L5( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -779,7 +778,7 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "L5", queue)); + "Channel", "L5", std::move(queue))); return channel_; } @@ -787,8 +786,8 @@ std::unique_ptr GNSSBlockFactory::GetChannel_L5( //********* BeiDou B1I CHANNEL ***************** std::unique_ptr GNSSBlockFactory::GetChannel_B1( - std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue) { std::stringstream stream; @@ -846,13 +845,13 @@ std::unique_ptr GNSSBlockFactory::GetChannel_B1( std::move(acq_), std::move(trk_), std::move(tlm_), - "Channel", "B1", queue)); + "Channel", "B1", std::move(queue))); return channel_; } std::unique_ptr>> GNSSBlockFactory::GetChannels( - std::shared_ptr configuration, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param) { std::string default_implementation = "Pass_Through"; std::string tracking_implementation; @@ -1118,7 +1117,7 @@ std::unique_ptr>> GNSSBlockFacto channel_absolute_id++; } } - catch (const std::exception &e) + catch (const std::exception& e) { LOG(WARNING) << e.what(); } @@ -1137,10 +1136,10 @@ std::unique_ptr>> GNSSBlockFacto * (see below) */ std::unique_ptr GNSSBlockFactory::GetBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, - unsigned int out_streams, gr::msg_queue::sptr queue) + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, + unsigned int out_streams, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param) { std::unique_ptr block; @@ -1161,7 +1160,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1177,7 +1176,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1192,7 +1191,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1207,7 +1206,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1221,7 +1220,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1236,7 +1235,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1250,7 +1249,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1264,7 +1263,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams, queue)); block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1279,7 +1278,7 @@ std::unique_ptr GNSSBlockFactory::GetBlock( block = std::move(block_); } - catch (const std::exception &e) + catch (const std::exception& e) { std::cout << "GNSS-SDR program ended." << std::endl; exit(1); @@ -1825,9 +1824,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( */ std::unique_ptr GNSSBlockFactory::GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -1996,9 +1995,9 @@ std::unique_ptr GNSSBlockFactory::GetAcqBlock( std::unique_ptr GNSSBlockFactory::GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; @@ -2147,9 +2146,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( std::unique_ptr GNSSBlockFactory::GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams) { std::unique_ptr block; diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index ad014d356..2b2acc8b6 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -57,75 +57,75 @@ class GNSSBlockFactory public: GNSSBlockFactory(); virtual ~GNSSBlockFactory(); - std::unique_ptr GetSignalSource(std::shared_ptr configuration, - gr::msg_queue::sptr queue, int ID = -1); + std::unique_ptr GetSignalSource(const std::shared_ptr& configuration, + const gr::msg_queue::sptr queue, int ID = -1); // NOLINT(performance-unnecessary-value-param) - std::unique_ptr GetSignalConditioner(std::shared_ptr configuration, int ID = -1); + std::unique_ptr GetSignalConditioner(const std::shared_ptr& configuration, int ID = -1); - std::unique_ptr GetPVT(std::shared_ptr configuration); + std::unique_ptr GetPVT(const std::shared_ptr& configuration); - std::unique_ptr GetObservables(std::shared_ptr configuration); + std::unique_ptr GetObservables(const std::shared_ptr& configuration); - std::unique_ptr>> GetChannels(std::shared_ptr configuration, - gr::msg_queue::sptr queue); + std::unique_ptr>> GetChannels(const std::shared_ptr& configuration, + const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param) /* * \brief Returns the block with the required configuration and implementation */ - std::unique_ptr GetBlock(std::shared_ptr configuration, - std::string role, std::string implementation, + std::unique_ptr GetBlock(const std::shared_ptr& configuration, + const std::string& role, const std::string& implementation, unsigned int in_streams, unsigned int out_streams, - gr::msg_queue::sptr queue = nullptr); + const gr::msg_queue::sptr queue = nullptr); // NOLINT(performance-unnecessary-value-param) private: - std::unique_ptr GetChannel_1C(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1C(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_2S(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2S(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1B(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1B(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_5X(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_5X(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_L5(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_L5(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, gr::msg_queue::sptr queue); - std::unique_ptr GetChannel_1G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_1G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_2G(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_2G(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); - std::unique_ptr GetChannel_B1(std::shared_ptr configuration, - std::string acq, std::string trk, std::string tlm, int channel, + std::unique_ptr GetChannel_B1(const std::shared_ptr& configuration, + const std::string& acq, const std::string& trk, const std::string& tlm, int channel, boost::shared_ptr queue); std::unique_ptr GetAcqBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTrkBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); std::unique_ptr GetTlmBlock( - std::shared_ptr configuration, - std::string role, - std::string implementation, unsigned int in_streams, + const std::shared_ptr& configuration, + const std::string& role, + const std::string& implementation, unsigned int in_streams, unsigned int out_streams); }; diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 0cf20bd99..50f4d6f96 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -62,12 +62,12 @@ using google::LogMessage; -GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue) +GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param) { connected_ = false; running_ = false; - configuration_ = configuration; - queue_ = std::move(queue); + configuration_ = std::move(configuration); + queue_ = queue; init(); } @@ -283,6 +283,7 @@ void GNSSFlowgraph::connect() #endif #if ENABLE_FPGA +//<<<<<<< HEAD // if (FPGA_enabled == false) // { // //connect the signal source to sample counter @@ -312,6 +313,36 @@ void GNSSFlowgraph::connect() // } // else // { +//======= +// if (FPGA_enabled == false) +// { +// //connect the signal source to sample counter +// //connect the sample counter to Observables +// try +// { +// double fs = static_cast(configuration_->property("GNSS-SDR.internal_fs_sps", 0)); +// if (fs == 0.0) +// { +// LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file"; +// std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl; +// throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration")); +// } +// int observable_interval_ms = static_cast(configuration_->property("GNSS-SDR.observable_interval_ms", 20)); +// ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0)); +// top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0); +// top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse +// } +// catch (const std::exception& e) +// { +// LOG(WARNING) << "Can't connect sample counter"; +// LOG(ERROR) << e.what(); +// top_block_->disconnect_all(); +// return; +// } +// } +// else +// { +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 //create a hardware-defined gnss_synchro pulse for the observables block try { @@ -405,10 +436,10 @@ void GNSSFlowgraph::connect() acq_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; break; case evGAL_1B: - acq_fs = Galileo_E1_OPT_ACQ_FS_HZ; + acq_fs = GALILEO_E1_OPT_ACQ_FS_HZ; break; case evGAL_5X: - acq_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + acq_fs = GALILEO_E5A_OPT_ACQ_FS_HZ; break; case evGLO_1G: acq_fs = fs; @@ -431,7 +462,7 @@ void GNSSFlowgraph::connect() { decimation--; }; - double acq_fs = fs / decimation; + double acq_fs = static_cast(fs) / static_cast(decimation); if (decimation > 1) { @@ -920,6 +951,10 @@ void GNSSFlowgraph::disconnect() for (unsigned int i = 0; i < channels_count_; i++) { top_block_->disconnect(observables_->get_right_block(), i, pvt_->get_left_block(), i); + if (enable_monitor_) + { + top_block_->disconnect(observables_->get_right_block(), i, GnssSynchroMonitor_, i); + } top_block_->msg_disconnect(channels_.at(i)->get_right_block(), pmt::mp("telemetry"), pvt_->get_left_block(), pmt::mp("telemetry")); } } @@ -1462,11 +1497,11 @@ void GNSSFlowgraph::priorize_satellites(std::vector>::iterator it = visible_satellites.begin(); it != visible_satellites.end(); ++it) + for (auto& visible_satellite : visible_satellites) { - if (it->second.get_system() == "GPS") + if (visible_satellite.second.get_system() == "GPS") { - gs = Gnss_Signal(it->second, "1C"); + gs = Gnss_Signal(visible_satellite.second, "1C"); old_size = available_GPS_1C_signals_.size(); available_GPS_1C_signals_.remove(gs); if (old_size > available_GPS_1C_signals_.size()) @@ -1474,7 +1509,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "2S"); + gs = Gnss_Signal(visible_satellite.second, "2S"); old_size = available_GPS_2S_signals_.size(); available_GPS_2S_signals_.remove(gs); if (old_size > available_GPS_2S_signals_.size()) @@ -1482,7 +1517,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "L5"); + gs = Gnss_Signal(visible_satellite.second, "L5"); old_size = available_GPS_L5_signals_.size(); available_GPS_L5_signals_.remove(gs); if (old_size > available_GPS_L5_signals_.size()) @@ -1490,9 +1525,9 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond.get_system() == "Galileo") + else if (visible_satellite.second.get_system() == "Galileo") { - gs = Gnss_Signal(it->second, "1B"); + gs = Gnss_Signal(visible_satellite.second, "1B"); old_size = available_GAL_1B_signals_.size(); available_GAL_1B_signals_.remove(gs); if (old_size > available_GAL_1B_signals_.size()) @@ -1500,7 +1535,7 @@ void GNSSFlowgraph::priorize_satellites(std::vectorsecond, "5X"); + gs = Gnss_Signal(visible_satellite.second, "5X"); old_size = available_GAL_5X_signals_.size(); available_GAL_5X_signals_.remove(gs); if (old_size > available_GAL_5X_signals_.size()) @@ -1523,7 +1558,7 @@ void GNSSFlowgraph::set_configuration(std::shared_ptr co { LOG(WARNING) << "Unable to update configuration while flowgraph connected"; } - configuration_ = configuration; + configuration_ = std::move(configuration); } #ifdef ENABLE_FPGA @@ -1666,7 +1701,7 @@ void GNSSFlowgraph::init() if (enable_monitor_) { GnssSynchroMonitor_ = gr::basic_block_sptr(new gnss_synchro_monitor(channels_count_, - configuration_->property("Monitor.output_rate_ms", 1), + configuration_->property("Monitor.decimation_factor", 1), configuration_->property("Monitor.udp_port", 1234), udp_addr_vec)); } @@ -1706,7 +1741,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_galileo_prn = tmp_set; } @@ -1722,7 +1757,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_gps_prn = tmp_set; } @@ -1738,7 +1773,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_sbas_prn = tmp_set; } @@ -1754,7 +1789,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_glonass_prn = tmp_set; } @@ -1770,7 +1805,7 @@ void GNSSFlowgraph::set_signals_list() std::transform(tok.begin(), tok.end(), std::inserter(tmp_set, tmp_set.begin()), boost::lexical_cast); - if (tmp_set.size() > 0) + if (!tmp_set.empty()) { available_beidou_prn = tmp_set; } @@ -1944,7 +1979,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1C")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1C")) + { + untracked_satellite = false; + } } if (untracked_satellite and configuration_->property("Channels_2S.count", 0) > 0) { @@ -1975,7 +2013,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2S")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2S")) + { + untracked_satellite = false; + } } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -2006,7 +2047,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "L5")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "L5")) + { + untracked_satellite = false; + } } if (untracked_satellite and configuration_->property("Channels_1C.count", 0) > 0) { @@ -2037,7 +2081,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1B")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1B")) + { + untracked_satellite = false; + } } if (untracked_satellite) { @@ -2062,7 +2109,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "5X")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "5X")) + { + untracked_satellite = false; + } } if (untracked_satellite) { @@ -2087,7 +2137,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1G")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "1G")) + { + untracked_satellite = false; + } } if (untracked_satellite) { @@ -2112,7 +2165,10 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal { for (unsigned int ch = 0; ch < channels_count_; ch++) { - if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2G")) untracked_satellite = false; + if ((channels_[ch]->get_signal().get_satellite() == result.get_satellite()) and (channels_[ch]->get_signal().get_signal_str() != "2G")) + { + untracked_satellite = false; + } } if (untracked_satellite) { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 97ab7f1c2..0a95eb60b 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -72,7 +72,7 @@ public: /*! * \brief Constructor that initializes the receiver flow graph */ - GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr& queue); + GNSSFlowgraph(std::shared_ptr configuration, const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param) /*! * \brief Destructor diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 57b274757..0096c26a1 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -33,6 +33,7 @@ #include "control_message_factory.h" #include #include +#include TcpCmdInterface::TcpCmdInterface() @@ -64,7 +65,7 @@ void TcpCmdInterface::register_functions() void TcpCmdInterface::set_pvt(std::shared_ptr PVT_sptr) { - PVT_sptr_ = PVT_sptr; + PVT_sptr_ = std::move(PVT_sptr); } @@ -284,7 +285,7 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector &co void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue) { - control_queue_ = control_queue; + control_queue_ = std::move(control_queue); } @@ -330,7 +331,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port) std::vector cmd_vector(std::istream_iterator{iss}, std::istream_iterator()); - if (cmd_vector.size() > 0) + if (!cmd_vector.empty()) { try { diff --git a/src/core/receiver/tcp_cmd_interface.h b/src/core/receiver/tcp_cmd_interface.h index 4cafb898d..2e75298ec 100644 --- a/src/core/receiver/tcp_cmd_interface.h +++ b/src/core/receiver/tcp_cmd_interface.h @@ -34,7 +34,6 @@ #include "pvt_interface.h" #include #include -#include #include #include #include diff --git a/src/core/system_parameters/Beidou_B1I.h b/src/core/system_parameters/Beidou_B1I.h index f0b3a7bd9..b31f470e9 100644 --- a/src/core/system_parameters/Beidou_B1I.h +++ b/src/core/system_parameters/Beidou_B1I.h @@ -33,12 +33,13 @@ #define GNSS_SDR_BEIDOU_B1I_H_ #include "MATH_CONSTANTS.h" +#include #include // std::pair #include // Physical constants -const double BEIDOU_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double BEIDOU_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double BEIDOU_C_M_S = 299792458.0; //!< The speed of light, [m/s] +const double BEIDOU_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double BEIDOU_PI = 3.1415926535898; //!< Pi const double BEIDOU_TWO_PI = 6.283185307179586; //!< 2Pi const double BEIDOU_OMEGA_EARTH_DOT = 7.2921150e-5; //!< Earth rotation rate, [rad/s] as defined in CGCS2000 @@ -51,9 +52,9 @@ const double BEIDOU_B1I_FREQ_HZ = 1.561098e9; //!< b1I [Hz] const double BEIDOU_B1I_CODE_RATE_HZ = 2.046e6; //!< beidou b1I code rate [chips/s] const double BEIDOU_B1I_CODE_LENGTH_CHIPS = 2046.0; //!< beidou b1I code length [chips] const double BEIDOU_B1I_CODE_PERIOD = 0.001; //!< beidou b1I code period [seconds] -const unsigned int BEIDOU_B1I_CODE_PERIOD_MS = 1; //!< GPS L1 C/A code period [ms] +const uint32_t BEIDOU_B1I_CODE_PERIOD_MS = 1; //!< beidou b1I L1 C/A code period [ms] const double BEIDOU_B1I_CHIP_PERIOD = 4.8875e-07; //!< beidou b1I chip period [seconds] -const int BEIDOU_B1I_SECONDARY_CODE_LENGTH = 20; +const int32_t BEIDOU_B1I_SECONDARY_CODE_LENGTH = 20; const std::string BEIDOU_B1I_SECONDARY_CODE = "00000100110101001110"; const std::string BEIDOU_B1I_SECONDARY_CODE_STR = "00000100110101001110"; const std::string BEIDOU_B1I_D2_SECONDARY_CODE_STR = "00"; @@ -69,33 +70,33 @@ const std::string BEIDOU_B1I_D2_SECONDARY_CODE_STR = "00"; const double BEIDOU_MAX_TOA_DELAY_MS = 20; //****************** //#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here -const double BEIDOU_STARTOFFSET_ms = 68.802; //**************[ms] Initial sign. travel time (this cannot go here) +const double BEIDOU_STARTOFFSET_MS = 68.802; //**************[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION -const int BEIDOU_B1I_HISTORY_DEEP = 100; // **************** +const int32_t BEIDOU_B1I_HISTORY_DEEP = 100; // **************** // NAVIGATION MESSAGE DEMODULATION AND DECODING -const int BEIDOU_B1I_PREAMBLE_LENGTH_BITS = 11; -const int BEIDOU_B1I_PREAMBLE_LENGTH_SYMBOLS = 220; // ************** +const int32_t BEIDOU_B1I_PREAMBLE_LENGTH_BITS = 11; +const int32_t BEIDOU_B1I_PREAMBLE_LENGTH_SYMBOLS = 220; // ************** const double BEIDOU_B1I_PREAMBLE_DURATION_S = 0.220; -const int BEIDOU_B1I_PREAMBLE_DURATION_MS = 220; -const int BEIDOU_B1I_TELEMETRY_RATE_BITS_SECOND = 50; //!< D1 NAV message bit rate [bits/s] -const int BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT = 20; // ************* -const int BEIDOU_B1I_TELEMETRY_RATE_SYMBOLS_SECOND = BEIDOU_B1I_TELEMETRY_RATE_BITS_SECOND * BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT; //************!< NAV message bit rate [symbols/s] -const int BEIDOU_WORD_LENGTH = 4; //**************!< CRC + BEIDOU WORD (-2 -1 0 ... 29) Bits = 4 bytes -const int BEIDOU_SUBFRAME_LENGTH = 40; //**************!< BEIDOU_WORD_LENGTH x 10 = 40 bytes -const int BEIDOU_DNAV_SUBFRAME_DATA_BITS = 300; //!< Number of bits per subframe in the NAV message [bits] -const int BEIDOU_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds] -const int BEIDOU_SUBFRAME_MS = 6000; //!< Subframe duration [miliseconds] -const int BEIDOU_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits] +const int32_t BEIDOU_B1I_PREAMBLE_DURATION_MS = 220; +const int32_t BEIDOU_B1I_TELEMETRY_RATE_BITS_SECOND = 50; //!< D1 NAV message bit rate [bits/s] +const int32_t BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT = 20; // ************* +const int32_t BEIDOU_B1I_TELEMETRY_RATE_SYMBOLS_SECOND = BEIDOU_B1I_TELEMETRY_RATE_BITS_SECOND * BEIDOU_B1I_TELEMETRY_SYMBOLS_PER_BIT; //************!< NAV message bit rate [symbols/s] +const int32_t BEIDOU_WORD_LENGTH = 4; //**************!< CRC + BEIDOU WORD (-2 -1 0 ... 29) Bits = 4 bytes +const int32_t BEIDOU_SUBFRAME_LENGTH = 40; //**************!< BEIDOU_WORD_LENGTH x 10 = 40 bytes +const int32_t BEIDOU_DNAV_SUBFRAME_DATA_BITS = 300; //!< Number of bits per subframe in the NAV message [bits] +const int32_t BEIDOU_SUBFRAME_SECONDS = 6; //!< Subframe duration [seconds] +const int32_t BEIDOU_SUBFRAME_MS = 6000; //!< Subframe duration [miliseconds] +const int32_t BEIDOU_WORD_BITS = 30; //!< Number of bits per word in the NAV message [bits] const std::string BEIDOU_DNAV_PREAMBLE = "11100010010"; -const int BEIDOU_DNAV_PREAMBLE_LENGTH_BITS = 11; -const int BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS = 11; // ************** -const double BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS = 300; -const double BEIDOU_DNAV_SUBFRAME_SYMBOLS = 300; +const int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_BITS = 11; +const int32_t BEIDOU_DNAV_PREAMBLE_LENGTH_SYMBOLS = 11; // ************** +const uint32_t BEIDOU_DNAV_PREAMBLE_PERIOD_SYMBOLS = 300; +const uint32_t BEIDOU_DNAV_SUBFRAME_SYMBOLS = 300; const double BEIDOU_DNAV_DATA_BITS = 300; const double BEIDOU_DNAV_WORDS_SUBFRAME = 10; const double BEIDOU_DNAV_WORD_LENGTH_BITS = 30; @@ -106,10 +107,10 @@ const double BEIDOU_B1I_PREAMBLE_PERIOD_SYMBOLS = 300; // BEIDOU D1 NAVIGATION MESSAGE STRUCTURE // GENERAL -const std::vector > D1_PRE({{1, 11}}); -const std::vector > D1_FRAID({{16, 3}}); -const std::vector > D1_SOW({{19, 8}, {31, 12}}); -const std::vector > D1_PNUM({{44, 7}}); +const std::vector > D1_PRE({{1, 11}}); +const std::vector > D1_FRAID({{16, 3}}); +const std::vector > D1_SOW({{19, 8}, {31, 12}}); +const std::vector > D1_PNUM({{44, 7}}); // DNAV SCALE FACTORS // EPH @@ -164,183 +165,183 @@ const double D1_A0UTC_LSB = TWO_N30; const double D1_A1UTC_LSB = TWO_N50; // SUBFRAME 1 -const std::vector > D1_SAT_H1({{43, 1}}); -const std::vector > D1_AODC({{44, 5}}); -const std::vector > D1_URAI({{49, 4}}); -const std::vector > D1_WN({{61, 13}}); -const std::vector > D1_TOC({{74, 9}, {91, 8}}); -const std::vector > D1_TGD1({{99, 10}}); -const std::vector > D1_TGD2({{121, 6}}); -const std::vector > D1_ALPHA0({{127, 8}}); -const std::vector > D1_ALPHA1({{135, 8}}); -const std::vector > D1_ALPHA2({{151, 8}}); -const std::vector > D1_ALPHA3({{159, 8}}); -const std::vector > D1_BETA0({{167, 6}, {181, 2}}); -const std::vector > D1_BETA1({{183, 8}}); -const std::vector > D1_BETA2({{191, 8}}); -const std::vector > D1_BETA3({{199, 4}, {211, 4}}); -const std::vector > D1_A2({{215, 11}}); -const std::vector > D1_A0({{226, 7}, {241, 17}}); -const std::vector > D1_A1({{258, 5}, {271, 17}}); -const std::vector > D1_AODE({{288, 5}}); +const std::vector > D1_SAT_H1({{43, 1}}); +const std::vector > D1_AODC({{44, 5}}); +const std::vector > D1_URAI({{49, 4}}); +const std::vector > D1_WN({{61, 13}}); +const std::vector > D1_TOC({{74, 9}, {91, 8}}); +const std::vector > D1_TGD1({{99, 10}}); +const std::vector > D1_TGD2({{121, 6}}); +const std::vector > D1_ALPHA0({{127, 8}}); +const std::vector > D1_ALPHA1({{135, 8}}); +const std::vector > D1_ALPHA2({{151, 8}}); +const std::vector > D1_ALPHA3({{159, 8}}); +const std::vector > D1_BETA0({{167, 6}, {181, 2}}); +const std::vector > D1_BETA1({{183, 8}}); +const std::vector > D1_BETA2({{191, 8}}); +const std::vector > D1_BETA3({{199, 4}, {211, 4}}); +const std::vector > D1_A2({{215, 11}}); +const std::vector > D1_A0({{226, 7}, {241, 17}}); +const std::vector > D1_A1({{258, 5}, {271, 17}}); +const std::vector > D1_AODE({{288, 5}}); //SUBFRAME 2 -const std::vector > D1_DELTA_N({{43, 10}, {61, 6}}); -const std::vector > D1_CUC({{67, 16}, {91, 2}}); -const std::vector > D1_M0({{93, 20}, {121, 12}}); -const std::vector > D1_E({{133, 10}, {151, 22}}); -const std::vector > D1_CUS({{181, 18}}); -const std::vector > D1_CRC({{199, 4}, {211, 14}}); -const std::vector > D1_CRS({{225, 8}, {241, 10}}); -const std::vector > D1_SQRT_A({{251, 12}, {271, 20}}); -const std::vector > D1_TOE_SF2({{291, 2}}); +const std::vector > D1_DELTA_N({{43, 10}, {61, 6}}); +const std::vector > D1_CUC({{67, 16}, {91, 2}}); +const std::vector > D1_M0({{93, 20}, {121, 12}}); +const std::vector > D1_E({{133, 10}, {151, 22}}); +const std::vector > D1_CUS({{181, 18}}); +const std::vector > D1_CRC({{199, 4}, {211, 14}}); +const std::vector > D1_CRS({{225, 8}, {241, 10}}); +const std::vector > D1_SQRT_A({{251, 12}, {271, 20}}); +const std::vector > D1_TOE_SF2({{291, 2}}); //SUBFRAME 3 -const std::vector > D1_TOE_SF3({{43, 10}, {61, 5}}); -const std::vector > D1_I0({{66, 17}, {91, 15}}); -const std::vector > D1_CIC({{106, 7}, {121, 11}}); -const std::vector > D1_OMEGA_DOT({{132, 11}, {151, 13}}); -const std::vector > D1_CIS({{164, 9}, {181, 9}}); -const std::vector > D1_IDOT({{190, 13}, {211, 1}}); -const std::vector > D1_OMEGA0({{212, 21}, {241, 11}}); -const std::vector > D1_OMEGA({{252, 11}, {271, 21}}); +const std::vector > D1_TOE_SF3({{43, 10}, {61, 5}}); +const std::vector > D1_I0({{66, 17}, {91, 15}}); +const std::vector > D1_CIC({{106, 7}, {121, 11}}); +const std::vector > D1_OMEGA_DOT({{132, 11}, {151, 13}}); +const std::vector > D1_CIS({{164, 9}, {181, 9}}); +const std::vector > D1_IDOT({{190, 13}, {211, 1}}); +const std::vector > D1_OMEGA0({{212, 21}, {241, 11}}); +const std::vector > D1_OMEGA({{252, 11}, {271, 21}}); //SUBFRAME 4 AND PAGES 1 THROUGH 6 IN SUBFRAME 5 -const std::vector > D1_SQRT_A_ALMANAC({{51, 2}, {61, 22}}); -const std::vector > D1_A1_ALMANAC({{91, 11}}); -const std::vector > D1_A0_ALMANAC({{102, 11}}); -const std::vector > D1_OMEGA0_ALMANAC({{121, 22}, {151, 2}}); -const std::vector > D1_E_ALMANAC({{153, 17}}); -const std::vector > D1_DELTA_I({{170, 3}, {181, 13}}); -const std::vector > D1_TOA({{194, 8}}); -const std::vector > D1_OMEGA_DOT_ALMANAC({{202, 1}, {211, 16}}); -const std::vector > D1_OMEGA_ALMANAC({{227, 6}, {241, 18}}); -const std::vector > D1_M0_ALMANAC({{259, 4}, {271, 20}}); +const std::vector > D1_SQRT_A_ALMANAC({{51, 2}, {61, 22}}); +const std::vector > D1_A1_ALMANAC({{91, 11}}); +const std::vector > D1_A0_ALMANAC({{102, 11}}); +const std::vector > D1_OMEGA0_ALMANAC({{121, 22}, {151, 2}}); +const std::vector > D1_E_ALMANAC({{153, 17}}); +const std::vector > D1_DELTA_I({{170, 3}, {181, 13}}); +const std::vector > D1_TOA({{194, 8}}); +const std::vector > D1_OMEGA_DOT_ALMANAC({{202, 1}, {211, 16}}); +const std::vector > D1_OMEGA_ALMANAC({{227, 6}, {241, 18}}); +const std::vector > D1_M0_ALMANAC({{259, 4}, {271, 20}}); //SUBFRAME 5 PAGE 7 -const std::vector > D1_HEA1({{51, 2}, {61, 7}}); -const std::vector > D1_HEA2({{68, 9}}); -const std::vector > D1_HEA3({{77, 6}, {91, 3}}); -const std::vector > D1_HEA4({{94, 9}}); -const std::vector > D1_HEA5({{103, 9}}); -const std::vector > D1_HEA6({{112, 1}, {121, 8}}); -const std::vector > D1_HEA7({{129, 9}}); -const std::vector > D1_HEA8({{138, 5}, {151, 4}}); -const std::vector > D1_HEA9({{155, 9}}); -const std::vector > D1_HEA10({{164, 9}}); -const std::vector > D1_HEA11({{181, 9}}); -const std::vector > D1_HEA12({{190, 9}}); -const std::vector > D1_HEA13({{199, 4}, {211, 5}}); -const std::vector > D1_HEA14({{216, 9}}); -const std::vector > D1_HEA15({{225, 8}, {241, 1}}); -const std::vector > D1_HEA16({{242, 9}}); -const std::vector > D1_HEA17({{251, 9}}); -const std::vector > D1_HEA18({{260, 3}, {271, 6}}); -const std::vector > D1_HEA19({{277, 9}}); +const std::vector > D1_HEA1({{51, 2}, {61, 7}}); +const std::vector > D1_HEA2({{68, 9}}); +const std::vector > D1_HEA3({{77, 6}, {91, 3}}); +const std::vector > D1_HEA4({{94, 9}}); +const std::vector > D1_HEA5({{103, 9}}); +const std::vector > D1_HEA6({{112, 1}, {121, 8}}); +const std::vector > D1_HEA7({{129, 9}}); +const std::vector > D1_HEA8({{138, 5}, {151, 4}}); +const std::vector > D1_HEA9({{155, 9}}); +const std::vector > D1_HEA10({{164, 9}}); +const std::vector > D1_HEA11({{181, 9}}); +const std::vector > D1_HEA12({{190, 9}}); +const std::vector > D1_HEA13({{199, 4}, {211, 5}}); +const std::vector > D1_HEA14({{216, 9}}); +const std::vector > D1_HEA15({{225, 8}, {241, 1}}); +const std::vector > D1_HEA16({{242, 9}}); +const std::vector > D1_HEA17({{251, 9}}); +const std::vector > D1_HEA18({{260, 3}, {271, 6}}); +const std::vector > D1_HEA19({{277, 9}}); //SUBFRAME 5 PAGE 8 -const std::vector > D1_HEA20({{51, 2}, {61, 7}}); -const std::vector > D1_HEA21({{68, 9}}); -const std::vector > D1_HEA22({{77, 6}, {91, 3}}); -const std::vector > D1_HEA23({{94, 9}}); -const std::vector > D1_HEA24({{103, 9}}); -const std::vector > D1_HEA25({{112, 1}, {121, 8}}); -const std::vector > D1_HEA26({{129, 9}}); -const std::vector > D1_HEA27({{138, 5}, {151, 4}}); -const std::vector > D1_HEA28({{155, 9}}); -const std::vector > D1_HEA29({{164, 9}}); -const std::vector > D1_HEA30({{181, 9}}); -const std::vector > D1_WNA({{190, 8}}); -const std::vector > D1_TOA2({{198, 5}, {211, 3}}); +const std::vector > D1_HEA20({{51, 2}, {61, 7}}); +const std::vector > D1_HEA21({{68, 9}}); +const std::vector > D1_HEA22({{77, 6}, {91, 3}}); +const std::vector > D1_HEA23({{94, 9}}); +const std::vector > D1_HEA24({{103, 9}}); +const std::vector > D1_HEA25({{112, 1}, {121, 8}}); +const std::vector > D1_HEA26({{129, 9}}); +const std::vector > D1_HEA27({{138, 5}, {151, 4}}); +const std::vector > D1_HEA28({{155, 9}}); +const std::vector > D1_HEA29({{164, 9}}); +const std::vector > D1_HEA30({{181, 9}}); +const std::vector > D1_WNA({{190, 8}}); +const std::vector > D1_TOA2({{198, 5}, {211, 3}}); //SUBFRAME 5 PAGE 9 -const std::vector > D1_A0GPS({{97, 14}}); -const std::vector > D1_A1GPS({{111, 2}, {121, 14}}); -const std::vector > D1_A0GAL({{135, 8}, {151, 6}}); -const std::vector > D1_A1GAL({{157, 16}}); -const std::vector > D1_A0GLO({{181, 14}}); -const std::vector > D1_A1GLO({{195, 8}, {211, 8}}); +const std::vector > D1_A0GPS({{97, 14}}); +const std::vector > D1_A1GPS({{111, 2}, {121, 14}}); +const std::vector > D1_A0GAL({{135, 8}, {151, 6}}); +const std::vector > D1_A1GAL({{157, 16}}); +const std::vector > D1_A0GLO({{181, 14}}); +const std::vector > D1_A1GLO({{195, 8}, {211, 8}}); //SUBFRAME 5 PAGE 10 -const std::vector > D1_DELTA_T_LS({{51, 2}, {61, 6}}); -const std::vector > D1_DELTA_T_LSF({{67, 8}}); -const std::vector > D1_WN_LSF({{75, 8}}); -const std::vector > D1_A0UTC({{91, 22}, {121, 10}}); -const std::vector > D1_A1UTC({{131, 12}, {151, 12}}); -const std::vector > D1_DN({{163, 8}}); +const std::vector > D1_DELTA_T_LS({{51, 2}, {61, 6}}); +const std::vector > D1_DELTA_T_LSF({{67, 8}}); +const std::vector > D1_WN_LSF({{75, 8}}); +const std::vector > D1_A0UTC({{91, 22}, {121, 10}}); +const std::vector > D1_A1UTC({{131, 12}, {151, 12}}); +const std::vector > D1_DN({{163, 8}}); // D2 NAV Message Decoding Information -const std::vector > D2_PRE({{1, 11}}); -const std::vector > D2_FRAID({{16, 3}}); -const std::vector > D2_SOW({{19, 8}, {31, 12}}); -const std::vector > D2_PNUM({{43, 4}}); +const std::vector > D2_PRE({{1, 11}}); +const std::vector > D2_FRAID({{16, 3}}); +const std::vector > D2_SOW({{19, 8}, {31, 12}}); +const std::vector > D2_PNUM({{43, 4}}); // D2 NAV, SUBFRAME 1, PAGE 1 -const std::vector > D2_SAT_H1({{47, 1}}); -const std::vector > D2_AODC({{48, 5}}); -const std::vector > D2_URAI({{61, 4}}); -const std::vector > D2_WN({{65, 13}}); -const std::vector > D2_TOC({{78, 5}, {91, 12}}); -const std::vector > D2_TGD1({{103, 10}}); -const std::vector > D2_TGD2({{121, 10}}); +const std::vector > D2_SAT_H1({{47, 1}}); +const std::vector > D2_AODC({{48, 5}}); +const std::vector > D2_URAI({{61, 4}}); +const std::vector > D2_WN({{65, 13}}); +const std::vector > D2_TOC({{78, 5}, {91, 12}}); +const std::vector > D2_TGD1({{103, 10}}); +const std::vector > D2_TGD2({{121, 10}}); // D2 NAV, SUBFRAME 1, PAGE 2 -const std::vector > D2_ALPHA0({{47, 6}, {61, 2}}); -const std::vector > D2_ALPHA1({{63, 8}}); -const std::vector > D2_ALPHA2({{71, 8}}); -const std::vector > D2_ALPHA3({{79, 4}, {91, 4}}); -const std::vector > D2_BETA0({{95, 8}}); -const std::vector > D2_BETA1({{103, 8}}); -const std::vector > D2_BETA2({{111, 2}, {121, 6}}); -const std::vector > D2_BETA3({{127, 8}}); +const std::vector > D2_ALPHA0({{47, 6}, {61, 2}}); +const std::vector > D2_ALPHA1({{63, 8}}); +const std::vector > D2_ALPHA2({{71, 8}}); +const std::vector > D2_ALPHA3({{79, 4}, {91, 4}}); +const std::vector > D2_BETA0({{95, 8}}); +const std::vector > D2_BETA1({{103, 8}}); +const std::vector > D2_BETA2({{111, 2}, {121, 6}}); +const std::vector > D2_BETA3({{127, 8}}); // D2 NAV, SUBFRAME 1, PAGE 3 -const std::vector > D2_A0({{101, 12}, {121, 12}}); -const std::vector > D2_A1_MSB({{133, 4}}); -const std::vector > D2_A1_LSB({{47, 6}, {61, 12}}); -const std::vector > D2_A1({{279, 22}}); +const std::vector > D2_A0({{101, 12}, {121, 12}}); +const std::vector > D2_A1_MSB({{133, 4}}); +const std::vector > D2_A1_LSB({{47, 6}, {61, 12}}); +const std::vector > D2_A1({{279, 22}}); // D2 NAV, SUBFRAME 1, PAGE 4 -const std::vector > D2_A2({{73, 10}, {91, 1}}); -const std::vector > D2_AODE({{92, 5}}); -const std::vector > D2_DELTA_N({{97, 16}}); -const std::vector > D2_CUC_MSB({{121, 14}}); -const std::vector > D2_CUC_LSB({{47, 4}}); -const std::vector > D2_CUC({{283, 18}}); +const std::vector > D2_A2({{73, 10}, {91, 1}}); +const std::vector > D2_AODE({{92, 5}}); +const std::vector > D2_DELTA_N({{97, 16}}); +const std::vector > D2_CUC_MSB({{121, 14}}); +const std::vector > D2_CUC_LSB({{47, 4}}); +const std::vector > D2_CUC({{283, 18}}); // D2 NAV, SUBFRAME 1, PAGE 5 -const std::vector > D2_M0({{51, 2}, {61, 22}, {91, 8}}); -const std::vector > D2_CUS({{99, 14}, {121, 4}}); -const std::vector > D2_E_MSB({{125, 10}}); +const std::vector > D2_M0({{51, 2}, {61, 22}, {91, 8}}); +const std::vector > D2_CUS({{99, 14}, {121, 4}}); +const std::vector > D2_E_MSB({{125, 10}}); // D2 NAV, SUBFRAME 1, PAGE 6 -const std::vector > D2_E_LSB({{47, 6}, {61, 16}}); -const std::vector > D2_SQRT_A({{77, 6}, {91, 22}, {121, 4}}); -const std::vector > D2_CIC_MSB({{125, 10}}); -const std::vector > D2_CIC_LSB({{47, 6}, {61, 2}}); -const std::vector > D2_CIC({{283, 18}}); +const std::vector > D2_E_LSB({{47, 6}, {61, 16}}); +const std::vector > D2_SQRT_A({{77, 6}, {91, 22}, {121, 4}}); +const std::vector > D2_CIC_MSB({{125, 10}}); +const std::vector > D2_CIC_LSB({{47, 6}, {61, 2}}); +const std::vector > D2_CIC({{283, 18}}); // D2 NAV, SUBFRAME 1, PAGE 7 -const std::vector > D2_CIS({{63, 18}}); -const std::vector > D2_TOE({{81, 2}, {91, 15}}); -const std::vector > D2_I0_MSB({{106, 7}, {121, 14}}); -const std::vector > D2_I0_LSB({{47, 6}, {61, 5}}); -const std::vector > D2_I0({{269, 32}}); +const std::vector > D2_CIS({{63, 18}}); +const std::vector > D2_TOE({{81, 2}, {91, 15}}); +const std::vector > D2_I0_MSB({{106, 7}, {121, 14}}); +const std::vector > D2_I0_LSB({{47, 6}, {61, 5}}); +const std::vector > D2_I0({{269, 32}}); // D2 NAV, SUBFRAME 1, PAGE 8 -const std::vector > D2_CRC({{66, 17}, {91, 1}}); -const std::vector > D2_CRS({{92, 18}}); -const std::vector > D2_OMEGA_DOT_MSB({{110, 3}, {121, 16}}); -const std::vector > D2_OMEGA_DOT_LSB({{47, 5}}); -const std::vector > D2_OMEGA_DOT({{277, 24}}); +const std::vector > D2_CRC({{66, 17}, {91, 1}}); +const std::vector > D2_CRS({{92, 18}}); +const std::vector > D2_OMEGA_DOT_MSB({{110, 3}, {121, 16}}); +const std::vector > D2_OMEGA_DOT_LSB({{47, 5}}); +const std::vector > D2_OMEGA_DOT({{277, 24}}); // D2 NAV, SUBFRAME 1, PAGE 9 -const std::vector > D2_OMEGA0({{52, 1}, {61, 22}, {91, 9}}); -const std::vector > D2_OMEGA_MSB({{100, 13}, {121, 14}}); -const std::vector > D2_OMEGA_LSB({{47, 5}}); -const std::vector > D2_OMEGA({{269, 32}}); +const std::vector > D2_OMEGA0({{52, 1}, {61, 22}, {91, 9}}); +const std::vector > D2_OMEGA_MSB({{100, 13}, {121, 14}}); +const std::vector > D2_OMEGA_LSB({{47, 5}}); +const std::vector > D2_OMEGA({{269, 32}}); // D2 NAV, SUBFRAME 1, PAGE 10 -const std::vector > D2_IDOT({{52, 1}, {61, 13}}); +const std::vector > D2_IDOT({{52, 1}, {61, 13}}); #endif /* GNSS_SDR_BEIDOU_B1I_H_ */ diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 45a3513c3..262aab718 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -45,7 +45,6 @@ set(SYSTEM_PARAMETERS_SOURCES gps_cnav_navigation_message.cc gps_cnav_iono.cc gps_cnav_utc_model.cc - rtcm.cc glonass_gnav_ephemeris.cc glonass_gnav_almanac.cc glonass_gnav_utc_model.cc @@ -75,7 +74,6 @@ set(SYSTEM_PARAMETERS_HEADERS gps_cnav_navigation_message.h gps_cnav_iono.h gps_cnav_utc_model.h - rtcm.h glonass_gnav_ephemeris.h glonass_gnav_almanac.h glonass_gnav_utc_model.h @@ -100,26 +98,35 @@ set(SYSTEM_PARAMETERS_HEADERS MATH_CONSTANTS.h ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${GLOG_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} -) - list(SORT SYSTEM_PARAMETERS_HEADERS) list(SORT SYSTEM_PARAMETERS_SOURCES) -add_library(gnss_system_parameters +source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) + +add_library(core_system_parameters ${SYSTEM_PARAMETERS_SOURCES} ${SYSTEM_PARAMETERS_HEADERS} ) -source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS}) +target_link_libraries(core_system_parameters + PUBLIC + Boost::date_time + Boost::serialization + Glog::glog + PRIVATE + Gflags::gflags +) -add_dependencies(gnss_system_parameters rtklib_lib glog-${glog_RELEASE}) +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(core_system_parameters + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() -target_link_libraries(gnss_system_parameters rtklib_lib ${Boost_LIBRARIES}) +set_property(TARGET core_system_parameters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/core/system_parameters/GLONASS_L1_L2_CA.h b/src/core/system_parameters/GLONASS_L1_L2_CA.h index 816b2c9aa..b8c796b4f 100644 --- a/src/core/system_parameters/GLONASS_L1_L2_CA.h +++ b/src/core/system_parameters/GLONASS_L1_L2_CA.h @@ -42,13 +42,13 @@ // Physical constants -const double GLONASS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] -const double GLONASS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GLONASS_C_M_S = SPEED_OF_LIGHT; //!< The speed of light, [m/s] +const double GLONASS_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double GLONASS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E const double GLONASS_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double GLONASS_OMEGA_EARTH_DOT = 7.292115e-5; //!< Earth rotation rate, [rad/s] const double GLONASS_GM = 398600.4418e9; //!< Universal gravitational constant times the mass of the Earth, [m^3/s^2] -const double GLONASS_fM_a = 0.35e9; //!< Gravitational constant of atmosphere [m^3/s^2] +const double GLONASS_F_M_A = 0.35e9; //!< Gravitational constant of atmosphere [m^3/s^2] const double GLONASS_SEMI_MAJOR_AXIS = 6378136; //!< Semi-major axis of Earth [m] const double GLONASS_FLATTENING = 1 / 29825784; //!< Flattening parameter const double GLONASS_GRAVITY = 97803284; //!< Equatorial acceleration of gravity [mGal] @@ -225,7 +225,7 @@ const std::map GLONASS_PRN = { }, //Plane 3 {24, 2}}; //Plane 3 -const double GLONASS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) +const double GLONASS_STARTOFFSET_MS = 68.802; //[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION const int32_t GLONASS_L1_CA_HISTORY_DEEP = 100; @@ -301,7 +301,7 @@ const std::vector> N({{71, 5}}); const std::vector> M({{76, 2}}); // STRING 5 -const std::vector> N_A({{6, 11}}); +const std::vector> DAY_NUMBER_A({{6, 11}}); const std::vector> TAU_C({{17, 32}}); const std::vector> N_4({{50, 5}}); const std::vector> TAU_GPS({{55, 22}}); @@ -310,7 +310,7 @@ const std::vector> ALM_L_N({{77, 1}}); // STRING 6, 8, 10, 12, 14 const std::vector> C_N({{6, 1}}); const std::vector> M_N_A({{7, 2}}); -const std::vector> n_A({{9, 5}}); +const std::vector> N_A({{9, 5}}); const std::vector> TAU_N_A({{14, 10}}); const std::vector> LAMBDA_N_A({{24, 21}}); const std::vector> DELTA_I_N_A({{45, 18}}); diff --git a/src/core/system_parameters/GPS_L1_CA.h b/src/core/system_parameters/GPS_L1_CA.h index 349897994..ee81a18e8 100644 --- a/src/core/system_parameters/GPS_L1_CA.h +++ b/src/core/system_parameters/GPS_L1_CA.h @@ -40,8 +40,8 @@ // Physical constants -const double GPS_C_m_s = SPEED_OF_LIGHT; //!< The speed of light, [m/s] -const double GPS_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_C_M_S = SPEED_OF_LIGHT; //!< The speed of light, [m/s] +const double GPS_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double GPS_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E const double GPS_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double OMEGA_EARTH_DOT = DEFAULT_OMEGA_EARTH_DOT; //!< Earth rotation rate, [rad/s] @@ -72,7 +72,7 @@ const double MAX_TOA_DELAY_MS = 20; //#define NAVIGATION_SOLUTION_RATE_MS 1000 // this cannot go here //const double GPS_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) -const double GPS_STARTOFFSET_ms = 60.0; +const double GPS_STARTOFFSET_MS = 60.0; // OBSERVABLE HISTORY DEEP FOR INTERPOLATION const int32_t GPS_L1_CA_HISTORY_DEEP = 100; diff --git a/src/core/system_parameters/GPS_L2C.h b/src/core/system_parameters/GPS_L2C.h index 40986fd5b..95542e2e2 100644 --- a/src/core/system_parameters/GPS_L2C.h +++ b/src/core/system_parameters/GPS_L2C.h @@ -42,8 +42,8 @@ // Physical constants -const double GPS_L2_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GPS_L2_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_L2_C_M_S = 299792458.0; //!< The speed of light, [m/s] +const double GPS_L2_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double GPS_L2_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E const double GPS_L2_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double GPS_L2_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] diff --git a/src/core/system_parameters/GPS_L5.h b/src/core/system_parameters/GPS_L5.h index ff669d8b0..d2fa25db3 100644 --- a/src/core/system_parameters/GPS_L5.h +++ b/src/core/system_parameters/GPS_L5.h @@ -40,8 +40,8 @@ // Physical constants -const double GPS_L5_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GPS_L5_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GPS_L5_C_M_S = 299792458.0; //!< The speed of light, [m/s] +const double GPS_L5_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double GPS_L5_PI = 3.1415926535898; //!< Pi as defined in IS-GPS-200E const double GPS_L5_TWO_PI = 6.283185307179586; //!< 2Pi as defined in IS-GPS-200E const double GPS_L5_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Earth rotation rate, [rad/s] @@ -51,23 +51,23 @@ const double GPS_L5_F = -4.442807633e-10; //!< Constant, [s/(m)^(1 // carrier and code frequencies const double GPS_L5_FREQ_HZ = FREQ5; //!< L5 [Hz] -const double GPS_L5i_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] -const int32_t GPS_L5i_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] -const double GPS_L5i_PERIOD = 0.001; //!< GPS L5 code period [seconds] -const int32_t GPS_L5i_PERIOD_MS = 1; //!< GPS L5 code period [ms] -const double GPS_L5i_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds] -const int32_t GPS_L5i_SYMBOL_PERIOD_MS = 10; //!< GPS L5 symbol period [ms] +const double GPS_L5I_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] +const int32_t GPS_L5I_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] +const double GPS_L5I_PERIOD = 0.001; //!< GPS L5 code period [seconds] +const int32_t GPS_L5I_PERIOD_MS = 1; //!< GPS L5 code period [ms] +const double GPS_L5I_SYMBOL_PERIOD = 0.01; //!< GPS L5 symbol period [seconds] +const int32_t GPS_L5I_SYMBOL_PERIOD_MS = 10; //!< GPS L5 symbol period [ms] -const double GPS_L5q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] -const int32_t GPS_L5q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] -const double GPS_L5q_PERIOD = 0.001; //!< GPS L5 code period [seconds] +const double GPS_L5Q_CODE_RATE_HZ = 10.23e6; //!< GPS L5i code rate [chips/s] +const int32_t GPS_L5Q_CODE_LENGTH_CHIPS = 10230; //!< GPS L5i code length [chips] +const double GPS_L5Q_PERIOD = 0.001; //!< GPS L5 code period [seconds] const int32_t GPS_L5_HISTORY_DEEP = 5; //optimum parameters const uint32_t GPS_L5_OPT_ACQ_FS_HZ = 10000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate -const int32_t GPS_L5i_INIT_REG[210] = +const int32_t GPS_L5I_INIT_REG[210] = {266, 365, 804, 1138, 1509, 1559, 1756, 2084, 2170, 2303, 2527, 2687, @@ -124,7 +124,7 @@ const int32_t GPS_L5i_INIT_REG[210] = 5950, 5521, 1515}; -const int32_t GPS_L5q_INIT_REG[210] = +const int32_t GPS_L5Q_INIT_REG[210] = { 1701, 323, 5292, 2020, 5429, 7136, 1041, 5947, @@ -186,11 +186,11 @@ const int32_t GPS_L5_SYMBOLS_PER_BIT = 2; const int32_t GPS_L5_SAMPLES_PER_SYMBOL = 10; const int32_t GPS_L5_CNAV_DATA_PAGE_SYMBOLS = 600; const int32_t GPS_L5_CNAV_DATA_PAGE_DURATION_S = 6; -const int32_t GPS_L5i_NH_CODE_LENGTH = 10; -const int32_t GPS_L5i_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1}; -const std::string GPS_L5i_NH_CODE_STR = "0000110101"; -const int32_t GPS_L5q_NH_CODE_LENGTH = 20; -const int32_t GPS_L5q_NH_CODE[20] = {0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0}; -const std::string GPS_L5q_NH_CODE_STR = "00000100110101001110"; +const int32_t GPS_L5I_NH_CODE_LENGTH = 10; +const int32_t GPS_L5I_NH_CODE[10] = {0, 0, 0, 0, 1, 1, 0, 1, 0, 1}; +const std::string GPS_L5I_NH_CODE_STR = "0000110101"; +const int32_t GPS_L5Q_NH_CODE_LENGTH = 20; +const int32_t GPS_L5Q_NH_CODE[20] = {0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0}; +const std::string GPS_L5Q_NH_CODE_STR = "00000100110101001110"; #endif /* GNSS_SDR_GPS_L5_H_ */ diff --git a/src/core/system_parameters/Galileo_E1.h b/src/core/system_parameters/Galileo_E1.h index 4c9048c11..ee5fc3896 100644 --- a/src/core/system_parameters/Galileo_E1.h +++ b/src/core/system_parameters/Galileo_E1.h @@ -46,29 +46,29 @@ const double GALILEO_PI = 3.1415926535898; //!< Pi as defined in G const double GALILEO_TWO_PI = 6.283185307179600; //!< 2*Pi as defined in GALILEO ICD const double GALILEO_GM = 3.986004418e14; //!< Geocentric gravitational constant[m^3/s^2] const double GALILEO_OMEGA_EARTH_DOT = 7.2921151467e-5; //!< Mean angular velocity of the Earth [rad/s] -const double GALILEO_C_m_s = 299792458.0; //!< The speed of light, [m/s] -const double GALILEO_C_m_ms = 299792.4580; //!< The speed of light, [m/ms] +const double GALILEO_C_M_S = 299792458.0; //!< The speed of light, [m/s] +const double GALILEO_C_M_MS = 299792.4580; //!< The speed of light, [m/ms] const double GALILEO_F = -4.442807309e-10; //!< Constant, [s/(m)^(1/2)] // carrier and code frequencies -const double Galileo_E1_FREQ_HZ = FREQ1; //!< Galileo E1 carrier frequency [Hz] -const double Galileo_E1_CODE_CHIP_RATE_HZ = 1.023e6; //!< Galileo E1 code rate [chips/s] -const double Galileo_E1_CODE_PERIOD = 0.004; //!< Galileo E1 code period [s] -const int32_t Galileo_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] -const double Galileo_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-carrier 'a' rate [Hz] -const double Galileo_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] -const double Galileo_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] -const double Galileo_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] -const int32_t Galileo_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS -const int32_t Galileo_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] -const int32_t Galileo_E1_NUMBER_OF_CODES = 50; +const double GALILEO_E1_FREQ_HZ = FREQ1; //!< Galileo E1 carrier frequency [Hz] +const double GALILEO_E1_CODE_CHIP_RATE_HZ = 1.023e6; //!< Galileo E1 code rate [chips/s] +const double GALILEO_E1_CODE_PERIOD = 0.004; //!< Galileo E1 code period [s] +const int32_t GALILEO_E1_CODE_PERIOD_MS = 4; //!< Galileo E1 code period [ms] +const double GALILEO_E1_SUB_CARRIER_A_RATE_HZ = 1.023e6; //!< Galileo E1 sub-carrier 'a' rate [Hz] +const double GALILEO_E1_SUB_CARRIER_B_RATE_HZ = 6.138e6; //!< Galileo E1 sub-carrier 'b' rate [Hz] +const double GALILEO_E1_B_CODE_LENGTH_CHIPS = 4092.0; //!< Galileo E1-B code length [chips] +const double GALILEO_E1_B_SYMBOL_RATE_BPS = 250.0; //!< Galileo E1-B symbol rate [bits/second] +const int32_t GALILEO_E1_B_SAMPLES_PER_SYMBOL = 1; //!< (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS) / Galileo_E1_B_SYMBOL_RATE_BPS +const int32_t GALILEO_E1_C_SECONDARY_CODE_LENGTH = 25; //!< Galileo E1-C secondary code length [chips] +const int32_t GALILEO_E1_NUMBER_OF_CODES = 50; //optimum parameters -const uint32_t Galileo_E1_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate +const uint32_t GALILEO_E1_OPT_ACQ_FS_HZ = 2000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate -const double GALILEO_STARTOFFSET_ms = 68.802; //[ms] Initial sign. travel time (this cannot go here) +const double GALILEO_STARTOFFSET_MS = 68.802; //[ms] Initial sign. travel time (this cannot go here) // OBSERVABLE HISTORY DEEP FOR INTERPOLATION @@ -79,7 +79,7 @@ const int32_t GALILEO_E1_HISTORY_DEEP = 100; const std::string GALILEO_INAV_PREAMBLE = {"0101100000"}; const int32_t GALILEO_INAV_PREAMBLE_LENGTH_BITS = 10; -const double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + GALILEO_INAV_PREAMBLE_LENGTH_BITS * Galileo_E1_CODE_PERIOD; +const double GALILEO_INAV_PAGE_PART_WITH_PREABLE_SECONDS = 2.0 + GALILEO_INAV_PREAMBLE_LENGTH_BITS * GALILEO_E1_CODE_PERIOD; const int32_t GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS = 250; const int32_t GALILEO_INAV_PAGE_PART_SYMBOLS = 250; //!< Each Galileo INAV pages are composed of two parts (even and odd) each of 250 symbols, including preamble. See Galileo ICD 4.3.2 const int32_t GALILEO_INAV_PAGE_SYMBOLS = 500; //!< The complete Galileo INAV page length @@ -93,218 +93,216 @@ const int32_t GALILEO_PAGE_TYPE_BITS = 6; const int32_t GALILEO_DATA_JK_BITS = 128; const int32_t GALILEO_DATA_FRAME_BITS = 196; const int32_t GALILEO_DATA_FRAME_BYTES = 25; -const double GALILEO_E1_CODE_PERIOD = 0.004; -const int32_t GALILEO_E1_CODE_PERIOD_MS = 4; -const std::vector> type({{1, 6}}); -const std::vector> PAGE_TYPE_bit({{1, 6}}); +const std::vector> TYPE({{1, 6}}); +const std::vector> PAGE_TYPE_BIT({{1, 6}}); /*Page 1 - Word type 1: Ephemeris (1/4)*/ -const std::vector> IOD_nav_1_bit({{7, 10}}); -const std::vector> T0E_1_bit({{17, 14}}); -const int32_t t0e_1_LSB = 60; -const std::vector> M0_1_bit({{31, 32}}); +const std::vector> IOD_NAV_1_BIT({{7, 10}}); +const std::vector> T0_E_1_BIT({{17, 14}}); +const int32_t T0E_1_LSB = 60; +const std::vector> M0_1_BIT({{31, 32}}); const double M0_1_LSB = PI_TWO_N31; -const std::vector> e_1_bit({{63, 32}}); -const double e_1_LSB = TWO_N33; -const std::vector> A_1_bit({{95, 32}}); -const double A_1_LSB_gal = TWO_N19; +const std::vector> E_1_BIT({{63, 32}}); +const double E_1_LSB = TWO_N33; +const std::vector> A_1_BIT({{95, 32}}); +const double A_1_LSB_GAL = TWO_N19; //last two bits are reserved /*Page 2 - Word type 2: Ephemeris (2/4)*/ -const std::vector> IOD_nav_2_bit({{7, 10}}); -const std::vector> OMEGA_0_2_bit({{17, 32}}); +const std::vector> IOD_NAV_2_BIT({{7, 10}}); +const std::vector> OMEGA_0_2_BIT({{17, 32}}); const double OMEGA_0_2_LSB = PI_TWO_N31; -const std::vector> i_0_2_bit({{49, 32}}); -const double i_0_2_LSB = PI_TWO_N31; -const std::vector> omega_2_bit({{81, 32}}); -const double omega_2_LSB = PI_TWO_N31; -const std::vector> iDot_2_bit({{113, 14}}); -const double iDot_2_LSB = PI_TWO_N43; +const std::vector> I_0_2_BIT({{49, 32}}); +const double I_0_2_LSB = PI_TWO_N31; +const std::vector> OMEGA_2_BIT({{81, 32}}); +const double OMEGA_2_LSB = PI_TWO_N31; +const std::vector> I_DOT_2_BIT({{113, 14}}); +const double I_DOT_2_LSB = PI_TWO_N43; //last two bits are reserved /*Word type 3: Ephemeris (3/4) and SISA*/ -const std::vector> IOD_nav_3_bit({{7, 10}}); -const std::vector> OMEGA_dot_3_bit({{17, 24}}); -const double OMEGA_dot_3_LSB = PI_TWO_N43; -const std::vector> delta_n_3_bit({{41, 16}}); -const double delta_n_3_LSB = PI_TWO_N43; -const std::vector> C_uc_3_bit({{57, 16}}); -const double C_uc_3_LSB = TWO_N29; -const std::vector> C_us_3_bit({{73, 16}}); -const double C_us_3_LSB = TWO_N29; -const std::vector> C_rc_3_bit({{89, 16}}); -const double C_rc_3_LSB = TWO_N5; -const std::vector> C_rs_3_bit({{105, 16}}); -const double C_rs_3_LSB = TWO_N5; -const std::vector> SISA_3_bit({{121, 8}}); +const std::vector> IOD_NAV_3_BIT({{7, 10}}); +const std::vector> OMEGA_DOT_3_BIT({{17, 24}}); +const double OMEGA_DOT_3_LSB = PI_TWO_N43; +const std::vector> DELTA_N_3_BIT({{41, 16}}); +const double DELTA_N_3_LSB = PI_TWO_N43; +const std::vector> C_UC_3_BIT({{57, 16}}); +const double C_UC_3_LSB = TWO_N29; +const std::vector> C_US_3_BIT({{73, 16}}); +const double C_US_3_LSB = TWO_N29; +const std::vector> C_RC_3_BIT({{89, 16}}); +const double C_RC_3_LSB = TWO_N5; +const std::vector> C_RS_3_BIT({{105, 16}}); +const double C_RS_3_LSB = TWO_N5; +const std::vector> SISA_3_BIT({{121, 8}}); /*Word type 4: Ephemeris (4/4) and Clock correction parameters*/ -const std::vector> IOD_nav_4_bit({{7, 10}}); -const std::vector> SV_ID_PRN_4_bit({{17, 6}}); -const std::vector> C_ic_4_bit({{23, 16}}); -const double C_ic_4_LSB = TWO_N29; -const std::vector> C_is_4_bit({{39, 16}}); -const double C_is_4_LSB = TWO_N29; -const std::vector> t0c_4_bit({{55, 14}}); // -const int32_t t0c_4_LSB = 60; -const std::vector> af0_4_bit({{69, 31}}); // -const double af0_4_LSB = TWO_N34; -const std::vector> af1_4_bit({{100, 21}}); // -const double af1_4_LSB = TWO_N46; -const std::vector> af2_4_bit({{121, 6}}); -const double af2_4_LSB = TWO_N59; -const std::vector> spare_4_bit({{127, 2}}); +const std::vector> IOD_NAV_4_BIT({{7, 10}}); +const std::vector> SV_ID_PRN_4_BIT({{17, 6}}); +const std::vector> C_IC_4_BIT({{23, 16}}); +const double C_IC_4_LSB = TWO_N29; +const std::vector> C_IS_4_BIT({{39, 16}}); +const double C_IS_4_LSB = TWO_N29; +const std::vector> T0C_4_BIT({{55, 14}}); // +const int32_t T0C_4_LSB = 60; +const std::vector> AF0_4_BIT({{69, 31}}); // +const double AF0_4_LSB = TWO_N34; +const std::vector> AF1_4_BIT({{100, 21}}); // +const double AF1_4_LSB = TWO_N46; +const std::vector> AF2_4_BIT({{121, 6}}); +const double AF2_4_LSB = TWO_N59; +const std::vector> SPARE_4_BIT({{127, 2}}); //last two bits are reserved /*Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST*/ /*Ionospheric correction*/ /*Az*/ -const std::vector> ai0_5_bit({{7, 11}}); // -const double ai0_5_LSB = TWO_N2; -const std::vector> ai1_5_bit({{18, 11}}); // -const double ai1_5_LSB = TWO_N8; -const std::vector> ai2_5_bit({{29, 14}}); // -const double ai2_5_LSB = TWO_N15; +const std::vector> AI0_5_BIT({{7, 11}}); // +const double AI0_5_LSB = TWO_N2; +const std::vector> AI1_5_BIT({{18, 11}}); // +const double AI1_5_LSB = TWO_N8; +const std::vector> AI2_5_BIT({{29, 14}}); // +const double AI2_5_LSB = TWO_N15; /*Ionospheric disturbance flag*/ -const std::vector> Region1_5_bit({{43, 1}}); // -const std::vector> Region2_5_bit({{44, 1}}); // -const std::vector> Region3_5_bit({{45, 1}}); // -const std::vector> Region4_5_bit({{46, 1}}); // -const std::vector> Region5_5_bit({{47, 1}}); // -const std::vector> BGD_E1E5a_5_bit({{48, 10}}); // -const double BGD_E1E5a_5_LSB = TWO_N32; -const std::vector> BGD_E1E5b_5_bit({{58, 10}}); // -const double BGD_E1E5b_5_LSB = TWO_N32; -const std::vector> E5b_HS_5_bit({{68, 2}}); // -const std::vector> E1B_HS_5_bit({{70, 2}}); // -const std::vector> E5b_DVS_5_bit({{72, 1}}); // -const std::vector> E1B_DVS_5_bit({{73, 1}}); // +const std::vector> REGION1_5_BIT({{43, 1}}); // +const std::vector> REGION2_5_BIT({{44, 1}}); // +const std::vector> REGION3_5_BIT({{45, 1}}); // +const std::vector> REGION4_5_BIT({{46, 1}}); // +const std::vector> REGION5_5_BIT({{47, 1}}); // +const std::vector> BGD_E1_E5A_5_BIT({{48, 10}}); // +const double BGD_E1_E5A_5_LSB = TWO_N32; +const std::vector> BGD_E1_E5B_5_BIT({{58, 10}}); // +const double BGD_E1_E5B_5_LSB = TWO_N32; +const std::vector> E5B_HS_5_BIT({{68, 2}}); // +const std::vector> E1_B_HS_5_BIT({{70, 2}}); // +const std::vector> E5B_DVS_5_BIT({{72, 1}}); // +const std::vector> E1_B_DVS_5_BIT({{73, 1}}); // /*GST*/ -const std::vector> WN_5_bit({{74, 12}}); -const std::vector> TOW_5_bit({{86, 20}}); -const std::vector> spare_5_bit({{106, 23}}); +const std::vector> WN_5_BIT({{74, 12}}); +const std::vector> TOW_5_BIT({{86, 20}}); +const std::vector> SPARE_5_BIT({{106, 23}}); /* Page 6 */ -const std::vector> A0_6_bit({{7, 32}}); +const std::vector> A0_6_BIT({{7, 32}}); const double A0_6_LSB = TWO_N30; -const std::vector> A1_6_bit({{39, 24}}); +const std::vector> A1_6_BIT({{39, 24}}); const double A1_6_LSB = TWO_N50; -const std::vector> Delta_tLS_6_bit({{63, 8}}); -const std::vector> t0t_6_bit({{71, 8}}); -const int32_t t0t_6_LSB = 3600; -const std::vector> WNot_6_bit({{79, 8}}); -const std::vector> WN_LSF_6_bit({{87, 8}}); -const std::vector> DN_6_bit({{95, 3}}); -const std::vector> Delta_tLSF_6_bit({{98, 8}}); -const std::vector> TOW_6_bit({{106, 20}}); +const std::vector> DELTA_T_LS_6_BIT({{63, 8}}); +const std::vector> T0T_6_BIT({{71, 8}}); +const int32_t T0T_6_LSB = 3600; +const std::vector> W_NOT_6_BIT({{79, 8}}); +const std::vector> WN_LSF_6_BIT({{87, 8}}); +const std::vector> DN_6_BIT({{95, 3}}); +const std::vector> DELTA_T_LSF_6_BIT({{98, 8}}); +const std::vector> TOW_6_BIT({{106, 20}}); /* Page 7 */ -const std::vector> IOD_a_7_bit({{7, 4}}); -const std::vector> WN_a_7_bit({{11, 2}}); -const std::vector> t0a_7_bit({{13, 10}}); -const int32_t t0a_7_LSB = 600; -const std::vector> SVID1_7_bit({{23, 6}}); -const std::vector> DELTA_A_7_bit({{29, 13}}); +const std::vector> IOD_A_7_BIT({{7, 4}}); +const std::vector> WN_A_7_BIT({{11, 2}}); +const std::vector> T0A_7_BIT({{13, 10}}); +const int32_t T0A_7_LSB = 600; +const std::vector> SVI_D1_7_BIT({{23, 6}}); +const std::vector> DELTA_A_7_BIT({{29, 13}}); const double DELTA_A_7_LSB = TWO_N9; -const std::vector> e_7_bit({{42, 11}}); -const double e_7_LSB = TWO_N16; -const std::vector> omega_7_bit({{53, 16}}); -const double omega_7_LSB = TWO_N15; -const std::vector> delta_i_7_bit({{69, 11}}); -const double delta_i_7_LSB = TWO_N14; -const std::vector> Omega0_7_bit({{80, 16}}); -const double Omega0_7_LSB = TWO_N15; -const std::vector> Omega_dot_7_bit({{96, 11}}); -const double Omega_dot_7_LSB = TWO_N33; -const std::vector> M0_7_bit({{107, 16}}); +const std::vector> E_7_BIT({{42, 11}}); +const double E_7_LSB = TWO_N16; +const std::vector> OMEGA_7_BIT({{53, 16}}); +const double OMEGA_7_LSB = TWO_N15; +const std::vector> DELTA_I_7_BIT({{69, 11}}); +const double DELTA_I_7_LSB = TWO_N14; +const std::vector> OMEGA0_7_BIT({{80, 16}}); +const double OMEGA0_7_LSB = TWO_N15; +const std::vector> OMEGA_DOT_7_BIT({{96, 11}}); +const double OMEGA_DOT_7_LSB = TWO_N33; +const std::vector> M0_7_BIT({{107, 16}}); const double M0_7_LSB = TWO_N15; /* Page 8 */ -const std::vector> IOD_a_8_bit({{7, 4}}); -const std::vector> af0_8_bit({{11, 16}}); -const double af0_8_LSB = TWO_N19; -const std::vector> af1_8_bit({{27, 13}}); -const double af1_8_LSB = TWO_N38; -const std::vector> E5b_HS_8_bit({{40, 2}}); -const std::vector> E1B_HS_8_bit({{42, 2}}); -const std::vector> SVID2_8_bit({{44, 6}}); -const std::vector> DELTA_A_8_bit({{50, 13}}); +const std::vector> IOD_A_8_BIT({{7, 4}}); +const std::vector> AF0_8_BIT({{11, 16}}); +const double AF0_8_LSB = TWO_N19; +const std::vector> AF1_8_BIT({{27, 13}}); +const double AF1_8_LSB = TWO_N38; +const std::vector> E5B_HS_8_BIT({{40, 2}}); +const std::vector> E1_B_HS_8_BIT({{42, 2}}); +const std::vector> SVI_D2_8_BIT({{44, 6}}); +const std::vector> DELTA_A_8_BIT({{50, 13}}); const double DELTA_A_8_LSB = TWO_N9; -const std::vector> e_8_bit({{63, 11}}); -const double e_8_LSB = TWO_N16; -const std::vector> omega_8_bit({{74, 16}}); -const double omega_8_LSB = TWO_N15; -const std::vector> delta_i_8_bit({{90, 11}}); -const double delta_i_8_LSB = TWO_N14; -const std::vector> Omega0_8_bit({{101, 16}}); -const double Omega0_8_LSB = TWO_N15; -const std::vector> Omega_dot_8_bit({{117, 11}}); -const double Omega_dot_8_LSB = TWO_N33; +const std::vector> E_8_BIT({{63, 11}}); +const double E_8_LSB = TWO_N16; +const std::vector> OMEGA_8_BIT({{74, 16}}); +const double OMEGA_8_LSB = TWO_N15; +const std::vector> DELTA_I_8_BIT({{90, 11}}); +const double DELTA_I_8_LSB = TWO_N14; +const std::vector> OMEGA0_8_BIT({{101, 16}}); +const double OMEGA0_8_LSB = TWO_N15; +const std::vector> OMEGA_DOT_8_BIT({{117, 11}}); +const double OMEGA_DOT_8_LSB = TWO_N33; /* Page 9 */ -const std::vector> IOD_a_9_bit({{7, 4}}); -const std::vector> WN_a_9_bit({{11, 2}}); -const std::vector> t0a_9_bit({{13, 10}}); -const int32_t t0a_9_LSB = 600; -const std::vector> M0_9_bit({{23, 16}}); +const std::vector> IOD_A_9_BIT({{7, 4}}); +const std::vector> WN_A_9_BIT({{11, 2}}); +const std::vector> T0A_9_BIT({{13, 10}}); +const int32_t T0A_9_LSB = 600; +const std::vector> M0_9_BIT({{23, 16}}); const double M0_9_LSB = TWO_N15; -const std::vector> af0_9_bit({{39, 16}}); -const double af0_9_LSB = TWO_N19; -const std::vector> af1_9_bit({{55, 13}}); -const double af1_9_LSB = TWO_N38; -const std::vector> E5b_HS_9_bit({{68, 2}}); -const std::vector> E1B_HS_9_bit({{70, 2}}); -const std::vector> SVID3_9_bit({{72, 6}}); -const std::vector> DELTA_A_9_bit({{78, 13}}); +const std::vector> AF0_9_BIT({{39, 16}}); +const double AF0_9_LSB = TWO_N19; +const std::vector> AF1_9_BIT({{55, 13}}); +const double AF1_9_LSB = TWO_N38; +const std::vector> E5B_HS_9_BIT({{68, 2}}); +const std::vector> E1_B_HS_9_BIT({{70, 2}}); +const std::vector> SVI_D3_9_BIT({{72, 6}}); +const std::vector> DELTA_A_9_BIT({{78, 13}}); const double DELTA_A_9_LSB = TWO_N9; -const std::vector> e_9_bit({{91, 11}}); -const double e_9_LSB = TWO_N16; -const std::vector> omega_9_bit({{102, 16}}); -const double omega_9_LSB = TWO_N15; -const std::vector> delta_i_9_bit({{118, 11}}); -const double delta_i_9_LSB = TWO_N14; +const std::vector> E_9_BIT({{91, 11}}); +const double E_9_LSB = TWO_N16; +const std::vector> OMEGA_9_BIT({{102, 16}}); +const double OMEGA_9_LSB = TWO_N15; +const std::vector> DELTA_I_9_BIT({{118, 11}}); +const double DELTA_I_9_LSB = TWO_N14; /* Page 10 */ -const std::vector> IOD_a_10_bit({{7, 4}}); -const std::vector> Omega0_10_bit({{11, 16}}); -const double Omega0_10_LSB = TWO_N15; -const std::vector> Omega_dot_10_bit({{27, 11}}); -const double Omega_dot_10_LSB = TWO_N33; -const std::vector> M0_10_bit({{38, 16}}); +const std::vector> IOD_A_10_BIT({{7, 4}}); +const std::vector> OMEGA0_10_BIT({{11, 16}}); +const double OMEGA0_10_LSB = TWO_N15; +const std::vector> OMEGA_DOT_10_BIT({{27, 11}}); +const double OMEGA_DOT_10_LSB = TWO_N33; +const std::vector> M0_10_BIT({{38, 16}}); const double M0_10_LSB = TWO_N15; -const std::vector> af0_10_bit({{54, 16}}); -const double af0_10_LSB = TWO_N19; -const std::vector> af1_10_bit({{70, 13}}); -const double af1_10_LSB = TWO_N38; -const std::vector> E5b_HS_10_bit({{83, 2}}); -const std::vector> E1B_HS_10_bit({{85, 2}}); -const std::vector> A_0G_10_bit({{87, 16}}); +const std::vector> AF0_10_BIT({{54, 16}}); +const double AF0_10_LSB = TWO_N19; +const std::vector> AF1_10_BIT({{70, 13}}); +const double AF1_10_LSB = TWO_N38; +const std::vector> E5B_HS_10_BIT({{83, 2}}); +const std::vector> E1_B_HS_10_BIT({{85, 2}}); +const std::vector> A_0_G_10_BIT({{87, 16}}); const double A_0G_10_LSB = TWO_N35; -const std::vector> A_1G_10_bit({{103, 12}}); +const std::vector> A_1_G_10_BIT({{103, 12}}); const double A_1G_10_LSB = TWO_N51; -const std::vector> t_0G_10_bit({{115, 8}}); -const int32_t t_0G_10_LSB = 3600; -const std::vector> WN_0G_10_bit({{123, 6}}); +const std::vector> T_0_G_10_BIT({{115, 8}}); +const int32_t T_0_G_10_LSB = 3600; +const std::vector> WN_0_G_10_BIT({{123, 6}}); /* Page 0 */ -const std::vector> Time_0_bit({{7, 2}}); -const std::vector> WN_0_bit({{97, 12}}); -const std::vector> TOW_0_bit({{109, 20}}); +const std::vector> TIME_0_BIT({{7, 2}}); +const std::vector> WN_0_BIT({{97, 12}}); +const std::vector> TOW_0_BIT({{109, 20}}); // Galileo E1 primary codes -const std::string Galileo_E1_B_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { +const std::string GALILEO_E1_B_PRIMARY_CODE[GALILEO_E1_NUMBER_OF_CODES] = { "F5D710130573541B9DBD4FD9E9B20A0D59D144C54BC7935539D2E75810FB51E494093A0A19DD79C70C5A98E5657AA578097777E86BCC4651CC72F2F974DC766E07AEA3D0B557EF42FF57E6A58E805358CE9257669133B18F80FDBDFB38C5524C7FB1DE079842482990DF58F72321D9201F8979EAB159B2679C9E95AA6D53456C0DF75C2B4316D1E2309216882854253A1FA60CA2C94ECE013E2A8C943341E7D9E5A8464B3AD407E0AE465C3E3DD1BE60A8C3D50F831536401E776BE02A6042FC4A27AF653F0CFC4D4D013F115310788D68CAEAD3ECCCC5330587EB3C22A1459FC8E6FCCE9CDE849A5205E70C6D66D125814D698DD0EEBFEAE52CC65C5C84EEDF207379000E169D318426516AC5D1C31F2E18A65E07AE6E33FDD724B13098B3A444688389EFBBB5EEAB588742BB083B679D42FB26FF77919EAB21DE0389D9997498F967AE05AF0F4C7E177416E18C4D5E6987ED3590690AD127D872F14A8F4903A12329732A9768F82F295BEE391879293E3A97D51435A7F03ED7FBE275F102A83202DC3DE94AF4C712E9D006D182693E9632933E6EB773880CF147B922E74539E4582F79E39723B4C80E42EDCE4C08A8D02221BAE6D17734817D5B531C0D3C1AE723911F3FFF6AAC02E97FEA69E376AF4761E6451CA61FDB2F9187642EFCD63A09AAB680770C1593EEDD4FF4293BFFD6DD2C3367E85B14A654C834B6699421A", // 01 "96B856A629F581D1344FEF597835FE60434625D077ECF0D95FBE1155EA0431979E5AFF544AF591A332FDAEF98AB1EDD847A73F3AF15AAEE7E9A05C9D82C59EC325EF4CF264B8ADF2A8E8BA459354CB4B415CC50BF239ADBC31B3A9C87B0843CF3B9E6D646BA43F866276B053826F3A2334CC5E2EFB9F8F195B382E75EEA63F58A06B3F82A3B5C77C1800FD9498F803E524435B321210BB84690BED0BBBE16D363B3A90656A73720E27008852FB7DACC8284411B177728D9527C560859084A395A6F11A96AD9DB6B43E00642B000ED12BFD967868EAB1108552CD4FC89FBC408ACE7678C381EC91DD000319124EB5D5EF52C4CAC9AADEE2FA045C16CE492D7F43743CA77924C78696FCBF2F9F7F36D8E623752200C6FCBBD71ABBB6877F3C5D6E6740AB0389458A6B66440858B2D383244E853646FE2714211DEA9E6196252815BB704A20BFE556AC474F8998944E0CABBBE21A6400B87BFDCF937D12B2821D59298AF4AD378F0F42BD8C41693B8D993CF37C8B478F3BB5D33AD2A9FA24AD7B8FA895FDBC04964192F7BA3FF74E0E3A435B5DFE042E3115CACF29624C0645E9C917534A2EBC1F5665E4E1B1BC56208DBCD8A27CCB6474D5D0E20CA4072C960E5ACE41BDA3770DF3B681F2B318F6F8E1CB17C2857350FB6009AED665E13B2780D79217F73FAC7A8A48048DB0FB8A8A5007CDDC9A7B2DA8257C99F1CB605A18204", "E57DE19A3E4A8C122FCB1DD6584B3D2DAE364D800F9C5A9E957B38F624CBD3ACC58FA3ED070B5E44857CCB813FBC0BB83B5D157C6C562422E5963CC4DD753C45B0264F8E136A0F1774D77A543E44D51EF8C6B9408B6E3B5CEE1347A94F13ECDC94DC764976E5A50B4CB0AE7557553B47EDFE03EC2CD32EA8D125A341E1EDFC77E75330D6E7B23DC838EBCE7E5567F5B8C80C3D15E7404B4E10F0BEB0C69626A814AF91334199864FC77E0FF548DC2A6FA6A71C3C0561F2B085CC05E8512E27B9DBA60B93D114B87935776C8E9A67905C429D48BF3AB1B0A56FAFBFD5D9C8D8C8A9E5918BFF273CF5E8664FF2B90314BDBFDAD5AB8C22A0E45C104ECE75EA43FE9BDCE306A5A28AE464628163D249D8056005F1A900951808CC8620F81768153436F741667A8E271DD986C7A1E5046FCC74C7CEBBF9A1296D6CF0B2FF85BE412D87214BB368DFF462AD649D7324A117252311C664D33E4DAFBD830FBCEB6EFBDD7391D4BADA7A775FD1949D981F619655DB3C22BAC34E5AE41222905C0C7E80D6EA28471EC0468756531C09A471EDBE200472E78F1701FEE96E5769A9893C0F11E7906B064442E06E21ED8B0D70AF288690C532A2D03B373E1E0085F62F7AAA658B569C5184E3DDC40ECAA88B887118601691892F9F55E2DE79E49DFF11D434C2BA3AA6447522A7C99DC215CAD2ED0114ED62CBDAE9D315E48AE14D2014B7F8E", @@ -357,7 +355,7 @@ const std::string Galileo_E1_B_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { "97051FC67ACA30E8AEE73D3A8CF38BB13524D4E0EBD9BE68398C7C16227CABB1D0B0A0ABE7B6384ABA02905BA0C3C7363599D059C7B4C99DB165CD14FA12FA7912449CA7DD5E346D8010C85A757382270DAD15BA3CE36A76EF55F81A1E80BF366B37FE3A88EC722028C25E234E624040450A99CD808F942568AA7133981D72E7F2928894670AD5399482DF1B90E7E64062F830B736C79C30F36281495C76699CD48404673FA334F042F9E0E67DD7F3853BF71ABEAF6A9A5546855E840CE42B224D8F6490C6CE5FC02EBAF4FFC390107058F54CD635D4A7F2878099C1EF495750E6921BE2F39AD808C4210F287319F811A254CEF8CF153FC50AB2F3D694A530949E5F578D075DB96DDCF2BB90ED3DE09D9CA8E08662FD8982741DE1CE0A6B64C3D3D5004B5C04B2B0DFD976A20FACC94D1762D41EE03B40D2CF367612812EF4CC41D1BFE9CEB51AE3A22AF1BE7B85A057D3048D0E73FA0FDAF1119EFD76F0A41BE63128B22D64A5553E9549D411483BBCA1483EF30CF6A6D317AD2C7973EFA6D4C1121F703D2F48FCDA3177AD450D75D2A28D2C244AEA13F0E60AEED8ACBAB444D400DF5E280DB799B2D9A984DF1E2567D39D1DE58EF78CA6B4D8BC172B07DCB02D156CA96EEFAC69E556CFCE0AAB617C7FBB8C34871C1D35E74B7BD307D3F2E424C7A9AD676A1A69E0FE735EA50887A1DFAE6CA2FE4460FC7EF323ADE493020" // 50 }; -const std::string Galileo_E1_C_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { +const std::string GALILEO_E1_C_PRIMARY_CODE[GALILEO_E1_NUMBER_OF_CODES] = { "B39340CA1C817D81EF4FAE4E95BF3504A7709089FB48560E9E3EF802180E85EB2194E05902C6C4C52021FEB7EC64FD416BCEBC8E39D64A4B5EE345291911AB8204A888C25B1CD3D9342A56C538636D3EAB957037D09E879AE5F3A39834FBB84A3D8D5090D7814246B62E9CA68533D2EC403B4FB9488467FF9758B0D15A8CEF89187A1D5897880040B6C3C5244E85A2AD14BCF2F5ABC44A7B1D4A87E8BDA05766218773ED4F70F8D1D07CBB1E8CA6298E64EE6DC5886D37495BA2EDB3E0B0B68AD9F300310B88898DDEEFD484538C31A9BCAA76ECAD0C16607D32189058B0862EE9D70CEA9D304755CE8037BA4C46C2573181748A212E4B2BDD04F9BC240518273DC17CBAFF21A03E9120FA7DCA18D56DD1D9A7E510C90CF219104385F531F2EFAFD185ECB6B911F9B7809D98D86F15516FFDDBE9BD1CF8662EB777C3F94EA3F962D7B79449FAAD39935429E92CAE5637E9BCF4E94D413D27934952409AB536BE4055AFBC4330CD1E4B5509EFE5F8EFC9ECBE9EF377DE7E37C479BB9D3EE7745E4609B0A6D2C5D92EB3C9E2278C1F2221FF907596AA5E096ACF8990EBA907E43AD320F8019CB6355A2BA8670EE5A4F463E8E56F8F1D3E7F4922510FB668E32C4CF23AD8496399638B095B47833E0CBB34977EB3E4242EAF870D86660D6A73F83E45D6E8A41EDCA3815079649544597C5C43B6C93FEBAD5700D22EDAF431FD340", "A64F94BB47BD4033C76D4924305907EC1F618B43C7535F3CFC093E5AF5DDD5C4339F3BB6D835B5C2C2053CD3D5693368D4E1A7CAC59425D1FD96809C67285CFD3FC05B01053CB0773221D7205778022F487BF99D1650566BE287FD7AE882AA8E8F52E5D4E3C0C2F971C9FF70AA378691EBD8ADE45CF213822D09FD05243F9726F6C69893845E57C37A7643E16B770E26F431FF69D437271905D270EB85D8D229D7D87662121F0BEEB1E895ED9589A9CF5833408A04197AC9025D8570AD9B75DB7E192EA0A089504996E9DC652975D83633619CFF80667D8B519536B3475248BA8213C8A4C66DE69B4B3774BF9142425C57F34A27B1E288119E3FFCC6AF6A21087F9394F09DDFBD42F32D059B8CD4104A519BA640765D5CDE490E62F10E695FBFD33CBC9D2208A532C8EC25DA28B8CC1B6850AB43D9B5C00B6E74B7A148791AB07B328D347058C7E6233E18C5ED172C9F9E9ACF29D913E2A1614BFC0893D4967ED033B2B9AE6B51F908F1CED57C14FEEA85CD4D9711216BE7F79FA6721B7DCCA033C80127AC6E5FCF58EB4005EC24CB4886D787355362D5E7031B9B2AC2A86D730AD734181E723A811FF510A4DF868001973FE83288D78E6F9B9441DAF5BE2974A2848FD917C3BCD346A431922246EC852E4AAD467E60C15D61DD3BF4A207BB57DB45DCADEFE3210BE74B9DACC918A394469F2E2C95AD1E211947948FE24F5E4", "FD1F6976002C39C87187C44E3D224ED4DF0B67750105944C651A5E57798F168A136AC0FB5979C4E847A82B20A2E6C45DB42EF2B930A80D3257BCCC53EDA966F5DCD9AD47CFB226EED9B62A874E9F6404D4087798A1005F4131171D3A47907A3CD602B83DABE094D2CB031867DF4595F3ED59FD8C4D76EDEEE59E422CE5C7D0A5F720BE94FA24DF05F758348EADD5EFE9197C6BB2292E2B14DB8C6DB24AA94C5FF0F5106D2B566058D32C58B63A150784F7B02478D9973DD4CFD2E84059AE0F4F1320754B7EE83F04A51C67EFFC2EB1C301C0C58DBAEBE95474E3484A76500103C14C40BB0B7D3A04D8BDABB605C1EF9FD4A6564934DEC50BD5878243AEE80F9796EED70CE1B1E8B55725DF76472D12D4A7A487989F42E6705818B1F7E149E97153A7B05A82FA3FBE51763E61171A4E12931472E94CCBA74CC09483DF93623FC60945070FDDF3A00B561650427E4BD64D675B1EB398B35EF057A66FD0B48EDBABBDCD57C32ABAE46F5CDD0CB1FCF17765258236F3DE40BD5D0A3C5C978D81DEB07367AB20B2CAA9834B9576161C4F20FB9C184A01DC9021A4E92B71333354E05BBEA9015E5AC4C66312E8B79F0B92279AC7EF1936BCC30802B83DB3D113BEF64452CAD7ACF6674FDA44023A661019841A101BE80FDA4E3210AE774E433A9ABD97F2755259AECE21F7A8C3B1A3D471F874D2EEC85B9B21BC0C2E2EC9016F847C6", @@ -409,6 +407,6 @@ const std::string Galileo_E1_C_PRIMARY_CODE[Galileo_E1_NUMBER_OF_CODES] = { "CD7AAC98501F29507EA4E0183E8A40D2E5117E47BB5D18D01A3732DE4C821DFE86521CBEA7DB29BE1148BD544ECC681689BCD1B41EAF755310B7659342F8EE11CB41550CC30E566E192796B66C1A83C0B28BACCFA6C393043A0A2CB89712BC1CCB174DE58E66896AF39C1CEED1E05B0435F8CF6FD920D100F51584FE24879987399481DBF27DDB6286B6353919E552E669290CE02AB4CD5113D7F484229F379C7332767EC69E4336439B05DE1C1E3563DD303A4F580BFF20A40E49CB0822F715ED0221EBCDB5DBAD751124B1715E82F37488265135B6C8BBCF4F801ECC4D3525FF189493AD4EFF0C042B070C4CA8FB1FDF43D79F06A6E4E3D35D7B07D4B728D5DC54EEDACBBBA1EDDCDC07ADF7DFCFEF835E44DF1FF66DAF2A7BAEBE218AC3B15E183044D6A8A89B3C101B40BED97ED5DF93BBC1B84931D56B8C822A6D058AC74CFA4C85D8B456698E82D5B7574C17B041E5F4BEED09F75012355CBC322B822C63F10C18A8F279E9A0E18E1FEF183D23E13894E31F6D046956FE8A647558228F6D4D6910151EC03937876B6ED7A078D33DAEB3F2239353BB8181E62B286BBC41588DE10F478A5CE5B508F205A41820356767B0A0ED4B8DB9EFE348362E9A90D6C30218B295B338B51C09239D02FC8A1E7DAAAB60AC37F5E67CFC88EEF69567B5C81A03B449F4ED38B9D295A36AA3503173F6F6F66D93CE72D753076040FACDE", "ADDCEDB50E907D20E826E6E8A0D30C20C74B2DF204EA784BAE9F618CAE33A3C937729DF9CB10BA2A4C33E0182A37200C0CC509729D828B8A2A20F283AC4F9306596684EA3FB5492A4C9F2DB459E7531C9F9C0950E7D9E93B3EE5912AE7E39AC8F4EC14B18F24E325003F477E347C5AC1B67CDB11AF3BBBBCD0AC3703024B5767AA67A208254F798684BFD1D3EACD757EEC77254950A146620400DB95E694574F739A991EBA771EBBDFF1056BB39A77DBE0636A032E17141332F951C57C6C90F348F165E3ABDD60D429D5D6BEC7E3E3463806F819EB2D212B3528A5EDE51F235AD100A35E890955F8A1DC51FDCB53EABCA2540997DD054C1F5B29462995B876B44D085904E55E1B838BEF600A992EB49CE078DF75AF3D0F137685AC0D07F0BE1EB87B63A41E74DDE869C8A683BDE60AF5D77FF18F7137495BCEFD0ED28F62F9C3E25D332B5F861D999FCDC0B4851A984A4DBB53401FD40351ADA4335C702BCC8D900C737507B990BDDBE91D201E3A0946DC968D43FD10D04B0B76667FF5B4291C2124B0124C6B710A6D1BCFAEB016B9DEEB0F7A4FE044CA4EA0CCD84B7682617C3A545071EC295B0663B3F577D562DE1D9DD80DE6A1EFD6D5991EB5246F1597B86D0E9A90CF6DB0EB2B8E7BAE9431E567F01AA98502C773742246467ABF911A91A51F6C1B9E0C3233DC1A37D17DB91A5F0F661B0EB5886964456C7818601BD0C"}; -const std::string Galileo_E1_C_SECONDARY_CODE = "0011100000001010110110010"; +const std::string GALILEO_E1_C_SECONDARY_CODE = "0011100000001010110110010"; #endif /* GNSS_SDR_GALILEO_E1_H_ */ diff --git a/src/core/system_parameters/Galileo_E5a.h b/src/core/system_parameters/Galileo_E5a.h index cf7e56ce1..19122372c 100644 --- a/src/core/system_parameters/Galileo_E5a.h +++ b/src/core/system_parameters/Galileo_E5a.h @@ -40,17 +40,17 @@ // Carrier and code frequencies -const double Galileo_E5a_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz] -const double Galileo_E5a_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s] -const double Galileo_E5a_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s] -const double Galileo_E5a_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s] -const int32_t Galileo_E5a_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips] -const int32_t Galileo_E5a_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips] -const int32_t Galileo_E5a_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips] -const double GALILEO_E5a_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s] -const int32_t GALILEO_E5a_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms] -const int32_t Galileo_E5a_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second] -const int32_t Galileo_E5a_NUMBER_OF_CODES = 50; +const double GALILEO_E5A_FREQ_HZ = FREQ5; //!< Galileo E5a carrier frequency [Hz] +const double GALILEO_E5A_CODE_CHIP_RATE_HZ = 1.023e7; //!< Galileo E5a code rate [chips/s] +const double GALILEO_E5A_I_TIERED_CODE_PERIOD = 0.020; //!< Galileo E5a-I tiered code period [s] +const double GALILEO_E5A_Q_TIERED_CODE_PERIOD = 0.100; //!< Galileo E5a-Q tiered code period [s] +const int32_t GALILEO_E5A_CODE_LENGTH_CHIPS = 10230; //!< Galileo E5a primary code length [chips] +const int32_t GALILEO_E5A_I_SECONDARY_CODE_LENGTH = 20; //!< Galileo E5a-I secondary code length [chips] +const int32_t GALILEO_E5A_Q_SECONDARY_CODE_LENGTH = 100; //!< Galileo E5a-Q secondary code length [chips] +const double GALILEO_E5A_CODE_PERIOD = 0.001; //!< Galileo E1 primary code period [s] +const int32_t GALILEO_E5A_CODE_PERIOD_MS = 1; //!< Galileo E1 primary code period [ms] +const int32_t GALILEO_E5A_SYMBOL_RATE_BPS = 50; //!< Galileo E5a symbol rate [bits/second] +const int32_t GALILEO_E5A_NUMBER_OF_CODES = 50; // OBSERVABLE HISTORY DEEP FOR INTERPOLATION AND CRC ERROR LIMIT @@ -58,7 +58,7 @@ const int32_t GALILEO_E5A_HISTORY_DEEP = 20; const int32_t GALILEO_E5A_CRC_ERROR_LIMIT = 6; //optimum parameters -const uint32_t Galileo_E5a_OPT_ACQ_FS_HZ = 10000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate +const uint32_t GALILEO_E5A_OPT_ACQ_FS_HZ = 10000000; //!< Sampling frequncy that maximizes the acquisition SNR while using a non-multiple of chip rate // F/NAV message structure @@ -77,156 +77,156 @@ const int32_t GALILEO_FNAV_PAGE_TYPE_BITS = 6; const int32_t GALILEO_FNAV_DATA_FRAME_BITS = 214; const int32_t GALILEO_FNAV_DATA_FRAME_BYTES = 27; -const std::vector> FNAV_PAGE_TYPE_bit({{1, 6}}); +const std::vector> FNAV_PAGE_TYPE_BIT({{1, 6}}); /* WORD 1 iono corrections. FNAV (Galileo E5a message)*/ -const std::vector> FNAV_SV_ID_PRN_1_bit({{7, 6}}); -const std::vector> FNAV_IODnav_1_bit({{13, 10}}); -const std::vector> FNAV_t0c_1_bit({{23, 14}}); -const int32_t FNAV_t0c_1_LSB = 60; -const std::vector> FNAV_af0_1_bit({{37, 31}}); -const double FNAV_af0_1_LSB = TWO_N34; -const std::vector> FNAV_af1_1_bit({{68, 21}}); -const double FNAV_af1_1_LSB = TWO_N46; -const std::vector> FNAV_af2_1_bit({{89, 6}}); -const double FNAV_af2_1_LSB = TWO_N59; -const std::vector> FNAV_SISA_1_bit({{95, 8}}); -const std::vector> FNAV_ai0_1_bit({{103, 11}}); -const double FNAV_ai0_1_LSB = TWO_N2; -const std::vector> FNAV_ai1_1_bit({{114, 11}}); -const double FNAV_ai1_1_LSB = TWO_N8; -const std::vector> FNAV_ai2_1_bit({{125, 14}}); -const double FNAV_ai2_1_LSB = TWO_N15; -const std::vector> FNAV_region1_1_bit({{139, 1}}); -const std::vector> FNAV_region2_1_bit({{140, 1}}); -const std::vector> FNAV_region3_1_bit({{141, 1}}); -const std::vector> FNAV_region4_1_bit({{142, 1}}); -const std::vector> FNAV_region5_1_bit({{143, 1}}); -const std::vector> FNAV_BGD_1_bit({{144, 10}}); +const std::vector> FNAV_SV_ID_PRN_1_BIT({{7, 6}}); +const std::vector> FNAV_IO_DNAV_1_BIT({{13, 10}}); +const std::vector> FNAV_T0C_1_BIT({{23, 14}}); +const int32_t FNAV_T0C_1_LSB = 60; +const std::vector> FNAV_AF0_1_BIT({{37, 31}}); +const double FNAV_AF0_1_LSB = TWO_N34; +const std::vector> FNAV_AF1_1_BIT({{68, 21}}); +const double FNAV_AF1_1_LSB = TWO_N46; +const std::vector> FNAV_AF2_1_BIT({{89, 6}}); +const double FNAV_AF2_1_LSB = TWO_N59; +const std::vector> FNAV_SISA_1_BIT({{95, 8}}); +const std::vector> FNAV_AI0_1_BIT({{103, 11}}); +const double FNAV_AI0_1_LSB = TWO_N2; +const std::vector> FNAV_AI1_1_BIT({{114, 11}}); +const double FNAV_AI1_1_LSB = TWO_N8; +const std::vector> FNAV_AI2_1_BIT({{125, 14}}); +const double FNAV_AI2_1_LSB = TWO_N15; +const std::vector> FNAV_REGION1_1_BIT({{139, 1}}); +const std::vector> FNAV_REGION2_1_BIT({{140, 1}}); +const std::vector> FNAV_REGION3_1_BIT({{141, 1}}); +const std::vector> FNAV_REGION4_1_BIT({{142, 1}}); +const std::vector> FNAV_REGION5_1_BIT({{143, 1}}); +const std::vector> FNAV_BGD_1_BIT({{144, 10}}); const double FNAV_BGD_1_LSB = TWO_N32; -const std::vector> FNAV_E5ahs_1_bit({{154, 2}}); -const std::vector> FNAV_WN_1_bit({{156, 12}}); -const std::vector> FNAV_TOW_1_bit({{168, 20}}); -const std::vector> FNAV_E5advs_1_bit({{188, 1}}); +const std::vector> FNAV_E5AHS_1_BIT({{154, 2}}); +const std::vector> FNAV_WN_1_BIT({{156, 12}}); +const std::vector> FNAV_TOW_1_BIT({{168, 20}}); +const std::vector> FNAV_E5ADVS_1_BIT({{188, 1}}); // WORD 2 Ephemeris (1/3) -const std::vector> FNAV_IODnav_2_bit({{7, 10}}); -const std::vector> FNAV_M0_2_bit({{17, 32}}); +const std::vector> FNAV_IO_DNAV_2_BIT({{7, 10}}); +const std::vector> FNAV_M0_2_BIT({{17, 32}}); const double FNAV_M0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_omegadot_2_bit({{49, 24}}); -const double FNAV_omegadot_2_LSB = PI_TWO_N43; -const std::vector> FNAV_e_2_bit({{73, 32}}); -const double FNAV_e_2_LSB = TWO_N33; -const std::vector> FNAV_a12_2_bit({{105, 32}}); -const double FNAV_a12_2_LSB = TWO_N19; -const std::vector> FNAV_omega0_2_bit({{137, 32}}); -const double FNAV_omega0_2_LSB = PI_TWO_N31; -const std::vector> FNAV_idot_2_bit({{169, 14}}); -const double FNAV_idot_2_LSB = PI_TWO_N43; -const std::vector> FNAV_WN_2_bit({{183, 12}}); -const std::vector> FNAV_TOW_2_bit({{195, 20}}); +const std::vector> FNAV_OMEGADOT_2_BIT({{49, 24}}); +const double FNAV_OMEGADOT_2_LSB = PI_TWO_N43; +const std::vector> FNAV_E_2_BIT({{73, 32}}); +const double FNAV_E_2_LSB = TWO_N33; +const std::vector> FNAV_A12_2_BIT({{105, 32}}); +const double FNAV_A12_2_LSB = TWO_N19; +const std::vector> FNAV_OMEGA0_2_BIT({{137, 32}}); +const double FNAV_OMEGA0_2_LSB = PI_TWO_N31; +const std::vector> FNAV_IDOT_2_BIT({{169, 14}}); +const double FNAV_IDOT_2_LSB = PI_TWO_N43; +const std::vector> FNAV_WN_2_BIT({{183, 12}}); +const std::vector> FNAV_TOW_2_BIT({{195, 20}}); // WORD 3 Ephemeris (2/3) -const std::vector> FNAV_IODnav_3_bit({{7, 10}}); -const std::vector> FNAV_i0_3_bit({{17, 32}}); -const double FNAV_i0_3_LSB = PI_TWO_N31; -const std::vector> FNAV_w_3_bit({{49, 32}}); -const double FNAV_w_3_LSB = PI_TWO_N31; -const std::vector> FNAV_deltan_3_bit({{81, 16}}); -const double FNAV_deltan_3_LSB = PI_TWO_N43; -const std::vector> FNAV_Cuc_3_bit({{97, 16}}); -const double FNAV_Cuc_3_LSB = TWO_N29; -const std::vector> FNAV_Cus_3_bit({{113, 16}}); -const double FNAV_Cus_3_LSB = TWO_N29; -const std::vector> FNAV_Crc_3_bit({{129, 16}}); -const double FNAV_Crc_3_LSB = TWO_N5; -const std::vector> FNAV_Crs_3_bit({{145, 16}}); -const double FNAV_Crs_3_LSB = TWO_N5; -const std::vector> FNAV_t0e_3_bit({{161, 14}}); -const int32_t FNAV_t0e_3_LSB = 60; -const std::vector> FNAV_WN_3_bit({{175, 12}}); -const std::vector> FNAV_TOW_3_bit({{187, 20}}); +const std::vector> FNAV_IO_DNAV_3_BIT({{7, 10}}); +const std::vector> FNAV_I0_3_BIT({{17, 32}}); +const double FNAV_I0_3_LSB = PI_TWO_N31; +const std::vector> FNAV_W_3_BIT({{49, 32}}); +const double FNAV_W_3_LSB = PI_TWO_N31; +const std::vector> FNAV_DELTAN_3_BIT({{81, 16}}); +const double FNAV_DELTAN_3_LSB = PI_TWO_N43; +const std::vector> FNAV_CUC_3_BIT({{97, 16}}); +const double FNAV_CUC_3_LSB = TWO_N29; +const std::vector> FNAV_CUS_3_BIT({{113, 16}}); +const double FNAV_CUS_3_LSB = TWO_N29; +const std::vector> FNAV_CRC_3_BIT({{129, 16}}); +const double FNAV_CRC_3_LSB = TWO_N5; +const std::vector> FNAV_CRS_3_BIT({{145, 16}}); +const double FNAV_CRS_3_LSB = TWO_N5; +const std::vector> FNAV_T0E_3_BIT({{161, 14}}); +const int32_t FNAV_T0E_3_LSB = 60; +const std::vector> FNAV_WN_3_BIT({{175, 12}}); +const std::vector> FNAV_TOW_3_BIT({{187, 20}}); // WORD 4 Ephemeris (3/3) -const std::vector> FNAV_IODnav_4_bit({{7, 10}}); -const std::vector> FNAV_Cic_4_bit({{17, 16}}); -const double FNAV_Cic_4_LSB = TWO_N29; -const std::vector> FNAV_Cis_4_bit({{33, 16}}); -const double FNAV_Cis_4_LSB = TWO_N29; -const std::vector> FNAV_A0_4_bit({{49, 32}}); +const std::vector> FNAV_IO_DNAV_4_BIT({{7, 10}}); +const std::vector> FNAV_CIC_4_BIT({{17, 16}}); +const double FNAV_CIC_4_LSB = TWO_N29; +const std::vector> FNAV_CIS_4_BIT({{33, 16}}); +const double FNAV_CIS_4_LSB = TWO_N29; +const std::vector> FNAV_A0_4_BIT({{49, 32}}); const double FNAV_A0_4_LSB = TWO_N30; -const std::vector> FNAV_A1_4_bit({{81, 24}}); +const std::vector> FNAV_A1_4_BIT({{81, 24}}); const double FNAV_A1_4_LSB = TWO_N50; -const std::vector> FNAV_deltatls_4_bit({{105, 8}}); -const std::vector> FNAV_t0t_4_bit({{113, 8}}); -const int32_t FNAV_t0t_4_LSB = 3600; -const std::vector> FNAV_WNot_4_bit({{121, 8}}); -const std::vector> FNAV_WNlsf_4_bit({{129, 8}}); -const std::vector> FNAV_DN_4_bit({{137, 3}}); -const std::vector> FNAV_deltatlsf_4_bit({{140, 8}}); -const std::vector> FNAV_t0g_4_bit({{148, 8}}); -const int32_t FNAV_t0g_4_LSB = 3600; -const std::vector> FNAV_A0g_4_bit({{156, 16}}); -const double FNAV_A0g_4_LSB = TWO_N35; -const std::vector> FNAV_A1g_4_bit({{172, 12}}); -const double FNAV_A1g_4_LSB = TWO_N51; -const std::vector> FNAV_WN0g_4_bit({{184, 6}}); -const std::vector> FNAV_TOW_4_bit({{190, 20}}); +const std::vector> FNAV_DELTATLS_4_BIT({{105, 8}}); +const std::vector> FNAV_T0T_4_BIT({{113, 8}}); +const int32_t FNAV_T0T_4_LSB = 3600; +const std::vector> FNAV_W_NOT_4_BIT({{121, 8}}); +const std::vector> FNAV_W_NLSF_4_BIT({{129, 8}}); +const std::vector> FNAV_DN_4_BIT({{137, 3}}); +const std::vector> FNAV_DELTATLSF_4_BIT({{140, 8}}); +const std::vector> FNAV_T0G_4_BIT({{148, 8}}); +const int32_t FNAV_T0G_4_LSB = 3600; +const std::vector> FNAV_A0G_4_BIT({{156, 16}}); +const double FNAV_A0G_4_LSB = TWO_N35; +const std::vector> FNAV_A1G_4_BIT({{172, 12}}); +const double FNAV_A1G_4_LSB = TWO_N51; +const std::vector> FNAV_W_N0G_4_BIT({{184, 6}}); +const std::vector> FNAV_TOW_4_BIT({{190, 20}}); // WORD 5 Almanac SVID1 SVID2(1/2) -const std::vector> FNAV_IODa_5_bit({{7, 4}}); -const std::vector> FNAV_WNa_5_bit({{11, 2}}); -const std::vector> FNAV_t0a_5_bit({{13, 10}}); -const int32_t FNAV_t0a_5_LSB = 600; -const std::vector> FNAV_SVID1_5_bit({{23, 6}}); -const std::vector> FNAV_Deltaa12_1_5_bit({{29, 13}}); -const double FNAV_Deltaa12_5_LSB = TWO_N9; -const std::vector> FNAV_e_1_5_bit({{42, 11}}); -const double FNAV_e_5_LSB = TWO_N16; -const std::vector> FNAV_w_1_5_bit({{53, 16}}); -const double FNAV_w_5_LSB = TWO_N15; -const std::vector> FNAV_deltai_1_5_bit({{69, 11}}); -const double FNAV_deltai_5_LSB = TWO_N14; -const std::vector> FNAV_Omega0_1_5_bit({{80, 16}}); -const double FNAV_Omega0_5_LSB = TWO_N15; -const std::vector> FNAV_Omegadot_1_5_bit({{96, 11}}); -const double FNAV_Omegadot_5_LSB = TWO_N33; -const std::vector> FNAV_M0_1_5_bit({{107, 16}}); +const std::vector> FNAV_IO_DA_5_BIT({{7, 4}}); +const std::vector> FNAV_W_NA_5_BIT({{11, 2}}); +const std::vector> FNAV_T0A_5_BIT({{13, 10}}); +const int32_t FNAV_T0A_5_LSB = 600; +const std::vector> FNAV_SVI_D1_5_BIT({{23, 6}}); +const std::vector> FNAV_DELTAA12_1_5_BIT({{29, 13}}); +const double FNAV_DELTAA12_5_LSB = TWO_N9; +const std::vector> FNAV_E_1_5_BIT({{42, 11}}); +const double FNAV_E_5_LSB = TWO_N16; +const std::vector> FNAV_W_1_5_BIT({{53, 16}}); +const double FNAV_W_5_LSB = TWO_N15; +const std::vector> FNAV_DELTAI_1_5_BIT({{69, 11}}); +const double FNAV_DELTAI_5_LSB = TWO_N14; +const std::vector> FNAV_OMEGA0_1_5_BIT({{80, 16}}); +const double FNAV_OMEGA0_5_LSB = TWO_N15; +const std::vector> FNAV_OMEGADOT_1_5_BIT({{96, 11}}); +const double FNAV_OMEGADOT_5_LSB = TWO_N33; +const std::vector> FNAV_M0_1_5_BIT({{107, 16}}); const double FNAV_M0_5_LSB = TWO_N15; -const std::vector> FNAV_af0_1_5_bit({{123, 16}}); -const double FNAV_af0_5_LSB = TWO_N19; -const std::vector> FNAV_af1_1_5_bit({{139, 13}}); -const double FNAV_af1_5_LSB = TWO_N38; -const std::vector> FNAV_E5ahs_1_5_bit({{152, 2}}); -const std::vector> FNAV_SVID2_5_bit({{154, 6}}); -const std::vector> FNAV_Deltaa12_2_5_bit({{160, 13}}); -const std::vector> FNAV_e_2_5_bit({{173, 11}}); -const std::vector> FNAV_w_2_5_bit({{184, 16}}); -const std::vector> FNAV_deltai_2_5_bit({{200, 11}}); +const std::vector> FNAV_AF0_1_5_BIT({{123, 16}}); +const double FNAV_AF0_5_LSB = TWO_N19; +const std::vector> FNAV_AF1_1_5_BIT({{139, 13}}); +const double FNAV_AF1_5_LSB = TWO_N38; +const std::vector> FNAV_E5AHS_1_5_BIT({{152, 2}}); +const std::vector> FNAV_SVI_D2_5_BIT({{154, 6}}); +const std::vector> FNAV_DELTAA12_2_5_BIT({{160, 13}}); +const std::vector> FNAV_E_2_5_BIT({{173, 11}}); +const std::vector> FNAV_W_2_5_BIT({{184, 16}}); +const std::vector> FNAV_DELTAI_2_5_BIT({{200, 11}}); //const std::vector> FNAV_Omega012_2_5_bit({{210,4}}); // WORD 6 Almanac SVID2(1/2) SVID3 -const std::vector> FNAV_IODa_6_bit({{7, 4}}); +const std::vector> FNAV_IO_DA_6_BIT({{7, 4}}); //const std::vector> FNAV_Omega022_2_6_bit({{10,12}}); -const std::vector> FNAV_Omegadot_2_6_bit({{23, 11}}); -const std::vector> FNAV_M0_2_6_bit({{34, 16}}); -const std::vector> FNAV_af0_2_6_bit({{50, 16}}); -const std::vector> FNAV_af1_2_6_bit({{66, 13}}); -const std::vector> FNAV_E5ahs_2_6_bit({{79, 2}}); -const std::vector> FNAV_SVID3_6_bit({{81, 6}}); -const std::vector> FNAV_Deltaa12_3_6_bit({{87, 13}}); -const std::vector> FNAV_e_3_6_bit({{100, 11}}); -const std::vector> FNAV_w_3_6_bit({{111, 16}}); -const std::vector> FNAV_deltai_3_6_bit({{127, 11}}); -const std::vector> FNAV_Omega0_3_6_bit({{138, 16}}); -const std::vector> FNAV_Omegadot_3_6_bit({{154, 11}}); -const std::vector> FNAV_M0_3_6_bit({{165, 16}}); -const std::vector> FNAV_af0_3_6_bit({{181, 16}}); -const std::vector> FNAV_af1_3_6_bit({{197, 13}}); -const std::vector> FNAV_E5ahs_3_6_bit({{210, 2}}); +const std::vector> FNAV_OMEGADOT_2_6_BIT({{23, 11}}); +const std::vector> FNAV_M0_2_6_BIT({{34, 16}}); +const std::vector> FNAV_AF0_2_6_BIT({{50, 16}}); +const std::vector> FNAV_AF1_2_6_BIT({{66, 13}}); +const std::vector> FNAV_E5AHS_2_6_BIT({{79, 2}}); +const std::vector> FNAV_SVI_D3_6_BIT({{81, 6}}); +const std::vector> FNAV_DELTAA12_3_6_BIT({{87, 13}}); +const std::vector> FNAV_E_3_6_BIT({{100, 11}}); +const std::vector> FNAV_W_3_6_BIT({{111, 16}}); +const std::vector> FNAV_DELTAI_3_6_BIT({{127, 11}}); +const std::vector> FNAV_OMEGA0_3_6_BIT({{138, 16}}); +const std::vector> FNAV_OMEGADOT_3_6_BIT({{154, 11}}); +const std::vector> FNAV_M0_3_6_BIT({{165, 16}}); +const std::vector> FNAV_AF0_3_6_BIT({{181, 16}}); +const std::vector> FNAV_AF1_3_6_BIT({{197, 13}}); +const std::vector> FNAV_E5AHS_3_6_BIT({{210, 2}}); // Galileo E5a-I primary codes -const std::string Galileo_E5a_I_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { +const std::string GALILEO_E5A_I_PRIMARY_CODE[GALILEO_E5A_NUMBER_OF_CODES] = { "3CEA9DA7B07B13A6CC0AE53DAD1EE2A0FCC70009338C08AC0EE457F76A1690815C3C940AB722487CC8F3D1F4C428828E7FD2A21230E42A3BBDF1E792165F644D0E0335F95EBDC93D6005CC0C680DB7B0E1B8C4946B7974319F9816141DB9E01011E4F20DA8F1B8E15A6F618CF599C3F5C1A1B276D51318ED4119BCE0ACD0332F3DD8F88EC5215AB311C51FF4987DA93B09A43BA84CF08032F6CB28F43043C54586811D870AD6FA27AA63785345C8BCDD3DA26A0134738BC7E08461D5409FF0B791D8574CE797FC5EF7821055028CB4AF92AE1088F8806CD55F0E5FDFCD8D74ED801B2B44AD5D79D1924D41DDC6AB2070B5360CB64CCF487FE517420348CC39BF50BDF78BE7DA91542FEAB689457B3EE69E43C75FADC303F31032FD96B7DC70A88C3B7BAC7322B285D9CFB3A93AC8B890165F23848FAD8477DBDD3D0AA4CB3CD73A48000B6D134DA2DA70B56E590A101AEE78864DA0C64A7BCC6B37CD6F31E9AFF10CA4D47630752D253944632DF6EC60AECDCD223F29399CDA3B74D1DFA5471277EE6C814464A8C55D3C0B83B36B6AC9FA90CE876ACDF65E3EA3FD61D309EB71ED29A3D510B2F4C0B6D6C5B57EC9060CFBE48389DCB17CBB2284E7F578565B91503B06F49CF3E8534870AEB6AD9707265A9A1E6E2E5E6DF6DAA367239A96EF5B02C19A4543D537EB4D9D73966C09E9B52B4706F57B3E0987885EB84DEA26F7823D895F62015188ED38C04CC6714F797FDB0BC713E3D0208462F9A68E3872A167BF1BF9791AEE8BB73CF527C50975B55C4E5C2F2E95B677F833ECC878D1764839608CC1108A75EE9E58FFCFE4CB52884E7AF15EE0632E0729DA1CF5B7A227028CFE1E08F8B881E1A743D52DD27BED33DE0EE75DC031B4864CF192DFEAF64F726D73321363A233F81C57232432D2B0A5A4C44F4320847A9C143F378F204185D2B571482FE45D6BCA152E6EA7223BFC6DCE06CEF90CE9114623EAB9B1EC789B2051B4AB711DABF5B16FCD970F437B8860313B4F1F14D384EE3976B7E55D2FDCB7E1BD9BE18B722E37C853ADC7E1CC2870A02881F95B78487780E1D1C296415109CF07AB63D0782A9F451CBEB3E8B919917AEDBCA8A8E563AD3784639793E0F25CC9CC62240FA04B2F141E71BF5C84EAC56431159556B8BCE077A51469A87737D3D6F06D97DD479FCC35129F4499C19EF98BDCEA9D4941B3756CDE1997C3AFCAE62B6D9E23341E11CD05A7FFF52F5814011A84D737E1264109006BEF5F19E3C6A9C7521B44741A8282755A8F0DC2FA0E1F6CA4FB34D8CD5FAA27E18808868725B9634376137C1BBC46934F83958112D03082DDD6148F353BD1DD24B9F8FD7AD89C40DA0A92A8DBE3608038CD56FFC4ACA35241D76FAC4CAE1211AAD9D73D51C81C59BCE05F71C345730D3A2C670F8F533A950EF24B00EFE6A3F1354694ABCC6FD9EC4E74DDE1F287AD4F847A297ECCCC39AF029EFCDDDB19932D906B9CEDFCBE0D422CEE305DD05E407340F28EEEA866664D60AF293A45D5D6D5C0000B05F79463DB513ED488DE7BD4EC9EACFEF973B23CE4E9539EFCB797456CF5FD1EC54FDCEE80B39063C48B91A5C2D2BEBC81B9B46D0AD6503BE5AACED2BA5EBE81F630B4E07510356E8229F7FC5EA532B8729CDB819E066A15379AC6942CD4BC5E97C6791E098105C323A3A3DA3880D5EE5562ABBA2BDC9906F4486B51ACF8AA4405E9D7A63DB9E3058782DD9AF3995FFB3D34AEF98234A0B3DC62C339325B60706C068F0198BD8FA658396D06931B069155217690C7F88FD230CDB38E3E48530BD47722FC", "9D8CF144C4B667345D44F765622A956CAC4E097AB1CAB05CFBCC6BB68C709503AD9DB09C09C983D46A04A05B6F7EB26DB4D46F868C10E112828B1AEDB3C0074BE0DE3C9B7821BABB4F8B8E24F69869CCD981B09A783BF6A95F39ECFAF25DED6B16F89EA09D3A8413CCEBB545651B363DD385D12BB72420440C40E804FA27DE029A1E08629BAAB598C035DC58FDD309844F3BEBDE40FCC231F38605DED06572ADD85DC51D3D8B89B4480143D0B75283522354330E5CCF4DE1A6E68047D5B8D45D835A891F2D40C9DB8A76CEB1D18FE2BC38D080A8D97064CC87D692DF21184ABFDDA7642D0BD6F3209D06B4AE7600F7DDDB71DA751120599117ECCE645FD109CCA2EC7DB98F4177F14DB854FEB314B5D7CDC3385AD203464EADEAFF4AD08DFEF3D21240BFB8EFCAAC1356C72A0F5C61BE03CD2A21A7D756FA9003D562FC4A49A6BE788EC8D80054ACA881DFFF72C2966EECD09F185EDD11218C6696DB14E05FFF3644D11E508F4F1E9C5AB3074FB1C3FB21092A1C8D5AE05688FA4A9226C3C30D0BC3981933DC8648240F8CB67085F53AC5295428DC8447A1E5A46C2BA86796982C4C6CC647FD8079BC4024BB69E2B226E6F3D0F8A90B4D36DA2AED4C6BB60D318AA7479FDC2031143C67CB4381C27072E12935001524C7BECEDAA9954BCC2AA218E9EC2C95498FD8DF655C015896D9ED42CE7F91CBBA2CC4A7920038EBB5F5CE638F969F8B179E72AE252BE7E826E5CB53C2E85AAF1E1F1AD8D534F78A681928818AC3154651FFC583DEB0A6A1F40B98771ACC528AAF80D210ADAF83597869968D499ADE9A19BAF341E8CBA20F0E1473BDD898C24C7A5466F9924EC7EE992A2086AF295BEE1F6D0F8843D91180BF2C981C11FD978B23B6BAF7786BD526B458B76A87C31D7C52DFA43F3D362C8EEFFFB3FE5FB3F6E5F34B1FEC7EF1031146F3F609B32677F148F7DEBCF3526BB45582436A3092408193D6312626E46ECFA96FEAD12A234CACE10FAF9DE75EE2D238088146328E10E9ECDBB0B018ECDF2725415CF5A06AAB857403BBF6CBFC350903A982864827988BC805A3484A31FECF7A40D4FE251BC7E487613B9D3A48D3C7DAEFDC49C4B7E625F868DB53A798515A61050978552699EF2A5BF2F13BDD444EADC9B60B479FDD4633EB4C1062AA78BEF06692DED203819D3160310FD7F2343732156A9CBCB0B50BA9A8F93E339B702670E54BFA6DB2E2E773202C690FB71EB03671AB0B1B02B2F189BD99061ADD23F75F4914067AE638C9A29DD3661C28AE272CE692CBDE6AE880FBCF272E548342372CBAF6370C7E3AE9648341CE7310BE1C534B5702B0611AF65868F840B6B7613FDAEA21DEFB4F2024487023B02B8B58C9E9F27AA787EE775249EFC40913CBBD69C38538F239B203815F00F7B9CB30DC79E6A0C3E069D109E4A1BAEEE36D354C3D0121F1342F1F4AC504A68D69DEC158D54B04BE8164B48F31BC0827A0379C5237070B6F963741AD9ED4F3865698FB8233D7F49ED4E0EEF3AD927CBAF4FAE183252BC56AE4CDE3E329B1D9C87C6C11429B15B8EE589213CFAC208A12AA01B4F1F7CC35CD0AEAE217471B3DAC1C279F353DC61994FC45FEDBBE0005D8EC729385645864EF98A3A417E62F1EACA7E60D4E773BB2E4024D62830F103A7988733DD7BBCF3AB0CD0049006FE2F7EB3821724BEC37EAE44681A9699A025D212724CD98CA3415FE2BD09FADC02F1501FA38A6083427B662DDCBD0460E12A09072698EC8966C47B8A640AC79C1B7722E78A6C28680F4BB77BBA477BE0A6FAB959B9753217C5708", "45D1C8FF162EE106CC87C3EBF6A837930F8CC797EC7A446E8A213ABD239582350636B19B5BE428A9C13F980B7AF5CD7F32630AFE8693CDF0EC0BC2C84F2472F5B86576E8C43136C14717A24705953D392BAC96C1055B782C7941D82FEA357E5FDEFF772FB9F3DF248455CADEAC4CBA2EBA9C91184006D1680E000D59E4BC8FBE2C2F7CC2E78BFA5B60EB292F244E6CF497D5A287432F2520B31B9D9FEC1210923299EDFF043CE077195509E92372F5959AAB4666AE486DEFA400D81463C388CD05C677BFD4953D2627105B0A776960FEE916C75D53981D30DC689581B7E8E0723D65949662ECFAA6FCC9F0CE8892E367721718F906207663F9AD450AE98D75DF004080FC15DC2CD7A1DCE013A0E547ADDC29A397ECB9E7FA02035327AC40240E2091098708D424563AB7C5867F3F2D78EE3EF5B658FDDBD49435060CA2EA3D559CDE957B7E48B98DB41CF875F7B3D9EBDF6547B4EDD98DF4B747B0793152FA8CC07C6D9EE5A2002464566D86466C2EDE54A2BF4BBE823049E57364C127A14BFE1B88ECF70EFB81EB831BBF50F6AE124E5F6A775F3F2620E91D489CCF24811C0890EF905E9E2ACD399E13DC81333A54BDD295B872EB74E412E2FB654A9874854FBC3A68C73434C5FC5CED27534B2B13C316205FF4E432FAFC13A7B5B7A7FFA9FEEDB5AE69036F8F2955DA124CE5856E8C53F24E609F7D3386DC5212B2E78B5AA23B59D45FE98AA08E9CFAA9D52ED260A36AF07522C047ED43808A39D7019E444EDF84D885A9AC84092A0F6BFED562F3E0D79FB5CF62F98E67EF219FA3F5AEB7D4E344642D3D4B1A7EEA18464F6CE8D4CB3181D9EBF6F4122751B54D0D7F3FC470A91B547148AAB1CA0DF59872120190640555A7561B0F2C11280768F74B1A56674FD5480B0F510491431810D99CECBC6DB85888BACBE2B020FB8B3D78039773229714156494EAEC3A2D0A59E718F72205747D69C05DDF1C678E2E154A1F84EF0CA2E24DC4A6A996F0850A396D2432596EAE84AEC0935B8C25D5C65B52A32722F01D281C4F753EE03EB10020E9FA02462CA303DA39560669637532D381EB78AE5EC0F6DBF6273EC979442E6243F65FC51F26C6C9554C6C0E3EFF33BC4EAB6A27CAB9383BE7DDDE4218C4998033B47919503E1C9A789711EBEAAD6C0298B3DC563F54D28675260F6D896F1B8D4FD0001C429210398E9544B3DAA12C31F7EE82EF4D2234E26F873610B76756DDACD24B6132BCFFE735FE75513ED527DD04D7DC6D24059F85706679DCD1474A9DB9571426BE17E6DEBA58B33B708567697F471CA8B78E8FA73B0E18CB6F88BF9E4F442F0FC21FAB89305484828F18B65F9D373A6A2B380D73F5924F80DA234C1DD87416D025E4E663C96F287B0C83DC92C2164D81830781B715209FD11A65E64962D805389BAAA91DFBB990D3511E506A8EC101131C5B7284252F861D047DB2C2027DBAAD487ABFE429CA21CBEA7671350618E441F4D62F2D579CAE29D97023A8873869B553293D9F54D4A929E252AF132325A6E3BCBF7B36D0DAFA1E56A39A5D801FD0D5A41111017BF62AAF8346C7D424FE007C32B437ADE60AAA9540AA5078FE6C3C3CCEA53EE863086646C976FE6C79434A0AA4F53B2E9E2C3B4CF9C9C4015391E27CDFF5C1FCCCC00BBF5B99715A1265F591E294D530DB14DFD485AD34BBCEA32E5B5D0EED15F88BF5D96D058E6D70BB1A232597E35A625E5E8C2EF5E7031A71F70309019A0591BA0A50E87C839498255A3602C0FAE53166BE5E49E29D24AEC47002B698F80FC49E718B66A8959259ACC540", @@ -280,7 +280,7 @@ const std::string Galileo_E5a_I_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { }; // Galileo E5a-Q primary codes -const std::string Galileo_E5a_Q_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { +const std::string GALILEO_E5A_Q_PRIMARY_CODE[GALILEO_E5A_NUMBER_OF_CODES] = { "515537AD5E5F4216C16046FB0AC50DCDBE5CEE7E3CBB51B6ABB4E87A407B90E0EFD49DE1DE5ED29184E7FF0DC31F75FBB94F46FF6586B36C7771E5A68D060A965ACCF8D640C6B6E4530FDF19DD2491BCAB69ACBCFD3EC7281CCC31253A471B652E21C4CB0B43613EC542266460F0A6199B436BEFD95572DEBEE920A915FD854D17FFD0DF8C74E23B21B28493A0927709709B07C65878C43B69DC501E9D0AA21061ECF173876CAE708C764435832D9D6FCFE62DDF2543016D6325A56D9BF1007886E62E8A832BC32063CB0717D723C5E8C5F0C0EB3960577D364C93060B64EE04A539B7601CC3113E0AEC53CF21AFAD0154DC5CCECF038474E0F4004A65B1EE2801F81968B88C3D35E87CBB126C02D770CC3D32A552883D351DEF47847391484F80646728221F993921BFC14126EE3D9527DE607152724C6D2DD305D3FEA0AAAEDF6509A2FE3248494A54FDA8E3CE7E6BBCE234E4686BA5A19724BA2CB78CFE71A6AF45532EFB286C5BB47BC3C1EEF4E4A8C757786AE974F30A86CD60EBCBFDF5502AA8F643819CBA4301E731ADBA1345B61C0B444FE7B817EA86F8DD749C451AE7D24A68D914F26C918238953E8AE61CC8553213DD6856C7863F9F6BAB1B4C84B225911E7B92BFFC12AC211B2B2CD905877FE976E07057963D47C437FE47D89648053F81AC39E8FD2F3A726866F6693E503CB6F0C3F0AA9B3EE2EA3BCDB16D726E1C6D8B073AA15F64EB68D53B1F8CDAC19C7AC33361226E81F1C793BF188755A3FE1BAC38B91ABBD4F077F7A28983EAFADC346CB941D49492625893453B364D07FE06FE42B160C16FE0462AB6366FFDEE54DC9CE4DCCA21E4E4AE5E92C872D1E4EC6FF6D3063C98A5AA5EE72481A0BDF15152E2A5425AB722101474D0E1EC8401273EA1BE1DAF7403190A94305BD1C7DFBE1F35F65D5CB97E82B7A297047507FFA0012FB73360FB8719C174E78A989A96E60A9184B3F3A8188DE100AB361921D38E8142859C8F0F7D441DB1B2E9687BBD1086643987C83DEE0BE8CED4C83BCC82B62B45311CE4F13ABC55BF5EB1ECDF15F5A07F8B2C42F07FACE0E299E87727E2D534FEBF7B9C3894CC3E2E4127A294B9FA2A671273B174DBB81D247CD2846116500A072DC3962C65FFECD0C0B46DC2AF52882058259C26FDE50BEB319AEECFA1FABA34C069680B9EBAA9D96EEBD7EA30E748213E1283396A2AFC63527624641D4E1F1022A973B1898BD4CEF4D712B49371A51D60E08F42ED1EA90AC49EEFBCC53E7F9E899DD1AA4056F11462DF1A4C81620A73C831CEB897430A22252B901EC3D6F3DF58EF26422F796EA31AA4E0E9CE5B4A9C312A22305E298FEB3B3628283D405EDF726937327D90C542434BA3B60684584A9DB244839D2ACBCD7EF147A541E35687B5B8F5F07764973112D20D1ED75DC31F6A938542B42EFAAEE0F11B0583AA4925C3132356200E8D6BDB3127B975F4115A7A8A1C471836E3C5450B501A24D4A1308BB319AA827222B550F253F64B6F7D2322C6A2D3012FEC265A66A60102A3340CBDAB900DFDB36693D41DAD8DDB8875F8C3BE76AD5355DD81D67AAEBFFFE9458E522BE0312E60F63DD92F25C0D7CF82F223AEC0BD7456752CBD5151FEB5368F8857EAFAA90E8C7499B75D46EC4CA20BA8A24C90C016B5BD2CD7864828C6140E98EDB9509AD1194F56D49675D077DE92CD481B469E3A37F7DF0D5392DA4CE4CB282530F1C73482CC0926B877B00B0CE49FAD21E4C26194C7E950E0078F3854EF88755E08E9380165C584A3DBF1ECEF6A31B224FC321326B93797BFE8", "D67539AFB80711A0BA3CD67D963BAD346BA813D35A2EEA104D36AAAB863C656A07AD61BA60598C07744D32ED01EFCE928346C09EAAC2D392E5655F0FEBC486815AE30A38014DD8520F73CCBB71D9D42636328A50998A2A3BED3E4B34D0DCD65B94807064E2EF0C420898DB96E3B99EA9A0AD91C63857DEAEDDA5E644E62212B23D72FEDBBAA78C6581C677B10689C4AF387626DAC55F4EBE1893D52D28D20EA365702448A64A0C553ED337C3BB911DDAE2A91727299D8064BEC880183064574B5E3631E70A0590210143F4079C572BD5E2F7634C2D53B1FB1DABE79C484799E7075EFF98F033F5B2EC66C373825335D883911CEC9CFBBE2E38129B7E03D9646A7E513D5069043BC62AF4C524F12D8F98D8C9DAC5D8642DFFF48CF6737AFBBCBE965925F55F03BBD5123C9DB47AAC780301DE91FBED3C01D03E6464C2C2915BFA187A4BD93E20C24574FB91F0358CBE0921DCC8D6B7E9976763A1D2158511861EFF5D1C0B71F608E7ADE91D9DCFF5640B55BC9BD1BB322C879C7EB5C06EB2601D06241D09CFB1BC1695DFA55FA044E0E2E4BC86EFBF6A55740C4640512DDD6CA069940BC0FE1738FD376C68BA8AF7CCBA7D89F7966B29355538836372EF418D149EBF3AC104919D91BCA2F13E79A7CF7684A4DC0AC556A2843E041A71F97C94B859FE009659F593EFFEBAA6F6C1C57A5BF22752613AFB26379C42AC25804AEDAE22D63B230FCB858F496B8EA6F37104D0890525DBDE06AD988BA0287B0938572F14A98EC9E60E973FD693DB1F2AFF671AB03FB12B729D0867938DF6B60EC69790C992C6C33A531FE56D0ECC1465F65E3E57FC9E45F0F65A1061CE6D3190B6C1B8708A8A5A47222369AE889D26499CDE8F0548B8D7071F2D4DF6C0F2418BE449552327981CB0B54F792F29A71E30DE257CE1B3A7553A22275E4C8B9FAC3B8D4E9912BB22B0A899E7337513C7ACBEDA15FAD3D6919FDDD941CA659D78B74FD39E2E2F622691B89CA82FFE602DB2578A20D4665184456F32DF4DD6CBC412EC7C6914CA427CEE02F6D9810AAE1406DD68ED3869BD8E3947A2B3A803E875FF82005D853E3F43A6BF936030744C34C8B71B7722BE0AD3F475E531C9249A42671D5F3A5C77C4C28DE29AE953EBFB572578B17B636F8365FC755C22871E7D53A1F1561C92909305C9FD36AAF79E8844B63370B800B25CC1355211D9919B830A988926829F808DD2C66400279E6AC14F8EECBBE8B6E9ABFA3BDBB38A49535F64F719EF48C5FE6B2738DC6F71AACD70274FD40A29BFCAA594AC3E7D0C3C522E406BA6392444C9F362339E8FF34BE330911DC7EB11A47FF3A62A46CDE961A40CD5B24020909E5B034F45FE96CB156FFE8E2FDBC12A7C12D60D24BFBE596544E4F03AF26F086A5A667496B7DF302E4DCFC568C7ABD665EA7EAD8A7F5A000DAD9F43E68C4D8A14742E050769B3CB270E3856D7E8F4E827046D3E55A52F0E02C883881914DE87AE3C24D93E61A94919B40398D3EABB1B5142431AB919208A9785962D05061EDC951C83C73FBF6AE8DD6FF839E631C9FCF6635FA053DBCF932E359F83FBB3EE310281569741E3A8975FAAD1E573E0EC3207F6DBCDB8CC90DCA1CE517C8DFC1D31AE4841F87A5157792738DAEE7C29240DAE26C6C3E9D8A899D2271B0C374BD2EE846C6625E31B2F8379A96F601323039D281608A01A1844E5D1D20CF1D92C52107CDA71BB3B7EC4DEA958CFD7A79F71868116CD1DD2B2E66BB94D1373B733F324BE489DA51BE72B01A8572880AE1E61650B839D03B0192D290D5B36A9CF93B304", "58B2E58A13D4D5F84F37A389E6B01DFA66DBC6A25338B2884EF08056BF0A9124DA29254AA79CDF1B0944DDED4BC7FE683EF7A3C7A1C359E61E959471E30F9D534F43EEF274AC6535C616ADC7455BFBFF43ABF268F7C995CE020CEC73BDBD04007562F2710498AD1A324F25A6233B2DF2D9A429F1C39943E45F934986D1979D293F90CFBEBE01665C98C0D72D09A382348136980B31F5D4696B85C3F42D5C445996804159CD4C4CE7547C4A3FB718AB62D9E9826D05C44C6BD21D708CABB01F46514F29FBE7352866EDBFABD0ADBB6093E1A519D0E11E27737239A07866752B6D864686AF1E308481C53C635046C0756E8008D3CD26DB970C5D6EF8CB9DE6BC4339EE9F88EA45D11B74A1525E2F1B9F91567A78E403F7ECD47A99E95C098870B928E1B0DAA984CCECA13C6857F350E808BBF66AB4EDFB0F369F6F009268D19DEEB377F7D0C4ED6414EF6D23A0A5F37A25AAD3CD62C2115CB70409049CF0CE6D4DBCC5C96767614C6FAF73E9A76C7550BB970AB3D3ACE0C07FAA9F36F1935DFCD5228427BBEB5FC7A2F951D9210A5BC32ACCA7E78AFD5FD460CE2A79348714E5542BF2D453680B070E85F3244E8A6B4EB6ED49F803E60B8A383C8BE6283B1C4DF79E0C4A23D5DAFCB26DFC5DF1D1520FB6CDA23A05A1513F751EBD0143C2B9F5494BAA74F9F95F189C5767C6F5623559D9F20CC9B9C9ADFE285FA4E1BBDA481A52ABAB36A5393370091A49A59B968CFAE89BEAF33BCA5C2A9BCC1758CEEFC2D0A175C8A5CAD5C7E3FA706C2FEA55F4971A7B8A0C5D1F22A26D7DA9A70603AC34566E4929AE78C8F1926239950EC0A6E1B37D919E24431E53FB08B2F7DCDCA2EF4177BD7D2F81BFC784FBEA0471831CDCBB9E11D60C53D0E062E8BB8D98B8EE5A40960EBE10FA642751B96E1407B38A024DC64D5C2005E71198EF394673A4A0097187D2475CF27B3EAA7955AD9F412A89B36AFB27FDF7FE699B2CC8C03F7FA40549178DF8A3C1A39441EAE869BBC89D583ECB18E310885F33B95B719045CA6955720CA75D5CF0B29E5F1B9E9EAC5EC92980B2D37EF6509CCA6E67544A8116494AC7EB9032E1E8CDB053B5AC0F60DE59BBFB78E3491D50C7ADED95042A8885FE284E90C04FFC0370B92B68379B2E7D52392A42FEB26B2419CC64412BFFC036C01109B9EAEC5FAF485F0D61C37A703EAD02127611F9D25E4EC515CABE21247156F0779CAB57C35581646BB71E87941AB5D06FB3C06C423E9E83E0C07E611C89CB000344AF49498EF5C30305DDC8958F45A45E1218837269DEEDBB0AE51D2AD8B41BE425EB7AB798856911B6F0DC721756A8154B9D1CCD61092D16A3E9E1CD5E1D7C2C45D236C9B21A0ED64AD4C0660FE42FC0B543A34FB545B0D88D42F696D53BF54A1A259486846E81B44C16EF146310AEFB3933BA9F9D4497E74AFE1449D69105B9F295DB24B4563C3FC0166CB70F104B3360BC0998EFEBABC6276F570F7679865036DB59B51AD2F91C0CCD3BCF5C07492765D480494AB5B87E83FD04B75A35F88656D3329AA5FD550DBF493B0CD2C19DEBE4358661C72A71FB17C812F75BEB61302AAAA1F757288C1D8626461F4162A2EC6296B3CCABE21B4F0695F2D2CB02B86035251FC9C5F2FB5BBF28237417DC56471629B3B4C25AFEDC4C9CD108ADAD9DB1330AB680E4998C5B3D99BCE8F08156B630A63EF36A51C813CE22A6B178683EDA389ACF58653582BC2AE8170ADEC4BE03C04CBA603C0E4572A74BD9599A8442E894EB504F7703F2353A8A3525EC5535E750303AC07E08D952755F97AF236014", @@ -334,10 +334,10 @@ const std::string Galileo_E5a_Q_PRIMARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { }; // Galileo E5a-I secondary code -const std::string Galileo_E5a_I_SECONDARY_CODE = "10000100001011101001"; +const std::string GALILEO_E5A_I_SECONDARY_CODE = "10000100001011101001"; // Galileo E5a-Q secondary codes -const std::string Galileo_E5a_Q_SECONDARY_CODE[Galileo_E5a_NUMBER_OF_CODES] = { +const std::string GALILEO_E5A_Q_SECONDARY_CODE[GALILEO_E5A_NUMBER_OF_CODES] = { "1000001111110110111101101001110110001111011011100001010101000001000111111011100011001001101100011100", "0110011001010101100010111101001111001110000011000111011110010010111010000011001101010000010100100101", "0101100110100000001001011010100111000001101011110000011001010001101101110111100110101000001110000001", diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.cc b/src/core/system_parameters/beidou_dnav_ephemeris.cc index bb9bcde71..5081daa6a 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.cc +++ b/src/core/system_parameters/beidou_dnav_ephemeris.cc @@ -1,12 +1,11 @@ /*! - * \file beidou_ephemeris.cc + * \file beidou_dnav_ephemeris.cc * \brief Interface of a BeiDou EPHEMERIS storage and orbital model functions - * * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -24,7 +23,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -276,7 +275,7 @@ double Beidou_Dnav_Ephemeris::satellitePosition(double transmitTime) double dtr_s = d_A_f0 + d_A_f1 * tk + d_A_f2 * tk * tk; /* relativity correction */ - dtr_s -= 2.0 * sqrt(BEIDOU_GM * a) * d_eccentricity * sin(E) / (BEIDOU_C_m_s * BEIDOU_C_m_s); + dtr_s -= 2.0 * sqrt(BEIDOU_GM * a) * d_eccentricity * sin(E) / (BEIDOU_C_M_S * BEIDOU_C_M_S); return dtr_s; } diff --git a/src/core/system_parameters/beidou_dnav_ephemeris.h b/src/core/system_parameters/beidou_dnav_ephemeris.h index 79aad2eb7..2cdfcfe61 100644 --- a/src/core/system_parameters/beidou_dnav_ephemeris.h +++ b/src/core/system_parameters/beidou_dnav_ephemeris.h @@ -1,11 +1,11 @@ /*! - * \file beidou_ephemeris.h + * \file beidou_dnav_ephemeris.h * \brief Interface of a BEIDOU EPHEMERIS storage * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -23,7 +23,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -32,8 +32,6 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H_ #define GNSS_SDR_BEIDOU_DNAV_EPHEMERIS_H_ - -#include "boost/assign.hpp" #include #include #include diff --git a/src/core/system_parameters/beidou_dnav_iono.cc b/src/core/system_parameters/beidou_dnav_iono.cc index b7d4ebb7e..a0a20743b 100644 --- a/src/core/system_parameters/beidou_dnav_iono.cc +++ b/src/core/system_parameters/beidou_dnav_iono.cc @@ -1,12 +1,11 @@ /*! - * \file beidou_iono.cc + * \file beidou_dnav_iono.cc * \brief Interface of a BEIDOU IONOSPHERIC MODEL storage - * * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -24,7 +23,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ diff --git a/src/core/system_parameters/beidou_dnav_iono.h b/src/core/system_parameters/beidou_dnav_iono.h index 1bedd8a83..2349360bc 100644 --- a/src/core/system_parameters/beidou_dnav_iono.h +++ b/src/core/system_parameters/beidou_dnav_iono.h @@ -1,11 +1,11 @@ /*! - * \file beidou_iono.h + * \file beidou_dnav_iono.h * \brief Interface of a BEIDOU IONOSPHERIC MODEL storage * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * * ------------------------------------------------------------------------- * - * Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors) + * Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -23,7 +23,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -32,8 +32,6 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_IONO_H_ #define GNSS_SDR_BEIDOU_DNAV_IONO_H_ - -#include "boost/assign.hpp" #include diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.cc b/src/core/system_parameters/beidou_dnav_navigation_message.cc index 0b9f1be9d..e280d07f8 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.cc +++ b/src/core/system_parameters/beidou_dnav_navigation_message.cc @@ -1,6 +1,7 @@ /*! - * \file beidou_navigation_message.cc - * \brief Implementation of a BeiDou D1 NAV Data message decoder as described in BeiDou ICD Version 2.1 + * \file beidou_dnav_navigation_message.cc + * \brief Implementation of a BeiDou D1 NAV Data message decoder as described + * in BeiDou ICD Version 2.1 * * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * \author Damian Miralles, 2018. dmiralles2009@gmail.com @@ -24,18 +25,18 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ #include "beidou_dnav_navigation_message.h" +#include "gnss_satellite.h" #include // for boost::crc_basic, boost::crc_optimal #include #include #include #include -#include #include #include @@ -58,7 +59,7 @@ void Beidou_Dnav_Navigation_Message::reset() flag_d1_sf5_p9 = false; flag_d1_sf5_p10 = false; flag_new_SOW_available = false; - d_previous_aode = 0; + d_previous_aode = 0.0; flag_sf1_p1 = false; flag_sf1_p2 = false; @@ -91,63 +92,65 @@ void Beidou_Dnav_Navigation_Message::reset() d_eccentricity_msb = 0; d_eccentricity_lsb = 0; - d_SOW = 0; - d_SOW_SF1 = 0; - d_SOW_SF2 = 0; - d_SOW_SF3 = 0; - d_SOW_SF4 = 0; - d_SOW_SF5 = 0; - d_AODE = 0; - d_Crs = 0; - d_Delta_n = 0; - d_M_0 = 0; - d_Cuc = 0; - d_eccentricity = 0; - d_Cus = 0; - d_sqrt_A = 0; - d_Toe_sf2 = 0; - d_Toc = 0; - d_Cic = 0; - d_OMEGA0 = 0; - d_Cis = 0; - d_i_0 = 0; - d_Crc = 0; - d_OMEGA = 0; - d_OMEGA_DOT = 0; - d_IDOT = 0; + d_SOW = 0.0; + d_SOW_SF1 = 0.0; + d_SOW_SF2 = 0.0; + d_SOW_SF3 = 0.0; + d_SOW_SF4 = 0.0; + d_SOW_SF5 = 0.0; + d_AODE = 0.0; + d_Crs = 0.0; + d_Delta_n = 0.0; + d_M_0 = 0.0; + d_Cuc = 0.0; + d_eccentricity = 0.0; + d_Cus = 0.0; + d_sqrt_A = 0.0; + d_Toe_sf2 = 0.0; + d_Toe_sf3 = 0.0; + d_Toe = 0.0; + d_Toc = 0.0; + d_Cic = 0.0; + d_OMEGA0 = 0.0; + d_Cis = 0.0; + d_i_0 = 0.0; + d_Crc = 0.0; + d_OMEGA = 0.0; + d_OMEGA_DOT = 0.0; + d_IDOT = 0.0; i_BEIDOU_week = 0; i_SV_accuracy = 0; i_SV_health = 0; - d_TGD1 = 0; - d_TGD2 = 0; - d_AODC = -1; + d_TGD1 = 0.0; + d_TGD2 = 0.0; + d_AODC = -1.0; // i_AODO = 0; b_fit_interval_flag = false; - d_spare1 = 0; - d_spare2 = 0; + d_spare1 = 0.0; + d_spare2 = 0.0; - d_A_f0 = 0; - d_A_f1 = 0; - d_A_f2 = 0; + d_A_f0 = 0.0; + d_A_f1 = 0.0; + d_A_f2 = 0.0; //clock terms //d_master_clock=0; - d_dtr = 0; - d_satClkCorr = 0; - d_satClkDrift = 0; + d_dtr = 0.0; + d_satClkCorr = 0.0; + d_satClkDrift = 0.0; // satellite positions - d_satpos_X = 0; - d_satpos_Y = 0; - d_satpos_Z = 0; + d_satpos_X = 0.0; + d_satpos_Y = 0.0; + d_satpos_Z = 0.0; // info i_channel_ID = 0; i_satellite_PRN = 0; // time synchro - d_subframe_timestamp_ms = 0; + d_subframe_timestamp_ms = 0.0; // flags b_alert_flag = false; @@ -157,76 +160,81 @@ void Beidou_Dnav_Navigation_Message::reset() // Ionosphere and UTC flag_iono_valid = false; flag_utc_model_valid = false; - d_alpha0 = 0; - d_alpha1 = 0; - d_alpha2 = 0; - d_alpha3 = 0; - d_beta0 = 0; - d_beta1 = 0; - d_beta2 = 0; - d_beta3 = 0; - d_A1UTC = 0; - d_A0UTC = 0; - d_DeltaT_LS = 0; + d_alpha0 = 0.0; + d_alpha1 = 0.0; + d_alpha2 = 0.0; + d_alpha3 = 0.0; + d_beta0 = 0.0; + d_beta1 = 0.0; + d_beta2 = 0.0; + d_beta3 = 0.0; + d_A1UTC = 0.0; + d_A0UTC = 0.0; + d_DeltaT_LS = 0.0; i_WN_LSF = 0; i_DN = 0; - d_DeltaT_LSF = 0; + d_DeltaT_LSF = 0.0; //Almanac - d_Toa = 0; + d_Toa = 0.0; i_WN_A = 0; - for (int i = 1; i < 36; i++) + for (int32_t i = 1; i < 36; i++) { almanacHealth[i] = 0; } // Satellite velocity - d_satvel_X = 0; - d_satvel_Y = 0; - d_satvel_Z = 0; - d_A1GPS = 0; - d_A0GPS = 0; - d_A1GAL = 0; - d_A0GAL = 0; - d_A1GLO = 0; - d_A0GLO = 0; - d_SQRT_A_ALMANAC = 0; - d_A1_ALMANAC = 0; - d_A0_ALMANAC = 0; - d_OMEGA0_ALMANAC = 0; - d_E_ALMANAC = 0; - d_DELTA_I = 0; - d_TOA = 0; - d_OMEGA_DOT_ALMANAC = 0; - d_OMEGA_ALMANAC = 0; - d_M0_ALMANAC = 0; + d_satvel_X = 0.0; + d_satvel_Y = 0.0; + d_satvel_Z = 0.0; + d_A1GPS = 0.0; + d_A0GPS = 0.0; + d_A1GAL = 0.0; + d_A0GAL = 0.0; + d_A1GLO = 0.0; + d_A0GLO = 0.0; + d_SQRT_A_ALMANAC = 0.0; + d_A1_ALMANAC = 0.0; + d_A0_ALMANAC = 0.0; + d_OMEGA0_ALMANAC = 0.0; + d_E_ALMANAC = 0.0; + d_DELTA_I = 0.0; + d_TOA = 0.0; + d_OMEGA_DOT_ALMANAC = 0.0; + d_OMEGA_ALMANAC = 0.0; + d_M0_ALMANAC = 0.0; almanac_WN = 0; - d_toa2 = 0; - d_A_f0 = 0; - d_A_f1 = 0; - d_A_f2 = 0; + d_toa2 = 0.0; + d_A_f0 = 0.0; + d_A_f1 = 0.0; + d_A_f2 = 0.0; auto gnss_sat = Gnss_Satellite(); std::string _system("Beidou"); - for (unsigned int i = 1; i < 36; i++) + for (uint32_t i = 1; i < 36; i++) { satelliteBlock[i] = gnss_sat.what_block(_system, i); } } + Beidou_Dnav_Navigation_Message::Beidou_Dnav_Navigation_Message() { reset(); } -void Beidou_Dnav_Navigation_Message::print_beidou_word_bytes(unsigned int BEIDOU_word) + +void Beidou_Dnav_Navigation_Message::print_beidou_word_bytes(uint32_t BEIDOU_word) { std::cout << " Word ="; std::cout << std::bitset<32>(BEIDOU_word); std::cout << std::endl; } -bool Beidou_Dnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) + +bool Beidou_Dnav_Navigation_Message::read_navigation_bool( + std::bitset bits, + const std::vector>& parameter) { bool value; @@ -241,15 +249,18 @@ bool Beidou_Dnav_Navigation_Message::read_navigation_bool(std::bitset bits, const std::vector>& parameter) + +uint64_t Beidou_Dnav_Navigation_Message::read_navigation_unsigned( + std::bitset bits, + const std::vector>& parameter) { - unsigned long int value = 0; - int num_of_slices = parameter.size(); - for (int i = 0; i < num_of_slices; i++) + uint64_t value = 0ULL; + int32_t num_of_slices = parameter.size(); + for (int32_t i = 0; i < num_of_slices; i++) { - for (int j = 0; j < parameter[i].second; j++) + for (int32_t j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left + value <<= 1; // shift left if (bits[BEIDOU_DNAV_SUBFRAME_DATA_BITS - parameter[i].first - j] == 1) { value += 1; // insert the bit @@ -259,30 +270,33 @@ unsigned long int Beidou_Dnav_Navigation_Message::read_navigation_unsigned(std:: return value; } -signed long int Beidou_Dnav_Navigation_Message::read_navigation_signed(std::bitset bits, const std::vector>& parameter) + +int64_t Beidou_Dnav_Navigation_Message::read_navigation_signed( + std::bitset bits, + const std::vector>& parameter) { - signed long int value = 0; - int num_of_slices = parameter.size(); + int64_t value = 0; + int32_t num_of_slices = parameter.size(); // Discriminate between 64 bits and 32 bits compiler - int long_int_size_bytes = sizeof(signed long int); + int32_t long_int_size_bytes = sizeof(int64_t); if (long_int_size_bytes == 8) // if a long int takes 8 bytes, we are in a 64 bits system { // read the MSB and perform the sign extension if (bits[BEIDOU_DNAV_SUBFRAME_DATA_BITS - parameter[0].first] == 1) { - value ^= 0xFFFFFFFFFFFFFFFF; //64 bits variable + value ^= 0xFFFFFFFFFFFFFFFF; // 64 bits variable } else { value &= 0; } - for (int i = 0; i < num_of_slices; i++) + for (int32_t i = 0; i < num_of_slices; i++) { - for (int j = 0; j < parameter[i].second; j++) + for (int32_t j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left - value &= 0xFFFFFFFFFFFFFFFE; //reset the corresponding bit (for the 64 bits variable) + value <<= 1; // shift left + value &= 0xFFFFFFFFFFFFFFFE; // reset the corresponding bit (for the 64 bits variable) if (bits[BEIDOU_DNAV_SUBFRAME_DATA_BITS - parameter[i].first - j] == 1) { value += 1; // insert the bit @@ -302,12 +316,12 @@ signed long int Beidou_Dnav_Navigation_Message::read_navigation_signed(std::bits value &= 0; } - for (int i = 0; i < num_of_slices; i++) + for (int32_t i = 0; i < num_of_slices; i++) { - for (int j = 0; j < parameter[i].second; j++) + for (int32_t j = 0; j < parameter[i].second; j++) { - value <<= 1; //shift left - value &= 0xFFFFFFFE; //reset the corresponding bit + value <<= 1; // shift left + value &= 0xFFFFFFFE; // reset the corresponding bit if (bits[BEIDOU_DNAV_SUBFRAME_DATA_BITS - parameter[i].first - j] == 1) { value += 1; // insert the bit @@ -318,6 +332,7 @@ signed long int Beidou_Dnav_Navigation_Message::read_navigation_signed(std::bits return value; } + double Beidou_Dnav_Navigation_Message::check_t(double time) { double corrTime; @@ -334,6 +349,7 @@ double Beidou_Dnav_Navigation_Message::check_t(double time) return corrTime; } + double Beidou_Dnav_Navigation_Message::sv_clock_correction(double transmitTime) { double dt; @@ -343,6 +359,7 @@ double Beidou_Dnav_Navigation_Message::sv_clock_correction(double transmitTime) return correctedTime; } + void Beidou_Dnav_Navigation_Message::satellitePosition(double transmitTime) { double tk; @@ -384,7 +401,7 @@ void Beidou_Dnav_Navigation_Message::satellitePosition(double transmitTime) E = M; // --- Iteratively compute eccentric anomaly ---------------------------- - for (int ii = 1; ii < 20; ii++) + for (int32_t ii = 1; ii < 20; ii++) { E_old = E; E = M + d_eccentricity * sin(E); @@ -437,9 +454,10 @@ void Beidou_Dnav_Navigation_Message::satellitePosition(double transmitTime) d_satvel_Z = d_satpos_Y * sin(i); } -int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subframe) + +int32_t Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subframe) { - int subframe_ID = 0; + int32_t subframe_ID = 0; std::bitset subframe_bits(subframe); subframe_ID = static_cast(read_navigation_unsigned(subframe_bits, D1_FRAID)); @@ -505,8 +523,6 @@ int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subfr break; case 2: // --- It is subframe 2 --- - - d_SOW_SF2 = static_cast(read_navigation_unsigned(subframe_bits, D1_SOW)); d_SOW = d_SOW_SF2; // Set transmission time @@ -541,7 +557,6 @@ int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subfr break; case 3: // --- It is subframe 3 --- - d_SOW_SF3 = static_cast(read_navigation_unsigned(subframe_bits, D1_SOW)); d_SOW = d_SOW_SF3; // Set transmission time @@ -615,7 +630,7 @@ int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subfr break; case 5: // --- It is subframe 5 --- - int SV_page_5; + int32_t SV_page_5; d_SOW_SF5 = static_cast(read_navigation_unsigned(subframe_bits, D1_SOW)); d_SOW = d_SOW_SF5; // Set transmission time @@ -731,10 +746,11 @@ int Beidou_Dnav_Navigation_Message::d1_subframe_decoder(std::string const& subfr return subframe_ID; } -int Beidou_Dnav_Navigation_Message::d2_subframe_decoder(std::string const& subframe) + +int32_t Beidou_Dnav_Navigation_Message::d2_subframe_decoder(std::string const& subframe) { - int subframe_ID = 0; - int page_ID = 0; + int32_t subframe_ID = 0; + int32_t page_ID = 0; std::bitset subframe_bits(subframe); @@ -818,7 +834,7 @@ int Beidou_Dnav_Navigation_Message::d2_subframe_decoder(std::string const& subfr d_eccentricity_msb = static_cast(read_navigation_unsigned(subframe_bits, D2_E_MSB)); d_eccentricity_msb_bits = (read_navigation_unsigned(subframe_bits, D2_E_MSB)); // Adjust for lsb in next page (shift number of lsb to the left) - d_eccentricity_msb = static_cast((static_cast(d_eccentricity_msb) << 22)); + d_eccentricity_msb = d_eccentricity_msb << 22; d_eccentricity_msb_bits = d_eccentricity_msb_bits << 22; // Set system flags for message reception @@ -920,6 +936,7 @@ int Beidou_Dnav_Navigation_Message::d2_subframe_decoder(std::string const& subfr return subframe_ID; } + double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_corrected) const { double t_utc; @@ -927,12 +944,12 @@ double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_correcte double Delta_t_UTC = d_DeltaT_LS + d_A0UTC + d_A1UTC * (beidoutime_corrected); // Determine if the effectivity time of the leap second event is in the past - int weeksToLeapSecondEvent = i_WN_LSF - i_BEIDOU_week; + int32_t weeksToLeapSecondEvent = i_WN_LSF - i_BEIDOU_week; if ((weeksToLeapSecondEvent) >= 0) // is not in the past { //Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s - int secondOfLeapSecondEvent = i_DN * 24 * 60 * 60; + int32_t secondOfLeapSecondEvent = i_DN * 24 * 60 * 60; if (weeksToLeapSecondEvent > 0) { t_utc_daytime = fmod(beidoutime_corrected - Delta_t_UTC, 86400); @@ -947,7 +964,7 @@ double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_correcte { if ((beidoutime_corrected - secondOfLeapSecondEvent) < (5 / 4) * 24 * 60 * 60) { - int W = fmod(beidoutime_corrected - Delta_t_UTC - 43200, 86400) + 43200; + int32_t W = fmod(beidoutime_corrected - Delta_t_UTC - 43200, 86400) + 43200; t_utc_daytime = fmod(W, 86400 + d_DeltaT_LSF - d_DeltaT_LS); } else @@ -967,6 +984,7 @@ double Beidou_Dnav_Navigation_Message::utc_time(const double beidoutime_correcte return t_utc; } + Beidou_Dnav_Ephemeris Beidou_Dnav_Navigation_Message::get_ephemeris() { Beidou_Dnav_Ephemeris eph; @@ -1064,6 +1082,7 @@ Beidou_Dnav_Ephemeris Beidou_Dnav_Navigation_Message::get_ephemeris() return eph; } + Beidou_Dnav_Iono Beidou_Dnav_Navigation_Message::get_iono() { Beidou_Dnav_Iono iono; @@ -1081,6 +1100,7 @@ Beidou_Dnav_Iono Beidou_Dnav_Navigation_Message::get_iono() return iono; } + Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() { Beidou_Dnav_Utc_Model utc_model; @@ -1105,6 +1125,7 @@ Beidou_Dnav_Utc_Model Beidou_Dnav_Navigation_Message::get_utc_model() return utc_model; } + bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a new ephemeris stored in the galileo navigation class { if (i_satellite_PRN > 0 and i_satellite_PRN < 6) @@ -1160,6 +1181,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_ephemeris() // Check if we have a return false; } + bool Beidou_Dnav_Navigation_Message::have_new_iono() { // the condition on flag_utc_model is added to have a time stamp for iono @@ -1171,6 +1193,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_iono() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_utc_model() { if (flag_d1_sf5_p9 == true and flag_d1_sf5_p10 == true) @@ -1185,6 +1208,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_utc_model() return false; } + bool Beidou_Dnav_Navigation_Message::have_new_almanac() { if ((flag_d1_sf4 == true) and (flag_d1_sf5 == true)) @@ -1199,6 +1223,7 @@ bool Beidou_Dnav_Navigation_Message::have_new_almanac() return false; } + bool Beidou_Dnav_Navigation_Message::satellite_validation() { bool flag_data_valid = false; diff --git a/src/core/system_parameters/beidou_dnav_navigation_message.h b/src/core/system_parameters/beidou_dnav_navigation_message.h index 1525c7b4b..93c1c9a24 100644 --- a/src/core/system_parameters/beidou_dnav_navigation_message.h +++ b/src/core/system_parameters/beidou_dnav_navigation_message.h @@ -1,5 +1,5 @@ /*! - * \file beidou_navigation_message.h + * \file beidou_dnav_navigation_message.h * \brief Interface of a BeiDou DNAV Data message decoder * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com * \author Damian Miralles, 2018. dmiralles2009@gmail.com @@ -24,7 +24,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with GNSS-SDR. If not, see . + * along with GNSS-SDR. If not, see . * * ------------------------------------------------------------------------- */ @@ -54,10 +54,10 @@ class Beidou_Dnav_Navigation_Message { private: - unsigned long int read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); - signed long int read_navigation_signed(std::bitset bits, const std::vector>& parameter); - bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); - void print_beidou_word_bytes(unsigned int BEIDOU_word); + uint64_t read_navigation_unsigned(std::bitset bits, const std::vector>& parameter); + int64_t read_navigation_signed(std::bitset bits, const std::vector>& parameter); + bool read_navigation_bool(std::bitset bits, const std::vector>& parameter); + void print_beidou_word_bytes(uint32_t BEIDOU_word); /* * Accounts for the beginning or end of week crossover * @@ -129,16 +129,16 @@ public: double d_OMEGA; //!< Argument of Perigee [semi-cicles] double d_OMEGA_DOT; //!< Rate of Right Ascension [semi-circles/s] //broadcast orbit 5 - double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] - int i_BEIDOU_week; //!< BeiDou week number, aka WN [week] + double d_IDOT; //!< Rate of Inclination Angle [semi-circles/s] + int32_t i_BEIDOU_week; //!< BeiDou week number, aka WN [week] //broadcast orbit 6 - int i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV - int i_SV_health; + int32_t i_SV_accuracy; //!< User Range Accuracy (URA) index of the SV + int32_t i_SV_health; double d_TGD1; //!< Estimated Group Delay Differential in B1 [s] double d_TGD2; //!< Estimated Group Delay Differential in B2 [s] double d_AODC; //!< Age of Data, Clock //broadcast orbit 7 - // int i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] + // int32_t i_AODO; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s] bool b_fit_interval_flag; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours. double d_spare1; @@ -149,29 +149,29 @@ public: double d_A_f2; //!< Clock correction parameters. Coefficient 2 of code phase offset model [s/s^2] // D2 NAV Message Decoding - unsigned long int d_A_f1_msb_bits; //!< Clock correction parameters, D2 NAV MSB - unsigned long int d_A_f1_lsb_bits; //!< Clock correction parameters, D2 NAV LSB - unsigned long int d_Cuc_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - unsigned long int d_Cuc_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - unsigned long int d_eccentricity_msb; //!< Eccentricity [dimensionless] - unsigned long int d_eccentricity_lsb; //!< Eccentricity [dimensionless] - unsigned long int d_Cic_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - unsigned long int d_Cic_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] - unsigned long int d_eccentricity_msb_bits; //!< Eccentricity [dimensionless] - unsigned long int d_eccentricity_lsb_bits; - unsigned long int d_i_0_msb_bits; //!< Inclination Angle at Reference Time [semi-circles] - unsigned long int d_i_0_lsb_bits; //!< Inclination Angle at Reference Time [semi-circles] - unsigned long int d_OMEGA_msb_bits; //!< Argument of Perigee [semi-cicles] - unsigned long int d_OMEGA_lsb_bits; //!< Argument of Perigee [semi-cicles] - unsigned long int d_OMEGA_DOT_msb_bits; //!< Rate of Right Ascension [semi-circles/s] - unsigned long int d_OMEGA_DOT_lsb_bits; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_A_f1_msb_bits; //!< Clock correction parameters, D2 NAV MSB + uint64_t d_A_f1_lsb_bits; //!< Clock correction parameters, D2 NAV LSB + uint64_t d_Cuc_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cuc_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb; //!< Eccentricity [dimensionless] + uint64_t d_Cic_msb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_Cic_lsb_bits; //!< Amplitude of the Cosine Harmonic Correction Term to the Argument of Latitude [rad] + uint64_t d_eccentricity_msb_bits; //!< Eccentricity [dimensionless] + uint64_t d_eccentricity_lsb_bits; + uint64_t d_i_0_msb_bits; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_i_0_lsb_bits; //!< Inclination Angle at Reference Time [semi-circles] + uint64_t d_OMEGA_msb_bits; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_lsb_bits; //!< Argument of Perigee [semi-cicles] + uint64_t d_OMEGA_DOT_msb_bits; //!< Rate of Right Ascension [semi-circles/s] + uint64_t d_OMEGA_DOT_lsb_bits; //!< Rate of Right Ascension [semi-circles/s] // Almanac - double d_Toa; //!< Almanac reference time [s] - int i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced - std::map almanacHealth; //!< Map that stores the health information stored in the almanac + double d_Toa; //!< Almanac reference time [s] + int32_t i_WN_A; //!< Modulo 256 of the GPS week number to which the almanac reference time (d_Toa) is referenced + std::map almanacHealth; //!< Map that stores the health information stored in the almanac - std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus + std::map satelliteBlock; //!< Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus // Flags @@ -201,8 +201,8 @@ public: double d_satpos_Z; //!< Earth-fixed coordinate z of the satellite [m]. The direction of the IERS (International Earth Rotation and Reference Systems Service) Reference Pole (IRP). // satellite identification info - int i_channel_ID; - unsigned int i_satellite_PRN; + int32_t i_channel_ID; + uint32_t i_satellite_PRN; // time synchro double d_subframe_timestamp_ms; //[ms] @@ -221,8 +221,8 @@ public: double d_A1UTC; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s/s] double d_A0UTC; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200E) [s] double d_DeltaT_LS; //!< delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac. - int i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] - int i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] + int32_t i_WN_LSF; //!< Week number at the end of which the leap second becomes effective [weeks] + int32_t i_DN; //!< Day number (DN) at the end of which the leap second becomes effective [days] double d_DeltaT_LSF; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s] double d_A1GPS; double d_A0GPS; @@ -241,7 +241,7 @@ public: double d_OMEGA_DOT_ALMANAC; double d_OMEGA_ALMANAC; double d_M0_ALMANAC; - int almanac_WN; + int32_t almanac_WN; double d_toa2; // Satellite velocity @@ -272,12 +272,12 @@ public: /*! * \brief Decodes the BDS D1 NAV message */ - int d1_subframe_decoder(std::string const& subframe); + int32_t d1_subframe_decoder(std::string const& subframe); /*! * \brief Decodes the BDS D2 NAV message */ - int d2_subframe_decoder(std::string const& subframe); + int32_t d2_subframe_decoder(std::string const& subframe); /*! * \brief Computes the position of the satellite @@ -296,7 +296,7 @@ public: * \brief Computes the Coordinated Universal Time (UTC) and * returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4) */ - double utc_time(const double gpstime_corrected) const; + double utc_time(const double beidoutime_corrected) const; bool satellite_validation(); diff --git a/src/core/system_parameters/beidou_dnav_utc_model.cc b/src/core/system_parameters/beidou_dnav_utc_model.cc index e56d2c1b8..1997f9276 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.cc +++ b/src/core/system_parameters/beidou_dnav_utc_model.cc @@ -1,5 +1,5 @@ /*! - * \file beidou_dnav_utc_model.c + * \file beidou_dnav_utc_model.cc * \brief Interface of a BeiDou UTC Model storage * \author Damian Miralles, 2018. dmiralles2009(at)gmail.com * \author Sergi Segura, 2018. sergi.segura.munoz(at)gmail.com diff --git a/src/core/system_parameters/beidou_dnav_utc_model.h b/src/core/system_parameters/beidou_dnav_utc_model.h index cb2073f1a..8ca6a1929 100644 --- a/src/core/system_parameters/beidou_dnav_utc_model.h +++ b/src/core/system_parameters/beidou_dnav_utc_model.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_BEIDOU_DNAV_UTC_MODEL_H_ #define GNSS_SDR_BEIDOU_DNAV_UTC_MODEL_H_ -#include #include diff --git a/src/core/system_parameters/galileo_ephemeris.h b/src/core/system_parameters/galileo_ephemeris.h index 75d2bdbd9..42e4288a4 100644 --- a/src/core/system_parameters/galileo_ephemeris.h +++ b/src/core/system_parameters/galileo_ephemeris.h @@ -33,7 +33,6 @@ #ifndef GNSS_SDR_GALILEO_EPHEMERIS_H_ #define GNSS_SDR_GALILEO_EPHEMERIS_H_ -#include #include #include diff --git a/src/core/system_parameters/galileo_fnav_message.cc b/src/core/system_parameters/galileo_fnav_message.cc index b7fa86e3c..918b7e9c7 100644 --- a/src/core/system_parameters/galileo_fnav_message.cc +++ b/src/core/system_parameters/galileo_fnav_message.cc @@ -232,150 +232,150 @@ bool Galileo_Fnav_Message::_CRC_test(std::bitset b void Galileo_Fnav_Message::decode_page(const std::string& data) { std::bitset data_bits(data); - page_type = read_navigation_unsigned(data_bits, FNAV_PAGE_TYPE_bit); + page_type = read_navigation_unsigned(data_bits, FNAV_PAGE_TYPE_BIT); switch (page_type) { case 1: // SVID, Clock correction, SISA, Ionospheric correction, BGD, GST, Signal health and Data validity status - FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_bit)); - FNAV_IODnav_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_1_bit)); - FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0c_1_bit)); - FNAV_t0c_1 *= FNAV_t0c_1_LSB; - FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_bit)); - FNAV_af0_1 *= FNAV_af0_1_LSB; - FNAV_af1_1 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_bit)); - FNAV_af1_1 *= FNAV_af1_1_LSB; - FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_af2_1_bit)); - FNAV_af2_1 *= FNAV_af2_1_LSB; - FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_bit)); - FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_ai0_1_bit)); - FNAV_ai0_1 *= FNAV_ai0_1_LSB; - FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai1_1_bit)); - FNAV_ai1_1 *= FNAV_ai1_1_LSB; - FNAV_ai2_1 = static_cast(read_navigation_signed(data_bits, FNAV_ai2_1_bit)); - FNAV_ai2_1 *= FNAV_ai2_1_LSB; - FNAV_region1_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region1_1_bit)); - FNAV_region2_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region2_1_bit)); - FNAV_region3_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region3_1_bit)); - FNAV_region4_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region4_1_bit)); - FNAV_region5_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_region5_1_bit)); - FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_bit)); + FNAV_SV_ID_PRN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SV_ID_PRN_1_BIT)); + FNAV_IODnav_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DNAV_1_BIT)); + FNAV_t0c_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_T0C_1_BIT)); + FNAV_t0c_1 *= FNAV_T0C_1_LSB; + FNAV_af0_1 = static_cast(read_navigation_signed(data_bits, FNAV_AF0_1_BIT)); + FNAV_af0_1 *= FNAV_AF0_1_LSB; + FNAV_af1_1 = static_cast(read_navigation_signed(data_bits, FNAV_AF1_1_BIT)); + FNAV_af1_1 *= FNAV_AF1_1_LSB; + FNAV_af2_1 = static_cast(read_navigation_signed(data_bits, FNAV_AF2_1_BIT)); + FNAV_af2_1 *= FNAV_AF2_1_LSB; + FNAV_SISA_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_SISA_1_BIT)); + FNAV_ai0_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_AI0_1_BIT)); + FNAV_ai0_1 *= FNAV_AI0_1_LSB; + FNAV_ai1_1 = static_cast(read_navigation_signed(data_bits, FNAV_AI1_1_BIT)); + FNAV_ai1_1 *= FNAV_AI1_1_LSB; + FNAV_ai2_1 = static_cast(read_navigation_signed(data_bits, FNAV_AI2_1_BIT)); + FNAV_ai2_1 *= FNAV_AI2_1_LSB; + FNAV_region1_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_REGION1_1_BIT)); + FNAV_region2_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_REGION2_1_BIT)); + FNAV_region3_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_REGION3_1_BIT)); + FNAV_region4_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_REGION4_1_BIT)); + FNAV_region5_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_REGION5_1_BIT)); + FNAV_BGD_1 = static_cast(read_navigation_signed(data_bits, FNAV_BGD_1_BIT)); FNAV_BGD_1 *= FNAV_BGD_1_LSB; - FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_bit)); - FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_bit)); - FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_bit)); - FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5advs_1_bit)); + FNAV_E5ahs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5AHS_1_BIT)); + FNAV_WN_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_1_BIT)); + FNAV_TOW_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_1_BIT)); + FNAV_E5advs_1 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ADVS_1_BIT)); flag_TOW_1 = true; flag_TOW_set = true; flag_iono_and_GST = true; // set to false externally break; case 2: // Ephemeris (1/3) and GST - FNAV_IODnav_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_2_bit)); - FNAV_M0_2 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_bit)); + FNAV_IODnav_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DNAV_2_BIT)); + FNAV_M0_2 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_BIT)); FNAV_M0_2 *= FNAV_M0_2_LSB; - FNAV_omegadot_2 = static_cast(read_navigation_signed(data_bits, FNAV_omegadot_2_bit)); - FNAV_omegadot_2 *= FNAV_omegadot_2_LSB; - FNAV_e_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_bit)); - FNAV_e_2 *= FNAV_e_2_LSB; - FNAV_a12_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_a12_2_bit)); - FNAV_a12_2 *= FNAV_a12_2_LSB; - FNAV_omega0_2 = static_cast(read_navigation_signed(data_bits, FNAV_omega0_2_bit)); - FNAV_omega0_2 *= FNAV_omega0_2_LSB; - FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_idot_2_bit)); - FNAV_idot_2 *= FNAV_idot_2_LSB; - FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_bit)); - FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_bit)); + FNAV_omegadot_2 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGADOT_2_BIT)); + FNAV_omegadot_2 *= FNAV_OMEGADOT_2_LSB; + FNAV_e_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_E_2_BIT)); + FNAV_e_2 *= FNAV_E_2_LSB; + FNAV_a12_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_A12_2_BIT)); + FNAV_a12_2 *= FNAV_A12_2_LSB; + FNAV_omega0_2 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGA0_2_BIT)); + FNAV_omega0_2 *= FNAV_OMEGA0_2_LSB; + FNAV_idot_2 = static_cast(read_navigation_signed(data_bits, FNAV_IDOT_2_BIT)); + FNAV_idot_2 *= FNAV_IDOT_2_LSB; + FNAV_WN_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_2_BIT)); + FNAV_TOW_2 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_2_BIT)); flag_TOW_2 = true; flag_TOW_set = true; flag_ephemeris_1 = true; break; case 3: // Ephemeris (2/3) and GST - FNAV_IODnav_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_3_bit)); - FNAV_i0_3 = static_cast(read_navigation_signed(data_bits, FNAV_i0_3_bit)); - FNAV_i0_3 *= FNAV_i0_3_LSB; - FNAV_w_3 = static_cast(read_navigation_signed(data_bits, FNAV_w_3_bit)); - FNAV_w_3 *= FNAV_w_3_LSB; - FNAV_deltan_3 = static_cast(read_navigation_signed(data_bits, FNAV_deltan_3_bit)); - FNAV_deltan_3 *= FNAV_deltan_3_LSB; - FNAV_Cuc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cuc_3_bit)); - FNAV_Cuc_3 *= FNAV_Cuc_3_LSB; - FNAV_Cus_3 = static_cast(read_navigation_signed(data_bits, FNAV_Cus_3_bit)); - FNAV_Cus_3 *= FNAV_Cus_3_LSB; - FNAV_Crc_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crc_3_bit)); - FNAV_Crc_3 *= FNAV_Crc_3_LSB; - FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_Crs_3_bit)); - FNAV_Crs_3 *= FNAV_Crs_3_LSB; - FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0e_3_bit)); - FNAV_t0e_3 *= FNAV_t0e_3_LSB; - FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_bit)); - FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_bit)); + FNAV_IODnav_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DNAV_3_BIT)); + FNAV_i0_3 = static_cast(read_navigation_signed(data_bits, FNAV_I0_3_BIT)); + FNAV_i0_3 *= FNAV_I0_3_LSB; + FNAV_w_3 = static_cast(read_navigation_signed(data_bits, FNAV_W_3_BIT)); + FNAV_w_3 *= FNAV_W_3_LSB; + FNAV_deltan_3 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAN_3_BIT)); + FNAV_deltan_3 *= FNAV_DELTAN_3_LSB; + FNAV_Cuc_3 = static_cast(read_navigation_signed(data_bits, FNAV_CUC_3_BIT)); + FNAV_Cuc_3 *= FNAV_CUC_3_LSB; + FNAV_Cus_3 = static_cast(read_navigation_signed(data_bits, FNAV_CUS_3_BIT)); + FNAV_Cus_3 *= FNAV_CUS_3_LSB; + FNAV_Crc_3 = static_cast(read_navigation_signed(data_bits, FNAV_CRC_3_BIT)); + FNAV_Crc_3 *= FNAV_CRC_3_LSB; + FNAV_Crs_3 = static_cast(read_navigation_signed(data_bits, FNAV_CRS_3_BIT)); + FNAV_Crs_3 *= FNAV_CRS_3_LSB; + FNAV_t0e_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_T0E_3_BIT)); + FNAV_t0e_3 *= FNAV_T0E_3_LSB; + FNAV_WN_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN_3_BIT)); + FNAV_TOW_3 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_3_BIT)); flag_TOW_3 = true; flag_TOW_set = true; flag_ephemeris_2 = true; break; case 4: // Ephemeris (3/3), GST-UTC conversion, GST-GPS conversion and TOW - FNAV_IODnav_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODnav_4_bit)); - FNAV_Cic_4 = static_cast(read_navigation_signed(data_bits, FNAV_Cic_4_bit)); - FNAV_Cic_4 *= FNAV_Cic_4_LSB; - FNAV_Cis_4 = static_cast(read_navigation_signed(data_bits, FNAV_Cis_4_bit)); - FNAV_Cis_4 *= FNAV_Cis_4_LSB; - FNAV_A0_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0_4_bit)); + FNAV_IODnav_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DNAV_4_BIT)); + FNAV_Cic_4 = static_cast(read_navigation_signed(data_bits, FNAV_CIC_4_BIT)); + FNAV_Cic_4 *= FNAV_CIC_4_LSB; + FNAV_Cis_4 = static_cast(read_navigation_signed(data_bits, FNAV_CIS_4_BIT)); + FNAV_Cis_4 *= FNAV_CIS_4_LSB; + FNAV_A0_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0_4_BIT)); FNAV_A0_4 *= FNAV_A0_4_LSB; - FNAV_A1_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1_4_bit)); + FNAV_A1_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1_4_BIT)); FNAV_A1_4 *= FNAV_A1_4_LSB; - FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatls_4_bit)); - FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0t_4_bit)); - FNAV_t0t_4 *= FNAV_t0t_4_LSB; - FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNot_4_bit)); - FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNlsf_4_bit)); - FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_bit)); - FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_deltatlsf_4_bit)); - FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0g_4_bit)); - FNAV_t0g_4 *= FNAV_t0g_4_LSB; - FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0g_4_bit)); - FNAV_A0g_4 *= FNAV_A0g_4_LSB; - FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1g_4_bit)); - FNAV_A1g_4 *= FNAV_A1g_4_LSB; - FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_WN0g_4_bit)); - FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_bit)); + FNAV_deltatls_4 = static_cast(read_navigation_signed(data_bits, FNAV_DELTATLS_4_BIT)); + FNAV_t0t_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_T0T_4_BIT)); + FNAV_t0t_4 *= FNAV_T0T_4_LSB; + FNAV_WNot_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_W_NOT_4_BIT)); + FNAV_WNlsf_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_W_NLSF_4_BIT)); + FNAV_DN_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_DN_4_BIT)); + FNAV_deltatlsf_4 = static_cast(read_navigation_signed(data_bits, FNAV_DELTATLSF_4_BIT)); + FNAV_t0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_T0G_4_BIT)); + FNAV_t0g_4 *= FNAV_T0G_4_LSB; + FNAV_A0g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A0G_4_BIT)); + FNAV_A0g_4 *= FNAV_A0G_4_LSB; + FNAV_A1g_4 = static_cast(read_navigation_signed(data_bits, FNAV_A1G_4_BIT)); + FNAV_A1g_4 *= FNAV_A1G_4_LSB; + FNAV_WN0g_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_W_N0G_4_BIT)); + FNAV_TOW_4 = static_cast(read_navigation_unsigned(data_bits, FNAV_TOW_4_BIT)); flag_TOW_4 = true; flag_TOW_set = true; flag_ephemeris_3 = true; flag_utc_model = true; // set to false externally break; case 5: // Almanac (SVID1 and SVID2(1/2)), Week Number and almanac reference time - FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_5_bit)); - FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_WNa_5_bit)); - FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_t0a_5_bit)); - FNAV_t0a_5 *= FNAV_t0a_5_LSB; - FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID1_5_bit)); - FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_1_5_bit)); - FNAV_Deltaa12_1_5 *= FNAV_Deltaa12_5_LSB; - FNAV_e_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_1_5_bit)); - FNAV_e_1_5 *= FNAV_e_5_LSB; - FNAV_w_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_1_5_bit)); - FNAV_w_1_5 *= FNAV_w_5_LSB; - FNAV_deltai_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_1_5_bit)); - FNAV_deltai_1_5 *= FNAV_deltai_5_LSB; - FNAV_Omega0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_1_5_bit)); - FNAV_Omega0_1_5 *= FNAV_Omega0_5_LSB; - FNAV_Omegadot_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_1_5_bit)); - FNAV_Omegadot_1_5 *= FNAV_Omegadot_5_LSB; - FNAV_M0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_M0_1_5_bit)); + FNAV_IODa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DA_5_BIT)); + FNAV_WNa_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_W_NA_5_BIT)); + FNAV_t0a_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_T0A_5_BIT)); + FNAV_t0a_5 *= FNAV_T0A_5_LSB; + FNAV_SVID1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVI_D1_5_BIT)); + FNAV_Deltaa12_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAA12_1_5_BIT)); + FNAV_Deltaa12_1_5 *= FNAV_DELTAA12_5_LSB; + FNAV_e_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E_1_5_BIT)); + FNAV_e_1_5 *= FNAV_E_5_LSB; + FNAV_w_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_W_1_5_BIT)); + FNAV_w_1_5 *= FNAV_W_5_LSB; + FNAV_deltai_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAI_1_5_BIT)); + FNAV_deltai_1_5 *= FNAV_DELTAI_5_LSB; + FNAV_Omega0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGA0_1_5_BIT)); + FNAV_Omega0_1_5 *= FNAV_OMEGA0_5_LSB; + FNAV_Omegadot_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGADOT_1_5_BIT)); + FNAV_Omegadot_1_5 *= FNAV_OMEGADOT_5_LSB; + FNAV_M0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_M0_1_5_BIT)); FNAV_M0_1_5 *= FNAV_M0_5_LSB; - FNAV_af0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af0_1_5_bit)); - FNAV_af0_1_5 *= FNAV_af0_5_LSB; - FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_af1_1_5_bit)); - FNAV_af1_1_5 *= FNAV_af1_5_LSB; - FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_1_5_bit)); - FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID2_5_bit)); - FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_2_5_bit)); - FNAV_Deltaa12_2_5 *= FNAV_Deltaa12_5_LSB; - FNAV_e_2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_2_5_bit)); - FNAV_e_2_5 *= FNAV_e_5_LSB; - FNAV_w_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_w_2_5_bit)); - FNAV_w_2_5 *= FNAV_w_5_LSB; - FNAV_deltai_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_2_5_bit)); - FNAV_deltai_2_5 *= FNAV_deltai_5_LSB; + FNAV_af0_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_AF0_1_5_BIT)); + FNAV_af0_1_5 *= FNAV_AF0_5_LSB; + FNAV_af1_1_5 = static_cast(read_navigation_signed(data_bits, FNAV_AF1_1_5_BIT)); + FNAV_af1_1_5 *= FNAV_AF1_5_LSB; + FNAV_E5ahs_1_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5AHS_1_5_BIT)); + FNAV_SVID2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVI_D2_5_BIT)); + FNAV_Deltaa12_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAA12_2_5_BIT)); + FNAV_Deltaa12_2_5 *= FNAV_DELTAA12_5_LSB; + FNAV_e_2_5 = static_cast(read_navigation_unsigned(data_bits, FNAV_E_2_5_BIT)); + FNAV_e_2_5 *= FNAV_E_5_LSB; + FNAV_w_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_W_2_5_BIT)); + FNAV_w_2_5 *= FNAV_W_5_LSB; + FNAV_deltai_2_5 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAI_2_5_BIT)); + FNAV_deltai_2_5 *= FNAV_DELTAI_5_LSB; //TODO check this // Omega0_2 must be decoded when the two pieces are joined omega0_1 = data.substr(210, 4); @@ -385,7 +385,7 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) flag_almanac_1 = true; break; case 6: // Almanac (SVID2(2/2) and SVID3) - FNAV_IODa_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_IODa_6_bit)); + FNAV_IODa_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_IO_DA_6_BIT)); // Don't worry about omega pieces. If page 5 has not been received, all_ephemeris // flag will be set to false and the data won't be recorded.*/ std::string omega0_2 = data.substr(10, 12); @@ -393,36 +393,36 @@ void Galileo_Fnav_Message::decode_page(const std::string& data) std::bitset omega_bits(Omega0); const std::vector> om_bit({{0, 12}}); FNAV_Omega0_2_6 = static_cast(read_navigation_signed(omega_bits, om_bit)); - FNAV_Omega0_2_6 *= FNAV_Omega0_5_LSB; - FNAV_Omegadot_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_2_6_bit)); - FNAV_Omegadot_2_6 *= FNAV_Omegadot_5_LSB; - FNAV_M0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_6_bit)); + FNAV_Omega0_2_6 *= FNAV_OMEGA0_5_LSB; + FNAV_Omegadot_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGADOT_2_6_BIT)); + FNAV_Omegadot_2_6 *= FNAV_OMEGADOT_5_LSB; + FNAV_M0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_2_6_BIT)); FNAV_M0_2_6 *= FNAV_M0_5_LSB; - FNAV_af0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_2_6_bit)); - FNAV_af0_2_6 *= FNAV_af0_5_LSB; - FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_2_6_bit)); - FNAV_af1_2_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_2_6_bit)); - FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVID3_6_bit)); - FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Deltaa12_3_6_bit)); - FNAV_Deltaa12_3_6 *= FNAV_Deltaa12_5_LSB; - FNAV_e_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_e_3_6_bit)); - FNAV_e_3_6 *= FNAV_e_5_LSB; - FNAV_w_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_w_3_6_bit)); - FNAV_w_3_6 *= FNAV_w_5_LSB; - FNAV_deltai_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_deltai_3_6_bit)); - FNAV_deltai_3_6 *= FNAV_deltai_5_LSB; - FNAV_Omega0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omega0_3_6_bit)); - FNAV_Omega0_3_6 *= FNAV_Omega0_5_LSB; - FNAV_Omegadot_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_Omegadot_3_6_bit)); - FNAV_Omegadot_3_6 *= FNAV_Omegadot_5_LSB; - FNAV_M0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_3_6_bit)); + FNAV_af0_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_AF0_2_6_BIT)); + FNAV_af0_2_6 *= FNAV_AF0_5_LSB; + FNAV_af1_2_6 = static_cast(read_navigation_signed(data_bits, FNAV_AF1_2_6_BIT)); + FNAV_af1_2_6 *= FNAV_AF1_5_LSB; + FNAV_E5ahs_2_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5AHS_2_6_BIT)); + FNAV_SVID3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_SVI_D3_6_BIT)); + FNAV_Deltaa12_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAA12_3_6_BIT)); + FNAV_Deltaa12_3_6 *= FNAV_DELTAA12_5_LSB; + FNAV_e_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E_3_6_BIT)); + FNAV_e_3_6 *= FNAV_E_5_LSB; + FNAV_w_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_W_3_6_BIT)); + FNAV_w_3_6 *= FNAV_W_5_LSB; + FNAV_deltai_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_DELTAI_3_6_BIT)); + FNAV_deltai_3_6 *= FNAV_DELTAI_5_LSB; + FNAV_Omega0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGA0_3_6_BIT)); + FNAV_Omega0_3_6 *= FNAV_OMEGA0_5_LSB; + FNAV_Omegadot_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_OMEGADOT_3_6_BIT)); + FNAV_Omegadot_3_6 *= FNAV_OMEGADOT_5_LSB; + FNAV_M0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_M0_3_6_BIT)); FNAV_M0_3_6 *= FNAV_M0_5_LSB; - FNAV_af0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af0_3_6_bit)); - FNAV_af0_3_6 *= FNAV_af0_5_LSB; - FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_af1_3_6_bit)); - FNAV_af1_3_6 *= FNAV_af1_5_LSB; - FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5ahs_3_6_bit)); + FNAV_af0_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_AF0_3_6_BIT)); + FNAV_af0_3_6 *= FNAV_AF0_5_LSB; + FNAV_af1_3_6 = static_cast(read_navigation_signed(data_bits, FNAV_AF1_3_6_BIT)); + FNAV_af1_3_6 *= FNAV_AF1_5_LSB; + FNAV_E5ahs_3_6 = static_cast(read_navigation_unsigned(data_bits, FNAV_E5AHS_3_6_BIT)); flag_almanac_2 = true; break; diff --git a/src/core/system_parameters/galileo_navigation_message.cc b/src/core/system_parameters/galileo_navigation_message.cc index 7ac22320c..ea3e7889b 100644 --- a/src/core/system_parameters/galileo_navigation_message.cc +++ b/src/core/system_parameters/galileo_navigation_message.cc @@ -398,7 +398,7 @@ void Galileo_Navigation_Message::split_page(std::string page_string, int32_t fla // CRC correct: Decode word std::string page_number_bits = Data_k.substr(0, 6); std::bitset page_type_bits(page_number_bits); // from string to bitset - Page_type = static_cast(read_page_type_unsigned(page_type_bits, type)); + Page_type = static_cast(read_page_type_unsigned(page_type_bits, TYPE)); Page_type_time_stamp = Page_type; std::string Data_jk_ephemeris = Data_k + Data_j; page_jk_decoder(Data_jk_ephemeris.c_str()); @@ -645,101 +645,101 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) std::string data_jk_string = data_jk; std::bitset data_jk_bits(data_jk_string); - page_number = static_cast(read_navigation_unsigned(data_jk_bits, PAGE_TYPE_bit)); + page_number = static_cast(read_navigation_unsigned(data_jk_bits, PAGE_TYPE_BIT)); LOG(INFO) << "Page number = " << page_number; switch (page_number) { case 1: // Word type 1: Ephemeris (1/4) - IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_1_bit)); + IOD_nav_1 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_NAV_1_BIT)); DLOG(INFO) << "IOD_nav_1= " << IOD_nav_1; - t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0E_1_bit)); - t0e_1 = t0e_1 * t0e_1_LSB; + t0e_1 = static_cast(read_navigation_unsigned(data_jk_bits, T0_E_1_BIT)); + t0e_1 = t0e_1 * T0E_1_LSB; DLOG(INFO) << "t0e_1= " << t0e_1; - M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_bit)); + M0_1 = static_cast(read_navigation_signed(data_jk_bits, M0_1_BIT)); M0_1 = M0_1 * M0_1_LSB; DLOG(INFO) << "M0_1= " << M0_1; - e_1 = static_cast(read_navigation_unsigned(data_jk_bits, e_1_bit)); - e_1 = e_1 * e_1_LSB; + e_1 = static_cast(read_navigation_unsigned(data_jk_bits, E_1_BIT)); + e_1 = e_1 * E_1_LSB; DLOG(INFO) << "e_1= " << e_1; - A_1 = static_cast(read_navigation_unsigned(data_jk_bits, A_1_bit)); - A_1 = A_1 * A_1_LSB_gal; + A_1 = static_cast(read_navigation_unsigned(data_jk_bits, A_1_BIT)); + A_1 = A_1 * A_1_LSB_GAL; DLOG(INFO) << "A_1= " << A_1; flag_ephemeris_1 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; case 2: // Word type 2: Ephemeris (2/4) - IOD_nav_2 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_2_bit)); + IOD_nav_2 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_NAV_2_BIT)); DLOG(INFO) << "IOD_nav_2= " << IOD_nav_2; - OMEGA_0_2 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_0_2_bit)); + OMEGA_0_2 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_0_2_BIT)); OMEGA_0_2 = OMEGA_0_2 * OMEGA_0_2_LSB; DLOG(INFO) << "OMEGA_0_2= " << OMEGA_0_2; - i_0_2 = static_cast(read_navigation_signed(data_jk_bits, i_0_2_bit)); - i_0_2 = i_0_2 * i_0_2_LSB; + i_0_2 = static_cast(read_navigation_signed(data_jk_bits, I_0_2_BIT)); + i_0_2 = i_0_2 * I_0_2_LSB; DLOG(INFO) << "i_0_2= " << i_0_2; - omega_2 = static_cast(read_navigation_signed(data_jk_bits, omega_2_bit)); - omega_2 = omega_2 * omega_2_LSB; + omega_2 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_2_BIT)); + omega_2 = omega_2 * OMEGA_2_LSB; DLOG(INFO) << "omega_2= " << omega_2; - iDot_2 = static_cast(read_navigation_signed(data_jk_bits, iDot_2_bit)); - iDot_2 = iDot_2 * iDot_2_LSB; + iDot_2 = static_cast(read_navigation_signed(data_jk_bits, I_DOT_2_BIT)); + iDot_2 = iDot_2 * I_DOT_2_LSB; DLOG(INFO) << "iDot_2= " << iDot_2; flag_ephemeris_2 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; case 3: // Word type 3: Ephemeris (3/4) and SISA - IOD_nav_3 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_3_bit)); + IOD_nav_3 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_NAV_3_BIT)); DLOG(INFO) << "IOD_nav_3= " << IOD_nav_3; - OMEGA_dot_3 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_dot_3_bit)); - OMEGA_dot_3 = OMEGA_dot_3 * OMEGA_dot_3_LSB; + OMEGA_dot_3 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_DOT_3_BIT)); + OMEGA_dot_3 = OMEGA_dot_3 * OMEGA_DOT_3_LSB; DLOG(INFO) << "OMEGA_dot_3= " << OMEGA_dot_3; - delta_n_3 = static_cast(read_navigation_signed(data_jk_bits, delta_n_3_bit)); - delta_n_3 = delta_n_3 * delta_n_3_LSB; + delta_n_3 = static_cast(read_navigation_signed(data_jk_bits, DELTA_N_3_BIT)); + delta_n_3 = delta_n_3 * DELTA_N_3_LSB; DLOG(INFO) << "delta_n_3= " << delta_n_3; - C_uc_3 = static_cast(read_navigation_signed(data_jk_bits, C_uc_3_bit)); - C_uc_3 = C_uc_3 * C_uc_3_LSB; + C_uc_3 = static_cast(read_navigation_signed(data_jk_bits, C_UC_3_BIT)); + C_uc_3 = C_uc_3 * C_UC_3_LSB; DLOG(INFO) << "C_uc_3= " << C_uc_3; - C_us_3 = static_cast(read_navigation_signed(data_jk_bits, C_us_3_bit)); - C_us_3 = C_us_3 * C_us_3_LSB; + C_us_3 = static_cast(read_navigation_signed(data_jk_bits, C_US_3_BIT)); + C_us_3 = C_us_3 * C_US_3_LSB; DLOG(INFO) << "C_us_3= " << C_us_3; - C_rc_3 = static_cast(read_navigation_signed(data_jk_bits, C_rc_3_bit)); - C_rc_3 = C_rc_3 * C_rc_3_LSB; + C_rc_3 = static_cast(read_navigation_signed(data_jk_bits, C_RC_3_BIT)); + C_rc_3 = C_rc_3 * C_RC_3_LSB; DLOG(INFO) << "C_rc_3= " << C_rc_3; - C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_rs_3_bit)); - C_rs_3 = C_rs_3 * C_rs_3_LSB; + C_rs_3 = static_cast(read_navigation_signed(data_jk_bits, C_RS_3_BIT)); + C_rs_3 = C_rs_3 * C_RS_3_LSB; DLOG(INFO) << "C_rs_3= " << C_rs_3; - SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_bit)); + SISA_3 = static_cast(read_navigation_unsigned(data_jk_bits, SISA_3_BIT)); DLOG(INFO) << "SISA_3= " << SISA_3; flag_ephemeris_3 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; case 4: // Word type 4: Ephemeris (4/4) and Clock correction parameters - IOD_nav_4 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_nav_4_bit)); + IOD_nav_4 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_NAV_4_BIT)); DLOG(INFO) << "IOD_nav_4= " << IOD_nav_4; - SV_ID_PRN_4 = static_cast(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_bit)); + SV_ID_PRN_4 = static_cast(read_navigation_unsigned(data_jk_bits, SV_ID_PRN_4_BIT)); DLOG(INFO) << "SV_ID_PRN_4= " << SV_ID_PRN_4; - C_ic_4 = static_cast(read_navigation_signed(data_jk_bits, C_ic_4_bit)); - C_ic_4 = C_ic_4 * C_ic_4_LSB; + C_ic_4 = static_cast(read_navigation_signed(data_jk_bits, C_IC_4_BIT)); + C_ic_4 = C_ic_4 * C_IC_4_LSB; DLOG(INFO) << "C_ic_4= " << C_ic_4; - C_is_4 = static_cast(read_navigation_signed(data_jk_bits, C_is_4_bit)); - C_is_4 = C_is_4 * C_is_4_LSB; + C_is_4 = static_cast(read_navigation_signed(data_jk_bits, C_IS_4_BIT)); + C_is_4 = C_is_4 * C_IS_4_LSB; DLOG(INFO) << "C_is_4= " << C_is_4; // Clock correction parameters - t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, t0c_4_bit)); - t0c_4 = t0c_4 * t0c_4_LSB; + t0c_4 = static_cast(read_navigation_unsigned(data_jk_bits, T0C_4_BIT)); + t0c_4 = t0c_4 * T0C_4_LSB; DLOG(INFO) << "t0c_4= " << t0c_4; - af0_4 = static_cast(read_navigation_signed(data_jk_bits, af0_4_bit)); - af0_4 = af0_4 * af0_4_LSB; + af0_4 = static_cast(read_navigation_signed(data_jk_bits, AF0_4_BIT)); + af0_4 = af0_4 * AF0_4_LSB; DLOG(INFO) << "af0_4 = " << af0_4; - af1_4 = static_cast(read_navigation_signed(data_jk_bits, af1_4_bit)); - af1_4 = af1_4 * af1_4_LSB; + af1_4 = static_cast(read_navigation_signed(data_jk_bits, AF1_4_BIT)); + af1_4 = af1_4 * AF1_4_LSB; DLOG(INFO) << "af1_4 = " << af1_4; - af2_4 = static_cast(read_navigation_signed(data_jk_bits, af2_4_bit)); - af2_4 = af2_4 * af2_4_LSB; + af2_4 = static_cast(read_navigation_signed(data_jk_bits, AF2_4_BIT)); + af2_4 = af2_4 * AF2_4_LSB; DLOG(INFO) << "af2_4 = " << af2_4; - spare_4 = static_cast(read_navigation_unsigned(data_jk_bits, spare_4_bit)); + spare_4 = static_cast(read_navigation_unsigned(data_jk_bits, SPARE_4_BIT)); DLOG(INFO) << "spare_4 = " << spare_4; flag_ephemeris_4 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; @@ -747,47 +747,47 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) case 5: // Word type 5: Ionospheric correction, BGD, signal health and data validity status and GST // Ionospheric correction - ai0_5 = static_cast(read_navigation_unsigned(data_jk_bits, ai0_5_bit)); - ai0_5 = ai0_5 * ai0_5_LSB; + ai0_5 = static_cast(read_navigation_unsigned(data_jk_bits, AI0_5_BIT)); + ai0_5 = ai0_5 * AI0_5_LSB; DLOG(INFO) << "ai0_5= " << ai0_5; - ai1_5 = static_cast(read_navigation_signed(data_jk_bits, ai1_5_bit)); - ai1_5 = ai1_5 * ai1_5_LSB; + ai1_5 = static_cast(read_navigation_signed(data_jk_bits, AI1_5_BIT)); + ai1_5 = ai1_5 * AI1_5_LSB; DLOG(INFO) << "ai1_5= " << ai1_5; - ai2_5 = static_cast(read_navigation_signed(data_jk_bits, ai2_5_bit)); - ai2_5 = ai2_5 * ai2_5_LSB; + ai2_5 = static_cast(read_navigation_signed(data_jk_bits, AI2_5_BIT)); + ai2_5 = ai2_5 * AI2_5_LSB; DLOG(INFO) << "ai2_5= " << ai2_5; // Ionospheric disturbance flag - Region1_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region1_5_bit)); + Region1_flag_5 = static_cast(read_navigation_bool(data_jk_bits, REGION1_5_BIT)); DLOG(INFO) << "Region1_flag_5= " << Region1_flag_5; - Region2_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region2_5_bit)); + Region2_flag_5 = static_cast(read_navigation_bool(data_jk_bits, REGION2_5_BIT)); DLOG(INFO) << "Region2_flag_5= " << Region2_flag_5; - Region3_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region3_5_bit)); + Region3_flag_5 = static_cast(read_navigation_bool(data_jk_bits, REGION3_5_BIT)); DLOG(INFO) << "Region3_flag_5= " << Region3_flag_5; - Region4_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region4_5_bit)); + Region4_flag_5 = static_cast(read_navigation_bool(data_jk_bits, REGION4_5_BIT)); DLOG(INFO) << "Region4_flag_5= " << Region4_flag_5; - Region5_flag_5 = static_cast(read_navigation_bool(data_jk_bits, Region5_5_bit)); + Region5_flag_5 = static_cast(read_navigation_bool(data_jk_bits, REGION5_5_BIT)); DLOG(INFO) << "Region5_flag_5= " << Region5_flag_5; - BGD_E1E5a_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5a_5_bit)); - BGD_E1E5a_5 = BGD_E1E5a_5 * BGD_E1E5a_5_LSB; + BGD_E1E5a_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1_E5A_5_BIT)); + BGD_E1E5a_5 = BGD_E1E5a_5 * BGD_E1_E5A_5_LSB; DLOG(INFO) << "BGD_E1E5a_5= " << BGD_E1E5a_5; - BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1E5b_5_bit)); - BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1E5b_5_LSB; + BGD_E1E5b_5 = static_cast(read_navigation_signed(data_jk_bits, BGD_E1_E5B_5_BIT)); + BGD_E1E5b_5 = BGD_E1E5b_5 * BGD_E1_E5B_5_LSB; DLOG(INFO) << "BGD_E1E5b_5= " << BGD_E1E5b_5; - E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_5_bit)); + E5b_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5B_HS_5_BIT)); DLOG(INFO) << "E5b_HS_5= " << E5b_HS_5; - E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_5_bit)); + E1B_HS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1_B_HS_5_BIT)); DLOG(INFO) << "E1B_HS_5= " << E1B_HS_5; - E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_DVS_5_bit)); + E5b_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E5B_DVS_5_BIT)); DLOG(INFO) << "E5b_DVS_5= " << E5b_DVS_5; - E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_DVS_5_bit)); + E1B_DVS_5 = static_cast(read_navigation_unsigned(data_jk_bits, E1_B_DVS_5_BIT)); DLOG(INFO) << "E1B_DVS_5= " << E1B_DVS_5; // GST - WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_bit)); + WN_5 = static_cast(read_navigation_unsigned(data_jk_bits, WN_5_BIT)); DLOG(INFO) << "WN_5= " << WN_5; - TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_bit)); + TOW_5 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_5_BIT)); DLOG(INFO) << "TOW_5= " << TOW_5; flag_TOW_5 = true; // set to false externally - spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, spare_5_bit)); + spare_5 = static_cast(read_navigation_unsigned(data_jk_bits, SPARE_5_BIT)); DLOG(INFO) << "spare_5= " << spare_5; flag_iono_and_GST = true; // set to false externally flag_TOW_set = true; // set to false externally @@ -795,26 +795,26 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 6: // Word type 6: GST-UTC conversion parameters - A0_6 = static_cast(read_navigation_signed(data_jk_bits, A0_6_bit)); + A0_6 = static_cast(read_navigation_signed(data_jk_bits, A0_6_BIT)); A0_6 = A0_6 * A0_6_LSB; DLOG(INFO) << "A0_6= " << A0_6; - A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_bit)); + A1_6 = static_cast(read_navigation_signed(data_jk_bits, A1_6_BIT)); A1_6 = A1_6 * A1_6_LSB; DLOG(INFO) << "A1_6= " << A1_6; - Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLS_6_bit)); + Delta_tLS_6 = static_cast(read_navigation_signed(data_jk_bits, DELTA_T_LS_6_BIT)); DLOG(INFO) << "Delta_tLS_6= " << Delta_tLS_6; - t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, t0t_6_bit)); - t0t_6 = t0t_6 * t0t_6_LSB; + t0t_6 = static_cast(read_navigation_unsigned(data_jk_bits, T0T_6_BIT)); + t0t_6 = t0t_6 * T0T_6_LSB; DLOG(INFO) << "t0t_6= " << t0t_6; - WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, WNot_6_bit)); + WNot_6 = static_cast(read_navigation_unsigned(data_jk_bits, W_NOT_6_BIT)); DLOG(INFO) << "WNot_6= " << WNot_6; - WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_bit)); + WN_LSF_6 = static_cast(read_navigation_unsigned(data_jk_bits, WN_LSF_6_BIT)); DLOG(INFO) << "WN_LSF_6= " << WN_LSF_6; - DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_bit)); + DN_6 = static_cast(read_navigation_unsigned(data_jk_bits, DN_6_BIT)); DLOG(INFO) << "DN_6= " << DN_6; - Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, Delta_tLSF_6_bit)); + Delta_tLSF_6 = static_cast(read_navigation_signed(data_jk_bits, DELTA_T_LSF_6_BIT)); DLOG(INFO) << "Delta_tLSF_6= " << Delta_tLSF_6; - TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_bit)); + TOW_6 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_6_BIT)); DLOG(INFO) << "TOW_6= " << TOW_6; flag_TOW_6 = true; // set to false externally flag_utc_model = true; // set to false externally @@ -823,34 +823,34 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 7: // Word type 7: Almanac for SVID1 (1/2), almanac reference time and almanac reference week number - IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_7_bit)); + IOD_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_A_7_BIT)); DLOG(INFO) << "IOD_a_7= " << IOD_a_7; - WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_7_bit)); + WN_a_7 = static_cast(read_navigation_unsigned(data_jk_bits, WN_A_7_BIT)); DLOG(INFO) << "WN_a_7= " << WN_a_7; - t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_7_bit)); - t0a_7 = t0a_7 * t0a_7_LSB; + t0a_7 = static_cast(read_navigation_unsigned(data_jk_bits, T0A_7_BIT)); + t0a_7 = t0a_7 * T0A_7_LSB; DLOG(INFO) << "t0a_7= " << t0a_7; - SVID1_7 = static_cast(read_navigation_unsigned(data_jk_bits, SVID1_7_bit)); + SVID1_7 = static_cast(read_navigation_unsigned(data_jk_bits, SVI_D1_7_BIT)); DLOG(INFO) << "SVID1_7= " << SVID1_7; - DELTA_A_7 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_7_bit)); + DELTA_A_7 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_7_BIT)); DELTA_A_7 = DELTA_A_7 * DELTA_A_7_LSB; DLOG(INFO) << "DELTA_A_7= " << DELTA_A_7; - e_7 = static_cast(read_navigation_unsigned(data_jk_bits, e_7_bit)); - e_7 = e_7 * e_7_LSB; + e_7 = static_cast(read_navigation_unsigned(data_jk_bits, E_7_BIT)); + e_7 = e_7 * E_7_LSB; DLOG(INFO) << "e_7= " << e_7; - omega_7 = static_cast(read_navigation_signed(data_jk_bits, omega_7_bit)); - omega_7 = omega_7 * omega_7_LSB; + omega_7 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_7_BIT)); + omega_7 = omega_7 * OMEGA_7_LSB; DLOG(INFO) << "omega_7= " << omega_7; - delta_i_7 = static_cast(read_navigation_signed(data_jk_bits, delta_i_7_bit)); - delta_i_7 = delta_i_7 * delta_i_7_LSB; + delta_i_7 = static_cast(read_navigation_signed(data_jk_bits, DELTA_I_7_BIT)); + delta_i_7 = delta_i_7 * DELTA_I_7_LSB; DLOG(INFO) << "delta_i_7= " << delta_i_7; - Omega0_7 = static_cast(read_navigation_signed(data_jk_bits, Omega0_7_bit)); - Omega0_7 = Omega0_7 * Omega0_7_LSB; + Omega0_7 = static_cast(read_navigation_signed(data_jk_bits, OMEGA0_7_BIT)); + Omega0_7 = Omega0_7 * OMEGA0_7_LSB; DLOG(INFO) << "Omega0_7= " << Omega0_7; - Omega_dot_7 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_7_bit)); - Omega_dot_7 = Omega_dot_7 * Omega_dot_7_LSB; + Omega_dot_7 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_DOT_7_BIT)); + Omega_dot_7 = Omega_dot_7 * OMEGA_DOT_7_LSB; DLOG(INFO) << "Omega_dot_7= " << Omega_dot_7; - M0_7 = static_cast(read_navigation_signed(data_jk_bits, M0_7_bit)); + M0_7 = static_cast(read_navigation_signed(data_jk_bits, M0_7_BIT)); M0_7 = M0_7 * M0_7_LSB; DLOG(INFO) << "M0_7= " << M0_7; flag_almanac_1 = true; @@ -858,116 +858,116 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 8: // Word type 8: Almanac for SVID1 (2/2) and SVID2 (1/2)*/ - IOD_a_8 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_8_bit)); + IOD_a_8 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_A_8_BIT)); DLOG(INFO) << "IOD_a_8= " << IOD_a_8; - af0_8 = static_cast(read_navigation_signed(data_jk_bits, af0_8_bit)); - af0_8 = af0_8 * af0_8_LSB; + af0_8 = static_cast(read_navigation_signed(data_jk_bits, AF0_8_BIT)); + af0_8 = af0_8 * AF0_8_LSB; DLOG(INFO) << "af0_8= " << af0_8; - af1_8 = static_cast(read_navigation_signed(data_jk_bits, af1_8_bit)); - af1_8 = af1_8 * af1_8_LSB; + af1_8 = static_cast(read_navigation_signed(data_jk_bits, AF1_8_BIT)); + af1_8 = af1_8 * AF1_8_LSB; DLOG(INFO) << "af1_8= " << af1_8; - E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_8_bit)); + E5b_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E5B_HS_8_BIT)); DLOG(INFO) << "E5b_HS_8= " << E5b_HS_8; - E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_8_bit)); + E1B_HS_8 = static_cast(read_navigation_unsigned(data_jk_bits, E1_B_HS_8_BIT)); DLOG(INFO) << "E1B_HS_8= " << E1B_HS_8; - SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVID2_8_bit)); + SVID2_8 = static_cast(read_navigation_unsigned(data_jk_bits, SVI_D2_8_BIT)); DLOG(INFO) << "SVID2_8= " << SVID2_8; - DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_bit)); + DELTA_A_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_8_BIT)); DELTA_A_8 = DELTA_A_8 * DELTA_A_8_LSB; DLOG(INFO) << "DELTA_A_8= " << DELTA_A_8; - e_8 = static_cast(read_navigation_unsigned(data_jk_bits, e_8_bit)); - e_8 = e_8 * e_8_LSB; + e_8 = static_cast(read_navigation_unsigned(data_jk_bits, E_8_BIT)); + e_8 = e_8 * E_8_LSB; DLOG(INFO) << "e_8= " << e_8; - omega_8 = static_cast(read_navigation_signed(data_jk_bits, omega_8_bit)); - omega_8 = omega_8 * omega_8_LSB; + omega_8 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_8_BIT)); + omega_8 = omega_8 * OMEGA_8_LSB; DLOG(INFO) << "omega_8= " << omega_8; - delta_i_8 = static_cast(read_navigation_signed(data_jk_bits, delta_i_8_bit)); - delta_i_8 = delta_i_8 * delta_i_8_LSB; + delta_i_8 = static_cast(read_navigation_signed(data_jk_bits, DELTA_I_8_BIT)); + delta_i_8 = delta_i_8 * DELTA_I_8_LSB; DLOG(INFO) << "delta_i_8= " << delta_i_8; - Omega0_8 = static_cast(read_navigation_signed(data_jk_bits, Omega0_8_bit)); - Omega0_8 = Omega0_8 * Omega0_8_LSB; + Omega0_8 = static_cast(read_navigation_signed(data_jk_bits, OMEGA0_8_BIT)); + Omega0_8 = Omega0_8 * OMEGA0_8_LSB; DLOG(INFO) << "Omega0_8= " << Omega0_8; - Omega_dot_8 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_8_bit)); - Omega_dot_8 = Omega_dot_8 * Omega_dot_8_LSB; + Omega_dot_8 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_DOT_8_BIT)); + Omega_dot_8 = Omega_dot_8 * OMEGA_DOT_8_LSB; DLOG(INFO) << "Omega_dot_8= " << Omega_dot_8; flag_almanac_2 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; case 9: // Word type 9: Almanac for SVID2 (2/2) and SVID3 (1/2) - IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_9_bit)); + IOD_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_A_9_BIT)); DLOG(INFO) << "IOD_a_9= " << IOD_a_9; - WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_a_9_bit)); + WN_a_9 = static_cast(read_navigation_unsigned(data_jk_bits, WN_A_9_BIT)); DLOG(INFO) << "WN_a_9= " << WN_a_9; - t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, t0a_9_bit)); - t0a_9 = t0a_9 * t0a_9_LSB; + t0a_9 = static_cast(read_navigation_unsigned(data_jk_bits, T0A_9_BIT)); + t0a_9 = t0a_9 * T0A_9_LSB; DLOG(INFO) << "t0a_9= " << t0a_9; - M0_9 = static_cast(read_navigation_signed(data_jk_bits, M0_9_bit)); + M0_9 = static_cast(read_navigation_signed(data_jk_bits, M0_9_BIT)); M0_9 = M0_9 * M0_9_LSB; DLOG(INFO) << "M0_9= " << M0_9; - af0_9 = static_cast(read_navigation_signed(data_jk_bits, af0_9_bit)); - af0_9 = af0_9 * af0_9_LSB; + af0_9 = static_cast(read_navigation_signed(data_jk_bits, AF0_9_BIT)); + af0_9 = af0_9 * AF0_9_LSB; DLOG(INFO) << "af0_9= " << af0_9; - af1_9 = static_cast(read_navigation_signed(data_jk_bits, af1_9_bit)); - af1_9 = af1_9 * af1_9_LSB; + af1_9 = static_cast(read_navigation_signed(data_jk_bits, AF1_9_BIT)); + af1_9 = af1_9 * AF1_9_LSB; DLOG(INFO) << "af1_9= " << af1_9; - E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_9_bit)); + E5b_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E5B_HS_9_BIT)); DLOG(INFO) << "E5b_HS_9= " << E5b_HS_9; - E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_9_bit)); + E1B_HS_9 = static_cast(read_navigation_unsigned(data_jk_bits, E1_B_HS_9_BIT)); DLOG(INFO) << "E1B_HS_9= " << E1B_HS_9; - SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVID3_9_bit)); + SVID3_9 = static_cast(read_navigation_unsigned(data_jk_bits, SVI_D3_9_BIT)); DLOG(INFO) << "SVID3_9= " << SVID3_9; - DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_bit)); + DELTA_A_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_A_9_BIT)); DELTA_A_9 = DELTA_A_9 * DELTA_A_9_LSB; DLOG(INFO) << "DELTA_A_9= " << DELTA_A_9; - e_9 = static_cast(read_navigation_unsigned(data_jk_bits, e_9_bit)); - e_9 = e_9 * e_9_LSB; + e_9 = static_cast(read_navigation_unsigned(data_jk_bits, E_9_BIT)); + e_9 = e_9 * E_9_LSB; DLOG(INFO) << "e_9= " << e_9; - omega_9 = static_cast(read_navigation_signed(data_jk_bits, omega_9_bit)); - omega_9 = omega_9 * omega_9_LSB; + omega_9 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_9_BIT)); + omega_9 = omega_9 * OMEGA_9_LSB; DLOG(INFO) << "omega_9= " << omega_9; - delta_i_9 = static_cast(read_navigation_signed(data_jk_bits, delta_i_9_bit)); - delta_i_9 = delta_i_9 * delta_i_9_LSB; + delta_i_9 = static_cast(read_navigation_signed(data_jk_bits, DELTA_I_9_BIT)); + delta_i_9 = delta_i_9 * DELTA_I_9_LSB; DLOG(INFO) << "delta_i_9= " << delta_i_9; flag_almanac_3 = true; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; case 10: // Word type 10: Almanac for SVID3 (2/2) and GST-GPS conversion parameters - IOD_a_10 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_a_10_bit)); + IOD_a_10 = static_cast(read_navigation_unsigned(data_jk_bits, IOD_A_10_BIT)); DLOG(INFO) << "IOD_a_10= " << IOD_a_10; - Omega0_10 = static_cast(read_navigation_signed(data_jk_bits, Omega0_10_bit)); - Omega0_10 = Omega0_10 * Omega0_10_LSB; + Omega0_10 = static_cast(read_navigation_signed(data_jk_bits, OMEGA0_10_BIT)); + Omega0_10 = Omega0_10 * OMEGA0_10_LSB; DLOG(INFO) << "Omega0_10= " << Omega0_10; - Omega_dot_10 = static_cast(read_navigation_signed(data_jk_bits, Omega_dot_10_bit)); - Omega_dot_10 = Omega_dot_10 * Omega_dot_10_LSB; + Omega_dot_10 = static_cast(read_navigation_signed(data_jk_bits, OMEGA_DOT_10_BIT)); + Omega_dot_10 = Omega_dot_10 * OMEGA_DOT_10_LSB; DLOG(INFO) << "Omega_dot_10= " << Omega_dot_10; - M0_10 = static_cast(read_navigation_signed(data_jk_bits, M0_10_bit)); + M0_10 = static_cast(read_navigation_signed(data_jk_bits, M0_10_BIT)); M0_10 = M0_10 * M0_10_LSB; DLOG(INFO) << "M0_10= " << M0_10; - af0_10 = static_cast(read_navigation_signed(data_jk_bits, af0_10_bit)); - af0_10 = af0_10 * af0_10_LSB; + af0_10 = static_cast(read_navigation_signed(data_jk_bits, AF0_10_BIT)); + af0_10 = af0_10 * AF0_10_LSB; DLOG(INFO) << "af0_10= " << af0_10; - af1_10 = static_cast(read_navigation_signed(data_jk_bits, af1_10_bit)); - af1_10 = af1_10 * af1_10_LSB; + af1_10 = static_cast(read_navigation_signed(data_jk_bits, AF1_10_BIT)); + af1_10 = af1_10 * AF1_10_LSB; DLOG(INFO) << "af1_10= " << af1_10; - E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5b_HS_10_bit)); + E5b_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E5B_HS_10_BIT)); DLOG(INFO) << "E5b_HS_10= " << E5b_HS_10; - E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1B_HS_10_bit)); + E1B_HS_10 = static_cast(read_navigation_unsigned(data_jk_bits, E1_B_HS_10_BIT)); DLOG(INFO) << "E1B_HS_10= " << E1B_HS_10; - A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0G_10_bit)); + A_0G_10 = static_cast(read_navigation_signed(data_jk_bits, A_0_G_10_BIT)); A_0G_10 = A_0G_10 * A_0G_10_LSB; flag_GGTO_1 = true; DLOG(INFO) << "A_0G_10= " << A_0G_10; - A_1G_10 = static_cast(read_navigation_signed(data_jk_bits, A_1G_10_bit)); + A_1G_10 = static_cast(read_navigation_signed(data_jk_bits, A_1_G_10_BIT)); A_1G_10 = A_1G_10 * A_1G_10_LSB; flag_GGTO_2 = true; DLOG(INFO) << "A_1G_10= " << A_1G_10; - t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, t_0G_10_bit)); - t_0G_10 = t_0G_10 * t_0G_10_LSB; + t_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, T_0_G_10_BIT)); + t_0G_10 = t_0G_10 * T_0_G_10_LSB; flag_GGTO_3 = true; DLOG(INFO) << "t_0G_10= " << t_0G_10; - WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0G_10_bit)); + WN_0G_10 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_G_10_BIT)); flag_GGTO_4 = true; DLOG(INFO) << "WN_0G_10= " << WN_0G_10; flag_almanac_4 = true; @@ -975,11 +975,11 @@ int32_t Galileo_Navigation_Message::page_jk_decoder(const char* data_jk) break; case 0: // Word type 0: I/NAV Spare Word - Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, Time_0_bit)); + Time_0 = static_cast(read_navigation_unsigned(data_jk_bits, TIME_0_BIT)); DLOG(INFO) << "Time_0= " << Time_0; - WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_bit)); + WN_0 = static_cast(read_navigation_unsigned(data_jk_bits, WN_0_BIT)); DLOG(INFO) << "WN_0= " << WN_0; - TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_bit)); + TOW_0 = static_cast(read_navigation_unsigned(data_jk_bits, TOW_0_BIT)); DLOG(INFO) << "TOW_0= " << TOW_0; DLOG(INFO) << "flag_tow_set" << flag_TOW_set; break; diff --git a/src/core/system_parameters/glonass_gnav_navigation_message.cc b/src/core/system_parameters/glonass_gnav_navigation_message.cc index b2a825894..4433efc8a 100644 --- a/src/core/system_parameters/glonass_gnav_navigation_message.cc +++ b/src/core/system_parameters/glonass_gnav_navigation_message.cc @@ -84,7 +84,9 @@ void Glonass_Gnav_Navigation_Message::reset() // Data update information d_previous_tb = 0.0; for (double& i : d_previous_Na) - i = 0.0; + { + i = 0.0; + } std::map satelliteBlock; // Map that stores to which block the PRN belongs http://www.navcen.uscg.gov/?Do=constellationStatus @@ -320,7 +322,9 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame // Perform data verification and exit code if error in bit sequence flag_CRC_test = CRC_test(string_bits); if (flag_CRC_test == false) - return 0; + { + return 0; + } // Decode all 15 string messages d_string_ID = static_cast(read_navigation_unsigned(string_bits, STRING_ID)); @@ -401,7 +405,7 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame // --- It is string 5 ---------------------------------------------- if (flag_ephemeris_str_4 == true) { - gnav_utc_model.d_N_A = static_cast(read_navigation_unsigned(string_bits, N_A)); + gnav_utc_model.d_N_A = static_cast(read_navigation_unsigned(string_bits, DAY_NUMBER_A)); gnav_utc_model.d_tau_c = static_cast(read_navigation_signed(string_bits, TAU_C)) * TWO_N31; gnav_utc_model.d_N_4 = static_cast(read_navigation_unsigned(string_bits, N_4)); gnav_utc_model.d_tau_gps = static_cast(read_navigation_signed(string_bits, TAU_GPS)) * TWO_N30; @@ -447,15 +451,17 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame case 6: // --- It is string 6 ---------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, N_A)); d_frame_ID = get_frame_number(i_alm_satellite_slot_number); // Make sure a valid frame_ID or satellite slot number is returned if (d_frame_ID == 0) - return 0; + { + return 0; + } gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, N_A)); gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; @@ -495,15 +501,17 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame case 8: // --- It is string 8 ---------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, N_A)); d_frame_ID = get_frame_number(i_alm_satellite_slot_number); // Make sure a valid frame_ID or satellite slot number is returned if (d_frame_ID == 0) - return 0; + { + return 0; + } gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, N_A)); gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; @@ -538,15 +546,17 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame case 10: // --- It is string 10 --------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, N_A)); d_frame_ID = get_frame_number(i_alm_satellite_slot_number); // Make sure a valid frame_ID or satellite slot number is returned if (d_frame_ID == 0) - return 0; + { + return 0; + } gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, N_A)); gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; @@ -581,14 +591,16 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame case 12: // --- It is string 12 --------------------------------------------- - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, N_A)); d_frame_ID = get_frame_number(i_alm_satellite_slot_number); // Make sure a valid frame_ID or satellite slot number is returned if (d_frame_ID == 0) - return 0; + { + return 0; + } gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, N_A)); gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; @@ -630,14 +642,16 @@ int32_t Glonass_Gnav_Navigation_Message::string_decoder(const std::string& frame } else { - i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, n_A)); + i_alm_satellite_slot_number = static_cast(read_navigation_unsigned(string_bits, N_A)); d_frame_ID = get_frame_number(i_alm_satellite_slot_number); // Make sure a valid frame_ID or satellite slot number is returned if (d_frame_ID == 0) - return 0; + { + return 0; + } gnav_almanac[i_alm_satellite_slot_number - 1].d_C_n = static_cast(read_navigation_bool(string_bits, C_N)); gnav_almanac[i_alm_satellite_slot_number - 1].d_M_n_A = static_cast(read_navigation_unsigned(string_bits, M_N_A)); - gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, n_A)); + gnav_almanac[i_alm_satellite_slot_number - 1].d_n_A = static_cast(read_navigation_unsigned(string_bits, N_A)); gnav_almanac[i_alm_satellite_slot_number - 1].d_tau_n_A = static_cast(read_navigation_unsigned(string_bits, TAU_N_A)) * TWO_N18; gnav_almanac[i_alm_satellite_slot_number - 1].d_lambda_n_A = static_cast(read_navigation_signed(string_bits, LAMBDA_N_A)) * TWO_N20 * GLONASS_PI; gnav_almanac[i_alm_satellite_slot_number - 1].d_Delta_i_n_A = static_cast(read_navigation_signed(string_bits, DELTA_I_N_A)) * TWO_N20 * GLONASS_PI; diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index 6ff824868..0252ef8f8 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -69,8 +69,14 @@ std::ostream& operator<<(std::ostream& out, const Gnss_Satellite& sat) // outpu { std::string tag; std::string tag2; - if (sat.get_system() == "Galileo") tag = "E"; - if (sat.get_PRN() < 10) tag2 = "0"; + if (sat.get_system() == "Galileo") + { + tag = "E"; + } + if (sat.get_PRN() < 10) + { + tag2 = "0"; + } out << sat.get_system() << " PRN " << tag << tag2 << sat.get_PRN() << " (Block " << sat.get_block() << ")"; return out; } diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index 519deb671..064b34b2e 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -47,18 +47,19 @@ class Gnss_Satellite { public: - Gnss_Satellite(); //!< Default Constructor. - Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor. - ~Gnss_Satellite(); //!< Default Destructor. - void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages - uint32_t get_PRN() const; //!< Gets satellite's PRN - int32_t get_rf_link() const; //!< Gets the satellite's rf link - std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"} - std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"} - std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} - std::string what_block(const std::string& system_, uint32_t PRN_); //!< Gets the block of a given satellite - friend bool operator==(const Gnss_Satellite&, const Gnss_Satellite&); //!< operator== for comparison - friend std::ostream& operator<<(std::ostream&, const Gnss_Satellite&); //!< operator<< for pretty printing + Gnss_Satellite(); //!< Default Constructor. + Gnss_Satellite(const std::string& system_, uint32_t PRN_); //!< Concrete GNSS satellite Constructor. + ~Gnss_Satellite(); //!< Default Destructor. + void update_PRN(uint32_t PRN); //!< Updates the PRN Number when information is decoded, only applies to GLONASS GNAV messages + uint32_t get_PRN() const; //!< Gets satellite's PRN + int32_t get_rf_link() const; //!< Gets the satellite's rf link + std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"} + std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"} + std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} + std::string what_block(const std::string& system_, uint32_t PRN_); //!< Gets the block of a given satellite + + friend bool operator==(const Gnss_Satellite& /*sat1*/, const Gnss_Satellite& /*sat2*/); //!< operator== for comparison + friend std::ostream& operator<<(std::ostream& /*out*/, const Gnss_Satellite& /*sat*/); //!< operator<< for pretty printing //Gnss_Satellite& operator=(const Gnss_Satellite &); private: uint32_t PRN; diff --git a/src/core/system_parameters/gnss_signal.h b/src/core/system_parameters/gnss_signal.h index 2b739c633..a2abc773f 100644 --- a/src/core/system_parameters/gnss_signal.h +++ b/src/core/system_parameters/gnss_signal.h @@ -52,10 +52,11 @@ public: Gnss_Signal(const std::string& signal_); Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_); ~Gnss_Signal(); - std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a. - Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal - friend bool operator==(const Gnss_Signal&, const Gnss_Signal&); //!< operator== for comparison - friend std::ostream& operator<<(std::ostream&, const Gnss_Signal&); //!< operator<< for pretty printing + std::string get_signal_str() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "L5" for GPS L5, "1G" for GLONASS L1 C/A, "1B" for Galileo E1B, "5X" for Galileo E5a. + Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal + + friend bool operator==(const Gnss_Signal& /*sig1*/, const Gnss_Signal& /*sig2*/); //!< operator== for comparison + friend std::ostream& operator<<(std::ostream& /*out*/, const Gnss_Signal& /*sig*/); //!< operator<< for pretty printing }; #endif diff --git a/src/core/system_parameters/gps_ephemeris.cc b/src/core/system_parameters/gps_ephemeris.cc index c6e181815..e6b5b10ae 100644 --- a/src/core/system_parameters/gps_ephemeris.cc +++ b/src/core/system_parameters/gps_ephemeris.cc @@ -283,7 +283,7 @@ double Gps_Ephemeris::satellitePosition(double transmitTime) double dtr_s = d_A_f0 + d_A_f1 * tk + d_A_f2 * tk * tk; /* relativity correction */ - dtr_s -= 2.0 * sqrt(GM * a) * d_e_eccentricity * sin(E) / (GPS_C_m_s * GPS_C_m_s); + dtr_s -= 2.0 * sqrt(GM * a) * d_e_eccentricity * sin(E) / (GPS_C_M_S * GPS_C_M_S); return dtr_s; } diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc index e38f6bdb2..e551551dc 100644 --- a/src/core/system_parameters/gps_navigation_message.cc +++ b/src/core/system_parameters/gps_navigation_message.cc @@ -115,6 +115,7 @@ void Gps_Navigation_Message::reset() d_beta1 = 0.0; d_beta2 = 0.0; d_beta3 = 0.0; + d_A2 = 0.0; d_A1 = 0.0; d_A0 = 0.0; d_t_OT = 0; diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 85b250e91..ad785f0f0 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -16,90 +16,72 @@ # along with GNSS-SDR. If not, see . # -set(GNSS_SDR_OPTIONAL_LIBS "") -set(GNSS_SDR_OPTIONAL_HEADERS "") -if(ENABLE_GPERFTOOLS) - if(GPERFTOOLS_FOUND) - set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}") - set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif() -endif() +add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) -if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS}) -endif() +target_link_libraries(gnss-sdr + PUBLIC + Boost::filesystem + Boost::system + Gflags::gflags + Glog::glog + Threads::Threads + core_receiver + gnss_sdr_flags +) -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) +target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}") + +# Disable internal logging +if(NOT ENABLE_LOG) + target_compile_definitions(gnss-sdr PUBLIC -DGOOGLE_STRIP_LOG=1) endif() if(ENABLE_CUDA) - add_definitions(-DCUDA_GPU_ACCEL=1) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) + target_link_libraries(gnss-sdr + PUBLIC + ${CUDA_LIBRARIES} + ) + target_include_directories(gnss-sdr + PUBLIC + ${CUDA_INCLUDE_DIRS} + ) + target_compile_definitions(gnss-sdr PRIVATE -DCUDA_GPU_ACCEL=1) endif() -if(ORC_FOUND) - set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${ORC_LIBRARIES}) - set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${ORC_INCLUDE_DIRS}) -endif() - -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_OPTIONAL_HEADERS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${OPT_GNSSSDR_INCLUDE_DIRS} -) - -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") - -if(OS_IS_MACOSX) - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(MAC_LIBRARIES "-framework Accelerate -lc++") +if(ENABLE_GPERFTOOLS) + if(GPERFTOOLS_FOUND) + target_link_libraries(gnss-sdr + PUBLIC + Gperftools::profiler + Gperftools::tcmalloc + ) endif() endif() -add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) +if(OS_IS_MACOSX) + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_link_libraries(gnss-sdr + PUBLIC + "-lc++" + ) + endif() +endif() + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(gnss-sdr + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() add_custom_command(TARGET gnss-sdr POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$ ) -target_link_libraries(gnss-sdr - ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - gnss_sp_libs - gnss_sdr_flags - gnss_rx -) - install(TARGETS gnss-sdr RUNTIME DESTINATION bin COMPONENT "gnss-sdr") diff --git a/src/main/main.cc b/src/main/main.cc index 9b8354276..67e0881f5 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -8,7 +8,7 @@ * * ------------------------------------------------------------------------- * -* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) +* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) * * GNSS-SDR is a software defined Global Navigation * Satellite Systems receiver @@ -72,14 +72,14 @@ using google::LogMessage; */ // For GPS NAVIGATION (L1) -concurrent_queue global_gps_acq_assist_queue; -concurrent_map global_gps_acq_assist_map; +Concurrent_Queue global_gps_acq_assist_queue; +Concurrent_Map global_gps_acq_assist_map; int main(int argc, char** argv) { const std::string intro_help( std::string("\nGNSS-SDR is an Open Source GNSS Software Defined Receiver\n") + - "Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)\n" + + "Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)\n" + "This program comes with ABSOLUTELY NO WARRANTY;\n" + "See COPYING file to see a copy of the General Public License\n \n"); @@ -132,17 +132,22 @@ int main(int argc, char** argv) } } - std::unique_ptr control_thread(new ControlThread()); - - // record startup time std::chrono::time_point start, end; start = std::chrono::system_clock::now(); - - int return_code; + int return_code = 0; try { + std::unique_ptr control_thread(new ControlThread()); + // record startup time + start = std::chrono::system_clock::now(); return_code = control_thread->run(); } + catch (const boost::thread_resource_error& e) + { + std::cout << "Failed to create boost thread." << std::endl; + google::ShutDownCommandLineFlags(); + return 1; + } catch (const boost::exception& e) { if (GOOGLE_STRIP_LOG == 0) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index de39387b7..c6e4ab268 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -44,10 +44,24 @@ set(TOOLCHAIN_ARG "") if(EXISTS $ENV{OECORE_TARGET_SYSROOT}) set(GTEST_COMPILER "") set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/Toolchains/oe-sdk_cross.cmake") +else() + if(ENABLE_PACKAGING) + set(TOOLCHAIN_ARG "-DCMAKE_VERBOSE_MAKEFILE=ON") + endif() endif() if(NOT ${GTEST_DIR_LOCAL}) # if GTEST_DIR is not defined, we download and build it + if(CMAKE_BUILD_TYPE MATCHES Debug) + set(DEBUG_POSTFIX "d") + endif() + if(OS_IS_MACOSX) + if(CMAKE_GENERATOR STREQUAL Xcode) + set(DEBUG_PREFIX "Debug/") + set(DEBUG_POSTFIX "d") + endif() + endif() + if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( gtest-${GNSSSDR_GTEST_LOCAL_VERSION} @@ -55,7 +69,7 @@ if(NOT ${GTEST_DIR_LOCAL}) GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} + CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -Dgtest_hide_internal_symbols=ON ${TOOLCHAIN_ARG} UPDATE_COMMAND "" PATCH_COMMAND "" INSTALL_COMMAND "" @@ -67,94 +81,93 @@ if(NOT ${GTEST_DIR_LOCAL}) GIT_TAG release-${GNSSSDR_GTEST_LOCAL_VERSION} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF ${TOOLCHAIN_ARG} + CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -Dgtest_hide_internal_symbols=ON ${TOOLCHAIN_ARG} UPDATE_COMMAND "" PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) endif() - - # Set up variables - # Set recently downloaded and build Googletest root folder - set(GTEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") - # Source code - ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} source_dir) - set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include) - set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) - # Library ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) - if(OS_IS_MACOSX) - if(CMAKE_GENERATOR STREQUAL Xcode) - set(FINAL_D "d") - set(ADD_DEBUG "Debug/") - endif() + + if(NOT TARGET GTest::GTest) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include) + add_library(GTest::GTest STATIC IMPORTED) + add_dependencies(GTest::GTest gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${binary_dir}/googletest/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_POSTFIX}${CMAKE_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include" + INTERFACE_LINK_LIBRARIES "${binary_dir}/googletest/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_POSTFIX}${CMAKE_DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + set_target_properties(GTest::GTest PROPERTIES + INTERFACE_LINK_LIBRARIES Threads::Threads + ) + endif() + if(NOT TARGET GTest::Main) + add_library(GTest::Main STATIC IMPORTED) + add_dependencies(GTest::Main gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${binary_dir}/googletest/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include" + INTERFACE_LINK_LIBRARIES "${binary_dir}/googletest/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) endif() - set(GTEST_LIBRARY_PATH "${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX};${binary_dir}/googletest/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(GTEST_LIBRARY gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - set(GTEST_LIBRARIES - ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} - ${binary_dir}/googletest/${ADD_DEBUG}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${FINAL_D}${CMAKE_STATIC_LIBRARY_SUFFIX} - ${THREAD_LIBRARIES}) - set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest") else() if(GTEST_INCLUDE_DIRS) set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR}) - add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) - set(GTEST_LIBRARIES gtest) - else() - # If the variable GTEST_DIR is defined, we use the existing Googletest - set(GTEST_DIR $ENV{GTEST_DIR}) - set(GTEST_INCLUDE_DIRECTORIES ${GTEST_DIR}/include ${GTEST_DIR} ${GTEST_DIR}/src) - add_library(gtest ${GTEST_DIR}/src/gtest-all.cc ${GTEST_DIR}/src/gtest_main.cc) - set(GTEST_LIBRARIES gtest) + add_library(gtest STATIC ${LIBGTEST_DEV_DIR}/src/gtest-all.cc) + target_include_directories(gtest + PUBLIC + ${GTEST_INCLUDE_DIRECTORIES} + ) + add_library(gtest_main STATIC ${LIBGTEST_DEV_DIR}/src/gtest_main.cc) + target_include_directories(gtest_main + PUBLIC + ${GTEST_INCLUDE_DIRECTORIES} + ) + if(NOT TARGET GTest::GTest) + add_library(GTest::GTest STATIC IMPORTED) + add_dependencies(GTest::GTest gtest) + set_target_properties(GTest::GTest PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + set_target_properties(GTest::GTest PROPERTIES + INTERFACE_LINK_LIBRARIES Threads::Threads + ) + endif() + if(NOT TARGET GTest::Main) + add_library(GTest::Main STATIC IMPORTED) + add_dependencies(GTest::Main gtest_main) + set_target_properties(GTest::Main PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/${DEBUG_PREFIX}${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) + endif() endif() - target_link_libraries(gtest ${THREAD_LIBRARIES}) endif() ################################################################################ -# Optional libraries +# Definitions ################################################################################ -set(GNSS_SDR_TEST_OPTIONAL_LIBS "") -set(GNSS_SDR_TEST_OPTIONAL_HEADERS "") - -if(ENABLE_CUDA) - set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${CUDA_INCLUDE_DIRS}) - set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${CUDA_LIBRARIES}) -endif() - -if(ENABLE_GPERFTOOLS) - if(GPERFTOOLS_FOUND) - set(GNSS_SDR_TEST_OPTIONAL_LIBS "${GNSS_SDR_TEST_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}") - set(GNSS_SDR_TEST_OPTIONAL_HEADERS "${GNSS_SDR_TEST_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}") - endif() -endif() - -if(Boost_VERSION LESS 105000) - add_definitions(-DOLD_BOOST=1) -endif() if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4") add_definitions(-DGR_GREATER_38=1) endif() -if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15") - add_definitions(-DGR_GREATER_38=1) -endif() - if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(OS_IS_MACOSX) - set(CLANG_FLAGS "-stdlib=libc++ -lc++") - endif() -endif() - if(OPENCL_FOUND) add_definitions(-DOPENCL_BLOCKS_TEST=1) endif() @@ -228,13 +241,12 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ################################################################################ find_package(GPSTK) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) - message(STATUS "GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") + message(STATUS " GPSTk v${GNSSSDR_GPSTK_LOCAL_VERSION} will be automatically downloaded and built when doing 'make'.") if("${TOOLCHAIN_ARG}" STREQUAL "") set(TOOLCHAIN_ARG "-DCMAKE_CXX_FLAGS=\"-Wno-deprecated\"") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") endif() include(GNUInstallDirs) - string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add( gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} @@ -254,29 +266,33 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install -DBUILD_EXT=OFF -DBUILD_PYTHON=OFF - BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX} UPDATE_COMMAND "" PATCH_COMMAND "" ) endif() set(GPSTK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GPSTK headers") - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_BINDIR ${CMAKE_CURRENT_SOURCE_DIR}/../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") set(OWN_GPSTK True) + add_library(Gpstk::gpstk SHARED IMPORTED) + add_dependencies(Gpstk::gpstk gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) + file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}) + file(MAKE_DIRECTORY ${GPSTK_INCLUDE_DIRS}/gpstk) + set_target_properties(Gpstk::gpstk PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${GPSTK_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIRS};${GPSTK_INCLUDE_DIRS}/gpstk" + INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}" + ) else() - set(GPSTK_INCLUDE_DIRS ${GPSTK_INCLUDE_DIR}) - set(GPSTK_BINDIR ${GPSTK_LIBRARY}/../bin/) + set(GPSTK_BINDIR ${GPSTK_INCLUDE_DIR}/../bin/) add_definitions(-DGPSTK_BINDIR="${GPSTK_BINDIR}") endif() endif() -if(ENABLE_UNIT_TESTING_EXTRA) - set(GNSS_SDR_TEST_OPTIONAL_LIBS ${GNSS_SDR_TEST_OPTIONAL_LIBS} ${GPSTK_LIBRARY}) - set(GNSS_SDR_TEST_OPTIONAL_HEADERS ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ${GPSTK_INCLUDE_DIRS} ${GPSTK_INCLUDE_DIRS}/gpstk) -endif() - if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) if(NOT EXISTS ${CMAKE_SOURCE_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) @@ -316,54 +332,7 @@ else() endif() set(LIST_INCLUDE_DIRS - ${GTEST_INCLUDE_DIRECTORIES} - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/core/monitor - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/resampler/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/signal_generator/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs - ${CMAKE_SOURCE_DIR}/src/tests/unit-tests/signal-processing-blocks/libs - ${CMAKE_SOURCE_DIR}/src/tests/system-tests/libs ${CMAKE_SOURCE_DIR}/src/tests/common-files - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${VOLK_INCLUDE_DIRS} - ${VOLK_GNSSSDR_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${GNSS_SDR_TEST_OPTIONAL_HEADERS} ) include_directories(${LIST_INCLUDE_DIRS}) @@ -374,34 +343,48 @@ include_directories(${LIST_INCLUDE_DIRS}) if(ENABLE_UNIT_TESTING) add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc) - target_link_libraries(run_tests ${CLANG_FLAGS} - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_generator_adapters - pvt_gr_blocks - signal_processing_testing_lib - system_testing_lib - ${VOLK_GNSSSDR_LIBRARIES} - ${MATIO_LIBRARIES} - ${GNSS_SDR_TEST_OPTIONAL_LIBS} + target_link_libraries(run_tests + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Armadillo::armadillo + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + GTest::GTest + GTest::Main + Matio::matio + Volk::volk + Volkgnsssdr::volkgnsssdr + signal_source_adapters + signal_source_gr_blocks + signal_source_libs + data_type_adapters + input_filter_adapters + resampler_adapters + channel_adapters + acquisition_adapters + tracking_adapters + tracking_libs + telemetry_decoder_adapters + obs_adapters + signal_generator_adapters + pvt_adapters + pvt_libs + algorithms_libs + core_monitor + signal_processing_testing_lib + system_testing_lib + core_receiver + core_system_parameters ) - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(run_tests gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) + if(ENABLE_UNIT_TESTING_EXTRA) + target_link_libraries(run_tests PUBLIC Gpstk::gpstk) endif() - if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/run_tests) file(REMOVE ${CMAKE_SOURCE_DIR}/install/run_tests) @@ -412,6 +395,32 @@ if(ENABLE_UNIT_TESTING) COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) endif() + if(ENABLE_GPERFTOOLS) + if(GPERFTOOLS_FOUND) + target_link_libraries(run_tests + PUBLIC + Gperftools::gperftools + ) + endif() + endif() + if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(run_tests + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() + endif() + if(ENABLE_CUDA) + target_link_libraries(run_tests + PUBLIC + ${CUDA_LIBRARIES} + ) + target_include_directories(run_tests + PUBLIC + ${CUDA_INCLUDE_DIRS} + ) + endif() endif() if(ENABLE_FPGA) @@ -420,20 +429,26 @@ if(ENABLE_FPGA) ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc ) target_link_libraries(gps_l1_ca_dll_pll_tracking_test_fpga - ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_LIBRARIES} - ${MATIO_LIBRARIES} - channel_fsm - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_processing_testing_lib + PUBLIC + Armadillo::armadillo + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + GTest::GTest + GTest::Main + Matio::matio + Volk::volk + channel_libs + data_type_adapters + tracking_adapters + signal_processing_testing_lib + algorithms_libs + core_receiver + core_system_parameters ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin @@ -442,7 +457,6 @@ if(ENABLE_FPGA) endif() - ################################################################################ # System testing ################################################################################ @@ -456,14 +470,8 @@ function(add_system_test executable) endif() add_executable(${executable} ${SYSTEM_TEST_SOURCES}) - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(${executable} gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else() - add_dependencies(${executable} gtest) - endif() - - include_directories(${OPT_INCLUDES_}) - target_link_libraries(${executable} ${OPT_LIBS_}) + target_include_directories(${executable} PUBLIC ${OPT_INCLUDES_} ${CMAKE_SOURCES_DIR}/src/algorithms/libs) + target_link_libraries(${executable} PUBLIC ${OPT_LIBS_} algorithms_libs) if(ENABLE_INSTALL_TESTS) if(EXISTS ${CMAKE_SOURCE_DIR}/install/${executable}) @@ -475,6 +483,14 @@ function(add_system_test executable) COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) endif() + if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(${executable} + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() + endif() endfunction() @@ -491,22 +507,25 @@ if(ENABLE_SYSTEM_TESTING) add_definitions(-DHOST_SYSTEM="${HOST_SYSTEM}") #### TTFF - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} ${GTEST_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs - gnss_rx gnss_system_parameters) - + set(OPT_LIBS_ Boost::filesystem Boost::system Boost::thread Boost::date_time + Threads::Threads Gflags::gflags Glog::glog + Gnuradio::runtime GTest::GTest GTest::Main + Gnuradio::blocks Gnuradio::filter + Gnuradio::analog algorithms_libs + core_receiver core_system_parameters + ) add_system_test(ttff) if(ENABLE_SYSTEM_TESTING_EXTRA) #### POSITION_TEST - set(OPT_LIBS_ ${Boost_LIBRARIES} ${THREAD_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} - gnss_sp_libs gnss_rx gnss_system_parameters - system_testing_lib) + set(OPT_LIBS_ Boost::filesystem Boost::system Boost::thread + Threads::Threads Gflags::gflags Glog::glog + GTest::GTest GTest::Main Gnuradio::runtime + Gnuradio::blocks Gnuradio::filter + Gnuradio::analog Matio::matio Volkgnsssdr::volkgnsssdr + algorithms_libs core_receiver core_system_parameters + system_testing_lib signal_processing_testing_lib + ) add_system_test(position_test) else() # Avoid working with old executables if they were switched ON and then OFF @@ -531,203 +550,262 @@ endif() set(CMAKE_CTEST_COMMAND ctest -V) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) -add_executable(flowgraph_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc) +if(NOT ENABLE_PACKAGING) + add_executable(flowgraph_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_flowgraph_test.cc + ) -target_link_libraries(flowgraph_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} -) + target_link_libraries(flowgraph_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + GTest::GTest + GTest::Main + Volkgnsssdr::volkgnsssdr + signal_source_adapters + signal_source_gr_blocks + signal_source_libs + input_filter_adapters + channel_adapters + core_receiver + algorithms_libs + core_system_parameters + ) -add_test(flowgraph_test flowgraph_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(flowgraph_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else() - add_dependencies(flowgraph_test gtest) + target_include_directories(flowgraph_test + PUBLIC + ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ) + + add_test(flowgraph_test flowgraph_test) + + set_property(TEST flowgraph_test PROPERTY TIMEOUT 30) endif() -set_property(TEST flowgraph_test PROPERTY TIMEOUT 30) + ######################################################### +if(NOT ENABLE_PACKAGING) + add_executable(gnss_block_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc + ) -add_executable(gnss_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/file_signal_source_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/pass_through_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/adapter/adapter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/gnss_block_factory_test.cc -) -target_link_libraries(gnss_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} -) -add_test(gnss_block_test gnss_block_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(gnss_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else() - add_dependencies(gnss_block_test gtest) + target_link_libraries(gnss_block_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + GTest::GTest + GTest::Main + Volkgnsssdr::volkgnsssdr + signal_source_adapters + signal_source_gr_blocks + signal_source_libs + data_type_adapters + input_filter_adapters + channel_adapters + core_receiver + algorithms_libs + core_system_parameters + ) + + target_include_directories(gnss_block_test PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs) + + if(ENABLE_FPGA) + target_compile_definitions(gnss_block_test PUBLIC -DENABLE_FPGA=1) + endif() + + add_test(gnss_block_test gnss_block_test) + + set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) endif() -set_property(TEST gnss_block_test PROPERTY TIMEOUT 60) + ######################################################### +if(NOT ENABLE_PACKAGING) + add_executable(gnuradio_block_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc + ) -add_executable(gnuradio_block_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/sources/unpack_2bit_samples_test.cc -) -target_link_libraries(gnuradio_block_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - ${VOLK_GNSSSDR_LIBRARIES} -) -add_test(gnuradio_block_test gnuradio_block_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(gnuradio_block_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else() - add_dependencies(gnuradio_block_test gtest) + target_link_libraries(gnuradio_block_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + GTest::GTest + GTest::Main + Volkgnsssdr::volkgnsssdr + signal_source_gr_blocks + signal_source_libs + core_receiver + algorithms_libs + core_system_parameters + ) + + add_test(gnuradio_block_test gnuradio_block_test) + + set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) endif() -set_property(TEST gnuradio_block_test PROPERTY TIMEOUT 30) + ######################################################### - -add_executable(matio_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc +add_executable(matio_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/arithmetic/matio_test.cc ) -target_link_libraries(matio_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${MATIO_LIBRARIES} - gnss_system_parameters + +target_link_libraries(matio_test + PUBLIC + Gflags::gflags + Glog::glog + GTest::GTest + GTest::Main + Matio::matio + core_receiver + core_system_parameters ) + add_test(matio_test matio_test) -if(NOT ${GTEST_DIR_LOCAL}) - if(MATIO_FOUND) - add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else() - add_dependencies(matio_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION} matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif() -else() - if(MATIO_FOUND) - add_dependencies(matio_test gtest) - else() - add_dependencies(matio_test gtest matio-${GNSSSDR_MATIO_LOCAL_VERSION}) - endif() -endif() + set_property(TEST matio_test PROPERTY TIMEOUT 30) -######################################################### - -add_executable(acq_test - ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc) -target_link_libraries(acq_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - signal_processing_testing_lib - ${VOLK_GNSSSDR_LIBRARIES}) -add_test(acq_test acq_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(acq_test acq_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else() - add_dependencies(acq_test acq_test gtest) -endif() -set_property(TEST acq_test PROPERTY TIMEOUT 30) ######################################################### +if(NOT ENABLE_PACKAGING) + add_executable(acq_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc + ) -add_executable(trk_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc - ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc -) + target_link_libraries(acq_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + GTest::GTest + GTest::Main + Volkgnsssdr::volkgnsssdr + signal_generator_gr_blocks + signal_source_gr_blocks + signal_source_libs + acquisition_adapters + acquisition_gr_blocks + algorithms_libs + signal_processing_testing_lib + core_receiver + core_system_parameters + ) -target_link_libraries(trk_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GNURADIO_ANALOG_LIBRARIES} - gnss_sp_libs - gnss_rx - gnss_system_parameters - signal_generator_blocks - ${VOLK_GNSSSDR_LIBRARIES} -) -add_test(trk_test trk_test) -if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(trk_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) -else() - add_dependencies(trk_test gtest) + add_test(acq_test acq_test) + + set_property(TEST acq_test PROPERTY TIMEOUT 30) endif() -set_property(TEST trk_test PROPERTY TIMEOUT 30) +######################################################### +if(NOT ENABLE_PACKAGING) + add_executable(trk_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/galileo_e1_dll_pll_veml_tracking_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/tracking_loop_filter_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc + ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/signal-processing-blocks/tracking/bayesian_estimation_test.cc + ) + + target_link_libraries(trk_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + Gnuradio::runtime + Gnuradio::blocks + Gnuradio::filter + Gnuradio::analog + GTest::GTest + GTest::Main + Volkgnsssdr::volkgnsssdr + signal_source_gr_blocks + signal_source_libs + algorithms_libs + tracking_adapters + signal_generator_gr_blocks + core_receiver + core_system_parameters + ) + + add_test(trk_test trk_test) + + set_property(TEST trk_test PROPERTY TIMEOUT 30) +endif() + ######################################################### if(NOT ENABLE_PACKAGING) - add_executable(control_thread_test ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc + add_executable(control_thread_test + ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ) - target_link_libraries(control_thread_test ${Boost_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${GTEST_LIBRARIES} - gnss_rx + target_link_libraries(control_thread_test + PUBLIC + Boost::filesystem + Boost::system + Boost::thread + Gflags::gflags + Glog::glog + GTest::GTest + GTest::Main + signal_source_adapters + signal_source_gr_blocks + signal_source_libs + algorithms_libs + core_receiver + core_system_parameters ) add_test(control_thread_test control_thread_test) - if(NOT ${GTEST_DIR_LOCAL}) - add_dependencies(control_thread_test gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) - else() - add_dependencies(control_thread_test gtest) - endif() + set_property(TEST control_thread_test PROPERTY TIMEOUT 30) endif() ######################################################### if(ENABLE_PACKAGING) - add_dependencies(check flowgraph_test gnss_block_test - gnuradio_block_test acq_test trk_test matio_test) + add_dependencies(check matio_test) else() add_dependencies(check control_thread_test flowgraph_test gnss_block_test gnuradio_block_test acq_test trk_test matio_test) diff --git a/src/tests/common-files/gnuplot_i.h b/src/tests/common-files/gnuplot_i.h index 7a971f02e..afdc47c3a 100644 --- a/src/tests/common-files/gnuplot_i.h +++ b/src/tests/common-files/gnuplot_i.h @@ -651,7 +651,10 @@ public: //---------------------------------------------------------------------------------- inline Gnuplot &replot(void) { - if (nplots > 0) cmd("replot"); + if (nplots > 0) + { + cmd("replot"); + } return *this; }; @@ -786,7 +789,7 @@ inline Gnuplot::Gnuplot(const std::vector &x, template Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) { - if (x.size() == 0) + if (x.empty()) { throw GnuplotException("std::vector too small"); return *this; @@ -794,14 +797,18 @@ Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file // for (unsigned int i = 0; i < x.size(); i++) - tmp << x[i] << std::endl; + { + tmp << x[i] << std::endl; + } tmp.flush(); tmp.close(); @@ -819,7 +826,7 @@ Gnuplot &Gnuplot::plot_x(const X &x, const std::string &title) template Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, const unsigned int decimate) { - if (x.size() == 0 || y.size() == 0) + if (x.empty() || y.empty()) { throw GnuplotException("std::vectors too small"); return *this; @@ -833,14 +840,18 @@ Gnuplot &Gnuplot::plot_xy(const X &x, const Y &y, const std::string &title, cons std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file // for (unsigned int i = 0; i < x.size(); i++) - tmp << x[i] << " " << y[i] << std::endl; + { + tmp << x[i] << " " << y[i] << std::endl; + } tmp.flush(); tmp.close(); @@ -861,7 +872,7 @@ Gnuplot &Gnuplot::plot_xy_err(const X &x, const E &dy, const std::string &title) { - if (x.size() == 0 || y.size() == 0 || dy.size() == 0) + if (x.empty() || y.empty() || dy.empty()) { throw GnuplotException("std::vectors too small"); return *this; @@ -875,14 +886,18 @@ Gnuplot &Gnuplot::plot_xy_err(const X &x, std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file // for (unsigned int i = 0; i < x.size(); i++) - tmp << x[i] << " " << y[i] << " " << dy[i] << std::endl; + { + tmp << x[i] << " " << y[i] << " " << dy[i] << std::endl; + } tmp.flush(); tmp.close(); @@ -904,15 +919,17 @@ Gnuplot &Gnuplot::plot_grid3d(const X &x, const E &mag, const std::string &title) { - if (x.size() == 0 || y.size() == 0) + if (x.empty() || y.empty()) { throw GnuplotException("std::vectors too small"); return *this; } std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file @@ -937,10 +954,14 @@ Gnuplot &Gnuplot::plot_grid3d(const X &x, cmdstr << " splot \"" << name << "\" u 1:2:3"; - if (title == "") - cmdstr << " notitle with " << pstyle << " palette"; + if (title.empty()) + { + cmdstr << " notitle with " << pstyle << " palette"; + } else - cmdstr << " title \"" << title << "\" with " << pstyle << " palette"; + { + cmdstr << " title \"" << title << "\" with " << pstyle << " palette"; + } cmdstr << "\n"; // @@ -961,7 +982,7 @@ Gnuplot &Gnuplot::plot_xyz(const X &x, const Z &z, const std::string &title) { - if (x.size() == 0 || y.size() == 0 || z.size() == 0) + if (x.empty() || y.empty() || z.empty()) { throw GnuplotException("std::vectors too small"); return *this; @@ -975,14 +996,18 @@ Gnuplot &Gnuplot::plot_xyz(const X &x, std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file // for (unsigned int i = 0; i < x.size(); i++) - tmp << x[i] << " " << y[i] << " " << z[i] << std::endl; + { + tmp << x[i] << " " << y[i] << " " << z[i] << std::endl; + } tmp.flush(); tmp.close(); @@ -1055,7 +1080,9 @@ void stringtok(Container &container, i = in.find_first_not_of(delimiters, i); if (i == std::string::npos) - return; // nothing left but white space + { + return; // nothing left but white space + } // find the end of the token std::string::size_type j = in.find_first_of(delimiters, i); @@ -1084,18 +1111,19 @@ void stringtok(Container &container, Gnuplot::~Gnuplot() { // remove_tmpfiles(); - // A stream opened by popen() should be closed by pclose() #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) if (_pclose(gnucmd) == -1) + { #elif defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__) if (pclose(gnucmd) == -1) + { #endif - // throw GnuplotException("Problem closing communication to gnuplot"); - std::cout << "Gnuplot window left open." << std::endl; + // throw GnuplotException("Problem closing communication to gnuplot"); + std::cout << "Gnuplot window left open." << std::endl; + } } - //------------------------------------------------------------------------------ // // Resets a gnuplot session (next plot will erase previous ones) @@ -1108,7 +1136,6 @@ Gnuplot &Gnuplot::reset_plot() return *this; } - //------------------------------------------------------------------------------ // // resets a gnuplot session and sets all variables to default @@ -1126,7 +1153,6 @@ Gnuplot &Gnuplot::reset_all() return *this; } - //------------------------------------------------------------------------------ // // Change the plotting style of a gnuplot session @@ -1172,7 +1198,6 @@ Gnuplot &Gnuplot::set_style(const std::string &stylestr) return *this; } - //------------------------------------------------------------------------------ // // smooth: interpolation and approximation of data @@ -1501,16 +1526,24 @@ Gnuplot &Gnuplot::plot_slope(const double a, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } cmdstr << a << " * x + " << b << " title \""; - if (title == "") - cmdstr << "f(x) = " << a << " * x + " << b; + if (title.empty()) + { + cmdstr << "f(x) = " << a << " * x + " << b; + } else - cmdstr << title; + { + cmdstr << title; + } cmdstr << "\" with " << pstyle; @@ -1535,16 +1568,24 @@ Gnuplot &Gnuplot::plot_equation(const std::string &equation, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } cmdstr << equation << " title \""; - if (title == "") - cmdstr << "f(x) = " << equation; + if (title.empty()) + { + cmdstr << "f(x) = " << equation; + } else - cmdstr << title; + { + cmdstr << title; + } cmdstr << "\" with " << pstyle; @@ -1569,16 +1610,24 @@ Gnuplot &Gnuplot::plot_equation3d(const std::string &equation, // command to be sent to gnuplot // if (nplots > 0 && two_dim == false) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "splot "; + { + cmdstr << "splot "; + } cmdstr << equation << " title \""; - if (title == "") - cmdstr << "f(x,y) = " << equation; + if (title.empty()) + { + cmdstr << "f(x,y) = " << equation; + } else - cmdstr << title; + { + cmdstr << title; + } cmdstr << "\" with " << pstyle; @@ -1609,21 +1658,33 @@ Gnuplot &Gnuplot::plotfile_x(const std::string &filename, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } cmdstr << "\"" << filename << "\" using " << column; - if (title == "") - cmdstr << " notitle "; + if (title.empty()) + { + cmdstr << " notitle "; + } else - cmdstr << " title \"" << title << "\" "; + { + cmdstr << " title \"" << title << "\" "; + } - if (smooth == "") - cmdstr << "with " << pstyle; + if (smooth.empty()) + { + cmdstr << "with " << pstyle; + } else - cmdstr << "smooth " << smooth; + { + cmdstr << "smooth " << smooth; + } // // Do the actual plot @@ -1654,21 +1715,33 @@ Gnuplot &Gnuplot::plotfile_xy(const std::string &filename, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y << " every " << std::to_string(decimate); - if (title == "") - cmdstr << " notitle "; + if (title.empty()) + { + cmdstr << " notitle "; + } else - cmdstr << " title \"" << title << "\" "; + { + cmdstr << " title \"" << title << "\" "; + } - if (smooth == "") - cmdstr << "with " << pstyle; + if (smooth.empty()) + { + cmdstr << "with " << pstyle; + } else - cmdstr << "smooth " << smooth; + { + cmdstr << "smooth " << smooth; + } // // Do the actual plot @@ -1699,18 +1772,26 @@ Gnuplot &Gnuplot::plotfile_xy_err(const std::string &filename, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y << ":" << column_dy << " with errorbars "; - if (title == "") - cmdstr << " notitle "; + if (title.empty()) + { + cmdstr << " notitle "; + } else - cmdstr << " title \"" << title << "\" "; + { + cmdstr << " title \"" << title << "\" "; + } // // Do the actual plot @@ -1741,17 +1822,25 @@ Gnuplot &Gnuplot::plotfile_xyz(const std::string &filename, // command to be sent to gnuplot // if (nplots > 0 && two_dim == false) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "splot "; + { + cmdstr << "splot "; + } cmdstr << "\"" << filename << "\" using " << column_x << ":" << column_y << ":" << column_z; - if (title == "") - cmdstr << " notitle with " << pstyle; + if (title.empty()) + { + cmdstr << " notitle with " << pstyle; + } else - cmdstr << " title \"" << title << "\" with " << pstyle; + { + cmdstr << " title \"" << title << "\" with " << pstyle; + } // // Do the actual plot @@ -1773,8 +1862,10 @@ Gnuplot &Gnuplot::plot_image(const unsigned char *ucPicBuf, { std::ofstream tmp; std::string name = create_tmpfile(tmp); - if (name == "") - return *this; + if (name.empty()) + { + return *this; + } // // write the data to file @@ -1797,14 +1888,22 @@ Gnuplot &Gnuplot::plot_image(const unsigned char *ucPicBuf, // command to be sent to gnuplot // if (nplots > 0 && two_dim == true) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } - if (title == "") - cmdstr << "\"" << name << "\" with image"; + if (title.empty()) + { + cmdstr << "\"" << name << "\" with image"; + } else - cmdstr << "\"" << name << "\" title \"" << title << "\" with image"; + { + cmdstr << "\"" << name << "\" title \"" << title << "\" with image"; + } // // Do the actual plot @@ -1824,7 +1923,7 @@ Gnuplot &Gnuplot::plot_circle(double east, double north, double radius, const st cmdstr << "set object circle at " + std::to_string(east) + "," + std::to_string(north) + " size " + std::to_string(radius) + " back\n"; - if (label != "") + if (!label.empty()) { double east_label = (std::cos(M_PI / 3.0) * radius) * 1.1 + east; double north_label = (std::sin(M_PI / 3.0) * radius) * 1.1 + north; @@ -1832,9 +1931,13 @@ Gnuplot &Gnuplot::plot_circle(double east, double north, double radius, const st ", " + std::to_string(north_label) + " norotate back nopoint offset 0,0\n"; } if (nplots > 0) - cmdstr << "replot "; + { + cmdstr << "replot "; + } else - cmdstr << "plot "; + { + cmdstr << "plot "; + } // // Do the actual plot @@ -1900,7 +2003,7 @@ void Gnuplot::init() // whose name is specified as argument. If the requested variable is not // part of the environment list, the function returns a NULL pointer. #if (defined(unix) || defined(__unix) || defined(__unix__)) && !defined(__APPLE__) - if (std::getenv("DISPLAY") == NULL) + if (std::getenv("DISPLAY") == nullptr) { valid = false; throw GnuplotException("Can't find DISPLAY variable"); @@ -2151,11 +2254,15 @@ std::string Gnuplot::create_tmpfile(std::ofstream &tmp) void Gnuplot::remove_tmpfiles() { - if ((tmpfile_list).size() > 0) + if (!(tmpfile_list).empty()) { for (auto &i : tmpfile_list) - if (remove(i.c_str()) != 0) - std::cout << "Problem closing files" << std::endl; + { + if (remove(i.c_str()) != 0) + { + std::cout << "Problem closing files" << std::endl; + } + } Gnuplot::tmpfile_num -= tmpfile_list.size(); } diff --git a/src/tests/single_test_main.cc b/src/tests/single_test_main.cc index 66a8ab7de..02814af09 100644 --- a/src/tests/single_test_main.cc +++ b/src/tests/single_test_main.cc @@ -40,7 +40,6 @@ #include "gps_ephemeris.h" #include "gps_navigation_message.h" #include -#include #include #include #include @@ -50,9 +49,9 @@ #include -concurrent_queue global_gps_acq_assist_queue; +Concurrent_Queue global_gps_acq_assist_queue; -concurrent_map global_gps_acq_assist_map; +Concurrent_Map global_gps_acq_assist_map; using google::LogMessage; diff --git a/src/tests/system-tests/libs/CMakeLists.txt b/src/tests/system-tests/libs/CMakeLists.txt index 178f83479..d29962cdf 100644 --- a/src/tests/system-tests/libs/CMakeLists.txt +++ b/src/tests/system-tests/libs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -22,15 +22,6 @@ set(SYSTEM_TESTING_LIB_SOURCES rtklib_solver_dump_reader.cc ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} -) - file(GLOB SYSTEM_TESTING_LIB_HEADERS "*.h") list(SORT SYSTEM_TESTING_LIB_HEADERS) @@ -41,11 +32,25 @@ add_library(system_testing_lib source_group(Headers FILES ${SYSTEM_TESTING_LIB_HEADERS}) -if(NOT MATIO_FOUND) - add_dependencies(system_testing_lib - armadillo-${armadillo_RELEASE} - matio-${GNSSSDR_MATIO_LOCAL_VERSION} - ) -else() - add_dependencies(system_testing_lib armadillo-${armadillo_RELEASE}) +target_link_libraries(system_testing_lib + PUBLIC + Armadillo::armadillo + Gflags::gflags + PRIVATE + Boost::boost + Matio::matio +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(system_testing_lib + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET system_testing_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc index a2c25debc..08939e1e3 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.cc @@ -29,10 +29,11 @@ */ #include "rtklib_solver_dump_reader.h" +#include #include #include -bool rtklib_solver_dump_reader::read_binary_obs() +bool Rtklib_Solver_Dump_Reader::read_binary_obs() { try { @@ -73,7 +74,7 @@ bool rtklib_solver_dump_reader::read_binary_obs() } -bool rtklib_solver_dump_reader::restart() +bool Rtklib_Solver_Dump_Reader::restart() { if (d_dump_file.is_open()) { @@ -85,7 +86,7 @@ bool rtklib_solver_dump_reader::restart() } -int64_t rtklib_solver_dump_reader::num_epochs() +int64_t Rtklib_Solver_Dump_Reader::num_epochs() { std::ifstream::pos_type size; int epoch_size_bytes = 2 * sizeof(uint32_t) + 21 * sizeof(double) + 3 * sizeof(uint8_t) + 2 * sizeof(float); @@ -100,7 +101,7 @@ int64_t rtklib_solver_dump_reader::num_epochs() } -bool rtklib_solver_dump_reader::open_obs_file(std::string out_file) +bool Rtklib_Solver_Dump_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -113,7 +114,7 @@ bool rtklib_solver_dump_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -124,10 +125,21 @@ bool rtklib_solver_dump_reader::open_obs_file(std::string out_file) } -rtklib_solver_dump_reader::~rtklib_solver_dump_reader() +Rtklib_Solver_Dump_Reader::~Rtklib_Solver_Dump_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing rtklib_solver dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/system-tests/libs/rtklib_solver_dump_reader.h b/src/tests/system-tests/libs/rtklib_solver_dump_reader.h index 5006482dd..d3990e30f 100644 --- a/src/tests/system-tests/libs/rtklib_solver_dump_reader.h +++ b/src/tests/system-tests/libs/rtklib_solver_dump_reader.h @@ -36,10 +36,10 @@ #include #include -class rtklib_solver_dump_reader +class Rtklib_Solver_Dump_Reader { public: - ~rtklib_solver_dump_reader(); + ~Rtklib_Solver_Dump_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc index 1082fb233..8a97cfeb3 100644 --- a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc +++ b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.cc @@ -30,11 +30,12 @@ #include "spirent_motion_csv_dump_reader.h" #include +#include #include #include -spirent_motion_csv_dump_reader::spirent_motion_csv_dump_reader() +Spirent_Motion_Csv_Dump_Reader::Spirent_Motion_Csv_Dump_Reader() { header_lines = 2; TOW_ms = 0.0; @@ -78,16 +79,27 @@ spirent_motion_csv_dump_reader::spirent_motion_csv_dump_reader() } -spirent_motion_csv_dump_reader::~spirent_motion_csv_dump_reader() +Spirent_Motion_Csv_Dump_Reader::~Spirent_Motion_Csv_Dump_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing Spirent CSV dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } -bool spirent_motion_csv_dump_reader::read_csv_obs() +bool Spirent_Motion_Csv_Dump_Reader::read_csv_obs() { try { @@ -121,7 +133,7 @@ bool spirent_motion_csv_dump_reader::read_csv_obs() } -bool spirent_motion_csv_dump_reader::parse_vector(std::vector &vec) +bool Spirent_Motion_Csv_Dump_Reader::parse_vector(std::vector &vec) { try { @@ -173,7 +185,7 @@ bool spirent_motion_csv_dump_reader::parse_vector(std::vector &vec) } -bool spirent_motion_csv_dump_reader::restart() +bool Spirent_Motion_Csv_Dump_Reader::restart() { if (d_dump_file.is_open()) { @@ -190,7 +202,7 @@ bool spirent_motion_csv_dump_reader::restart() } -int64_t spirent_motion_csv_dump_reader::num_epochs() +int64_t Spirent_Motion_Csv_Dump_Reader::num_epochs() { int64_t nepoch = 0LL; std::string line; @@ -207,7 +219,7 @@ int64_t spirent_motion_csv_dump_reader::num_epochs() } -bool spirent_motion_csv_dump_reader::open_obs_file(std::string out_file) +bool Spirent_Motion_Csv_Dump_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -225,7 +237,7 @@ bool spirent_motion_csv_dump_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -236,10 +248,21 @@ bool spirent_motion_csv_dump_reader::open_obs_file(std::string out_file) } -void spirent_motion_csv_dump_reader::close_obs_file() +void Spirent_Motion_Csv_Dump_Reader::close_obs_file() { - if (d_dump_file.is_open() == false) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing Spirent CSV dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.h b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.h index b08beb6e0..5d8066627 100644 --- a/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.h +++ b/src/tests/system-tests/libs/spirent_motion_csv_dump_reader.h @@ -36,11 +36,11 @@ #include #include -class spirent_motion_csv_dump_reader +class Spirent_Motion_Csv_Dump_Reader { public: - spirent_motion_csv_dump_reader(); - ~spirent_motion_csv_dump_reader(); + Spirent_Motion_Csv_Dump_Reader(); + ~Spirent_Motion_Csv_Dump_Reader(); bool read_csv_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index b719dba55..1365b4302 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -60,8 +60,8 @@ #include // For GPS NAVIGATION (L1) -concurrent_queue global_gps_acq_assist_queue; -concurrent_map global_gps_acq_assist_map; +Concurrent_Queue global_gps_acq_assist_queue; +Concurrent_Map global_gps_acq_assist_map; class PositionSystemTest : public ::testing::Test { @@ -104,7 +104,10 @@ int PositionSystemTest::configure_generator() if (FLAGS_dynamic_position.empty()) { p2 = std::string("-static_position=") + FLAGS_static_position + std::string(",") + std::to_string(std::min(FLAGS_duration * 10, 3000)); - if (FLAGS_duration > 300) std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; + if (FLAGS_duration > 300) + { + std::cout << "WARNING: Duration has been set to its maximum value of 300 s" << std::endl; + } } else { @@ -126,7 +129,9 @@ int PositionSystemTest::generate_signal() int pid; if ((pid = fork()) == -1) - perror("fork error"); + { + perror("fork error"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -135,7 +140,10 @@ int PositionSystemTest::generate_signal() } wait_result = waitpid(pid, &child_status, 0); - if (wait_result == -1) perror("waitpid error"); + if (wait_result == -1) + { + perror("waitpid error"); + } return 0; } @@ -305,12 +313,12 @@ int PositionSystemTest::configure_receiver() config->set_property("PVT.AR_GPS", "PPP-AR"); config->set_property("PVT.elevation_mask", std::to_string(15)); - config_f = 0; + config_f = nullptr; } else { config_f = std::make_shared(FLAGS_config_file_ptest); - config = 0; + config = nullptr; } return 0; } @@ -374,8 +382,8 @@ bool PositionSystemTest::save_mat_xy(std::vector* x, std::vector matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_xy write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); @@ -409,8 +417,8 @@ bool PositionSystemTest::save_mat_x(std::vector* x, std::string filename matvar_t* matvar; filename.append(".mat"); std::cout << "save_mat_x write " << filename << std::endl; - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT5); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x->size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); @@ -462,7 +470,7 @@ void PositionSystemTest::check_results() arma::vec ref_r_enu = {0, 0, 0}; cart2utm(true_r_eb_e, utm_zone, ref_r_enu); - rtklib_solver_dump_reader pvt_reader; + Rtklib_Solver_Dump_Reader pvt_reader; pvt_reader.open_obs_file(FLAGS_pvt_solver_dump_filename); int64_t n_epochs = pvt_reader.num_epochs(); R_eb_e = arma::zeros(3, n_epochs); @@ -588,7 +596,7 @@ void PositionSystemTest::check_results() else { //dynamic position - spirent_motion_csv_dump_reader ref_reader; + Spirent_Motion_Csv_Dump_Reader ref_reader; ref_reader.open_obs_file(FLAGS_ref_motion_filename); int64_t n_epochs = ref_reader.num_epochs(); ref_R_eb_e = arma::zeros(3, n_epochs); diff --git a/src/tests/system-tests/ttff.cc b/src/tests/system-tests/ttff.cc index e9a51e762..ab9391244 100644 --- a/src/tests/system-tests/ttff.cc +++ b/src/tests/system-tests/ttff.cc @@ -62,8 +62,8 @@ DEFINE_string(subdevice, "A:0", "USRP subdevice"); DEFINE_string(config_file_ttff, std::string(""), "File containing the configuration parameters for the TTFF test."); // For GPS NAVIGATION (L1) -concurrent_queue global_gps_acq_assist_queue; -concurrent_map global_gps_acq_assist_map; +Concurrent_Queue global_gps_acq_assist_queue; +Concurrent_Map global_gps_acq_assist_map; std::vector TTFF_v; @@ -79,7 +79,7 @@ class TtffTest : public ::testing::Test public: void config_1(); void config_2(); - void print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_); + void print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr &config_); std::shared_ptr config; std::shared_ptr config2; @@ -297,7 +297,7 @@ void receive_msg() } -void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ptr config_) +void TtffTest::print_TTFF_report(const std::vector &ttff_v, const std::shared_ptr &config_) { std::ofstream ttff_report_file; std::string filename = "ttff_report"; @@ -385,10 +385,13 @@ void TtffTest::print_TTFF_report(const std::vector &ttff_v, std::shared_ stm << "Disabled." << std::endl; } stm << "Valid measurements (" << ttff.size() << "/" << FLAGS_num_measurements << "): "; - for (double ttff_ : ttff) stm << ttff_ << " "; + for (double ttff_ : ttff) + { + stm << ttff_ << " "; + } stm << std::endl; stm << "TTFF mean: " << mean << " [s]" << std::endl; - if (ttff.size() > 0) + if (!ttff.empty()) { stm << "TTFF max: " << *max_ttff << " [s]" << std::endl; stm << "TTFF min: " << *min_ttff << " [s]" << std::endl; @@ -629,7 +632,7 @@ int main(int argc, char **argv) msgsend_size = sizeof(msg.ttff); msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); receive_msg_thread.join(); - msgctl(sysv_msqid, IPC_RMID, NULL); + msgctl(sysv_msqid, IPC_RMID, nullptr); google::ShutDownCommandLineFlags(); return res; diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index a29e76493..4f530334f 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -48,8 +48,7 @@ #include "gps_utc_model.h" #include "sbas_ephemeris.h" #include -#include -#include +#include #include #include #include @@ -174,8 +173,8 @@ DECLARE_string(log_dir); #endif // UNIT_TESTING_MINIMAL // For GPS NAVIGATION (L1) -concurrent_queue global_gps_acq_assist_queue; -concurrent_map global_gps_acq_assist_map; +Concurrent_Queue global_gps_acq_assist_queue; +Concurrent_Map global_gps_acq_assist_map; int main(int argc, char **argv) { diff --git a/src/tests/unit-tests/arithmetic/code_generation_test.cc b/src/tests/unit-tests/arithmetic/code_generation_test.cc index d89b03365..e252771af 100644 --- a/src/tests/unit-tests/arithmetic/code_generation_test.cc +++ b/src/tests/unit-tests/arithmetic/code_generation_test.cc @@ -37,7 +37,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1Test) { - std::complex* _dest = new std::complex[1023]; + auto* _dest = new std::complex[1023]; signed int _prn = 1; unsigned int _chip_shift = 4; @@ -68,7 +68,7 @@ TEST(CodeGenerationTest, CodeGenGPSL1SampledTest) const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); - std::complex* _dest = new std::complex[_samplesPerCode]; + auto* _dest = new std::complex[_samplesPerCode]; int iterations = 1000; @@ -96,7 +96,7 @@ TEST(CodeGenerationTest, ComplexConjugateTest) const signed int _codeFreqBasis = 1023000; //Hz const signed int _codeLength = 1023; int _samplesPerCode = round(_fs / static_cast(_codeFreqBasis / _codeLength)); - std::complex* _dest = new std::complex[_samplesPerCode]; + auto* _dest = new std::complex[_samplesPerCode]; int iterations = 1000; diff --git a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc index 3cac38fbe..72e12bcc0 100644 --- a/src/tests/unit-tests/arithmetic/complex_carrier_test.cc +++ b/src/tests/unit-tests/arithmetic/complex_carrier_test.cc @@ -41,10 +41,10 @@ TEST(ComplexCarrierTest, StandardComplexImplementation) { // Dynamic allocation creates new usable space on the program STACK // (an area of RAM specifically allocated to the program) - std::complex* output = new std::complex[FLAGS_size_carrier_test]; + auto* output = new std::complex[FLAGS_size_carrier_test]; const double _f = 2000.0; const double _fs = 2000000.0; - const double phase_step = static_cast((GPS_TWO_PI * _f) / _fs); + const auto phase_step = static_cast((GPS_TWO_PI * _f) / _fs); double phase = 0.0; std::chrono::time_point start, end; @@ -84,7 +84,7 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) std::vector> output(FLAGS_size_carrier_test); const double _f = 2000.0; const double _fs = 2000000.0; - const double phase_step = static_cast((GPS_TWO_PI * _f) / _fs); + const auto phase_step = static_cast((GPS_TWO_PI * _f) / _fs); double phase = 0.0; std::chrono::time_point start, end; @@ -113,7 +113,7 @@ TEST(ComplexCarrierTest, C11ComplexImplementation) TEST(ComplexCarrierTest, OwnComplexImplementation) { - std::complex* output = new std::complex[FLAGS_size_carrier_test]; + auto* output = new std::complex[FLAGS_size_carrier_test]; double _f = 2000.0; double _fs = 2000000.0; std::chrono::time_point start, end; diff --git a/src/tests/unit-tests/arithmetic/conjugate_test.cc b/src/tests/unit-tests/arithmetic/conjugate_test.cc index 1eaa4cc09..a32b12ebf 100644 --- a/src/tests/unit-tests/arithmetic/conjugate_test.cc +++ b/src/tests/unit-tests/arithmetic/conjugate_test.cc @@ -41,8 +41,8 @@ DEFINE_int32(size_conjugate_test, 100000, "Size of the arrays used for conjugate TEST(ConjugateTest, StandardCComplexImplementation) { - std::complex* input = new std::complex[FLAGS_size_conjugate_test]; - std::complex* output = new std::complex[FLAGS_size_conjugate_test]; + auto* input = new std::complex[FLAGS_size_conjugate_test]; + auto* output = new std::complex[FLAGS_size_conjugate_test]; std::fill_n(input, FLAGS_size_conjugate_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; @@ -114,8 +114,8 @@ TEST(ConjugateTest, ArmadilloComplexImplementation) TEST(ConjugateTest, VolkComplexImplementation) { - std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); - std::complex* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); + auto* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); + auto* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_conjugate_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); std::fill_n(input, FLAGS_size_conjugate_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; diff --git a/src/tests/unit-tests/arithmetic/fft_length_test.cc b/src/tests/unit-tests/arithmetic/fft_length_test.cc index 3e75c4285..c8eb8354d 100644 --- a/src/tests/unit-tests/arithmetic/fft_length_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_length_test.cc @@ -112,7 +112,7 @@ TEST(FFTLengthTest, MeasureExecutionTime) { 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("linespoints"); @@ -151,7 +151,10 @@ TEST(FFTLengthTest, MeasureExecutionTime) g2.set_style("points").plot_xy(powers_of_two, execution_times_powers_of_two, "Power of 2"); g2.savetops("FFT_execution_times"); g2.savetopdf("FFT_execution_times", 18); - if (FLAGS_show_plots) g2.showonscreen(); // window output + if (FLAGS_show_plots) + { + g2.showonscreen(); // window output + } } catch (const GnuplotException& ge) { diff --git a/src/tests/unit-tests/arithmetic/fft_speed_test.cc b/src/tests/unit-tests/arithmetic/fft_speed_test.cc index 009b40838..8d5486e62 100644 --- a/src/tests/unit-tests/arithmetic/fft_speed_test.cc +++ b/src/tests/unit-tests/arithmetic/fft_speed_test.cc @@ -46,8 +46,9 @@ TEST(FFTSpeedTest, ArmadilloVSGNURadioExecutionTime) unsigned int fft_sizes[19] = {16, 25, 32, 45, 64, 95, 128, 195, 256, 325, 512, 785, 1024, 1503, 2048, 3127, 4096, 6349, 8192}; double d_execution_time; EXPECT_NO_THROW( - for (int i = 0; i < 19; i++) { - d_fft_size = fft_sizes[i]; + for (unsigned int fft_size + : fft_sizes) { + d_fft_size = fft_size; gr::fft::fft_complex* d_gr_fft; d_gr_fft = new gr::fft::fft_complex(d_fft_size, true); arma::arma_rng::set_seed_random(); diff --git a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc index 5a51b32be..d8bd2bd1e 100644 --- a/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc +++ b/src/tests/unit-tests/arithmetic/magnitude_squared_test.cc @@ -42,8 +42,8 @@ DEFINE_int32(size_magnitude_test, 100000, "Size of the arrays used for magnitude TEST(MagnitudeSquaredTest, StandardCComplexImplementation) { - std::complex* input = new std::complex[FLAGS_size_magnitude_test]; - float* output = new float[FLAGS_size_magnitude_test]; + auto* input = new std::complex[FLAGS_size_magnitude_test]; + auto* output = new float[FLAGS_size_magnitude_test]; unsigned int number = 0; std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -114,9 +114,9 @@ TEST(MagnitudeSquaredTest, ArmadilloComplexImplementation) TEST(MagnitudeSquaredTest, VolkComplexImplementation) { - std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); + auto* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); std::fill_n(input, FLAGS_size_magnitude_test, std::complex(0.0, 0.0)); - float* output = static_cast(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(float), volk_gnsssdr_get_alignment())); + auto* output = static_cast(volk_gnsssdr_malloc(FLAGS_size_magnitude_test * sizeof(float), volk_gnsssdr_get_alignment())); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); diff --git a/src/tests/unit-tests/arithmetic/multiply_test.cc b/src/tests/unit-tests/arithmetic/multiply_test.cc index f4747431f..43a7e21ff 100644 --- a/src/tests/unit-tests/arithmetic/multiply_test.cc +++ b/src/tests/unit-tests/arithmetic/multiply_test.cc @@ -43,8 +43,8 @@ DEFINE_int32(size_multiply_test, 100000, "Size of the arrays used for multiply t TEST(MultiplyTest, StandardCDoubleImplementation) { - double* input = new double[FLAGS_size_multiply_test]; - double* output = new double[FLAGS_size_multiply_test]; + auto* input = new double[FLAGS_size_multiply_test]; + auto* output = new double[FLAGS_size_multiply_test]; std::fill_n(input, FLAGS_size_multiply_test, 0.0); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -95,8 +95,8 @@ TEST(MultiplyTest, ArmadilloImplementation) TEST(MultiplyTest, StandardCComplexImplementation) { - std::complex* input = new std::complex[FLAGS_size_multiply_test]; - std::complex* output = new std::complex[FLAGS_size_multiply_test]; + auto* input = new std::complex[FLAGS_size_multiply_test]; + auto* output = new std::complex[FLAGS_size_multiply_test]; std::fill_n(input, FLAGS_size_multiply_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; start = std::chrono::system_clock::now(); @@ -174,8 +174,8 @@ TEST(MultiplyTest, ArmadilloComplexImplementation) TEST(MultiplyTest, VolkComplexImplementation) { - std::complex* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); - std::complex* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); + auto* input = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); + auto* output = static_cast*>(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(std::complex), volk_gnsssdr_get_alignment())); std::fill_n(input, FLAGS_size_multiply_test, std::complex(0.0, 0.0)); std::chrono::time_point start, end; @@ -190,10 +190,10 @@ TEST(MultiplyTest, VolkComplexImplementation) << " microseconds" << std::endl; ASSERT_LE(0, elapsed_seconds.count() * 1e6); - float* mag = static_cast(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(float), volk_gnsssdr_get_alignment())); + auto* mag = static_cast(volk_gnsssdr_malloc(FLAGS_size_multiply_test * sizeof(float), volk_gnsssdr_get_alignment())); volk_32fc_magnitude_32f(mag, output, FLAGS_size_multiply_test); - float* result = new float(0); + auto* result = new float(0); volk_32f_accumulator_s32f(result, mag, FLAGS_size_multiply_test); // Comparing floating-point numbers is tricky. // Due to round-off errors, it is very unlikely that two floating-points will match exactly. diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc index 8b738eebf..3021e15a1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/acq_performance_test.cc @@ -52,6 +52,8 @@ #include #include #include +#include +#include DEFINE_string(config_file_ptest, std::string(""), "File containing alternative configuration parameters for the acquisition performance test."); @@ -94,15 +96,15 @@ class AcqPerfTest_msg_rx; typedef boost::shared_ptr AcqPerfTest_msg_rx_sptr; -AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(concurrent_queue& queue); +AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(Concurrent_Queue& queue); class AcqPerfTest_msg_rx : public gr::block { private: - friend AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(concurrent_queue& queue); + friend AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - AcqPerfTest_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + AcqPerfTest_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -110,7 +112,7 @@ public: }; -AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(concurrent_queue& queue) +AcqPerfTest_msg_rx_sptr AcqPerfTest_msg_rx_make(Concurrent_Queue& queue) { return AcqPerfTest_msg_rx_sptr(new AcqPerfTest_msg_rx(queue)); } @@ -120,7 +122,7 @@ void AcqPerfTest_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; channel_internal_queue.push(rx_message); } @@ -132,7 +134,7 @@ void AcqPerfTest_msg_rx::msg_handler_events(pmt::pmt_t msg) } -AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(concurrent_queue& queue) : gr::block("AcqPerfTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(Concurrent_Queue& queue) : gr::block("AcqPerfTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&AcqPerfTest_msg_rx::msg_handler_events, this, _1)); @@ -140,9 +142,7 @@ AcqPerfTest_msg_rx::AcqPerfTest_msg_rx(concurrent_queue& queue) : gr::block } -AcqPerfTest_msg_rx::~AcqPerfTest_msg_rx() -{ -} +AcqPerfTest_msg_rx::~AcqPerfTest_msg_rx() = default; // ----------------------------------------- @@ -173,21 +173,21 @@ protected: cn0_vector = {0.0}; } - if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + if (implementation == "GPS_L1_CA_PCPS_Acquisition") { signal_id = "1C"; system_id = 'G'; coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; min_integration_ms = 1; } - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { signal_id = "1C"; system_id = 'G'; coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; min_integration_ms = 1; } - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { signal_id = "1B"; system_id = 'E'; @@ -201,21 +201,21 @@ protected: coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; } } - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { signal_id = "1G"; system_id = 'R'; coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; min_integration_ms = 1; } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { signal_id = "2G"; system_id = 'R'; coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; min_integration_ms = 1; } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { signal_id = "2S"; system_id = 'G'; @@ -229,14 +229,14 @@ protected: } min_integration_ms = 20; } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { signal_id = "5X"; system_id = 'E'; coherent_integration_time_ms = FLAGS_acq_test_coherent_time_ms; min_integration_ms = 1; } - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { signal_id = "L5"; system_id = 'G'; @@ -265,7 +265,7 @@ protected: } else { - float aux = static_cast(FLAGS_acq_test_threshold_init); + auto aux = static_cast(FLAGS_acq_test_threshold_init); pfa_vector.push_back(aux); aux = aux + static_cast(FLAGS_acq_test_threshold_step); while (aux <= static_cast(FLAGS_acq_test_threshold_final)) @@ -288,16 +288,23 @@ protected: } Pd.resize(cn0_vector.size()); - for (int i = 0; i < static_cast(cn0_vector.size()); i++) Pd[i].reserve(num_thresholds); + for (int i = 0; i < static_cast(cn0_vector.size()); i++) + { + Pd[i].reserve(num_thresholds); + } Pfa.resize(cn0_vector.size()); - for (int i = 0; i < static_cast(cn0_vector.size()); i++) Pfa[i].reserve(num_thresholds); + for (int i = 0; i < static_cast(cn0_vector.size()); i++) + { + Pfa[i].reserve(num_thresholds); + } Pd_correct.resize(cn0_vector.size()); - for (int i = 0; i < static_cast(cn0_vector.size()); i++) Pd_correct[i].reserve(num_thresholds); + for (int i = 0; i < static_cast(cn0_vector.size()); i++) + { + Pd_correct[i].reserve(num_thresholds); + } } - ~AcquisitionPerformanceTest() - { - } + ~AcquisitionPerformanceTest() = default; std::vector cn0_vector; std::vector pfa_vector; @@ -317,7 +324,7 @@ protected: void check_results(); void plot_results(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; @@ -331,7 +338,7 @@ protected: bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; std::string implementation = FLAGS_acq_test_implementation; @@ -389,7 +396,7 @@ void AcquisitionPerformanceTest::init() void AcquisitionPerformanceTest::start_queue() { stop = false; - ch_thread = boost::thread(&AcquisitionPerformanceTest::wait_message, this); + ch_thread = std::thread(&AcquisitionPerformanceTest::wait_message, this); } @@ -450,11 +457,13 @@ int AcquisitionPerformanceTest::generate_signal() pid_t wait_result; int child_status; std::cout << "Generating signal for " << p6 << "..." << std::endl; - char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork error"); + { + perror("fork error"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -463,7 +472,10 @@ int AcquisitionPerformanceTest::generate_signal() } wait_result = waitpid(pid, &child_status, 0); - if (wait_result == -1) perror("waitpid error"); + if (wait_result == -1) + { + perror("waitpid error"); + } return 0; } @@ -539,12 +551,12 @@ int AcquisitionPerformanceTest::configure_receiver(double cn0, float pfa, unsign config->set_property("Acquisition.dump_channel", std::to_string(dump_channel)); config->set_property("Acquisition.blocking_on_standby", "true"); - config_f = 0; + config_f = nullptr; } else { config_f = std::make_shared(FLAGS_config_file_ptest); - config = 0; + config = nullptr; } return 0; } @@ -576,35 +588,35 @@ int AcquisitionPerformanceTest::run_receiver() int nsamples = floor(config->property("GNSS-SDR.internal_fs_sps", 2000000) * generated_signal_duration_s); boost::shared_ptr valve = gnss_sdr_make_valve(sizeof(gr_complex), nsamples, queue); - if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0) + if (implementation == "GPS_L1_CA_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0) + else if (implementation == "GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0) + else if (implementation == "Galileo_E1_PCPS_Ambiguous_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GLONASS_L1_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L1_CA_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GLONASS_L2_CA_PCPS_Acquisition") == 0) + else if (implementation == "GLONASS_L2_CA_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L2_M_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L2_M_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E5a_Pcps_Acquisition") == 0) + else if (implementation == "Galileo_E5a_Pcps_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L5i_PCPS_Acquisition") == 0) + else if (implementation == "GPS_L5i_PCPS_Acquisition") { acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } @@ -636,12 +648,7 @@ int AcquisitionPerformanceTest::run_receiver() top_block->run(); // Start threads and wait -#ifdef OLD_BOOST - ch_thread.timed_join(boost::posix_time::seconds(1)); -#endif -#ifndef OLD_BOOST - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); -#endif + ch_thread.join(); return 0; } @@ -654,12 +661,12 @@ int AcquisitionPerformanceTest::count_executions(const std::string& basename, un char buffer[1024]; fp = popen(&argum2[0], "r"); int num_executions = 1; - if (fp == NULL) + if (fp == nullptr) { std::cout << "Failed to run command: " << argum2 << std::endl; return 0; } - while (fgets(buffer, sizeof(buffer), fp) != NULL) + while (fgets(buffer, sizeof(buffer), fp) != nullptr) { std::string aux = std::string(buffer); EXPECT_EQ(aux.empty(), false); @@ -687,7 +694,7 @@ void AcquisitionPerformanceTest::plot_results() { 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("linespoints"); @@ -701,7 +708,7 @@ void AcquisitionPerformanceTest::plot_results() } g1.cmd("set font \"Times,18\""); g1.set_title("Receiver Operating Characteristic for GPS L1 C/A acquisition"); - g1.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + " \" at screen 0.12, 0.83 font \"Times,16\""); + g1.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + R"( " at screen 0.12, 0.83 font "Times,16")"); g1.cmd("set logscale x"); g1.cmd("set yrange [0:1]"); g1.cmd("set xrange[0.0001:1]"); @@ -737,7 +744,7 @@ void AcquisitionPerformanceTest::plot_results() } g2.cmd("set font \"Times,18\""); g2.set_title("Receiver Operating Characteristic for GPS L1 C/A valid acquisition"); - g2.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + " \" at screen 0.12, 0.83 font \"Times,16\""); + g2.cmd("set label 1 \"" + std::string("Coherent integration time: ") + std::to_string(config->property("Acquisition.coherent_integration_time_ms", 1)) + " ms, Non-coherent integrations: " + std::to_string(config->property("Acquisition.max_dwells", 1)) + R"( " at screen 0.12, 0.83 font "Times,16")"); g2.cmd("set logscale x"); g2.cmd("set yrange [0:1]"); g2.cmd("set xrange[0.0001:1]"); @@ -773,7 +780,7 @@ void AcquisitionPerformanceTest::plot_results() TEST_F(AcquisitionPerformanceTest, ROC) { - tracking_true_obs_reader true_trk_data; + Tracking_True_Obs_Reader true_trk_data; if (boost::filesystem::exists(path_str)) { @@ -783,13 +790,16 @@ TEST_F(AcquisitionPerformanceTest, ROC) ASSERT_TRUE(boost::filesystem::create_directory(path_str, ec)) << "Could not create the " << path_str << " folder."; unsigned int cn0_index = 0; - for (std::vector::const_iterator it = cn0_vector.cbegin(); it != cn0_vector.cend(); ++it) + for (double it : cn0_vector) { std::vector meas_Pd_; std::vector meas_Pd_correct_; std::vector meas_Pfa_; - if (FLAGS_acq_test_input_file.empty()) std::cout << "Execution for CN0 = " << *it << " dB-Hz" << std::endl; + if (FLAGS_acq_test_input_file.empty()) + { + std::cout << "Execution for CN0 = " << it << " dB-Hz" << std::endl; + } // Do N_iterations of the experiment for (int pfa_iter = 0; pfa_iter < static_cast(pfa_vector.size()); pfa_iter++) @@ -804,12 +814,18 @@ TEST_F(AcquisitionPerformanceTest, ROC) } // Configure the signal generator - if (FLAGS_acq_test_input_file.empty()) configure_generator(*it); + if (FLAGS_acq_test_input_file.empty()) + { + configure_generator(it); + } for (int iter = 0; iter < N_iterations; iter++) { // Generate signal raw signal samples and observations RINEX file - if (FLAGS_acq_test_input_file.empty()) generate_signal(); + if (FLAGS_acq_test_input_file.empty()) + { + generate_signal(); + } for (unsigned k = 0; k < 2; k++) { @@ -824,13 +840,13 @@ TEST_F(AcquisitionPerformanceTest, ROC) init(); // Configure the receiver - configure_receiver(*it, pfa_vector[pfa_iter], iter); + configure_receiver(it, pfa_vector[pfa_iter], iter); // Run it run_receiver(); // count executions - std::string basename = path_str + std::string("/acquisition_") + std::to_string(*it) + "_" + std::to_string(iter) + "_" + std::to_string(pfa_vector[pfa_iter]) + "_" + gnss_synchro.System + "_" + signal_id; + std::string basename = path_str + std::string("/acquisition_") + std::to_string(it) + "_" + std::to_string(iter) + "_" + std::to_string(pfa_vector[pfa_iter]) + "_" + gnss_synchro.System + "_" + signal_id; int num_executions = count_executions(basename, observed_satellite); // Read measured data @@ -857,7 +873,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) for (int execution = 1; execution <= num_executions; execution++) { - acquisition_dump_reader acq_dump(basename, + Acquisition_Dump_Reader acq_dump(basename, observed_satellite, config->property("Acquisition.doppler_max", 0), config->property("Acquisition.doppler_step", 0), @@ -973,7 +989,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { meas_Pd_.push_back(0.0); } - std::cout << TEXT_BOLD_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << *it << " dBHz" + std::cout << TEXT_BOLD_BLACK << "Probability of detection for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << (num_executions > 0 ? computed_Pd : 0.0) << TEXT_RESET << std::endl; } if (num_clean_executions > 0) @@ -990,7 +1006,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) } double computed_Pd_correct = correctly_detected / static_cast(num_clean_executions); meas_Pd_correct_.push_back(computed_Pd_correct); - std::cout << TEXT_BOLD_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << *it << " dBHz" + std::cout << TEXT_BOLD_BLACK << "Probability of correct detection for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << computed_Pd_correct << TEXT_RESET << std::endl; } else @@ -1008,7 +1024,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { meas_Pfa_.push_back(0.0); } - std::cout << TEXT_BOLD_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << *it << " dBHz" + std::cout << TEXT_BOLD_BLACK << "Probability of false alarm for channel=" << ch << ", CN0=" << it << " dBHz" << ": " << (num_executions > 0 ? computed_Pfa : 0.0) << TEXT_RESET << std::endl; } } @@ -1019,14 +1035,14 @@ TEST_F(AcquisitionPerformanceTest, ROC) float sum_pd = static_cast(std::accumulate(meas_Pd_.begin(), meas_Pd_.end(), 0.0)); float sum_pd_correct = static_cast(std::accumulate(meas_Pd_correct_.begin(), meas_Pd_correct_.end(), 0.0)); float sum_pfa = static_cast(std::accumulate(meas_Pfa_.begin(), meas_Pfa_.end(), 0.0)); - if (meas_Pd_.size() > 0 and meas_Pfa_.size() > 0) + if (!meas_Pd_.empty() and !meas_Pfa_.empty()) { Pd[cn0_index][pfa_iter] = sum_pd / static_cast(meas_Pd_.size()); Pfa[cn0_index][pfa_iter] = sum_pfa / static_cast(meas_Pfa_.size()); } else { - if (meas_Pd_.size() > 0) + if (!meas_Pd_.empty()) { Pd[cn0_index][pfa_iter] = sum_pd / static_cast(meas_Pd_.size()); } @@ -1034,7 +1050,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) { Pd[cn0_index][pfa_iter] = 0.0; } - if (meas_Pfa_.size() > 0) + if (!meas_Pfa_.empty()) { Pfa[cn0_index][pfa_iter] = sum_pfa / static_cast(meas_Pfa_.size()); } @@ -1043,7 +1059,7 @@ TEST_F(AcquisitionPerformanceTest, ROC) Pfa[cn0_index][pfa_iter] = 0.0; } } - if (meas_Pd_correct_.size() > 0) + if (!meas_Pd_correct_.empty()) { Pd_correct[cn0_index][pfa_iter] = sum_pd_correct / static_cast(meas_Pd_correct_.size()); } @@ -1060,9 +1076,9 @@ TEST_F(AcquisitionPerformanceTest, ROC) // Compute results unsigned int aux_index = 0; - for (std::vector::const_iterator it = cn0_vector.cbegin(); it != cn0_vector.cend(); ++it) + for (double it : cn0_vector) { - std::cout << "Results for CN0 = " << *it << " dBHz:" << std::endl; + std::cout << "Results for CN0 = " << it << " dBHz:" << std::endl; std::cout << "Pd = "; for (int pfa_iter = 0; pfa_iter < num_thresholds; pfa_iter++) { diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc index 7e3be06c6..a1517dd8f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_8ms_ambiguous_acquisition_gsoc2013_test.cc @@ -30,16 +30,6 @@ */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "fir_filter.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" #include "gen_signal_source.h" @@ -49,24 +39,36 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx; -typedef boost::shared_ptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr; +using GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); +GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); class GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); + friend GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -74,7 +76,7 @@ public: }; -GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue) +GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr(new GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(queue)); } @@ -84,7 +86,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -96,16 +98,14 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events } -GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx() -{ -} +GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test_msg_rx() = default; // ########################################################### @@ -123,9 +123,7 @@ protected: init(); } - ~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test() - { - } + ~GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test() = default; void init(); void config_1(); @@ -135,7 +133,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -145,7 +143,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -342,7 +340,7 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::config_2() void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc index 7f15ac400..346e59e79 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc2013_test.cc @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -56,18 +57,18 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr; +using GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); +GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); class GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); + friend GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -75,7 +76,7 @@ public: }; -GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue) +GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr(new GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(queue)); } @@ -85,7 +86,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pm { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -97,16 +98,14 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pm } -GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx() -{ -} +GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx() = default; // ########################################################### @@ -124,9 +123,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test() - { - } + ~GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test() = default; void init(); void config_1(); @@ -136,7 +133,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -146,7 +143,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -351,7 +348,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::config_2() void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc index 73b67416b..06ec5811c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_gsoc_test.cc @@ -45,6 +45,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -64,18 +65,18 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr; +using GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr = boost::shared_ptr; -GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(concurrent_queue& queue); +GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(Concurrent_Queue& queue); class GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx : public gr::block { private: - friend GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(concurrent_queue& queue); + friend GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -83,7 +84,7 @@ public: }; -GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(concurrent_queue& queue) +GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx_sptr(new GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(queue)); } @@ -93,7 +94,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events(pmt::p { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -105,16 +106,14 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events(pmt::p } -GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx() -{ -} +GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionGSoCTest_msg_rx() = default; // ########################################################### @@ -133,16 +132,14 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GalileoE1PcpsAmbiguousAcquisitionGSoCTest() - { - } + ~GalileoE1PcpsAmbiguousAcquisitionGSoCTest() = default; void init(); void start_queue(); void wait_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr factory; @@ -151,7 +148,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; }; @@ -178,7 +175,7 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::init() void GalileoE1PcpsAmbiguousAcquisitionGSoCTest::start_queue() { - ch_thread = boost::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message, this); + ch_thread = std::thread(&GalileoE1PcpsAmbiguousAcquisitionGSoCTest::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc index 786bfbff7..c31937d37 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_ambiguous_acquisition_test.cc @@ -31,17 +31,6 @@ */ -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "Galileo_E1.h" #include "acquisition_dump_reader.h" #include "galileo_e1_pcps_ambiguous_acquisition.h" @@ -53,14 +42,26 @@ #include "gnuplot_i.h" #include "in_memory_configuration.h" #include "test_flags.h" +#include +#include +#include +#include #include #include +#include #include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr; +using GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr = boost::shared_ptr; GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx_make(); @@ -87,7 +88,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt::pmt_t { 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) @@ -106,9 +107,7 @@ GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsAmbiguousAcquisitionT } -GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() -{ -} +GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsAmbiguousAcquisitionTest_msg_rx() = default; // ########################################################### @@ -126,9 +125,7 @@ protected: doppler_step = 250; } - ~GalileoE1PcpsAmbiguousAcquisitionTest() - { - } + ~GalileoE1PcpsAmbiguousAcquisitionTest() = default; void init(); void plot_grid(); @@ -176,12 +173,15 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() { //load the measured values std::string basename = "./tmp-acq-gal1/acquisition_E_1B"; - unsigned int sat = static_cast(gnss_synchro.PRN); + auto sat = static_cast(gnss_synchro.PRN); - unsigned int samples_per_code = static_cast(round(4000000 / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); // !! - acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code); + auto samples_per_code = static_cast(round(4000000 / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); // !! + Acquisition_Dump_Reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code); - if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + if (!acq_dump.read_binary_acq()) + { + std::cout << "Error reading files" << std::endl; + } std::vector* doppler = &acq_dump.doppler; std::vector* samples = &acq_dump.samples; @@ -201,7 +201,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid() { 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("lines"); @@ -351,7 +351,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults) std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); - float delay_error_chips = static_cast(delay_error_samples * 1023 / 4000000); + auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000000); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)"; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc index 3388bf162..60d23b6ba 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc @@ -31,16 +31,6 @@ */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "fir_filter.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" #include "gen_signal_source.h" @@ -50,24 +40,36 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr; +using GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr = boost::shared_ptr; -GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(concurrent_queue& queue); +GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(Concurrent_Queue& queue); class GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx : public gr::block { private: - friend GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(concurrent_queue& queue); + friend GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -75,7 +77,7 @@ public: }; -GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(concurrent_queue& queue) +GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_sptr(new GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(queue)); } @@ -85,7 +87,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt: { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -97,16 +99,14 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events(pmt: } -GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx() -{ -} +GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx::~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx() = default; // ########################################################### @@ -124,9 +124,7 @@ protected: init(); } - ~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest() - { - } + ~GalileoE1PcpsCccwsrAmbiguousAcquisitionTest() = default; void init(); void config_1(); @@ -136,7 +134,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -146,7 +144,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -349,7 +347,7 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::config_2() void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::wait_message, this); + ch_thread = std::thread(&GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::wait_message, this); } @@ -551,16 +549,10 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop"; -#endif } } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc index b4a7b4410..f2229bc57 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_quicksync_ambiguous_acquisition_gsoc2014_test.cc @@ -31,19 +31,6 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "fir_filter.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" #include "gen_signal_source.h" @@ -53,7 +40,22 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif DEFINE_double(e1_value_threshold, 0.3, "Value of the threshold for the acquisition"); DEFINE_int32(e1_value_CN0_dB_0, 50, "Value for the CN0_dB_0 in channel 0"); @@ -64,18 +66,18 @@ using google::LogMessage; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr; +using GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr = boost::shared_ptr; -GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue); +GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); class GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx : public gr::block { private: - friend GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue); + friend GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -83,7 +85,7 @@ public: }; -GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue) +GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx_sptr(new GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(queue)); } @@ -93,7 +95,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_ { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -105,7 +107,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_ } -GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); @@ -113,9 +115,7 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::GalileoE1PcpsQuic } -GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx() -{ -} +GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx::~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test_msg_rx() = default; // ########################################################### @@ -132,9 +132,7 @@ protected: gnss_synchro = Gnss_Synchro(); init(); } - ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test() - { - } + ~GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test() = default; void init(); void config_1(); @@ -145,7 +143,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -155,7 +153,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -465,7 +463,7 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::config_3() void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message, this); + ch_thread = std::thread(&GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc index 8fe2305a3..a021e5196 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc @@ -30,17 +30,6 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "fir_filter.h" #include "galileo_e1_pcps_tong_ambiguous_acquisition.h" @@ -51,25 +40,37 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx; -typedef boost::shared_ptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr; +using GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); +GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); + friend GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -77,7 +78,7 @@ public: }; -GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue) +GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue) { return GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_sptr(new GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(queue)); } @@ -87,7 +88,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_event { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -99,7 +100,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_event } -GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); @@ -107,9 +108,7 @@ GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::GalileoE1PcpsTongAmbig } -GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx() -{ -} +GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx::~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx() = default; class GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test : public ::testing::Test @@ -125,9 +124,7 @@ protected: init(); } - ~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test() - { - } + ~GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test() = default; void init(); void config_1(); @@ -137,7 +134,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -147,7 +144,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -352,7 +349,7 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::config_2() void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index df67c7756..f90407d0d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -55,18 +56,18 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx; -typedef boost::shared_ptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr; +using GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr = boost::shared_ptr; -GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(concurrent_queue& queue); +GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(Concurrent_Queue& queue); class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx : public gr::block { private: - friend GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(concurrent_queue& queue); + friend GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -74,7 +75,7 @@ public: }; -GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(concurrent_queue& queue) +GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(Concurrent_Queue& queue) { return GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_sptr(new GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(queue)); } @@ -84,7 +85,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events(p { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -96,7 +97,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events(p } -GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(concurrent_queue& queue) : gr::block("GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx(Concurrent_Queue& queue) : gr::block("GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::msg_handler_events, this, _1)); @@ -104,9 +105,7 @@ GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::GalileoE5aPcpsAcquisition } -GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx() -{ -} +GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx::~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx() = default; class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest : public ::testing::Test @@ -121,9 +120,7 @@ protected: init(); } - ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() - { - } + ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() = default; void init(); void config_1(); @@ -134,7 +131,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -144,7 +141,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -429,7 +426,7 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::config_3() void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::start_queue() { stop = false; - ch_thread = boost::thread(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::wait_message, this); + ch_thread = std::thread(&GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc index 70ad8e25e..dbee4f413 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_gsoc2017_test.cc @@ -31,15 +31,6 @@ */ -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "freq_xlating_fir_filter.h" #include "gen_signal_source.h" @@ -51,27 +42,37 @@ #include "pass_through.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "boost/shared_ptr.hpp" +#include +#include +#include #include #include +#include #include - +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx; -typedef boost::shared_ptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr; +using GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr = boost::shared_ptr; -GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(concurrent_queue& queue); +GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(Concurrent_Queue& queue); class GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx : public gr::block { private: - friend GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(concurrent_queue& queue); + friend GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -79,7 +80,7 @@ public: }; -GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(concurrent_queue& queue) +GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(Concurrent_Queue& queue) { return GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_sptr(new GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(queue)); } @@ -89,7 +90,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events(pmt::pmt_ { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -101,7 +102,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events(pmt::pmt_ } -GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(concurrent_queue& queue) : gr::block("GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx(Concurrent_Queue& queue) : gr::block("GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::msg_handler_events, this, _1)); @@ -109,9 +110,7 @@ GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::GlonassL1CaPcpsAcquisitionGSoC201 } -GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::~GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx() -{ -} +GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx::~GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx() = default; // ########################################################### @@ -125,13 +124,11 @@ protected: stop = false; message = 0; gnss_synchro = Gnss_Synchro(); - acquisition = 0; + acquisition = nullptr; init(); } - ~GlonassL1CaPcpsAcquisitionGSoC2017Test() - { - } + ~GlonassL1CaPcpsAcquisitionGSoC2017Test() = default; void init(); void config_1(); @@ -141,7 +138,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; @@ -151,7 +148,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -356,7 +353,7 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::config_2() void GlonassL1CaPcpsAcquisitionGSoC2017Test::start_queue() { stop = false; - ch_thread = boost::thread(&GlonassL1CaPcpsAcquisitionGSoC2017Test::wait_message, this); + ch_thread = std::thread(&GlonassL1CaPcpsAcquisitionGSoC2017Test::wait_message, this); } @@ -370,12 +367,12 @@ void GlonassL1CaPcpsAcquisitionGSoC2017Test::wait_message() { acquisition->reset(); - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); begin = tv.tv_sec * 1e6 + tv.tv_usec; channel_internal_queue.wait_and_pop(message); - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); end = tv.tv_sec * 1e6 + tv.tv_usec; mean_acq_time_us += (end - begin); @@ -553,16 +550,10 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop."; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -649,18 +640,11 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); + ch_thread.join(); }) << "Failure while waiting the queue to stop" << std::endl; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop" - << std::endl; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc index 9fca76da0..9cd20eefe 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l1_ca_pcps_acquisition_test.cc @@ -30,18 +30,6 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "freq_xlating_fir_filter.h" #include "glonass_l1_ca_pcps_acquisition.h" #include "gnss_block_factory.h" @@ -49,9 +37,21 @@ #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "in_memory_configuration.h" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### @@ -84,7 +84,7 @@ void GlonassL1CaPcpsAcquisitionTest_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) @@ -103,9 +103,7 @@ GlonassL1CaPcpsAcquisitionTest_msg_rx::GlonassL1CaPcpsAcquisitionTest_msg_rx() : } -GlonassL1CaPcpsAcquisitionTest_msg_rx::~GlonassL1CaPcpsAcquisitionTest_msg_rx() -{ -} +GlonassL1CaPcpsAcquisitionTest_msg_rx::~GlonassL1CaPcpsAcquisitionTest_msg_rx() = default; // ########################################################### @@ -121,9 +119,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GlonassL1CaPcpsAcquisitionTest() - { - } + ~GlonassL1CaPcpsAcquisitionTest() = default; void init(); diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc index a8f668f69..ba0611f90 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/glonass_l2_ca_pcps_acquisition_test.cc @@ -30,15 +30,6 @@ */ -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "fir_filter.h" #include "gen_signal_source.h" @@ -51,10 +42,19 @@ #include "signal_generator.h" #include "signal_generator_c.h" #include "boost/shared_ptr.hpp" +#include +#include #include #include +#include #include - +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL2CaPcpsAcquisitionTest_msg_rx; @@ -150,7 +150,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -351,7 +351,7 @@ void GlonassL2CaPcpsAcquisitionTest::config_2() void GlonassL2CaPcpsAcquisitionTest::start_queue() { stop = false; - ch_thread = boost::thread(&GlonassL2CaPcpsAcquisitionTest::wait_message, this); + ch_thread = std::thread(&GlonassL2CaPcpsAcquisitionTest::wait_message, this); } @@ -549,16 +549,10 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); - }) << "Failure while waiting the queue to stop."; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -645,16 +639,10 @@ TEST_F(GlonassL2CaPcpsAcquisitionTest, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index af4f5b6a5..e4ef9974b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -31,15 +31,6 @@ */ -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "fir_filter.h" #include "gen_signal_source.h" @@ -51,27 +42,38 @@ #include "pass_through.h" #include "signal_generator.h" #include "signal_generator_c.h" -#include "boost/shared_ptr.hpp" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx; -typedef boost::shared_ptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr; +using GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); +GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); class GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); + friend GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -79,7 +81,7 @@ public: }; -GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue) +GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue) { return GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx_sptr(new GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(queue)); } @@ -89,7 +91,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t ms { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -101,16 +103,14 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_t ms } -GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue) : gr::block("GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx() -{ -} +GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsAcquisitionGSoC2013Test_msg_rx() = default; // ########################################################### @@ -124,13 +124,11 @@ protected: stop = false; message = 0; gnss_synchro = Gnss_Synchro(); - acquisition = 0; + acquisition = nullptr; init(); } - ~GpsL1CaPcpsAcquisitionGSoC2013Test() - { - } + ~GpsL1CaPcpsAcquisitionGSoC2013Test() = default; void init(); void config_1(); @@ -140,7 +138,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; @@ -150,7 +148,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -351,7 +349,7 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::config_2() void GpsL1CaPcpsAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GpsL1CaPcpsAcquisitionGSoC2013Test::wait_message, this); } @@ -546,16 +544,10 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResults) { EXPECT_EQ(2, message) << "Acquisition failure. Expected message: 2=ACQ FAIL."; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; @@ -642,16 +634,10 @@ TEST_F(GpsL1CaPcpsAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) std::cout << "Estimated probability of false alarm (satellite absent) = " << Pfa_a << std::endl; std::cout << "Mean acq time = " << mean_acq_time_us << " microseconds." << std::endl; } -#ifdef OLD_BOOST + ASSERT_NO_THROW({ - ch_thread.timed_join(boost::posix_time::seconds(1)); + ch_thread.join(); }) << "Failure while waiting the queue to stop"; -#endif -#ifndef OLD_BOOST - ASSERT_NO_THROW({ - ch_thread.try_join_until(boost::chrono::steady_clock::now() + boost::chrono::milliseconds(50)); - }) << "Failure while waiting the queue to stop"; -#endif } delete acquisition; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc index d93f11918..8e6876aa9 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test.cc @@ -31,19 +31,6 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "GPS_L1_CA.h" #include "acquisition_dump_reader.h" #include "gnss_block_factory.h" @@ -54,9 +41,22 @@ #include "gps_l1_ca_pcps_acquisition.h" #include "in_memory_configuration.h" #include "test_flags.h" +#include +#include +#include +#include +#include #include #include +#include #include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### @@ -177,9 +177,12 @@ void GpsL1CaPcpsAcquisitionTest::plot_grid() auto sat = static_cast(gnss_synchro.PRN); auto samples_per_code = static_cast(round(4000000 / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); // !! - acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1); + Acquisition_Dump_Reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1); - if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + if (!acq_dump.read_binary_acq()) + { + std::cout << "Error reading files" << std::endl; + } std::vector *doppler = &acq_dump.doppler; std::vector *samples = &acq_dump.samples; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc index 79515988e..fd0da8297 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_acquisition_test_fpga.cc @@ -29,29 +29,30 @@ * ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "gnss_block_factory.h" #include "gnss_block_interface.h" #include "gnss_sdr_valve.h" #include "gnss_synchro.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" #include "in_memory_configuration.h" +#include +#include +#include +#include #include #include #include +#include #include +#include +#include #include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif #define DMA_ACQ_TRANSFER_SIZE 2046 // DMA transfer size for the acquisition #define RX_SIGNAL_MAX_VALUE 127 // 2^7 - 1 for 8-bit signed values @@ -203,7 +204,7 @@ void GpsL1CaPcpsAcquisitionTestFpga_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) @@ -225,9 +226,7 @@ GpsL1CaPcpsAcquisitionTestFpga_msg_rx::GpsL1CaPcpsAcquisitionTestFpga_msg_rx() : } -GpsL1CaPcpsAcquisitionTestFpga_msg_rx::~GpsL1CaPcpsAcquisitionTestFpga_msg_rx() -{ -} +GpsL1CaPcpsAcquisitionTestFpga_msg_rx::~GpsL1CaPcpsAcquisitionTestFpga_msg_rx() = default; class GpsL1CaPcpsAcquisitionTestFpga : public ::testing::Test @@ -241,9 +240,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CaPcpsAcquisitionTestFpga() - { - } + ~GpsL1CaPcpsAcquisitionTestFpga() = default; void init(); @@ -385,7 +382,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTestFpga, ValidationOfResults) ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); - float delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); + auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); EXPECT_LE(doppler_error_hz, 666) << "Doppler error exceeds the expected value: 666 Hz = 2/(3*integration period)"; diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc index 2fa64118b..2eecb0e53 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_opencl_acquisition_gsoc2013_test.cc @@ -31,16 +31,6 @@ */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "fir_filter.h" #include "gen_signal_source.h" @@ -51,8 +41,19 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsOpenClAcquisitionGSoC2013Test_msg_rx; @@ -147,7 +148,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -348,7 +349,7 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::config_2() void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc index 966b33473..db5e51af8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_quicksync_acquisition_gsoc2014_test.cc @@ -31,17 +31,6 @@ */ -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "gnss_block_factory.h" #include "gnss_block_interface.h" #include "gnss_sdr_valve.h" @@ -50,9 +39,22 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif DEFINE_double(value_threshold, 1, "Value of the threshold for the acquisition"); DEFINE_int32(value_CN0_dB_0, 44, "Value for the CN0_dB_0 in channel 0"); @@ -62,18 +64,18 @@ using google::LogMessage; // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx; -typedef boost::shared_ptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr; +using GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr = boost::shared_ptr; -GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue); +GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); class GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx : public gr::block { private: - friend GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue); + friend GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -81,7 +83,7 @@ public: }; -GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(concurrent_queue& queue) +GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_make(Concurrent_Queue& queue) { return GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx_sptr(new GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(queue)); } @@ -91,7 +93,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events(pmt: { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -103,7 +105,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events(pmt: } -GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx(Concurrent_Queue& queue) : gr::block("GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::msg_handler_events, this, _1)); @@ -111,9 +113,7 @@ GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::GpsL1CaPcpsQuickSyncAcquisit } -GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx() -{ -} +GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx::~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test_msg_rx() = default; // ########################################################### @@ -130,9 +130,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test() - { - } + ~GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test() = default; void init(); void config_1(); @@ -143,7 +141,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr factory; @@ -153,7 +151,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -457,7 +455,7 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::config_3() void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::start_queue() { stop = false; - ch_thread = boost::thread(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message, this); + ch_thread = std::thread(&GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc index d24b4b0f7..b5977ff39 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l1_ca_pcps_tong_acquisition_gsoc2013_test.cc @@ -31,16 +31,6 @@ */ -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "configuration_interface.h" #include "fir_filter.h" #include "gen_signal_source.h" @@ -51,25 +41,37 @@ #include "in_memory_configuration.h" #include "signal_generator.h" #include "signal_generator_c.h" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx; -typedef boost::shared_ptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr; +using GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr = boost::shared_ptr; -GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); +GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); class GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx : public gr::block { private: - friend GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue); + friend GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue); void msg_handler_events(pmt::pmt_t msg); - GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue); - concurrent_queue& channel_internal_queue; + GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue); + Concurrent_Queue& channel_internal_queue; public: int rx_message; @@ -77,7 +79,7 @@ public: }; -GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(concurrent_queue& queue) +GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_make(Concurrent_Queue& queue) { return GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx_sptr(new GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(queue)); } @@ -87,7 +89,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_ { try { - int64_t message = pmt::to_long(msg); + int64_t message = pmt::to_long(std::move(msg)); rx_message = message; channel_internal_queue.push(rx_message); } @@ -99,16 +101,14 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events(pmt::pmt_ } -GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(concurrent_queue& queue) : gr::block("GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) +GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx(Concurrent_Queue& queue) : gr::block("GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)), channel_internal_queue(queue) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), boost::bind(&GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::msg_handler_events, this, _1)); rx_message = 0; } -GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx() -{ -} +GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx::~GpsL1CaPcpsTongAcquisitionGSoC2013Test_msg_rx() = default; // ########################################################### @@ -124,9 +124,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CaPcpsTongAcquisitionGSoC2013Test() - { - } + ~GpsL1CaPcpsTongAcquisitionGSoC2013Test() = default; void init(); void config_1(); @@ -136,7 +134,7 @@ protected: void process_message(); void stop_queue(); - concurrent_queue channel_internal_queue; + Concurrent_Queue channel_internal_queue; gr::msg_queue::sptr queue; gr::top_block_sptr top_block; std::shared_ptr acquisition; @@ -145,7 +143,7 @@ protected: size_t item_size; bool stop; int message; - boost::thread ch_thread; + std::thread ch_thread; unsigned int integration_time_ms = 0; unsigned int fs_in = 0; @@ -346,7 +344,7 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::config_2() void GpsL1CaPcpsTongAcquisitionGSoC2013Test::start_queue() { stop = false; - ch_thread = boost::thread(&GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message, this); + ch_thread = std::thread(&GpsL1CaPcpsTongAcquisitionGSoC2013Test::wait_message, this); } diff --git a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc index f2d5e8e41..add12d00b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc @@ -31,17 +31,6 @@ */ -#include -#include -#include -#include -#include -#include -#ifdef GR_GREATER_38 -#include -#else -#include -#endif #include "GPS_L2C.h" #include "acquisition_dump_reader.h" #include "gnss_block_factory.h" @@ -52,11 +41,23 @@ #include "gps_l2_m_pcps_acquisition.h" #include "in_memory_configuration.h" #include "test_flags.h" +#include +#include +#include #include +#include #include #include #include +#include #include +#include +#include +#ifdef GR_GREATER_38 +#include +#else +#include +#endif // ######## GNURADIO BLOCK MESSAGE RECEVER ######### @@ -87,7 +88,7 @@ void GpsL2MPcpsAcquisitionTest_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) @@ -104,9 +105,7 @@ GpsL2MPcpsAcquisitionTest_msg_rx::GpsL2MPcpsAcquisitionTest_msg_rx() : gr::block rx_message = 0; } -GpsL2MPcpsAcquisitionTest_msg_rx::~GpsL2MPcpsAcquisitionTest_msg_rx() -{ -} +GpsL2MPcpsAcquisitionTest_msg_rx::~GpsL2MPcpsAcquisitionTest_msg_rx() = default; // ########################################################### @@ -126,9 +125,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GpsL2MPcpsAcquisitionTest() - { - } + ~GpsL2MPcpsAcquisitionTest() = default; void init(); void plot_grid(); @@ -181,11 +178,14 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() { //load the measured values std::string basename = "./tmp-acq-gps2/acquisition_test_G_2S"; - unsigned int sat = static_cast(gnss_synchro.PRN); + auto sat = static_cast(gnss_synchro.PRN); - unsigned int samples_per_code = static_cast(floor(static_cast(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); - acquisition_dump_reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1); - if (!acq_dump.read_binary_acq()) std::cout << "Error reading files" << std::endl; + auto samples_per_code = static_cast(floor(static_cast(sampling_frequency_hz) / (GPS_L2_M_CODE_RATE_HZ / static_cast(GPS_L2_M_CODE_LENGTH_CHIPS)))); + Acquisition_Dump_Reader acq_dump(basename, sat, doppler_max, doppler_step, samples_per_code, 1); + if (!acq_dump.read_binary_acq()) + { + std::cout << "Error reading files" << std::endl; + } std::vector *doppler = &acq_dump.doppler; std::vector *samples = &acq_dump.samples; @@ -205,7 +205,7 @@ void GpsL2MPcpsAcquisitionTest::plot_grid() { 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("impulses"); @@ -362,7 +362,7 @@ TEST_F(GpsL2MPcpsAcquisitionTest, ValidationOfResults) ASSERT_EQ(1, msg_rx->rx_message) << "Acquisition failure. Expected message: 1=ACQ SUCCESS."; double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples); - float delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); + auto delay_error_chips = static_cast(delay_error_samples * 1023 / 4000); double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz); EXPECT_LE(doppler_error_hz, 200) << "Doppler error exceeds the expected value: 2/(3*integration period)"; diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc index 9c411c862..42fb1496a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/fir_filter_test.cc @@ -137,7 +137,10 @@ TEST_F(FirFilterTest, InstantiateGrComplexGrComplex) configure_gr_complex_gr_complex(); std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } @@ -147,7 +150,10 @@ TEST_F(FirFilterTest, InstantiateCshortCshort) configure_cshort_cshort(); std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } @@ -158,7 +164,10 @@ TEST_F(FirFilterTest, InstantiateCbyteCbyte) configure_cbyte_cbyte(); std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } @@ -169,7 +178,10 @@ TEST_F(FirFilterTest, InstantiateCbyteGrComplex) configure_cbyte_gr_complex(); std::unique_ptr filter(new FirFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc index f23a84558..a77e9d853 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_lite_test.cc @@ -95,7 +95,10 @@ TEST_F(NotchFilterLiteTest, InstantiateGrComplexGrComplex) configure_gr_complex_gr_complex(); std::unique_ptr filter(new NotchFilterLite(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc index b3c9fbece..943ac2fe2 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/notch_filter_test.cc @@ -95,7 +95,10 @@ TEST_F(NotchFilterTest, InstantiateGrComplexGrComplex) configure_gr_complex_gr_complex(); std::unique_ptr filter(new NotchFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } diff --git a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc index 729ff78dd..83a63d551 100644 --- a/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/filter/pulse_blanking_filter_test.cc @@ -94,7 +94,10 @@ TEST_F(PulseBlankingFilterTest, InstantiateGrComplexGrComplex) configure_gr_complex_gr_complex(); std::unique_ptr filter(new PulseBlankingFilter(config.get(), "InputFilter", 1, 1)); int res = 0; - if (filter) res = 1; + if (filter) + { + res = 1; + } ASSERT_EQ(1, res); } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index d0bd655d7..1935b7eda 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -27,16 +27,6 @@ set(SIGNAL_PROCESSING_TESTING_LIB_SOURCES true_observables_reader.cc ) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${MATIO_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} -) - - file(GLOB SIGNAL_PROCESSING_TESTING_LIB_HEADERS "*.h") list(SORT SIGNAL_PROCESSING_TESTING_LIB_HEADERS) @@ -47,10 +37,27 @@ add_library(signal_processing_testing_lib source_group(Headers FILES ${SIGNAL_PROCESSING_TESTING_LIB_HEADERS}) -if(NOT MATIO_FOUND) - add_dependencies(signal_processing_testing_lib - matio-${GNSSSDR_MATIO_LOCAL_VERSION} glog-${glog_RELEASE} - ) -else() - add_dependencies(signal_processing_testing_lib glog-${glog_RELEASE}) +target_link_libraries(signal_processing_testing_lib + PUBLIC + Armadillo::armadillo + Gflags::gflags + Gnuradio::runtime + PRIVATE + Boost::boost + Matio::matio + Glog::glog +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(signal_processing_testing_lib + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() endif() + +set_property(TARGET signal_processing_testing_lib + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ +) diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index f401b1bc9..987ddb350 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -35,7 +35,7 @@ #include #include -bool acquisition_dump_reader::read_binary_acq() +bool Acquisition_Dump_Reader::read_binary_acq() { mat_t* matfile = Mat_Open(d_dump_filename.c_str(), MAT_ACC_RDONLY); if (matfile == nullptr) @@ -60,8 +60,14 @@ bool acquisition_dump_reader::read_binary_acq() if ((var_->dims[0] != d_samples_per_code) or (var_->dims[1] != d_num_doppler_bins)) { std::cout << "Invalid Acquisition dump file: dimension matrix error" << std::endl; - if (var_->dims[0] != d_samples_per_code) std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << std::endl; - if (var_->dims[1] != d_num_doppler_bins) std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << std::endl; + if (var_->dims[0] != d_samples_per_code) + { + std::cout << "Expected " << d_samples_per_code << " samples per code. Obtained " << var_->dims[0] << std::endl; + } + if (var_->dims[1] != d_num_doppler_bins) + { + std::cout << "Expected " << d_num_doppler_bins << " Doppler bins. Obtained " << var_->dims[1] << std::endl; + } Mat_VarFree(var_); Mat_Close(matfile); return false; @@ -137,7 +143,7 @@ bool acquisition_dump_reader::read_binary_acq() } -acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, +Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename, int channel, int execution) { @@ -186,7 +192,7 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, d_num_doppler_bins = 0; num_dwells = 0; - acquisition_dump_reader(basename, + Acquisition_Dump_Reader(basename, sat_, doppler_max_, doppler_step_, @@ -196,7 +202,7 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, } -acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, +Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, @@ -218,7 +224,10 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, sample_counter = 0; num_dwells = 0; PRN = 0; - if (d_doppler_step == 0) d_doppler_step = 1; + if (d_doppler_step == 0) + { + d_doppler_step = 1; + } d_num_doppler_bins = static_cast(ceil(static_cast(static_cast(d_doppler_max) - static_cast(-d_doppler_max)) / static_cast(d_doppler_step))); std::vector > mag_aux(d_num_doppler_bins, std::vector(d_samples_per_code)); mag = mag_aux; @@ -234,4 +243,4 @@ acquisition_dump_reader::acquisition_dump_reader(const std::string& basename, } -acquisition_dump_reader::~acquisition_dump_reader() = default; +Acquisition_Dump_Reader::~Acquisition_Dump_Reader() = default; diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h index be5779f38..c68a32347 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h @@ -36,10 +36,10 @@ #include #include -class acquisition_dump_reader +class Acquisition_Dump_Reader { public: - acquisition_dump_reader(const std::string& basename, + Acquisition_Dump_Reader(const std::string& basename, unsigned int sat, unsigned int doppler_max, unsigned int doppler_step, @@ -47,11 +47,11 @@ public: int channel = 0, int execution = 1); - acquisition_dump_reader(const std::string& basename, + Acquisition_Dump_Reader(const std::string& basename, int channel = 0, int execution = 1); - ~acquisition_dump_reader(); + ~Acquisition_Dump_Reader(); bool read_binary_acq(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h index 90a61a482..4dca5bcb8 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_msg_rx.h @@ -40,7 +40,7 @@ // ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### class Acquisition_msg_rx; -typedef boost::shared_ptr Acquisition_msg_rx_sptr; +using Acquisition_msg_rx_sptr = boost::shared_ptr; Acquisition_msg_rx_sptr Acquisition_msg_rx_make(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc index 95c5ed22d..c85062d55 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.cc @@ -29,10 +29,11 @@ */ #include "observables_dump_reader.h" +#include #include #include -bool observables_dump_reader::read_binary_obs() +bool Observables_Dump_Reader::read_binary_obs() { try { @@ -55,7 +56,7 @@ bool observables_dump_reader::read_binary_obs() } -bool observables_dump_reader::restart() +bool Observables_Dump_Reader::restart() { if (d_dump_file.is_open()) { @@ -67,7 +68,7 @@ bool observables_dump_reader::restart() } -int64_t observables_dump_reader::num_epochs() +int64_t Observables_Dump_Reader::num_epochs() { std::ifstream::pos_type size; int number_of_vars_in_epoch = n_channels * 7; @@ -83,7 +84,7 @@ int64_t observables_dump_reader::num_epochs() } -bool observables_dump_reader::open_obs_file(std::string out_file) +bool Observables_Dump_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -96,7 +97,7 @@ bool observables_dump_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening Observables dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -106,7 +107,8 @@ bool observables_dump_reader::open_obs_file(std::string out_file) } } -void observables_dump_reader::close_obs_file() + +void Observables_Dump_Reader::close_obs_file() { if (d_dump_file.is_open() == false) { @@ -114,7 +116,8 @@ void observables_dump_reader::close_obs_file() } } -observables_dump_reader::observables_dump_reader(int n_channels_) + +Observables_Dump_Reader::Observables_Dump_Reader(int n_channels_) { n_channels = n_channels_; RX_time = new double[n_channels]; @@ -127,11 +130,22 @@ observables_dump_reader::observables_dump_reader(int n_channels_) } -observables_dump_reader::~observables_dump_reader() +Observables_Dump_Reader::~Observables_Dump_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing Observables dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } delete[] RX_time; delete[] TOW_at_current_symbol_s; diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h index 9548829ac..be5c76ed1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/observables_dump_reader.h @@ -36,11 +36,11 @@ #include #include -class observables_dump_reader +class Observables_Dump_Reader { public: - observables_dump_reader(int n_channels); - ~observables_dump_reader(); + Observables_Dump_Reader(int n_channels); + ~Observables_Dump_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc index c8c95afd4..286994f7e 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.cc @@ -29,10 +29,11 @@ */ #include "tlm_dump_reader.h" +#include #include #include -bool tlm_dump_reader::read_binary_obs() +bool Tlm_Dump_Reader::read_binary_obs() { try { @@ -48,7 +49,7 @@ bool tlm_dump_reader::read_binary_obs() } -bool tlm_dump_reader::restart() +bool Tlm_Dump_Reader::restart() { if (d_dump_file.is_open()) { @@ -60,7 +61,7 @@ bool tlm_dump_reader::restart() } -int64_t tlm_dump_reader::num_epochs() +int64_t Tlm_Dump_Reader::num_epochs() { std::ifstream::pos_type size; int number_of_vars_in_epoch = 2; @@ -76,7 +77,7 @@ int64_t tlm_dump_reader::num_epochs() } -bool tlm_dump_reader::open_obs_file(std::string out_file) +bool Tlm_Dump_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -90,7 +91,7 @@ bool tlm_dump_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening TLM dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -101,10 +102,21 @@ bool tlm_dump_reader::open_obs_file(std::string out_file) } -tlm_dump_reader::~tlm_dump_reader() +Tlm_Dump_Reader::~Tlm_Dump_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing TLM dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h index 43178bdc6..3eacefee4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tlm_dump_reader.h @@ -36,10 +36,10 @@ #include #include -class tlm_dump_reader +class Tlm_Dump_Reader { public: - ~tlm_dump_reader(); + ~Tlm_Dump_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc index 233bd8acb..49b37e148 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.cc @@ -29,10 +29,11 @@ */ #include "tracking_dump_reader.h" +#include #include #include -bool tracking_dump_reader::read_binary_obs() +bool Tracking_Dump_Reader::read_binary_obs() { try { @@ -67,7 +68,7 @@ bool tracking_dump_reader::read_binary_obs() } -bool tracking_dump_reader::restart() +bool Tracking_Dump_Reader::restart() { if (d_dump_file.is_open()) { @@ -79,7 +80,7 @@ bool tracking_dump_reader::restart() } -int64_t tracking_dump_reader::num_epochs() +int64_t Tracking_Dump_Reader::num_epochs() { std::ifstream::pos_type size; int number_of_double_vars = 1; @@ -99,7 +100,7 @@ int64_t tracking_dump_reader::num_epochs() } -bool tracking_dump_reader::open_obs_file(std::string out_file) +bool Tracking_Dump_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -112,7 +113,7 @@ bool tracking_dump_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -123,10 +124,21 @@ bool tracking_dump_reader::open_obs_file(std::string out_file) } -tracking_dump_reader::~tracking_dump_reader() +Tracking_Dump_Reader::~Tracking_Dump_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing Tracking dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h index 790838a8a..7a2ca7e33 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_dump_reader.h @@ -36,10 +36,10 @@ #include #include -class tracking_dump_reader +class Tracking_Dump_Reader { public: - ~tracking_dump_reader(); + ~Tracking_Dump_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc index efa913404..25c81acc1 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.cc @@ -29,10 +29,11 @@ */ #include "tracking_true_obs_reader.h" +#include #include #include -bool tracking_true_obs_reader::read_binary_obs() +bool Tracking_True_Obs_Reader::read_binary_obs() { try { @@ -50,7 +51,7 @@ bool tracking_true_obs_reader::read_binary_obs() } -bool tracking_true_obs_reader::restart() +bool Tracking_True_Obs_Reader::restart() { if (d_dump_file.is_open()) { @@ -62,7 +63,7 @@ bool tracking_true_obs_reader::restart() } -int64_t tracking_true_obs_reader::num_epochs() +int64_t Tracking_True_Obs_Reader::num_epochs() { std::ifstream::pos_type size; int number_of_vars_in_epoch = 5; @@ -78,7 +79,7 @@ int64_t tracking_true_obs_reader::num_epochs() } -bool tracking_true_obs_reader::open_obs_file(std::string out_file) +bool Tracking_True_Obs_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -92,7 +93,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl; return false; } } @@ -102,7 +103,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file) } } -void tracking_true_obs_reader::close_obs_file() +void Tracking_True_Obs_Reader::close_obs_file() { if (d_dump_file.is_open() == true) { @@ -110,10 +111,21 @@ void tracking_true_obs_reader::close_obs_file() } } -tracking_true_obs_reader::~tracking_true_obs_reader() +Tracking_True_Obs_Reader::~Tracking_True_Obs_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing Tracking dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h index 5b8990325..50b496ceb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/tracking_true_obs_reader.h @@ -36,10 +36,10 @@ #include #include -class tracking_true_obs_reader +class Tracking_True_Obs_Reader { public: - ~tracking_true_obs_reader(); + ~Tracking_True_Obs_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc index 14cd52562..dd72ae6dc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.cc @@ -29,10 +29,11 @@ */ #include "true_observables_reader.h" +#include #include #include -bool true_observables_reader::read_binary_obs() +bool True_Observables_Reader::read_binary_obs() { try { @@ -55,7 +56,7 @@ bool true_observables_reader::read_binary_obs() } -bool true_observables_reader::restart() +bool True_Observables_Reader::restart() { if (d_dump_file.is_open()) { @@ -67,7 +68,7 @@ bool true_observables_reader::restart() } -int64_t true_observables_reader::num_epochs() +int64_t True_Observables_Reader::num_epochs() { std::ifstream::pos_type size; int number_of_vars_in_epoch = 6 * 12; @@ -83,7 +84,7 @@ int64_t true_observables_reader::num_epochs() } -bool true_observables_reader::open_obs_file(std::string out_file) +bool True_Observables_Reader::open_obs_file(std::string out_file) { if (d_dump_file.is_open() == false) { @@ -97,7 +98,7 @@ bool true_observables_reader::open_obs_file(std::string out_file) } catch (const std::ifstream::failure &e) { - std::cout << "Problem opening True observables Log file: " << d_dump_filename.c_str() << std::endl; + std::cout << "Problem opening true Observables Log file: " << d_dump_filename << std::endl; return false; } } @@ -108,10 +109,21 @@ bool true_observables_reader::open_obs_file(std::string out_file) } -true_observables_reader::~true_observables_reader() +True_Observables_Reader::~True_Observables_Reader() { - if (d_dump_file.is_open() == true) + try { - d_dump_file.close(); + if (d_dump_file.is_open() == true) + { + d_dump_file.close(); + } + } + catch (const std::ifstream::failure &e) + { + std::cerr << "Problem closing true Observables dump Log file: " << d_dump_filename << '\n'; + } + catch (const std::exception &e) + { + std::cerr << e.what() << '\n'; } } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h index 86e1c868d..f17561f84 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/true_observables_reader.h @@ -36,10 +36,10 @@ #include #include -class true_observables_reader +class True_Observables_Reader { public: - ~true_observables_reader(); + ~True_Observables_Reader(); bool read_binary_obs(); bool restart(); int64_t num_epochs(); diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc index feccb8105..cee43548b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test.cc @@ -80,6 +80,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -115,7 +116,7 @@ void HybridObservablesTest_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) @@ -132,9 +133,7 @@ HybridObservablesTest_msg_rx::HybridObservablesTest_msg_rx() : gr::block("Hybrid rx_message = 0; } -HybridObservablesTest_msg_rx::~HybridObservablesTest_msg_rx() -{ -} +HybridObservablesTest_msg_rx::~HybridObservablesTest_msg_rx() = default; // ########################################################### @@ -168,7 +167,7 @@ void HybridObservablesTest_tlm_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) @@ -185,9 +184,7 @@ HybridObservablesTest_tlm_msg_rx::HybridObservablesTest_tlm_msg_rx() : gr::block rx_message = 0; } -HybridObservablesTest_tlm_msg_rx::~HybridObservablesTest_tlm_msg_rx() -{ -} +HybridObservablesTest_tlm_msg_rx::~HybridObservablesTest_tlm_msg_rx() = default; // ########################################################### @@ -229,7 +226,7 @@ public: arma::mat& true_ch0, arma::vec& true_tow_s, arma::mat& measured_ch0, - std::string data_title); + const std::string& data_title); void check_results_carrier_phase_double_diff( arma::mat& true_ch0, arma::mat& true_ch1, @@ -237,11 +234,11 @@ public: arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title); + const std::string& data_title); void check_results_carrier_doppler(arma::mat& true_ch0, arma::vec& true_tow_s, arma::mat& measured_ch0, - std::string data_title); + const std::string& data_title); void check_results_carrier_doppler_double_diff( arma::mat& true_ch0, arma::mat& true_ch1, @@ -249,7 +246,7 @@ public: arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title); + const std::string& data_title); void check_results_code_pseudorange( arma::mat& true_ch0, arma::mat& true_ch1, @@ -257,13 +254,13 @@ public: arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title); + const std::string& data_title); void check_results_duplicated_satellite( arma::mat& measured_sat1, arma::mat& measured_sat2, int ch_id, - std::string data_title); + const std::string& data_title); HybridObservablesTest() { @@ -279,9 +276,7 @@ public: mapStringValues_["2G"] = evGLO_2G; } - ~HybridObservablesTest() - { - } + ~HybridObservablesTest() = default; bool ReadRinexObs(std::vector* obs_vec, Gnss_Synchro gnss); @@ -328,11 +323,13 @@ int HybridObservablesTest::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}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork err"); + { + perror("fork err"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -374,7 +371,7 @@ bool HybridObservablesTest::acquire_signal() std::string System_and_Signal; std::string signal; //create the correspondign acquisition block according to the desired tracking signal - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "1C"; @@ -386,7 +383,7 @@ bool HybridObservablesTest::acquire_signal() //acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { tmp_gnss_synchro.System = 'E'; signal = "1B"; @@ -397,7 +394,7 @@ bool HybridObservablesTest::acquire_signal() config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "2S"; @@ -408,7 +405,7 @@ bool HybridObservablesTest::acquire_signal() config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { tmp_gnss_synchro.System = 'E'; signal = "5X"; @@ -424,7 +421,7 @@ bool HybridObservablesTest::acquire_signal() acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'E'; signal = "5X"; @@ -435,7 +432,7 @@ bool HybridObservablesTest::acquire_signal() config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L5_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "L5"; @@ -496,10 +493,10 @@ bool HybridObservablesTest::acquire_signal() opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; break; case evGAL_1B: - opt_fs = Galileo_E1_OPT_ACQ_FS_HZ; + opt_fs = GALILEO_E1_OPT_ACQ_FS_HZ; break; case evGAL_5X: - opt_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + opt_fs = GALILEO_E5A_OPT_ACQ_FS_HZ; break; case evGLO_1G: opt_fs = baseband_sampling_freq; @@ -641,7 +638,7 @@ bool HybridObservablesTest::acquire_signal() std::cout << "Total signal acquisition run time " << elapsed_seconds.count() << " [seconds]" << std::endl; - if (gnss_synchro_vec.size() > 0) + if (!gnss_synchro_vec.empty()) { return true; } @@ -664,9 +661,13 @@ void HybridObservablesTest::configure_receiver( config = std::make_shared(); config->set_property("Tracking.dump", "true"); if (high_dyn) - config->set_property("Tracking.high_dyn", "true"); + { + config->set_property("Tracking.high_dyn", "true"); + } else - config->set_property("Tracking.high_dyn", "false"); + { + config->set_property("Tracking.high_dyn", "false"); + } config->set_property("Tracking.smoother_length", std::to_string(smoother_length)); config->set_property("Tracking.dump_filename", "./tracking_ch_"); config->set_property("Tracking.implementation", implementation); @@ -684,7 +685,7 @@ void HybridObservablesTest::configure_receiver( config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); std::string System_and_Signal; - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { gnss_synchro_master.System = 'G'; std::string signal = "1C"; @@ -697,7 +698,7 @@ void HybridObservablesTest::configure_receiver( config->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder"); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { gnss_synchro_master.System = 'E'; std::string signal = "1B"; @@ -713,7 +714,7 @@ void HybridObservablesTest::configure_receiver( config->set_property("TelemetryDecoder.implementation", "Galileo_E1B_Telemetry_Decoder"); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { gnss_synchro_master.System = 'G'; std::string signal = "2S"; @@ -726,7 +727,7 @@ void HybridObservablesTest::configure_receiver( config->set_property("TelemetryDecoder.implementation", "GPS_L2C_Telemetry_Decoder"); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0 or implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking" or implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { gnss_synchro_master.System = 'E'; std::string signal = "5X"; @@ -734,7 +735,7 @@ void HybridObservablesTest::configure_receiver( const char* str = signal.c_str(); // get a C style null terminated string std::memcpy(static_cast(gnss_synchro_master.Signal), str, 3); // copy string into synchro char array: 2 char + null - if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { config->supersede_property("Tracking.implementation", std::string("Galileo_E5a_DLL_PLL_Tracking")); } @@ -744,7 +745,7 @@ void HybridObservablesTest::configure_receiver( config->set_property("TelemetryDecoder.implementation", "Galileo_E5a_Telemetry_Decoder"); } - else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L5_DLL_PLL_Tracking") { gnss_synchro_master.System = 'G'; std::string signal = "L5"; @@ -784,7 +785,7 @@ void HybridObservablesTest::check_results_carrier_phase( arma::mat& true_ch0, arma::vec& true_tow_s, arma::mat& measured_ch0, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -865,7 +866,7 @@ void HybridObservablesTest::check_results_carrier_phase_double_diff( arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -956,7 +957,7 @@ void HybridObservablesTest::check_results_carrier_doppler_double_diff( arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -1044,7 +1045,7 @@ void HybridObservablesTest::check_results_carrier_doppler( arma::mat& true_ch0, arma::vec& true_tow_s, arma::mat& measured_ch0, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -1122,7 +1123,7 @@ void HybridObservablesTest::check_results_duplicated_satellite( arma::mat& measured_sat1, arma::mat& measured_sat2, int ch_id, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -1377,8 +1378,8 @@ bool HybridObservablesTest::save_mat_xy(std::vector& x, std::vector(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT5); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x.size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); @@ -1410,7 +1411,7 @@ void HybridObservablesTest::check_results_code_pseudorange( arma::vec& true_tow_ch1_s, arma::mat& measured_ch0, arma::mat& measured_ch1, - std::string data_title) + const std::string& data_title) { //1. True value interpolation to match the measurement times @@ -1534,7 +1535,7 @@ bool HybridObservablesTest::ReadRinexObs(std::vector* obs_vec, Gnss_S gpstk::CommonTime time = r_ref_data.time; double sow(static_cast(time).sow); - gpstk::Rinex3ObsData::DataMap::iterator pointer = r_ref_data.obs.find(prn); + auto pointer = r_ref_data.obs.find(prn); if (pointer == r_ref_data.obs.end()) { // PRN not present; do nothing @@ -1679,19 +1680,19 @@ TEST_F(HybridObservablesTest, ValidationOfResults) FLAGS_high_dyn); - for (unsigned int n = 0; n < gnss_synchro_vec.size(); n++) + for (auto& n : gnss_synchro_vec) { //setup the signal synchronization, simulating an acquisition if (!FLAGS_enable_external_signal_file) { //based on true observables metadata (for custom sdr generator) //open true observables log file written by the simulator or based on provided RINEX obs - std::vector> true_reader_vec; + std::vector> true_reader_vec; //read true data from the generator logs - true_reader_vec.push_back(std::make_shared()); - std::cout << "Loading true observable data for PRN " << gnss_synchro_vec.at(n).PRN << std::endl; + true_reader_vec.push_back(std::make_shared()); + std::cout << "Loading true observable data for PRN " << n.PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); - true_obs_file.append(std::to_string(gnss_synchro_vec.at(n).PRN)); + true_obs_file.append(std::to_string(n.PRN)); true_obs_file.append(".dat"); ASSERT_NO_THROW({ if (true_reader_vec.back()->open_obs_file(true_obs_file) == false) @@ -1713,17 +1714,17 @@ TEST_F(HybridObservablesTest, ValidationOfResults) std::cout << "Initial Doppler [Hz]=" << true_reader_vec.back()->doppler_l1_hz << " Initial code delay [Chips]=" << true_reader_vec.back()->prn_delay_chips << std::endl; - gnss_synchro_vec.at(n).Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD; - gnss_synchro_vec.at(n).Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz; - gnss_synchro_vec.at(n).Acq_samplestamp_samples = 0; + n.Acq_delay_samples = (GPS_L1_CA_CODE_LENGTH_CHIPS - true_reader_vec.back()->prn_delay_chips / GPS_L1_CA_CODE_LENGTH_CHIPS) * baseband_sampling_freq * GPS_L1_CA_CODE_PERIOD; + n.Acq_doppler_hz = true_reader_vec.back()->doppler_l1_hz; + n.Acq_samplestamp_samples = 0; } else { //based on the signal acquisition process - std::cout << "Estimated Initial Doppler " << gnss_synchro_vec.at(n).Acq_doppler_hz - << " [Hz], estimated Initial code delay " << gnss_synchro_vec.at(n).Acq_delay_samples << " [Samples]" - << " Acquisition SampleStamp is " << gnss_synchro_vec.at(n).Acq_samplestamp_samples << std::endl; - gnss_synchro_vec.at(n).Acq_samplestamp_samples = 0; + std::cout << "Estimated Initial Doppler " << n.Acq_doppler_hz + << " [Hz], estimated Initial code delay " << n.Acq_delay_samples << " [Samples]" + << " Acquisition SampleStamp is " << n.Acq_samplestamp_samples << std::endl; + n.Acq_samplestamp_samples = 0; } } @@ -1777,10 +1778,10 @@ TEST_F(HybridObservablesTest, ValidationOfResults) //Observables std::shared_ptr observables(new HybridObservables(config.get(), "Observables", tracking_ch_vec.size() + 1, tracking_ch_vec.size())); - for (unsigned int n = 0; n < tracking_ch_vec.size(); n++) + for (auto& n : tracking_ch_vec) { ASSERT_NO_THROW({ - tracking_ch_vec.at(n)->connect(top_block); + n->connect(top_block); }) << "Failure connecting tracking to the top_block."; } @@ -1817,9 +1818,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults) file_source->seek(2 * FLAGS_skip_samples, 0); //skip head. ibyte, two bytes per complex sample }) << "Failure connecting the blocks."; - for (unsigned int n = 0; n < tracking_ch_vec.size(); n++) + for (auto& n : tracking_ch_vec) { - tracking_ch_vec.at(n)->start_tracking(); + n->start_tracking(); } EXPECT_NO_THROW({ @@ -1836,7 +1837,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if (!FLAGS_enable_external_signal_file) { //load the true values - true_observables_reader true_observables; + True_Observables_Reader true_observables; ASSERT_NO_THROW({ if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) { @@ -1844,7 +1845,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } }) << "Failure opening true observables file"; - unsigned int nepoch = static_cast(true_observables.num_epochs()); + auto nepoch = static_cast(true_observables.num_epochs()); std::cout << "True observation epochs = " << nepoch << std::endl; @@ -1884,7 +1885,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } } //read measured values - observables_dump_reader estimated_observables(tracking_ch_vec.size()); + Observables_Dump_Reader estimated_observables(tracking_ch_vec.size()); ASSERT_NO_THROW({ if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false) { @@ -1892,7 +1893,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } }) << "Failure opening dump observables file"; - unsigned int nepoch = static_cast(estimated_observables.num_epochs()); + auto nepoch = static_cast(estimated_observables.num_epochs()); std::cout << "Measured observations epochs = " << nepoch << std::endl; // Matrices for storing columnwise measured RX_time, TOW, Doppler, Carrier phase and Pseudorange @@ -1923,12 +1924,12 @@ TEST_F(HybridObservablesTest, ValidationOfResults) //Cut measurement tail zeros arma::uvec index; - for (unsigned int n = 0; n < measured_obs_vec.size(); n++) + for (auto& n : measured_obs_vec) { - index = arma::find(measured_obs_vec.at(n).col(0) > 0.0, 1, "last"); - if ((index.size() > 0) and index(0) < (nepoch - 1)) + index = arma::find(n.col(0) > 0.0, 1, "last"); + if ((!index.empty()) and index(0) < (nepoch - 1)) { - measured_obs_vec.at(n).shed_rows(index(0) + 1, nepoch - 1); + n.shed_rows(index(0) + 1, nepoch - 1); } } @@ -1937,7 +1938,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) for (unsigned int n = 0; n < measured_obs_vec.size(); n++) { index = arma::find(measured_obs_vec.at(n).col(0) >= (measured_obs_vec.at(n)(0, 0) + initial_transitory_s), 1, "first"); - if ((index.size() > 0) and (index(0) > 0)) + if ((!index.empty()) and (index(0) > 0)) { measured_obs_vec.at(n).shed_rows(0, index(0)); } @@ -1945,7 +1946,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) if (!FLAGS_duplicated_satellites_test) { index = arma::find(measured_obs_vec.at(n).col(0) >= true_obs_vec.at(n)(0, 0), 1, "first"); - if ((index.size() > 0) and (index(0) > 0)) + if ((!index.empty()) and (index(0) > 0)) { measured_obs_vec.at(n).shed_rows(0, index(0)); } @@ -1963,7 +1964,9 @@ TEST_F(HybridObservablesTest, ValidationOfResults) { prn_pairs.push_back(i); if (ss.peek() == ',') - ss.ignore(); + { + ss.ignore(); + } } if (prn_pairs.size() % 2 != 0) @@ -2037,7 +2040,7 @@ TEST_F(HybridObservablesTest, ValidationOfResults) } arma::vec receiver_time_offset_ref_channel_s; - receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(0) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / GPS_C_m_s; + receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(0) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / GPS_C_M_S; std::cout << "Ref. channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]" << std::endl; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) diff --git a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc index e9de57455..b171502bc 100644 --- a/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/observables/hybrid_observables_test_fpga.cc @@ -707,19 +707,19 @@ bool HybridObservablesTestFpga::acquire_signal() } else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); - nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); + nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); //printf("dddddd code_length = %d nsamples_to_transfer = %d\n", code_length, nsamples_to_transfer); } else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); - nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); + nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GALILEO_E5A_CODE_CHIP_RATE_HZ / GALILEO_E5A_CODE_LENGTH_CHIPS))); } else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); - nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5i_CODE_RATE_HZ / GPS_L5i_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (GPS_L5I_CODE_RATE_HZ / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); + nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5I_CODE_RATE_HZ / GPS_L5I_CODE_LENGTH_CHIPS))); } float nbits = ceilf(log2f((float)code_length*2)); @@ -2124,9 +2124,10 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) //printf("HERE\n"); //based on true observables metadata (for custom sdr generator) //open true observables log file written by the simulator or based on provided RINEX obs - std::vector> true_reader_vec; + //std::vector> true_reader_vec; + std::vector> true_reader_vec; //read true data from the generator logs - true_reader_vec.push_back(std::make_shared()); + true_reader_vec.push_back(std::make_shared()); std::cout << "Loading true observable data for PRN " << gnss_synchro_vec.at(n).PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); true_obs_file.append(std::to_string(gnss_synchro_vec.at(n).PRN)); @@ -2180,19 +2181,19 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); //nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); //printf("sssssss code_length = %d \n", code_length); } else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); //nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); //printf("sssssss code_length = %d \n", code_length); } else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5I_CODE_RATE_HZ / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); //nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); //printf("sssssss code_length = %d \n", code_length); } @@ -2443,7 +2444,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) if (!FLAGS_enable_external_signal_file) { //load the true values - true_observables_reader true_observables; + True_Observables_Reader true_observables; ASSERT_NO_THROW({ if (true_observables.open_obs_file(std::string("./obs_out.bin")) == false) { @@ -2490,7 +2491,7 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) //read measured values - observables_dump_reader estimated_observables(tracking_ch_vec.size()); + Observables_Dump_Reader estimated_observables(tracking_ch_vec.size()); ASSERT_NO_THROW({ if (estimated_observables.open_obs_file(std::string("./observables.dat")) == false) { @@ -2591,7 +2592,8 @@ TEST_F(HybridObservablesTestFpga, ValidationOfResults) } arma::vec receiver_time_offset_ref_channel_s; - receiver_time_offset_ref_channel_s = true_obs_vec.at(min_pr_ch_id).col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0; + //receiver_time_offset_ref_channel_s = true_obs_vec.at(min_pr_ch_id).col(1) / GPS_C_m_s - GPS_STARTOFFSET_ms / 1000.0; + receiver_time_offset_ref_channel_s = (true_obs_vec.at(min_pr_ch_id).col(1)(0) - measured_obs_vec.at(min_pr_ch_id).col(4)(0)) / GPS_C_M_S; std::cout << "Ref channel initial Receiver time offset " << receiver_time_offset_ref_channel_s(0) * 1e3 << " [ms]" << std::endl; for (unsigned int n = 0; n < measured_obs_vec.size(); n++) diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc index 074deea05..89cbfad09 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/nmea_printer_test.cc @@ -42,9 +42,7 @@ protected: { this->conf(); } - ~NmeaPrinterTest() - { - } + ~NmeaPrinterTest() = default; void conf(); rtk_t rtk; }; @@ -157,7 +155,7 @@ void NmeaPrinterTest::conf() TEST_F(NmeaPrinterTest, PrintLine) { std::string filename("nmea_test.nmea"); - std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); + std::shared_ptr pvt_solution = std::make_shared(12, "filename", false, false, rtk); boost::posix_time::ptime pt(boost::gregorian::date(1994, boost::date_time::Nov, 19), boost::posix_time::hours(22) + boost::posix_time::minutes(54) + boost::posix_time::seconds(46)); diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index c4a559448..2f5e819f0 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -58,7 +58,10 @@ TEST(RinexPrinterTest, GalileoObsHeader) } std::string expected_str("E 4 C1B L1B D1B S1B SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } line_aux.clear(); std::shared_ptr rp2; @@ -82,7 +85,10 @@ TEST(RinexPrinterTest, GalileoObsHeader) std::string expected_str2("E 12 C1B L1B D1B S1B C5X L5X D5X S5X C7X L7X D7X S7X SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str2.compare(line_aux)); - if (remove(rp2->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp2->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -113,7 +119,10 @@ TEST(RinexPrinterTest, GlonassObsHeader) } std::string expected_str("R 4 C1C L1C D1C S1C SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } line_aux.clear(); } @@ -158,7 +167,10 @@ TEST(RinexPrinterTest, MixedObsHeader) std::string expected_str2("E 8 C1B L1B D1B S1B C5X L5X D5X S5X SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); EXPECT_EQ(0, expected_str2.compare(line_aux2)); - if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -202,7 +214,10 @@ TEST(RinexPrinterTest, MixedObsHeaderGpsGlo) std::string expected_str2("R 4 C1C L1C D1C S1C SYS / # / OBS TYPES "); EXPECT_EQ(0, expected_str.compare(line_aux)); EXPECT_EQ(0, expected_str2.compare(line_aux2)); - if (remove(rp1->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp1->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -270,7 +285,10 @@ TEST(RinexPrinterTest, GalileoObsLog) std::string expected_str("E22 22000000.000 7 3.724 7 1534.000 7 42.000 "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -338,7 +356,10 @@ TEST(RinexPrinterTest, GlonassObsLog) std::string expected_str("R22 22000000.000 7 3.724 7 1534.000 7 42.000 "); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -419,7 +440,10 @@ TEST(RinexPrinterTest, GpsObsLogDualBand) std::string expected_str("G08 22000002.100 6 7.226 6 321.000 6 39.000 22000000.000 7 3.724 7 1534.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -500,7 +524,10 @@ TEST(RinexPrinterTest, GalileoObsLogDualBand) std::string expected_str("E08 22000002.100 6 7.226 6 321.000 6 39.000 22000000.000 7 3.724 7 1534.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -610,7 +637,10 @@ TEST(RinexPrinterTest, MixedObsLog) std::string expected_str("E16 22000000.000 7 0.127 7 -20.000 7 42.000 22000000.000 6 8.292 6 1534.000 6 41.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } @@ -719,5 +749,8 @@ TEST(RinexPrinterTest, MixedObsLogGpsGlo) std::string expected_str("R16 22000000.000 6 8.292 6 1534.000 6 41.000 22000000.000 7 0.127 7 -20.000 7 42.000"); EXPECT_EQ(0, expected_str.compare(line_aux)); - if (remove(rp->obsfilename.c_str()) != 0) LOG(INFO) << "Error deleting temporary file"; + if (remove(rp->obsfilename.c_str()) != 0) + { + LOG(INFO) << "Error deleting temporary file"; + } } diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc index cd8771880..53028074b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtcm_test.cc @@ -295,7 +295,7 @@ TEST(RtcmTest, MT1020) // Bit distribution per fields dependent on other factors gnav_ephemeris.d_t_b = 8100; // Binary flag representation - gnav_ephemeris.d_P_3 = 1; + gnav_ephemeris.d_P_3 = true; std::string tx_msg = rtcm->print_MT1020(gnav_ephemeris, gnav_utc_model); @@ -336,14 +336,14 @@ TEST(RtcmTest, MT1045) Galileo_Ephemeris gal_eph_read = Galileo_Ephemeris(); gal_eph.i_satellite_PRN = 5; - gal_eph.OMEGA_dot_3 = 53.0 * OMEGA_dot_3_LSB; + gal_eph.OMEGA_dot_3 = 53.0 * OMEGA_DOT_3_LSB; gal_eph.E5a_DVS = true; std::string tx_msg = rtcm->print_MT1045(gal_eph); EXPECT_EQ(0, rtcm->read_MT1045(tx_msg, gal_eph_read)); EXPECT_EQ(expected_true, gal_eph_read.E5a_DVS); - EXPECT_DOUBLE_EQ(53.0 * OMEGA_dot_3_LSB, gal_eph_read.OMEGA_dot_3); + EXPECT_DOUBLE_EQ(53.0 * OMEGA_DOT_3_LSB, gal_eph_read.OMEGA_dot_3); EXPECT_EQ(static_cast(5), gal_eph_read.i_satellite_PRN); EXPECT_EQ(1, rtcm->read_MT1045(rtcm->bin_to_binary_data(rtcm->hex_to_bin("FFFFFFFFFFF")), gal_eph_read)); } @@ -570,7 +570,7 @@ TEST(RtcmTest, MSM1) EXPECT_EQ(ref_id, rtcm->bin_to_uint(MSM1_bin.substr(size_header + size_msg_length + 12, 12))); EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("101101")); // check cell mask - double meters_to_miliseconds = GPS_C_m_s * 0.001; + double meters_to_miliseconds = GPS_C_M_S * 0.001; unsigned int rough_range_1 = static_cast(std::floor(std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; unsigned int rough_range_2 = static_cast(std::floor(std::round(gnss_synchro2.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; unsigned int rough_range_4 = static_cast(std::floor(std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu; diff --git a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc index d4ae24ba8..ce191b01a 100644 --- a/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc @@ -58,11 +58,26 @@ rtk_t configure_rtklib_options() int positioning_mode = -1; std::string default_pos_mode("Single"); std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE; - if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC; - if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA; - if (positioning_mode_str.compare("PPP_Static") == 0) positioning_mode = PMODE_PPP_STATIC; - if (positioning_mode_str.compare("PPP_Kinematic") == 0) positioning_mode = PMODE_PPP_KINEMA; + if (positioning_mode_str == "Single") + { + positioning_mode = PMODE_SINGLE; + } + if (positioning_mode_str == "Static") + { + positioning_mode = PMODE_STATIC; + } + if (positioning_mode_str == "Kinematic") + { + positioning_mode = PMODE_KINEMA; + } + if (positioning_mode_str == "PPP_Static") + { + positioning_mode = PMODE_PPP_STATIC; + } + if (positioning_mode_str == "PPP_Kinematic") + { + positioning_mode = PMODE_PPP_KINEMA; + } if (positioning_mode == -1) { @@ -107,12 +122,30 @@ rtk_t configure_rtklib_options() std::string default_iono_model("OFF"); std::string iono_model_str = configuration->property(role + ".iono_model", default_iono_model); /* (IONOOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ int iono_model = -1; - if (iono_model_str.compare("OFF") == 0) iono_model = IONOOPT_OFF; - if (iono_model_str.compare("Broadcast") == 0) iono_model = IONOOPT_BRDC; - if (iono_model_str.compare("SBAS") == 0) iono_model = IONOOPT_SBAS; - if (iono_model_str.compare("Iono-Free-LC") == 0) iono_model = IONOOPT_IFLC; - if (iono_model_str.compare("Estimate_STEC") == 0) iono_model = IONOOPT_EST; - if (iono_model_str.compare("IONEX") == 0) iono_model = IONOOPT_TEC; + if (iono_model_str == "OFF") + { + iono_model = IONOOPT_OFF; + } + if (iono_model_str == "Broadcast") + { + iono_model = IONOOPT_BRDC; + } + if (iono_model_str == "SBAS") + { + iono_model = IONOOPT_SBAS; + } + if (iono_model_str == "Iono-Free-LC") + { + iono_model = IONOOPT_IFLC; + } + if (iono_model_str == "Estimate_STEC") + { + iono_model = IONOOPT_EST; + } + if (iono_model_str == "IONEX") + { + iono_model = IONOOPT_TEC; + } if (iono_model == -1) { //warn user and set the default @@ -126,11 +159,26 @@ rtk_t configure_rtklib_options() std::string default_trop_model("OFF"); int trop_model = -1; std::string trop_model_str = configuration->property(role + ".trop_model", default_trop_model); /* (TROPOPT_XXX) see src/algorithms/libs/rtklib/rtklib.h */ - if (trop_model_str.compare("OFF") == 0) trop_model = TROPOPT_OFF; - if (trop_model_str.compare("Saastamoinen") == 0) trop_model = TROPOPT_SAAS; - if (trop_model_str.compare("SBAS") == 0) trop_model = TROPOPT_SBAS; - if (trop_model_str.compare("Estimate_ZTD") == 0) trop_model = TROPOPT_EST; - if (trop_model_str.compare("Estimate_ZTD_Grad") == 0) trop_model = TROPOPT_ESTG; + if (trop_model_str == "OFF") + { + trop_model = TROPOPT_OFF; + } + if (trop_model_str == "Saastamoinen") + { + trop_model = TROPOPT_SAAS; + } + if (trop_model_str == "SBAS") + { + trop_model = TROPOPT_SBAS; + } + if (trop_model_str == "Estimate_ZTD") + { + trop_model = TROPOPT_EST; + } + if (trop_model_str == "Estimate_ZTD_Grad") + { + trop_model = TROPOPT_ESTG; + } if (trop_model == -1) { //warn user and set the default @@ -175,11 +223,26 @@ rtk_t configure_rtklib_options() std::string default_gps_ar("Continuous"); std::string integer_ambiguity_resolution_gps_str = configuration->property(role + ".AR_GPS", default_gps_ar); /* Integer Ambiguity Resolution mode for GPS (0:off,1:continuous,2:instantaneous,3:fix and hold,4:ppp-ar) */ int integer_ambiguity_resolution_gps = -1; - if (integer_ambiguity_resolution_gps_str.compare("OFF") == 0) integer_ambiguity_resolution_gps = ARMODE_OFF; - if (integer_ambiguity_resolution_gps_str.compare("Continuous") == 0) integer_ambiguity_resolution_gps = ARMODE_CONT; - if (integer_ambiguity_resolution_gps_str.compare("Instantaneous") == 0) integer_ambiguity_resolution_gps = ARMODE_INST; - if (integer_ambiguity_resolution_gps_str.compare("Fix-and-Hold") == 0) integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; - if (integer_ambiguity_resolution_gps_str.compare("PPP-AR") == 0) integer_ambiguity_resolution_gps = ARMODE_PPPAR; + if (integer_ambiguity_resolution_gps_str == "OFF") + { + integer_ambiguity_resolution_gps = ARMODE_OFF; + } + if (integer_ambiguity_resolution_gps_str == "Continuous") + { + integer_ambiguity_resolution_gps = ARMODE_CONT; + } + if (integer_ambiguity_resolution_gps_str == "Instantaneous") + { + integer_ambiguity_resolution_gps = ARMODE_INST; + } + if (integer_ambiguity_resolution_gps_str == "Fix-and-Hold") + { + integer_ambiguity_resolution_gps = ARMODE_FIXHOLD; + } + if (integer_ambiguity_resolution_gps_str == "PPP-AR") + { + integer_ambiguity_resolution_gps = ARMODE_PPPAR; + } if (integer_ambiguity_resolution_gps == -1) { //warn user and set the default @@ -333,12 +396,12 @@ TEST(RTKLibSolverTest, test1) bool save_to_mat = false; rtk_t rtk = configure_rtklib_options(); - std::unique_ptr d_ls_pvt(new rtklib_solver(nchannels, dump_filename, flag_dump_to_file, save_to_mat, rtk)); + std::unique_ptr d_ls_pvt(new Rtklib_Solver(nchannels, dump_filename, flag_dump_to_file, save_to_mat, rtk)); d_ls_pvt->set_averaging_depth(1); // load ephemeris std::string eph_xml_filename = path + "data/rtklib_test/eph_GPS_L1CA_test1.xml"; - gnss_sdr_supl_client supl_client_ephemeris_; + Gnss_Sdr_Supl_Client supl_client_ephemeris_; std::cout << "SUPL: Try read GPS ephemeris from XML file " << eph_xml_filename << std::endl; if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc index 748811a20..ae2416ec3 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/galileo_fnav_inav_decoder_test.cc @@ -61,7 +61,7 @@ public: } - void deinterleaver(int32_t rows, int32_t cols, double *in, double *out) + void deinterleaver(int32_t rows, int32_t cols, const double *in, double *out) { for (int32_t r = 0; r < rows; r++) { @@ -76,7 +76,7 @@ public: bool decode_INAV_word(double *page_part_symbols, int32_t frame_length) { // 1. De-interleave - double *page_part_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); + auto *page_part_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); deinterleaver(GALILEO_INAV_INTERLEAVER_ROWS, GALILEO_INAV_INTERLEAVER_COLS, page_part_symbols, page_part_symbols_deint); // 2. Viterbi decoder @@ -90,7 +90,7 @@ public: } } - int32_t *page_part_bits = static_cast(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment())); + auto *page_part_bits = static_cast(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment())); const int32_t CodeLength = 240; int32_t DataLength = (CodeLength / nn) - mm; @@ -137,7 +137,7 @@ public: bool decode_FNAV_word(double *page_symbols, int32_t frame_length) { // 1. De-interleave - double *page_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); + auto *page_symbols_deint = static_cast(volk_gnsssdr_malloc(frame_length * sizeof(double), volk_gnsssdr_get_alignment())); deinterleaver(GALILEO_FNAV_INTERLEAVER_ROWS, GALILEO_FNAV_INTERLEAVER_COLS, page_symbols, page_symbols_deint); // 2. Viterbi decoder @@ -150,7 +150,7 @@ public: page_symbols_deint[i] = -page_symbols_deint[i]; } } - int32_t *page_bits = static_cast(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment())); + auto *page_bits = static_cast(volk_gnsssdr_malloc((frame_length / 2) * sizeof(int32_t), volk_gnsssdr_get_alignment())); const int32_t CodeLength = 488; int32_t DataLength = (CodeLength / nn) - mm; @@ -180,10 +180,7 @@ public: std::cout << "Galileo E5a FNAV PAGE CRC correct \n"; return true; } - else - { - return false; - } + return false; } Galileo_FNAV_INAV_test() diff --git a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc index 4f5da024e..be7963164 100644 --- a/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/telemetry_decoder/gps_l1_ca_telemetry_decoder_test.cc @@ -38,6 +38,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -91,7 +92,7 @@ void GpsL1CADllPllTelemetryDecoderTest_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) @@ -108,9 +109,7 @@ GpsL1CADllPllTelemetryDecoderTest_msg_rx::GpsL1CADllPllTelemetryDecoderTest_msg_ rx_message = 0; } -GpsL1CADllPllTelemetryDecoderTest_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_msg_rx() -{ -} +GpsL1CADllPllTelemetryDecoderTest_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_msg_rx() = default; // ########################################################### @@ -144,7 +143,7 @@ void GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::msg_handler_events(pmt::pmt_t { 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) @@ -161,9 +160,7 @@ GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::GpsL1CADllPllTelemetryDecoderTest_ rx_message = 0; } -GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx() -{ -} +GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx::~GpsL1CADllPllTelemetryDecoderTest_tlm_msg_rx() = default; // ########################################################### @@ -199,9 +196,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CATelemetryDecoderTest() - { - } + ~GpsL1CATelemetryDecoderTest() = default; void configure_receiver(); @@ -238,11 +233,13 @@ int GpsL1CATelemetryDecoderTest::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}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork err"); + { + perror("fork err"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -346,7 +343,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) configure_receiver(); //open true observables log file written by the simulator - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); @@ -443,7 +440,7 @@ TEST_F(GpsL1CATelemetryDecoderTest, ValidationOfResults) } //load the measured values - tlm_dump_reader tlm_dump; + Tlm_Dump_Reader tlm_dump; ASSERT_NO_THROW({ if (tlm_dump.open_obs_file(std::string("./telemetry0.dat")) == false) { diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index 68eae1518..b4c5f432c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -45,7 +45,7 @@ DEFINE_int32(cpu_multicorrelator_real_codes_iterations_test, 100, "Number of averaged iterations in CPU multicorrelator test timing test"); DEFINE_int32(cpu_multicorrelator_real_codes_max_threads_test, 12, "Number of maximum concurrent correlators in CPU multicorrelator test timing test"); -void run_correlator_cpu_real_codes(cpu_multicorrelator_real_codes* correlator, +void run_correlator_cpu_real_codes(Cpu_Multicorrelator_Real_Codes* correlator, float d_rem_carrier_phase_rad, float d_carrier_phase_step_rad, float d_code_phase_step_chips, @@ -71,7 +71,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) std::chrono::duration elapsed_seconds(0); int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test; std::vector thread_pool; - cpu_multicorrelator_real_codes* correlator_pool[max_threads]; + Cpu_Multicorrelator_Real_Codes* correlator_pool[max_threads]; unsigned int correlation_sizes[3] = {2048, 4096, 8192}; double execution_times[3]; @@ -118,7 +118,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) for (int n = 0; n < max_threads; n++) { - correlator_pool[n] = new cpu_multicorrelator_real_codes(); + correlator_pool[n] = new Cpu_Multicorrelator_Real_Codes(); correlator_pool[n]->init(d_vector_length, d_n_correlator_taps); correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_cpu); correlator_pool[n]->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc index 706c6fe45..0f133db98 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_test.cc @@ -45,7 +45,7 @@ DEFINE_int32(cpu_multicorrelator_iterations_test, 100, "Number of averaged iterations in CPU multicorrelator test timing test"); DEFINE_int32(cpu_multicorrelator_max_threads_test, 12, "Number of maximum concurrent correlators in CPU multicorrelator test timing test"); -void run_correlator_cpu(cpu_multicorrelator* correlator, +void run_correlator_cpu(Cpu_Multicorrelator* correlator, float d_rem_carrier_phase_rad, float d_carrier_phase_step_rad, float d_code_phase_step_chips, @@ -69,7 +69,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) std::chrono::duration elapsed_seconds(0); int max_threads = FLAGS_cpu_multicorrelator_max_threads_test; std::vector thread_pool; - cpu_multicorrelator* correlator_pool[max_threads]; + Cpu_Multicorrelator* correlator_pool[max_threads]; unsigned int correlation_sizes[3] = {2048, 4096, 8192}; double execution_times[3]; @@ -116,7 +116,7 @@ TEST(CpuMulticorrelatorTest, MeasureExecutionTime) for (int n = 0; n < max_threads; n++) { - correlator_pool[n] = new cpu_multicorrelator(); + correlator_pool[n] = new Cpu_Multicorrelator(); correlator_pool[n]->init(d_vector_length, d_n_correlator_taps); correlator_pool[n]->set_input_output_vectors(d_correlator_outs, in_cpu); correlator_pool[n]->set_local_code_and_taps(static_cast(GPS_L1_CA_CODE_LENGTH_CHIPS), d_ca_code, d_local_code_shift_chips); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc index 29ffe6edd..122184eb7 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/galileo_e5a_tracking_test.cc @@ -65,9 +65,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GalileoE5aTrackingTest() - { - } + ~GalileoE5aTrackingTest() = default; void init(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc index 64c6df3b5..003c63a9d 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_c_aid_tracking_test.cc @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -55,7 +56,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllCAidTrackingTest_msg_rx; -typedef boost::shared_ptr GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr; +using GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr = boost::shared_ptr; GlonassL1CaDllPllCAidTrackingTest_msg_rx_sptr GlonassL1CaDllPllCAidTrackingTest_msg_rx_make(); @@ -80,7 +81,7 @@ void GlonassL1CaDllPllCAidTrackingTest_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) @@ -97,9 +98,7 @@ GlonassL1CaDllPllCAidTrackingTest_msg_rx::GlonassL1CaDllPllCAidTrackingTest_msg_ rx_message = 0; } -GlonassL1CaDllPllCAidTrackingTest_msg_rx::~GlonassL1CaDllPllCAidTrackingTest_msg_rx() -{ -} +GlonassL1CaDllPllCAidTrackingTest_msg_rx::~GlonassL1CaDllPllCAidTrackingTest_msg_rx() = default; // ########################################################### @@ -116,9 +115,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GlonassL1CaDllPllCAidTrackingTest() - { - } + ~GlonassL1CaDllPllCAidTrackingTest() = default; void init(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc index 2bf4f8938..20a910ce4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/glonass_l1_ca_dll_pll_tracking_test.cc @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -56,7 +57,7 @@ // ######## GNURADIO BLOCK MESSAGE RECEVER ######### class GlonassL1CaDllPllTrackingTest_msg_rx; -typedef boost::shared_ptr GlonassL1CaDllPllTrackingTest_msg_rx_sptr; +using GlonassL1CaDllPllTrackingTest_msg_rx_sptr = boost::shared_ptr; GlonassL1CaDllPllTrackingTest_msg_rx_sptr GlonassL1CaDllPllTrackingTest_msg_rx_make(); @@ -81,7 +82,7 @@ void GlonassL1CaDllPllTrackingTest_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) @@ -98,9 +99,7 @@ GlonassL1CaDllPllTrackingTest_msg_rx::GlonassL1CaDllPllTrackingTest_msg_rx() : g rx_message = 0; } -GlonassL1CaDllPllTrackingTest_msg_rx::~GlonassL1CaDllPllTrackingTest_msg_rx() -{ -} +GlonassL1CaDllPllTrackingTest_msg_rx::~GlonassL1CaDllPllTrackingTest_msg_rx() = default; // ########################################################### @@ -117,9 +116,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GlonassL1CaDllPllTrackingTest() - { - } + ~GlonassL1CaDllPllTrackingTest() = default; void init(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc index 58fd52407..982eda0ee 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc @@ -52,6 +52,7 @@ #include #include #include +#include #include #ifdef GR_GREATER_38 #include @@ -89,7 +90,7 @@ void GpsL1CADllPllTrackingTest_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; //3 -> loss of lock //std::cout << "Received trk message: " << rx_message << std::endl; } @@ -109,9 +110,7 @@ GpsL1CADllPllTrackingTest_msg_rx::GpsL1CADllPllTrackingTest_msg_rx() : gr::block } -GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx() -{ -} +GpsL1CADllPllTrackingTest_msg_rx::~GpsL1CADllPllTrackingTest_msg_rx() = default; // ########################################################### @@ -166,9 +165,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CADllPllTrackingTest() - { - } + ~GpsL1CADllPllTrackingTest() = default; void configure_receiver(double PLL_wide_bw_hz, double DLL_wide_bw_hz, @@ -210,11 +207,13 @@ int GpsL1CADllPllTrackingTest::generate_signal() { int child_status; - char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork err"); + { + perror("fork err"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -448,7 +447,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) int test_satellite_PRN = 0; double acq_delay_samples = 0.0; double acq_doppler_hz = 0.0; - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; // CONFIG PARAM SWEEP LOOP @@ -646,7 +645,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) //check results //load the measured values - tracking_dump_reader trk_dump; + Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; @@ -730,7 +729,7 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) double pull_in_offset_s = FLAGS_skip_trk_transitory_s; arma::uvec initial_meas_point = arma::find(trk_timestamp_s >= (true_timestamp_s(0) + pull_in_offset_s), 1, "first"); - if (initial_meas_point.size() > 0 and tracking_last_msg != 3) + if (!initial_meas_point.empty() and tracking_last_msg != 3) { trk_timestamp_s = trk_timestamp_s.subvec(initial_meas_point(0), trk_timestamp_s.size() - 1); trk_acc_carrier_phase_cycles = trk_acc_carrier_phase_cycles.subvec(initial_meas_point(0), trk_acc_carrier_phase_cycles.size() - 1); @@ -750,9 +749,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) rmse_doppler.push_back(rmse); code_phase_error_chips = check_results_codephase(true_timestamp_s, true_prn_delay_chips, trk_timestamp_s, trk_prn_delay_chips, mean_error, std_dev_error, rmse); - for (unsigned int ii = 0; ii < code_phase_error_chips.size(); ii++) + for (double code_phase_error_chip : code_phase_error_chips) { - code_phase_error_meters.push_back(GPS_L1_CA_CHIP_PERIOD * code_phase_error_chips.at(ii) * GPS_C_m_s); + code_phase_error_meters.push_back(GPS_L1_CA_CHIP_PERIOD * code_phase_error_chip * GPS_C_M_S); } mean_code_phase_error.push_back(mean_error); std_dev_code_phase_error.push_back(std_dev_error); @@ -821,9 +820,9 @@ TEST_F(GpsL1CADllPllTrackingTest, ValidationOfResults) { 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); - unsigned int decimate = static_cast(FLAGS_plot_decimate); + auto decimate = static_cast(FLAGS_plot_decimate); if (FLAGS_plot_detail_level >= 2) { @@ -1165,8 +1164,8 @@ bool GpsL1CADllPllTrackingTest::save_mat_xy(std::vector& x, std::vector< matvar_t* matvar; filename.erase(filename.length() - 4, 4); filename.append(".mat"); - matfp = Mat_CreateVer(filename.c_str(), NULL, MAT_FT_MAT73); - if (reinterpret_cast(matfp) != NULL) + matfp = Mat_CreateVer(filename.c_str(), nullptr, MAT_FT_MAT73); + if (reinterpret_cast(matfp) != nullptr) { size_t dims[2] = {1, x.size()}; matvar = Mat_VarCreate("x", MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, &x[0], 0); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc index fc7b028fe..78303a1cf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test_fpga.cc @@ -143,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, std::move(top_block)); + send_tracking_gps_input_samples(rx_signal_file, file_length, top_block); fclose(rx_signal_file); } @@ -453,7 +453,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) configure_receiver(); //open true observables log file written by the simulator - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); @@ -566,7 +566,7 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga) } //load the measured values - tracking_dump_reader trk_dump; + Tracking_Dump_Reader trk_dump; ASSERT_NO_THROW( { if (trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")) == false) diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc index 96c84302f..f1046a12b 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc @@ -51,6 +51,7 @@ #include #include #include +#include #include #ifdef GR_GREATER_38 #include @@ -91,7 +92,7 @@ void GpsL1CAKfTrackingTest_msg_rx::msg_handler_events(pmt::pmt_t msg) { try { - long int message = pmt::to_long(msg); + long int message = pmt::to_long(std::move(msg)); rx_message = message; } catch (boost::bad_any_cast& e) @@ -110,9 +111,7 @@ GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1C } -GpsL1CAKfTrackingTest_msg_rx::~GpsL1CAKfTrackingTest_msg_rx() -{ -} +GpsL1CAKfTrackingTest_msg_rx::~GpsL1CAKfTrackingTest_msg_rx() = default; // ########################################################### @@ -157,9 +156,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CAKfTrackingTest() - { - } + ~GpsL1CAKfTrackingTest() = default; void configure_receiver(); @@ -196,11 +193,13 @@ int GpsL1CAKfTrackingTest::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}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork err"); + { + perror("fork err"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -376,7 +375,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) configure_receiver(); // open true observables log file written by the simulator - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; int test_satellite_PRN = FLAGS_test_satellite_PRN; std::cout << "Testing satellite PRN=" << test_satellite_PRN << std::endl; std::string true_obs_file = std::string("./gps_l1_ca_obs_prn"); @@ -460,7 +459,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) } //load the measured values - tracking_dump_reader trk_dump; + Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; @@ -528,7 +527,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) { 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); std::vector timevec; @@ -544,7 +543,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) g1.set_xlabel("Time [s]"); g1.set_ylabel("Correlators' output"); g1.cmd("set key box opaque"); - unsigned int decimate = static_cast(FLAGS_plot_decimate); + auto decimate = static_cast(FLAGS_plot_decimate); g1.plot_xy(timevec, prompt, "Prompt", decimate); g1.plot_xy(timevec, early, "Early", decimate); g1.plot_xy(timevec, late, "Late", decimate); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc index d56f2f3ab..3b6b325a4 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef GR_GREATER_38 #include #else @@ -83,7 +84,7 @@ void GpsL2MDllPllTrackingTest_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) @@ -102,9 +103,7 @@ GpsL2MDllPllTrackingTest_msg_rx::GpsL2MDllPllTrackingTest_msg_rx() : gr::block(" } -GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx() -{ -} +GpsL2MDllPllTrackingTest_msg_rx::~GpsL2MDllPllTrackingTest_msg_rx() = default; // ########################################################### @@ -120,9 +119,7 @@ protected: gnss_synchro = Gnss_Synchro(); } - ~GpsL2MDllPllTrackingTest() - { - } + ~GpsL2MDllPllTrackingTest() = default; void init(); diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc index 2d9861d6f..306ad74fd 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc @@ -67,6 +67,7 @@ #include #include #include +#include #include #ifdef GR_GREATER_38 #include @@ -105,7 +106,7 @@ void TrackingPullInTest_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; //3 -> loss of lock //std::cout << "Received trk message: " << rx_message << std::endl; } @@ -125,9 +126,7 @@ TrackingPullInTest_msg_rx::TrackingPullInTest_msg_rx() : gr::block("TrackingPull } -TrackingPullInTest_msg_rx::~TrackingPullInTest_msg_rx() -{ -} +TrackingPullInTest_msg_rx::~TrackingPullInTest_msg_rx() = default; // ########################################################### @@ -202,9 +201,7 @@ public: mapStringValues_["2G"] = evGLO_2G; } - ~TrackingPullInTest() - { - } + ~TrackingPullInTest() = default; void configure_receiver(double PLL_wide_bw_hz, double DLL_wide_bw_hz, @@ -249,11 +246,13 @@ int TrackingPullInTest::generate_signal() { int child_status; - char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], NULL}; + char* const parmList[] = {&generator_binary[0], &generator_binary[0], &p1[0], &p2[0], &p3[0], &p4[0], &p5[0], &p6[0], nullptr}; int pid; if ((pid = fork()) == -1) - perror("fork err"); + { + perror("fork err"); + } else if (pid == 0) { execv(&generator_binary[0], parmList); @@ -290,7 +289,7 @@ void TrackingPullInTest::configure_receiver( config->set_property("GNSS-SDR.internal_fs_sps", std::to_string(baseband_sampling_freq)); std::string System_and_Signal; - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { gnss_synchro.System = 'G'; std::string signal = "1C"; @@ -299,7 +298,7 @@ void TrackingPullInTest::configure_receiver( config->set_property("Tracking.early_late_space_chips", "0.5"); config->set_property("Tracking.early_late_space_narrow_chips", "0.5"); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { gnss_synchro.System = 'E'; std::string signal = "1B"; @@ -311,7 +310,7 @@ void TrackingPullInTest::configure_receiver( config->set_property("Tracking.very_early_late_space_narrow_chips", "0.6"); config->set_property("Tracking.track_pilot", "true"); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { gnss_synchro.System = 'G'; std::string signal = "2S"; @@ -320,13 +319,13 @@ void TrackingPullInTest::configure_receiver( config->set_property("Tracking.early_late_space_chips", "0.5"); config->set_property("Tracking.track_pilot", "true"); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0 or implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking" or implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { gnss_synchro.System = 'E'; std::string signal = "5X"; System_and_Signal = "Galileo E5a"; signal.copy(gnss_synchro.Signal, 2, 0); - if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { config->supersede_property("Tracking.implementation", std::string("Galileo_E5a_DLL_PLL_Tracking")); } @@ -334,7 +333,7 @@ void TrackingPullInTest::configure_receiver( config->set_property("Tracking.track_pilot", "true"); config->set_property("Tracking.order", "2"); } - else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L5_DLL_PLL_Tracking") { gnss_synchro.System = 'G'; std::string signal = "L5"; @@ -394,7 +393,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) std::string System_and_Signal; std::string signal; //create the correspondign acquisition block according to the desired tracking signal - if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0) + if (implementation == "GPS_L1_CA_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "1C"; @@ -406,7 +405,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) //acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + else if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { tmp_gnss_synchro.System = 'E'; signal = "1B"; @@ -417,7 +416,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L2_M_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L2_M_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "2S"; @@ -428,7 +427,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_b") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking_b") { tmp_gnss_synchro.System = 'E'; signal = "5X"; @@ -444,7 +443,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking") == 0) + else if (implementation == "Galileo_E5a_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'E'; signal = "5X"; @@ -455,7 +454,7 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) config->set_property("Acquisition.max_dwells", std::to_string(FLAGS_external_signal_acquisition_dwells)); acquisition = std::make_shared(config.get(), "Acquisition", 1, 0); } - else if (implementation.compare("GPS_L5_DLL_PLL_Tracking") == 0) + else if (implementation == "GPS_L5_DLL_PLL_Tracking") { tmp_gnss_synchro.System = 'G'; signal = "L5"; @@ -515,10 +514,10 @@ bool TrackingPullInTest::acquire_signal(int SV_ID) opt_fs = GPS_L1_CA_OPT_ACQ_FS_HZ; break; case evGAL_1B: - opt_fs = Galileo_E1_OPT_ACQ_FS_HZ; + opt_fs = GALILEO_E1_OPT_ACQ_FS_HZ; break; case evGAL_5X: - opt_fs = Galileo_E5a_OPT_ACQ_FS_HZ; + opt_fs = GALILEO_E5A_OPT_ACQ_FS_HZ; break; case evGLO_1G: opt_fs = baseband_sampling_freq; @@ -717,7 +716,10 @@ TEST_F(TrackingPullInTest, ValidationOfResults) ASSERT_EQ(acquire_signal(FLAGS_test_satellite_PRN), true); bool found_satellite = doppler_measurements_map.find(FLAGS_test_satellite_PRN) != doppler_measurements_map.end(); EXPECT_TRUE(found_satellite) << "Error: satellite SV: " << FLAGS_test_satellite_PRN << " is not acquired"; - if (!found_satellite) return; + if (!found_satellite) + { + return; + } } else { @@ -748,7 +750,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) double true_acq_delay_samples = 0.0; uint64_t acq_samplestamp_samples = 0; - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; if (!FLAGS_enable_external_signal_file) { test_satellite_PRN = FLAGS_test_satellite_PRN; @@ -781,9 +783,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults) // create the msg queue for valve queue = gr::msg_queue::make(0); - boost::shared_ptr reseteable_valve; + boost::shared_ptr reseteable_valve; long long int acq_to_trk_delay_samples = ceil(static_cast(FLAGS_fs_gen_sps) * FLAGS_acq_to_trk_delay_s); - boost::shared_ptr resetable_valve_(new gnss_sdr_valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false)); + boost::shared_ptr resetable_valve_(new Gnss_Sdr_Valve(sizeof(gr_complex), acq_to_trk_delay_samples, queue, false)); std::shared_ptr control_message_factory_; std::shared_ptr>> control_messages_; @@ -870,7 +872,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) std::cout << " Waiting for valve...\n"; //wait the valve message indicating the circulation of the amount of samples of the delay gr::message::sptr queue_message = queue->delete_head(); - if (queue_message != 0) + if (queue_message != nullptr) { control_messages_ = control_message_factory_->GetControlMessages(queue_message); } @@ -908,7 +910,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots) { //load the measured values - tracking_dump_reader trk_dump; + Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; @@ -965,9 +967,9 @@ TEST_F(TrackingPullInTest, ValidationOfResults) { 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); - unsigned int decimate = static_cast(FLAGS_plot_decimate); + auto decimate = static_cast(FLAGS_plot_decimate); if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots) { @@ -989,7 +991,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) g1.plot_xy(trk_timestamp_s, prompt, "Prompt", decimate); g1.plot_xy(trk_timestamp_s, early, "Early", decimate); g1.plot_xy(trk_timestamp_s, late, "Late", decimate); - if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0) + if (implementation == "Galileo_E1_DLL_PLL_VEML_Tracking") { g1.plot_xy(trk_timestamp_s, v_early, "Very Early", decimate); g1.plot_xy(trk_timestamp_s, v_late, "Very Late", decimate); @@ -1099,7 +1101,7 @@ TEST_F(TrackingPullInTest, ValidationOfResults) { g4.disablescreen(); } - g4.cmd("set palette defined ( 0 \"black\", 1 \"green\" )"); + g4.cmd(R"(set palette defined ( 0 "black", 1 "green" ))"); g4.cmd("set key off"); g4.cmd("set view map"); std::string title; diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc index 9c0a88c38..0ac450cbf 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test_fpga.cc @@ -31,9 +31,15 @@ */ #include "GPS_L1_CA.h" -#include "Galileo_E1.h" -#include "Galileo_E5a.h" -#include "GPS_L5.h" +//<<<<<<< HEAD +//#include "Galileo_E1.h" +//#include "Galileo_E5a.h" +//#include "GPS_L5.h" +//======= +#include "acquisition_msg_rx.h" +#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" +#include "galileo_e5a_pcps_acquisition.h" +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 #include "gnss_block_factory.h" #include "tracking_interface.h" #include "gps_l1_ca_pcps_acquisition_fpga.h" @@ -91,6 +97,7 @@ bool skip_samples_already_used = 0; // if skip_samples_already_used = 1 => for e // (exactly in the same way as the SW) bool doppler_loop_control_in_sw = 0; +//<<<<<<< HEAD // ######## GNURADIO ACQUISITION BLOCK MESSAGE RECEVER ######### @@ -141,6 +148,8 @@ Acquisition_msg_rx_Fpga::Acquisition_msg_rx_Fpga() : gr::block("Acquisition_msg_ } Acquisition_msg_rx_Fpga::~Acquisition_msg_rx_Fpga() {} +//======= +//>>>>>>> 4fe976ba016fa9c1c64ece88b26a9a93d93a84f4 // ######## GNURADIO TRACKING BLOCK MESSAGE RECEVER ######### class TrackingPullInTestFpga_msg_rx; @@ -743,17 +752,17 @@ bool TrackingPullInTestFpga::acquire_signal(int SV_ID) } else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); - nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq_acquisition) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); + nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); } else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); } else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5I_CODE_RATE_HZ / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); nsamples_to_transfer = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS))); } @@ -1369,7 +1378,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) double true_acq_delay_samples = 0.0; uint64_t acq_samplestamp_samples = 0; - tracking_true_obs_reader true_obs_data; + Tracking_True_Obs_Reader true_obs_data; if (!FLAGS_enable_external_signal_file) { test_satellite_PRN = FLAGS_test_satellite_PRN; @@ -1409,16 +1418,16 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) } else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GALILEO_E1_CODE_CHIP_RATE_HZ / GALILEO_E1_B_CODE_LENGTH_CHIPS))); } else if (implementation.compare("Galileo_E5a_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / Galileo_E5a_CODE_CHIP_RATE_HZ * static_cast(Galileo_E5a_CODE_LENGTH_CHIPS))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / GALILEO_E5A_CODE_CHIP_RATE_HZ * static_cast(GALILEO_E5A_CODE_LENGTH_CHIPS))); } else if (implementation.compare("GPS_L5_DLL_PLL_Tracking_Fpga") == 0) { - code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5i_CODE_RATE_HZ / static_cast(GPS_L5i_CODE_LENGTH_CHIPS)))); + code_length = static_cast(std::round(static_cast(baseband_sampling_freq) / (GPS_L5I_CODE_RATE_HZ / static_cast(GPS_L5I_CODE_LENGTH_CHIPS)))); } float nbits = ceilf(log2f((float)code_length)); @@ -1565,7 +1574,7 @@ TEST_F(TrackingPullInTestFpga, ValidationOfResults) if (FLAGS_plot_detail_level >= 2 and FLAGS_show_plots) { //load the measured values - tracking_dump_reader trk_dump; + Tracking_Dump_Reader trk_dump; ASSERT_EQ(trk_dump.open_obs_file(std::string("./tracking_ch_0.dat")), true) << "Failure opening tracking dump file"; diff --git a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc index 3b91be0e6..0f570fe2a 100644 --- a/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc +++ b/src/tests/unit-tests/system-parameters/glonass_gnav_nav_message_test.cc @@ -126,7 +126,7 @@ TEST(GlonassGnavNavigationMessageTest, String2Decoder) // Fill out ephemeris values for truth gnav_ephemeris.d_B_n = 0; - gnav_ephemeris.d_P_2 = 1; + gnav_ephemeris.d_P_2 = true; gnav_ephemeris.d_t_b = 8100; gnav_ephemeris.d_VYn = -2.69022750854492; gnav_ephemeris.d_AYn = 0; @@ -162,10 +162,10 @@ TEST(GlonassGnavNavigationMessageTest, String3Decoder) Glonass_Gnav_Ephemeris gnav_ephemeris; // Fill out ephemeris values for truth - gnav_ephemeris.d_P_3 = 1; + gnav_ephemeris.d_P_3 = true; gnav_ephemeris.d_gamma_n = 1.81898940354586e-12; gnav_ephemeris.d_P = 3; - gnav_ephemeris.d_l3rd_n = 0; + gnav_ephemeris.d_l3rd_n = false; gnav_ephemeris.d_VZn = -1.82016849517822; gnav_ephemeris.d_AZn = -2.79396772384644e-09; gnav_ephemeris.d_Zn = 19929.2377929688; @@ -203,7 +203,7 @@ TEST(GlonassGnavNavigationMessageTest, String4Decoder) gnav_ephemeris.d_tau_n = -8.30907374620438e-05; gnav_ephemeris.d_Delta_tau_n = 9.31322574615479e-10; gnav_ephemeris.d_E_n = 0; - gnav_ephemeris.d_P_4 = 0; + gnav_ephemeris.d_P_4 = false; gnav_ephemeris.d_F_T = 6; gnav_ephemeris.d_N_T = 268; gnav_ephemeris.d_n = 21; diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 16dfa40be..a8d0e244e 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -17,85 +17,76 @@ # -if(OPENSSL_FOUND) - add_definitions(-DUSE_OPENSSL_FALLBACK=1) -endif() - set(FRONT_END_CAL_SOURCES front_end_cal.cc) set(FRONT_END_CAL_HEADERS front_end_cal.h) -include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/libs - ${CMAKE_SOURCE_DIR}/src/core/libs/supl - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp - ${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks - ${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs - ${CMAKE_SOURCE_DIR}/src/algorithms/libs - ${GLOG_INCLUDE_DIRS} - ${GFlags_INCLUDE_DIRS} - ${GNURADIO_RUNTIME_INCLUDE_DIRS} - ${GNURADIO_BLOCKS_INCLUDE_DIRS} - ${ARMADILLO_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${PUGIXML_INCLUDE_DIR} - ${VOLK_GNSSSDR_INCLUDE_DIRS} -) - add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS}) source_group(Headers FILES ${FRONT_END_CAL_HEADERS}) target_link_libraries(front_end_cal_lib - ${MAC_LIBRARIES} - ${THREAD_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_sdr_flags - gnss_rx - channel_fsm + PUBLIC + Armadillo::armadillo + Threads::Threads + Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} + signal_source_adapters + signal_source_gr_blocks + signal_source_libs + acquisition_adapters + gnss_sdr_flags + channel_libs + algorithms_libs + core_receiver + core_libs + PRIVATE + Boost::boost + Gflags::gflags + Glog::glog + Gnuradio::blocks + Gnuradio::runtime ) -add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE}) - -add_definitions(-DGNSS_SDR_VERSION="${VERSION}") -add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}") +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(front_end_cal_lib + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) +target_link_libraries(front-end-cal + PUBLIC + Volkgnsssdr::volkgnsssdr ${ORC_LIBRARIES} + core_libs + core_receiver + front_end_cal_lib + gnss_sdr_flags + PRIVATE + Boost::filesystem + Gflags::gflags + Glog::glog +) + +target_compile_definitions(front-end-cal + PUBLIC -DGNSS_SDR_VERSION="${VERSION}" + PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +if(ENABLE_CLANG_TIDY) + if(CLANG_TIDY_EXE) + set_target_properties(front-end-cal + PROPERTIES + CXX_CLANG_TIDY "${DO_CLANG_TIDY}" + ) + endif() +endif() + add_custom_command(TARGET front-end-cal POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}/install/$) -target_link_libraries(front-end-cal - ${MAC_LIBRARIES} - ${Boost_LIBRARIES} - ${GNURADIO_RUNTIME_LIBRARIES} - ${GNURADIO_BLOCKS_LIBRARIES} - ${GNURADIO_FFT_LIBRARIES} - ${GNURADIO_FILTER_LIBRARIES} - ${GFlags_LIBS} - ${GLOG_LIBRARIES} - ${ARMADILLO_LIBRARIES} - ${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES} - ${GNSS_SDR_OPTIONAL_LIBS} - rx_core_lib - gnss_rx - front_end_cal_lib -) - install(TARGETS front-end-cal RUNTIME DESTINATION bin COMPONENT "front-end-cal" diff --git a/src/utils/front-end-cal/front_end_cal.cc b/src/utils/front-end-cal/front_end_cal.cc index 9fd80f772..58e38e067 100644 --- a/src/utils/front-end-cal/front_end_cal.cc +++ b/src/utils/front-end-cal/front_end_cal.cc @@ -38,21 +38,18 @@ #include "gps_iono.h" #include "gps_navigation_message.h" #include "gps_utc_model.h" -#include #include -#include -#include #include #include #include #include #include -extern concurrent_map global_gps_ephemeris_map; -extern concurrent_map global_gps_iono_map; -extern concurrent_map global_gps_utc_model_map; -extern concurrent_map global_gps_almanac_map; -extern concurrent_map global_gps_acq_assist_map; +extern Concurrent_Map global_gps_ephemeris_map; +extern Concurrent_Map global_gps_iono_map; +extern Concurrent_Map global_gps_utc_model_map; +extern Concurrent_Map global_gps_almanac_map; +extern Concurrent_Map global_gps_acq_assist_map; FrontEndCal::FrontEndCal() = default; @@ -60,7 +57,7 @@ FrontEndCal::~FrontEndCal() = default; bool FrontEndCal::read_assistance_from_XML() { - gnss_sdr_supl_client supl_client_ephemeris_; + Gnss_Sdr_Supl_Client supl_client_ephemeris_; std::string eph_xml_filename = "gps_ephemeris.xml"; std::cout << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename << std::endl; LOG(INFO) << "SUPL: Trying to read GPS ephemeris from XML file " << eph_xml_filename; @@ -87,8 +84,8 @@ bool FrontEndCal::read_assistance_from_XML() int FrontEndCal::Get_SUPL_Assist() { //######### GNSS Assistance ################################# - gnss_sdr_supl_client supl_client_acquisition_; - gnss_sdr_supl_client supl_client_ephemeris_; + Gnss_Sdr_Supl_Client supl_client_acquisition_; + Gnss_Sdr_Supl_Client supl_client_ephemeris_; int supl_mcc; // Current network MCC (Mobile country code), 3 digits. int supl_mns; //Current network MNC (Mobile Network code), 2 or 3 digits. int supl_lac; // Current network LAC (Location area code),16 bits, 1-65520 are valid values. @@ -358,7 +355,7 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub //Doppler estimation arma::vec Doppler_Hz; - Doppler_Hz = (obs_to_sat_velocity / GPS_C_m_s) * GPS_L1_FREQ_HZ; + Doppler_Hz = (obs_to_sat_velocity / GPS_C_M_S) * GPS_L1_FREQ_HZ; double mean_Doppler_Hz; mean_Doppler_Hz = arma::mean(Doppler_Hz); return mean_Doppler_Hz; diff --git a/src/utils/front-end-cal/main.cc b/src/utils/front-end-cal/main.cc index b1680d51f..6d9380cb4 100644 --- a/src/utils/front-end-cal/main.cc +++ b/src/utils/front-end-cal/main.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -73,6 +72,7 @@ #include #include #include +#include #include #include @@ -81,14 +81,14 @@ using google::LogMessage; DECLARE_string(log_dir); -concurrent_map global_gps_ephemeris_map; -concurrent_map global_gps_iono_map; -concurrent_map global_gps_utc_model_map; -concurrent_map global_gps_almanac_map; -concurrent_map global_gps_acq_assist_map; +Concurrent_Map global_gps_ephemeris_map; +Concurrent_Map global_gps_iono_map; +Concurrent_Map global_gps_utc_model_map; +Concurrent_Map global_gps_almanac_map; +Concurrent_Map global_gps_acq_assist_map; bool stop; -concurrent_queue channel_internal_queue; +Concurrent_Queue channel_internal_queue; GpsL1CaPcpsAcquisitionFineDoppler* acquisition; Gnss_Synchro* gnss_synchro; std::vector gnss_sync_vector; @@ -398,7 +398,7 @@ int main(int argc, char** argv) std::map doppler_measurements_map; std::map cn0_measurements_map; - boost::thread ch_thread; + std::thread ch_thread; // record startup time std::chrono::time_point start, end; @@ -417,9 +417,9 @@ int main(int argc, char** argv) stop = false; try { - ch_thread = boost::thread(wait_message); + ch_thread = std::thread(wait_message); } - catch (const boost::thread_resource_error& e) + catch (const std::exception& e) { LOG(INFO) << "Exception caught (thread resource error)"; } @@ -457,7 +457,7 @@ int main(int argc, char** argv) { ch_thread.join(); } - catch (const boost::thread_resource_error& e) + catch (const std::exception& e) { LOG(INFO) << "Exception caught while joining threads."; } diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 344c0694b..d42b379b5 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors) +# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors) # # This file is part of GNSS-SDR. # @@ -19,14 +19,34 @@ find_package(GPSTK QUIET) if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) include(GNUInstallDirs) - string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) - set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) + #string(REGEX REPLACE /[^/]*$ "" LIBDIR ${CMAKE_INSTALL_LIBDIR}) + set(GPSTK_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_SHARED_LIBRARY_SUFFIX}) set(GPSTK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}/install/include) endif() -set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${GPSTK_INCLUDE_DIR}/gpstk) find_package(Boost COMPONENTS iostreams serialization QUIET) +if(CMAKE_VERSION VERSION_LESS 3.5) + if(NOT TARGET Boost::iostreams) + add_library(Boost::iostreams IMPORTED SHARED) + set_property(TARGET Boost::iostreams PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::iostreams PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_IOSTREAMS_LIBRARIES}) + set_property(TARGET Boost::iostreams PROPERTY + IMPORTED_LOCATION ${Boost_IOSTREAMS_LIBRARIES}) + endif() + if(NOT TARGET Boost::serialization) + add_library(Boost::serialization IMPORTED SHARED) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR}) + set_property(TARGET Boost::serialization PROPERTY + INTERFACE_LINK_LIBRARIES ${Boost_SERIALIZARION_LIBRARIES}) + set_property(TARGET Boost::serialization PROPERTY + IMPORTED_LOCATION ${Boost_SERIALIZARION_LIBRARIES}) + endif() +endif() + find_program(UNCOMPRESS_EXECUTABLE uncompress PATHS /bin @@ -34,33 +54,34 @@ find_program(UNCOMPRESS_EXECUTABLE uncompress /usr/sbin ) -if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) - add_definitions(-DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") -else() - add_definitions(-DUNCOMPRESS_EXECUTABLE="") -endif() - if(Boost_FOUND) - include_directories( - ${CMAKE_SOURCE_DIR}/src/core/system_parameters - ${GFlags_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} - ${GPSTK_INCLUDE_DIR}/gpstk - ${GPSTK_INCLUDE_DIR} - ) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") add_executable(rinex2assist ${CMAKE_CURRENT_SOURCE_DIR}/main.cc) target_link_libraries(rinex2assist - ${Boost_LIBRARIES} - ${GPSTK_LIBRARY} - ${GFlags_LIBS} - gnss_sp_libs - gnss_rx + PUBLIC + Boost::iostreams + Boost::serialization + ${GPSTK_LIBRARY} + Gflags::gflags + algorithms_libs + core_receiver + core_system_parameters ) + target_include_directories(rinex2assist + PUBLIC + ${GPSTK_INCLUDE_DIR}/gpstk + ${GPSTK_INCLUDE_DIR} + ) + + if(NOT UNCOMPRESS_EXECUTABLE-NOTFOUND) + target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="${UNCOMPRESS_EXECUTABLE}") + else() + target_compile_definitions(rinex2assist PUBLIC -DUNCOMPRESS_EXECUTABLE="") + endif() + if(NOT GPSTK_FOUND OR ENABLE_OWN_GPSTK) add_dependencies(rinex2assist gpstk-${GNSSSDR_GPSTK_LOCAL_VERSION}) endif() @@ -76,5 +97,5 @@ if(Boost_FOUND) ) else() message(STATUS "Boost Iostreams library not found.") - message(STATUS "rinex2assist will not be built.") + message(STATUS " rinex2assist will not be built.") endif()