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

UPM Utility driver for OZW. More...

Detailed Description

This "driver" does not actually control any device. It is meant as an example. It's only purpose is to support it's example (ozwdump), which initializes OZW on a Z-Wave network, and then prints out all Nodes (devices) and their associated valueids.

string defaultDev = "/dev/ttyACM0";
// if an argument was specified, use it as the device instead
if (argc > 1)
defaultDev = string(argv[1]);
// Instantiate an OZWDUMP instance
upm::OZWDUMP sensor;
// The first thing to do is create options, then lock them when done.
sensor.optionsCreate();
sensor.optionsLock();
// Next, initialize it.
cout << "Initializing, this may take awhile depending on your ZWave network" << endl;
sensor.init(defaultDev);
cout << "Initialization complete" << endl;
cout << "Dumping nodes..." << endl;
sensor.dumpNodes(true);
// The following is example output of dumpNodes:
//
// Dumping nodes...
// Node 1: Z-Stick Gen5
// Node 2: Smart Switch 6
// Index: 0, Type: bool, Label: Switch, Value: False
// Index: 2, Type: float, Label: Energy, Value: 1.190 kWh
// Index: 3, Type: float, Label: Previous Reading, Value: 1.190 kWh
// Index: 4, Type: int32, Label: Interval, Value: 1521 seconds
// Index: 5, Type: float, Label: Power, Value: 0.000 W
// Index: 6, Type: float, Label: Voltage, Value: 121.256 V
// Index: 7, Type: float, Label: Current, Value: 0.000 A
// Index: 8, Type: bool, Label: Exporting, Value: False
// Index: 45, Type: list, Label: Day, Value: Friday
// Index: 46, Type: byte, Label: Hour, Value: 5
// Index: 47, Type: byte, Label: Minute, Value: 53
// Node 3: Multi Sensor
// Index: 0, Type: bool, Label: Sensor, Value: True
// Index: 1, Type: float, Label: Temperature, Value: 72.8 F
// Index: 2, Type: float, Label: Luminance, Value: 4 lux
// Index: 3, Type: float, Label: Relative Humidity, Value: 22 %
// Index: 17, Type: byte, Label: Battery Level, Value: 98 %
// Node 5: Minimote
// Node 6: Smart Energy Switch
// Index: 0, Type: bool, Label: Switch, Value: False
// Index: 2, Type: float, Label: Power, Value: 0.000 W
// Index: 3, Type: float, Label: Energy, Value: 1.609 kWh
// Index: 4, Type: float, Label: Previous Reading, Value: 1.609 kWh
// Index: 5, Type: int32, Label: Interval, Value: 1521 seconds
// Index: 6, Type: float, Label: Power, Value: 0.000 W
// Index: 7, Type: float, Label: Previous Reading, Value: 1.609 W
// Index: 8, Type: int32, Label: Interval, Value: 1521 seconds
// Index: 9, Type: bool, Label: Exporting, Value: False
// Node 7: Smart Energy Switch
// Index: 0, Type: bool, Label: Switch, Value: False
// Index: 2, Type: float, Label: Power, Value: 0.000 W
// Index: 3, Type: float, Label: Energy, Value: 0.000 kWh
// Index: 4, Type: float, Label: Previous Reading, Value: 0.000 kWh
// Index: 5, Type: int32, Label: Interval, Value: 1521 seconds
// Index: 6, Type: float, Label: Power, Value: 0.000 W
// Index: 7, Type: float, Label: Previous Reading, Value: 0.000 W
// Index: 8, Type: int32, Label: Interval, Value: 1521 seconds
// Index: 9, Type: bool, Label: Exporting, Value: False
//

Public Member Functions

 OZWDUMP ()
 
 ~OZWDUMP ()
 
- Public Member Functions inherited from ozwInterface
 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)
 

Additional Inherited Members

- Protected Attributes inherited from ozwInterface
bool m_debugging
 
uint32_t m_nodeID
 
OZWm_instance
 
bool m_initialized
 

Constructor & Destructor Documentation

OZWDUMP ( )

ozwdump constructor

~OZWDUMP ( )

OZWDUMP Destructor

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

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