upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions | Protected Attributes

UPM Interface API for OpenZWave (OZW) More...

Detailed Description

This class implements some common access functions that are useful to any driver making use of the ozw driver.

It is intended to be inherited by device-specific ozw drivers, and provides some basic public methods all ozw drivers need to have, as well as protected access to other OZW facilities that are needed by a driver, but should not be exposed to the end-user.

Public Member Functions

 ozwInterface (int nodeID)
 
virtual ~ozwInterface ()
 
virtual void setDebug (bool enable)
 
virtual void optionsCreate (std::string configPath="/etc/openzwave", std::string userConfigDir="", std::string cmdLine="")
 
virtual void optionAddInt (std::string name, int val)
 
virtual void optionAddBool (std::string name, bool val)
 
virtual void optionAddString (std::string name, std::string val, bool append)
 
virtual void optionsLock ()
 
virtual void init (std::string devicePath, bool isHID=false)
 
virtual void dumpNodes (bool all=false)
 
virtual std::string getValueUnits (int index)
 
virtual std::string getValueLabel (int index)
 

Protected Attributes

bool m_debugging
 
uint32_t m_nodeID
 
OZWm_instance
 
bool m_initialized
 

Constructor & Destructor Documentation

ozwInterface ( int  nodeID)

ozwInterface constructor

Parameters
nodeIDThe ZWave node number of the device we are interested in.

Here is the call graph for this function:

~ozwInterface ( )
virtual

ozwInterface Destructor

Member Function Documentation

void setDebug ( bool  enable)
virtual

Enable some debugging output in this module as well as the OZW module. Debugging is disabled by default.

Parameters
enabletrue to enable, false to disable.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void optionsCreate ( std::string  configPath = "/etc/openzwave",
std::string  userConfigDir = "",
std::string  cmdLine = "" 
)
inlinevirtual

Start configuration with basic options. This must be called prior to init(), after the OZW() constructor is called.

Parameters
configPathSet the location of the OpenZWave config directory, default is /etc/openzwave
userConfigDirSet the path to the user configuration directory. This is the location of the zwcfg*.xml and option.xml files for the user (probably created by the OpenZWave Control Panel example application). The default is the current directory ("").
cmdLineSpecify command line formatted options to OpenZWave. The default is "".

Here is the call graph for this function:

virtual void optionAddInt ( std::string  name,
int  val 
)
inlinevirtual

Add an integer Option. See the OpenZWave documentation for valid values.

Parameters
nameThe name of the configuration option
valThe value to set it to

Here is the call graph for this function:

virtual void optionAddBool ( std::string  name,
bool  val 
)
inlinevirtual

Add a boolean Option. See the OpenZWave documentation for valid values.

Parameters
nameThe name of the configuration option
valThe value to set it to

Here is the call graph for this function:

virtual void optionAddString ( std::string  name,
std::string  val,
bool  append 
)
inlinevirtual

Add a string Option. See the OpenZWave documentation for valid values.

Parameters
nameThe name of the configuration option
valThe value to set it to true to append to the option, false to override

Here is the call graph for this function:

virtual void optionsLock ( )
inlinevirtual

Lock the Options. This must be called after all options have been set, and before init() is called. If init() is called without locking the Options, init() will lock them itself. After the options have been locked, no further options can be specified.

Here is the call graph for this function:

void init ( std::string  devicePath,
bool  isHID = false 
)
virtual

This function initializes the underlying OZW Master singleton and the openzwave library in the event it has not already been initialized. If the OZW Master singleton has already been initialized, then this call will be ignored.

Parameters
devicePathThe path to the device, typically something like /dev/ttyACM0.
isHIDtrue if this is an HID device, false if it's a serial device. The default is false.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void dumpNodes ( bool  all = false)
inlinevirtual

Dump information about all configured nodes and their valueids to stderr. This is useful to determine what nodes are available, and the index (used for querying and seting values for them). In addition, it includes information about each value (type, current value, etc).

Parameters
allset to true to dump information about all values available for each node. If false, only information about 'user' values (ignoring 'system' and 'configuration') are output. The default is false ('user' values only).

Here is the call graph for this function:

virtual std::string getValueUnits ( int  index)
inlinevirtual

Return a string (which may be empty) indicating the Units of measure for a given value. For example, querying a temperature value may return "F" to indicate Fahrenheit.

Parameters
indexThe value index (see dumpNodes()) of the value to query.
Returns
A string containing the Unit of measure for the value

Here is the call graph for this function:

virtual std::string getValueLabel ( int  index)
inlinevirtual

Return a string (which may be empty) indicating the Label set for a given value. For example, querying a temperature value may return "Temperature" to indicate what it is.

Parameters
indexThe value index (see dumpNodes()) of the value to query.
Returns
A string containing the Label for the value

Here is the call graph for this function:

Inheritance diagram for ozwInterface:
Inheritance graph
[legend]
Collaboration diagram for ozwInterface:
Collaboration graph
[legend]

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