aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/types/sensors.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/host/include/uhd/types/sensors.hpp b/host/include/uhd/types/sensors.hpp
index 6dede02dd..66501a7e9 100644
--- a/host/include/uhd/types/sensors.hpp
+++ b/host/include/uhd/types/sensors.hpp
@@ -8,6 +8,7 @@
#define INCLUDED_UHD_TYPES_SENSORS_HPP
#include <uhd/config.hpp>
+#include <map>
#include <string>
namespace uhd{
@@ -25,6 +26,7 @@ namespace uhd{
* //prints Temperature: 38.5 C
*/
struct UHD_API sensor_value_t{
+ typedef std::map<std::string, std::string> sensor_map_t;
/*!
* Create a sensor value from a boolean.
@@ -81,6 +83,18 @@ namespace uhd{
);
/*!
+ * Create a sensor value from a map.
+ *
+ * The map must have the following keys: name, type, value, and unit.
+ *
+ * type must one of the following strings: BOOLEAN, INTEGER, REALNUM,
+ * or STRING (see data_type_t).
+ */
+ sensor_value_t(
+ const std::map<std::string, std::string> &sensor_dict
+ );
+
+ /*!
* Create a sensor value from another sensor value.
* \param source the source sensor value to copy
*/