USRP Hardware Driver and Device Manual Version: 4.11.0.0-0-unknown
UHD and USRP Manual
Loading...
Searching...
No Matches
database.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
10#include <cstdint>
11#include <functional>
12#include <string>
13#include <vector>
14
15namespace uhd { namespace usrp { namespace cal {
16
23enum class source {
24 NONE,
30};
31
68{
69public:
87 static std::vector<uint8_t> read_cal_data(const std::string& key,
88 const std::string& serial,
89 const source source_type = source::ANY);
90
109 static bool has_cal_data(const std::string& key,
110 const std::string& serial,
111 const source source_type = source::ANY);
112
132 static void write_cal_data(const std::string& key,
133 const std::string& serial,
134 const std::vector<uint8_t>& cal_data,
135 const std::string& backup_ext = "");
136
138 using has_data_fn_type = std::function<bool(const std::string&, const std::string&)>;
139
147 std::function<std::vector<uint8_t>(const std::string&, const std::string&)>;
148
158 get_data_fn_type get_cal_data,
159 const source source_type = source::FLASH);
160};
161
162
163}}} // namespace uhd::usrp::cal
Definition database.hpp:68
static void register_lookup(has_data_fn_type has_cal_data, get_data_fn_type get_cal_data, const source source_type=source::FLASH)
Register a lookup function for cal data.
static bool has_cal_data(const std::string &key, const std::string &serial, const source source_type=source::ANY)
Check if calibration data exists for a given source type.
static std::vector< uint8_t > read_cal_data(const std::string &key, const std::string &serial, const source source_type=source::ANY)
Return a calibration data set as a serialized string.
std::function< bool(const std::string &, const std::string &)> has_data_fn_type
Function type to look up if there is cal data given a key and serial.
Definition database.hpp:138
std::function< std::vector< uint8_t >(const std::string &, const std::string &)> get_data_fn_type
Function type to return serialized cal data key and serial.
Definition database.hpp:146
static void write_cal_data(const std::string &key, const std::string &serial, const std::vector< uint8_t > &cal_data, const std::string &backup_ext="")
Store calibration data to the local filesystem database.
#define UHD_API
Definition config.h:87
Definition cal_utils.hpp:11
source
Identify the source of calibration data, i.e., where was it stored.
Definition database.hpp:23
@ FLASH
Stored on device flash memory, e.g. EEPROM.
Definition database.hpp:27
@ USER
Provided by the user.
Definition database.hpp:29
@ RC
Internal Resource Compiler (i.e., hard-coded within UHD).
Definition database.hpp:26
@ FILESYSTEM
Stored on the local filesystem.
Definition database.hpp:28
@ ANY
Undefined source.
Definition database.hpp:25
Definition cal_utils.hpp:11
Definition build_info.hpp:12