USRP Hardware Driver and USRP Manual  Version: 4.7.0.0
UHD and USRP Manual
uhd::image_loader Class Reference

#include <uhd/image_loader.hpp>

Inheritance diagram for uhd::image_loader:

Classes

struct  image_loader_args_t
 

Public Types

typedef std::function< bool(const image_loader_args_t &)> loader_fcn_t
 Signature of an image loading function. More...
 

Static Public Member Functions

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. More...
 
static bool load (const image_loader_args_t &image_loader_args)
 Load firmware and/or FPGA onto a device. More...
 
static std::string get_recovery_instructions (const std::string &device_type)
 Get the instructions on how to recovery a particular device. More...
 

Member Typedef Documentation

◆ loader_fcn_t

typedef std::function<bool(const image_loader_args_t&)> uhd::image_loader::loader_fcn_t

Signature of an image loading function.

This is the function signature for an image loading function. See the declaration of load() for the meaning of these arguments.

This function must return true upon the end of a successful image load or false if no applicable device was found. It may only throw a runtime error under one of three conditions:

  • The function finds multiple devices that fit the user's arguments.
  • The function has already engaged with a specific device and something goes wrong.
  • The user gives arguments that unambiguously lead to a specific device and expect the default image(s) to be loaded, but the specific model of the device cannot be determined beyond a category.

Member Function Documentation

◆ get_recovery_instructions()

static std::string uhd::image_loader::get_recovery_instructions ( const std::string &  device_type)
static

Get the instructions on how to recovery a particular device.

These instructions should be queried if the user interrupts an image loading session, as this will likely leave the device in an unstable state.

Parameters
device_typethe "type=foo" value given in an –args option
Returns
recovery instructions

◆ load()

static bool uhd::image_loader::load ( const image_loader_args_t image_loader_args)
static

Load firmware and/or FPGA onto a device.

Parameters
image_loader_argsarguments to pass into image loading function

◆ register_image_loader()

static void uhd::image_loader::register_image_loader ( const std::string &  device_type,
const loader_fcn_t loader_fcn,
const std::string &  recovery_instructions 
)
static

Register an image loader.

Parameters
device_typethe "type=foo" value given in an –args option
loader_fcnthe loader function for the given device
recovery_instructionsinstructions on how to restore a device

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