mraa  1.7.0
Low Level Skeleton Library for Communication on GNU/Linux platforms
 All Data Structures Namespaces Files Functions Typedefs Enumerations Enumerator Macros Pages
Public Member Functions
Iio Class Reference

Detailed Description

This file defines the C++ iio interface for libmraa

Public Member Functions

 Iio (int device)
 
 Iio (const std::string &deviceName)
 
 ~Iio ()
 
std::string getDeviceName () const
 
int readInt (const std::string &attributeName) const
 
float readFloat (const std::string &attributeName) const
 
void writeInt (const std::string &attributeName, int value) const
 
void writeFloat (const std::string &attributeName, float value) const
 
void registerEventHandler (IioHandler *handler) const
 

Constructor & Destructor Documentation

Iio ( int  device)
inline

Iio Constructor, takes a device number which will map directly to sysfs e.g. device 0 maps to /sys/bus/iio/devices/iio:device0

Parameters
deviceIIO device number
Exceptions
std::invalid_argumentif initialization fails

Here is the call graph for this function:

Iio ( const std::string &  deviceName)
inline

Iio Constructor

Parameters
deviceNameIIO device name
Exceptions
std::invalid_argumentif initialization fails

Here is the call graph for this function:

~Iio ( )
inline

Iio destructor

Here is the call graph for this function:

Member Function Documentation

std::string getDeviceName ( ) const
inline

Get device name

Returns
The device name
int readInt ( const std::string &  attributeName) const
inline

Read an int value from specified attribute.

Parameters
attributeNameattribute mame
Returns
The int value
Exceptions
std::invalid_argumentif read fails
float readFloat ( const std::string &  attributeName) const
inline

Read a float value from specified attribute.

Parameters
attributeNameattribute mame
Returns
The float value
Exceptions
std::invalid_argumentif read fails
void writeInt ( const std::string &  attributeName,
int  value 
) const
inline

Write an int value to specified attribute.

Parameters
attributeNameattribute mame
valueint value
Exceptions
std::invalid_argumentif write fails
void writeFloat ( const std::string &  attributeName,
float  value 
) const
inline

Write a float value to specified attribute.

Parameters
attributeNameattribute mame
valuefloat value
Exceptions
std::invalid_argumentif write fails
void registerEventHandler ( IioHandler handler) const
inline

Register event handler.

Parameters
handlerhandler class that implements IioHandler
Exceptions
std::invalid_argumenton failure

The documentation for this class was generated from the following file: