6 #ifndef SYSFSDRIVER_HPP_INCLUDE
7 #define SYSFSDRIVER_HPP_INCLUDE
74 virtual std::function<double(
const std::string&)>
signal_parse(
const std::string &signal_name)
const = 0;
83 virtual std::function<std::string(
double)>
control_gen(
const std::string &control_name)
const = 0;
87 virtual std::string
driver(
void)
const = 0;
89 virtual std::map<std::string, SysfsDriver::properties_s>
properties(
void)
const = 0;
90 static std::map<std::string, SysfsDriver::properties_s>
parse_properties_json(
const std::string &iogroup_name,
const std::string &properties_json);
Class used to implement the SysfsIOGroup base class.
Definition: SysfsDriver.hpp:23
virtual std::function< double(const std::string &)> signal_parse(const std::string &signal_name) const =0
Get function to convert contents of sysfs file into signal.
virtual int domain_type(const std::string &name) const =0
Get the PlatformTopo domain type for an named attribute.
static std::map< std::string, SysfsDriver::properties_s > parse_properties_json(const std::string &iogroup_name, const std::string &properties_json)
Definition: SysfsDriver.cpp:63
virtual ~SysfsDriver()=default
virtual std::map< std::string, SysfsDriver::properties_s > properties(void) const =0
Query the meta data about a signal or control.
virtual std::string driver(void) const =0
static constexpr size_t M_IO_BUFFER_SIZE
Arbitrary buffer size.
Definition: SysfsDriver.hpp:30
virtual std::function< std::string(double)> control_gen(const std::string &control_name) const =0
Get a function to convert a control into a sysfs string.
virtual std::string attribute_path(const std::string &name, int domain_idx)=0
Get the path to the sysfs entry for signal.
The properties about a signal or control.
Definition: SysfsDriver.hpp:32
std::string name
Definition: SysfsDriver.hpp:33
std::string alias
Definition: SysfsDriver.hpp:42
double scaling_factor
Definition: SysfsDriver.hpp:37
std::function< std::string(double)> format_function
Definition: SysfsDriver.hpp:41
std::string description
Definition: SysfsDriver.hpp:36
bool is_writable
Definition: SysfsDriver.hpp:34
std::string attribute
Definition: SysfsDriver.hpp:35
std::function< double(const std::vector< double > &)> aggregation_function
Definition: SysfsDriver.hpp:39
int behavior
Definition: SysfsDriver.hpp:40
int units
Definition: SysfsDriver.hpp:38