USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
sensors.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2011 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_TYPES_SENSORS_HPP
8 #define INCLUDED_UHD_TYPES_SENSORS_HPP
9 
10 #include <uhd/config.hpp>
11 #include <map>
12 #include <string>
13 
14 namespace uhd{
15 
29  typedef std::map<std::string, std::string> sensor_map_t;
30 
39  const std::string &name,
40  bool value,
41  const std::string &utrue,
42  const std::string &ufalse
43  );
44 
53  const std::string &name,
54  signed value,
55  const std::string &unit,
56  const std::string &formatter = "%d"
57  );
58 
67  const std::string &name,
68  double value,
69  const std::string &unit,
70  const std::string &formatter = "%f"
71  );
72 
80  const std::string &name,
81  const std::string &value,
82  const std::string &unit
83  );
84 
94  const std::map<std::string, std::string> &sensor_dict
95  );
96 
101  sensor_value_t(const sensor_value_t& source);
102 
104  bool to_bool(void) const;
105 
107  signed to_int(void) const;
108 
110  double to_real(void) const;
111 
113  std::string name;
114 
120  std::string value;
121 
127  std::string unit;
128 
130  enum data_type_t {
131  BOOLEAN = 'b',
132  INTEGER = 'i',
133  REALNUM = 'r',
134  STRING = 's'
135  };
136 
139 
141  std::string to_pp_string(void) const;
142 
144  sensor_value_t& operator=(const sensor_value_t& value);
145  };
146 
147 } //namespace uhd
148 
149 #endif /* INCLUDED_UHD_TYPES_SENSORS_HPP */
std::string value
Definition: sensors.hpp:120
data_type_t
Enumeration of possible data types in a sensor.
Definition: sensors.hpp:130
std::string name
The name of the sensor value.
Definition: sensors.hpp:113
Definition: build_info.hpp:14
Definition: sensors.hpp:28
#define UHD_API
Definition: config.h:62
std::map< std::string, std::string > sensor_map_t
Definition: sensors.hpp:29
std::string unit
Definition: sensors.hpp:127
data_type_t type
The data type of the value.
Definition: sensors.hpp:138