From a1f96194696494b756d691ff54e384a1ce478fc2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 5 Mar 2020 12:08:56 -0800 Subject: uhd: cal: Use usrp::cal::database instead of CSV files Now that we have cal::iq_cal and cal::database, there's no need to manually wrangle CSV files for calibration data. This commit replaces all CSV operations with cal::database calls and uses cal::iq_cal as a container. CSV files can still be read, but are considered deprecated. --- host/lib/utils/paths.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'host/lib/utils/paths.cpp') diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp index ccf52f257..3ecd5fe38 100644 --- a/host/lib/utils/paths.cpp +++ b/host/lib/utils/paths.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -189,6 +190,31 @@ std::string uhd::get_app_path(void) return uhd::get_tmp_path(); } +// Only used for deprecated CSV file loader. Delete this once CSV support is +// removed. +std::string uhd::get_appdata_path(void) +{ + const std::string uhdcalib_path = get_env_var("UHD_CONFIG_DIR"); + if (not uhdcalib_path.empty()) { + UHD_LOG_WARNING("UHD", + "The environment variable UHD_CONFIG_DIR is deprecated. Refer to " + "https://files.ettus.com/manual/page_calibration.html for how to store " + "calibration data."); + return uhdcalib_path; + } + + const std::string appdata_path = get_env_var("APPDATA"); + if (not appdata_path.empty()) + return appdata_path; + + const std::string home_path = get_env_var("HOME"); + if (not home_path.empty()) + return home_path; + + return uhd::get_tmp_path(); +} + + #if BOOST_VERSION >= 106100 std::string uhd::get_pkg_path(void) { -- cgit v1.2.3