USRP Hardware Driver and USRP Manual  Version: 003.009.007-0-g50839059
UHD and USRP Manual
image_loader.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014-2015 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_IMAGE_LOADER_HPP
19 #define INCLUDED_UHD_IMAGE_LOADER_HPP
20 
21 #include <string>
22 
23 #include <boost/function.hpp>
24 
25 #include <uhd/config.hpp>
27 
28 namespace uhd{
29 
30 class UHD_API image_loader : boost::noncopyable{
31 
32 public:
33 
34  typedef struct{
37  bool load_fpga;
38  std::string firmware_path;
39  std::string fpga_path;
41 
43 
58  typedef boost::function<bool(const image_loader_args_t &)> loader_fcn_t;
59 
61 
66  static void register_image_loader(
67  const std::string &device_type,
68  const loader_fcn_t &loader_fcn,
69  const std::string &recovery_instructions
70  );
71 
73 
76  static bool load(const image_loader_args_t &image_loader_args);
77 
79 
85  static std::string get_recovery_instructions(const std::string &device_type);
86 };
87 
88 }
89 
90 #endif /* INCLUDED_UHD_IMAGE_LOADER_HPP */
boost::function< bool(const image_loader_args_t &)> loader_fcn_t
Signature of an image loading function.
Definition: image_loader.hpp:58
uhd::device_addr_t args
Definition: image_loader.hpp:35
Definition: convert.hpp:28
Definition: image_loader.hpp:34
bool load_fpga
Definition: image_loader.hpp:37
#define UHD_API
Definition: config.h:66
std::string fpga_path
Definition: image_loader.hpp:39
std::string firmware_path
Definition: image_loader.hpp:38
Definition: image_loader.hpp:30
Definition: device_addr.hpp:47
bool load_firmware
Definition: image_loader.hpp:36