| USRP Hardware Driver and Device Manual Version: 4.10.0.0 UHD and USRP Manual |

Loading...
Searching...
No Matches
uhd::usrp::cal::database Class Reference

`#include <uhd/cal/database.hpp>`

## Detailed Description

Calibration Data Storage/Retrieval Class

UHD can store calibration data on disk or compiled within UHD. This class provides access to both locations.

# Format of binary data

This class can read and write binary data, but it does not verify the data or expect any kind of format. It simply manages BLOBs (binary large objects). It is up to the consumers and producers of this data to agree on a format. Typically, since this class stores calibration data, it will be consuming data that was produced by uhd::usrp::cal::container::serialize().

# Serial number and key

Calibration data is indexed by two keys: An arbitrary key that describes the type of calibration data (e.g., "rx_iq") and a serial number. The serial number has to uniquely identify the device for which the calibration data was obtained. This can either be the serial number of the daughterboard (if the calibration data only relates to the daughterboard), the motherboard (for example, if there is no such thing as a daughterboard, or the data only relates to the motherboard), it can be combination of both daughterboard and motherboard serial (if the calibration data is only valid for a combination), or it can be a combination of a device serial number and a channel index (if a device with single serial has different channels that have separate characteristics).

It is up to the individual device drivers which value they use for the serial numbers and keys.

Note that the serial number is irrelevant when the data is pulled out of the resource compiler. By definition, it is not permitted to store data in the resource compiler that is specific to a certain serial number, only data that applies to an entire family of devices is permitted.

## Public Types
using | has_data_fn_type = std::function<bool(const std::string&, const std::string&)>
| Function type to look up if there is cal data given a key and serial.
using | get_data_fn_type
| Function type to return serialized cal data key and serial.

## Static Public Member Functions
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.
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 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.
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.

## Member Typedef Documentation

## ◆ get_data_fn_type

using uhd::usrp::cal::database::get_data_fn_type

Initial value:
std::function<std::vector<uint8_t>(const std::string&, const std::string&)>

Function type to return serialized cal data key and serial.

## ◆ has_data_fn_type

using uhd::usrp::cal::database::has_data_fn_type = std::function<bool(const std::string&, const std::string&)>

Function type to look up if there is cal data given a key and serial.

## Member Function Documentation

## ◆ has_cal_data()

bool uhd::usrp::cal::database::has_cal_data | ( | const std::string & | key,
|  | const std::string & | serial,
|  | const source | source_type = source::ANY )
| static

Check if calibration data exists for a given source type.

## ◆ read_cal_data()

std::vector< uint8_t > uhd::usrp::cal::database::read_cal_data | ( | const std::string & | key,
|  | const std::string & | serial,
|  | const source | source_type = source::ANY )
| static

Return a calibration data set as a serialized string.

## ◆ register_lookup()

void uhd::usrp::cal::database::register_lookup | ( | has_data_fn_type | has_cal_data,
|  | get_data_fn_type | get_cal_data,
|  | const source | source_type = source::FLASH )
| static

Register a lookup function for cal data.

## ◆ write_cal_data()

void uhd::usrp::cal::database::write_cal_data | ( | const std::string & | key,
|  | const std::string & | serial,
|  | const std::vector< uint8_t > & | cal_data,
|  | const std::string & | backup_ext = "" )
| static

Store calibration data to the local filesystem database.

The documentation for this class was generated from the following file:

- database.hpp