All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
sensors.hpp
Go to the documentation of this file.
//
// Copyright 2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef INCLUDED_UHD_TYPES_SENSORS_HPP
#define INCLUDED_UHD_TYPES_SENSORS_HPP
#include <uhd/config.hpp>
#include <string>
namespace uhd{
struct UHD_API sensor_value_t{
sensor_value_t(
const std::string &name,
bool value,
const std::string &utrue,
const std::string &ufalse
);
sensor_value_t(
const std::string &name,
signed value,
const std::string &unit,
const std::string &formatter = "%d"
);
sensor_value_t(
const std::string &name,
double value,
const std::string &unit,
const std::string &formatter = "%f"
);
sensor_value_t(
const std::string &name,
const std::string &value,
const std::string &unit
);
bool to_bool(void) const;
signed to_int(void) const;
double to_real(void) const;
const std::string name;
const std::string value;
const std::string unit;
enum data_type_t {
BOOLEAN = 'b',
INTEGER = 'i',
REALNUM = 'r',
STRING = 's'
};
const data_type_t type;
std::string to_pp_string(void) const;
};
} //namespace uhd
#endif /* INCLUDED_UHD_TYPES_SENSORS_HPP */