Loading...
Searching...
No Matches
image_loader.hpp
Go to the documentation of this file.
//
// Copyright 2014-2017 Ettus Research
// Copyright 2018 Ettus Research, a National Instruments Company
// Copyright 2019 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/types/device_addr.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <functional>
#include <string>
namespace uhd {
class UHD_API image_loader : uhd::noncopyable
{
public:
struct image_loader_args_t
{
uhd::device_addr_t args;
bool load_firmware;
bool load_fpga;
bool download;
std::string firmware_path;
std::string fpga_path;
std::string out_path;
std::string id;
std::vector<uint8_t> component;
uhd::dict<std::string, std::string> metadata;
bool delay_reload = false;
bool just_reload = false;
};
typedef std::function<bool(const image_loader_args_t&)> loader_fcn_t;
static void register_image_loader(const std::string& device_type,
const loader_fcn_t& loader_fcn,
const std::string& recovery_instructions);
static bool load(const image_loader_args_t& image_loader_args);
static std::string get_recovery_instructions(const std::string& device_type);
};
} // namespace uhd
uhd::device_addr_t
Definition device_addr.hpp:39
uhd::dict
Definition dict.hpp:24
uhd::image_loader
Definition image_loader.hpp:20
uhd::image_loader::get_recovery_instructions
static std::string get_recovery_instructions(const std::string &device_type)
Get the instructions on how to recovery a particular device.
uhd::image_loader::loader_fcn_t
std::function< bool(const image_loader_args_t &)> loader_fcn_t
Signature of an image loading function.
Definition image_loader.hpp:54
uhd::image_loader::load
static bool load(const image_loader_args_t &image_loader_args)
Load firmware and/or FPGA onto a device.
uhd::image_loader::register_image_loader
static void register_image_loader(const std::string &device_type, const loader_fcn_t &loader_fcn, const std::string &recovery_instructions)
Register an image loader.
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
device_addr.hpp
uhd
Definition build_info.hpp:12
uhd::noncopyable
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
noncopyable.hpp
uhd::image_loader::image_loader_args_t
Definition image_loader.hpp:23
uhd::image_loader::image_loader_args_t::args
uhd::device_addr_t args
Definition image_loader.hpp:24
uhd::image_loader::image_loader_args_t::load_fpga
bool load_fpga
Definition image_loader.hpp:26
uhd::image_loader::image_loader_args_t::load_firmware
bool load_firmware
Definition image_loader.hpp:25
uhd::image_loader::image_loader_args_t::delay_reload
bool delay_reload
Definition image_loader.hpp:34
uhd::image_loader::image_loader_args_t::component
std::vector< uint8_t > component
Definition image_loader.hpp:32
uhd::image_loader::image_loader_args_t::download
bool download
Definition image_loader.hpp:27
uhd::image_loader::image_loader_args_t::fpga_path
std::string fpga_path
Definition image_loader.hpp:29
uhd::image_loader::image_loader_args_t::id
std::string id
Definition image_loader.hpp:31
uhd::image_loader::image_loader_args_t::firmware_path
std::string firmware_path
Definition image_loader.hpp:28
uhd::image_loader::image_loader_args_t::metadata
uhd::dict< std::string, std::string > metadata
Definition image_loader.hpp:33
uhd::image_loader::image_loader_args_t::out_path
std::string out_path
Definition image_loader.hpp:30
uhd::image_loader::image_loader_args_t::just_reload
bool just_reload
Definition image_loader.hpp:35