OpenZWave Library 1.4.0
Loading...
Searching...
No Matches
OpenZWave::Node Class Reference

The Node class describes a Z-Wave node object...typically a device on the Z-Wave network. More...

#include <Node.h>

Classes

struct  CommandClassData
struct  NodeData

Public Types

enum  QueryStage {
  QueryStage_None , QueryStage_ProtocolInfo , QueryStage_Probe , QueryStage_WakeUp ,
  QueryStage_ManufacturerSpecific1 , QueryStage_NodeInfo , QueryStage_NodePlusInfo , QueryStage_SecurityReport ,
  QueryStage_ManufacturerSpecific2 , QueryStage_Versions , QueryStage_Instances , QueryStage_Static ,
  QueryStage_CacheLoad , QueryStage_Probe1 = QueryStage_CacheLoad , QueryStage_Associations , QueryStage_Neighbors ,
  QueryStage_Session , QueryStage_Dynamic , QueryStage_Configuration , QueryStage_Complete
}
enum  {
  SecurityFlag_Security = 0x01 , SecurityFlag_Controller = 0x02 , SecurityFlag_SpecificDevice = 0x04 , SecurityFlag_RoutingSlave = 0x08 ,
  SecurityFlag_BeamCapability = 0x10 , SecurityFlag_Sensor250ms = 0x20 , SecurityFlag_Sensor1000ms = 0x40 , SecurityFlag_OptionalFunctionality = 0x80
}
enum  { NodeBroadcast = 0xff }

Public Member Functions

 Node (uint32 const _homeId, uint8 const _nodeId)
virtual ~Node ()
void AdvanceQueries ()
void QueryStageComplete (QueryStage const _stage)
void QueryStageRetry (QueryStage const _stage, uint8 const _maxAttempts=0)
void SetQueryStage (QueryStage const _stage, bool const _advance=true)
Node::QueryStage GetCurrentQueryStage ()
string GetQueryStageName (QueryStage const _stage)
bool IsNodeAlive () const
void UpdateProtocolInfo (uint8 const *_data)
void SetProtocolInfo (uint8 const *_protocolInfo, uint8 const _length)
void UpdateNodeInfo (uint8 const *_data, uint8 const _length)
bool ProtocolInfoReceived () const
bool NodeInfoReceived () const
bool IsNodeZWavePlus () const
bool AllQueriesCompleted () const
void SetNodePlusInfoReceived (const bool _received)
void SetNodeAlive (bool const _isAlive)
bool IsListeningDevice () const
bool IsFrequentListeningDevice () const
bool IsBeamingDevice () const
bool IsRoutingDevice () const
bool IsSecurityDevice () const
uint32 GetMaxBaudRate () const
uint8 GetVersion () const
uint8 GetSecurity () const
uint8 GetNodeId () const
uint8 GetBasic () const
uint8 GetGeneric () const
uint8 GetSpecific () const
string const & GetType () const
uint32 GetNeighbors (uint8 **o_associations)
bool IsController () const
bool IsAddingNode () const
void SetAddingNode ()
void ClearAddingNode ()
bool IsNodeReset ()
CommandClassGetCommandClass (uint8 const _commandClassId) const
void ApplicationCommandHandler (uint8 const *_data, bool encrypted)
void SetSecuredClasses (uint8 const *_data, uint8 const _length)
void SetSecured (bool secure)
void SetLevel (uint8 const _level)
void SetNodeOn ()
void SetNodeOff ()
ValueID CreateValueID (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, ValueID::ValueType const _type)
ValueGetValue (ValueID const &_id)
ValueGetValue (uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex)
bool RemoveValue (uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex)
bool CreateValueBool (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, bool const _default, uint8 const _pollIntensity)
bool CreateValueButton (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, uint8 const _pollIntensity)
bool CreateValueByte (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const _default, uint8 const _pollIntensity)
bool CreateValueDecimal (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, string const &_default, uint8 const _pollIntensity)
bool CreateValueInt (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, int32 const _default, uint8 const _pollIntensity)
bool CreateValueList (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const _size, vector< ValueList::Item > const &_items, int32 const _default, uint8 const _pollIntensity)
bool CreateValueRaw (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const *_default, uint8 const _length, uint8 const _pollIntensity)
bool CreateValueSchedule (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const _pollIntensity)
bool CreateValueShort (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, int16 const _default, uint8 const _pollIntensity)
bool CreateValueString (ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, string const &_default, uint8 const _pollIntensity)
void RemoveValueList (ValueList *_value)
void ReadValueFromXML (uint8 const _commandClassId, TiXmlElement const *_valueElement)
bool CreateValueFromXML (uint8 const _commandClassId, TiXmlElement const *_valueElement)
uint8GenerateNonceKey ()
uint8GetNonceKey (uint32 nonceid)

Friends

class Manager
class Driver
class Group
class Value
class ValueButton
class Alarm
class Association
class AssociationCommandConfiguration
class Basic
class Battery
class ClimateControlSchedule
class Clock
class CommandClass
class ControllerReplication
class EnergyProduction
class Hail
class Indicator
class Language
class Lock
class ManufacturerSpecific
class Meter
class MeterPulse
class MultiInstance
class MultiChannelAssociation
class NodeNaming
class Protection
class Security
class SensorAlarm
class SensorBinary
class SensorMultilevel
class SwitchAll
class SwitchBinary
class SwitchMultilevel
class SwitchToggleBinary
class SwitchToggleMultilevel
class ThermostatFanMode
class ThermostatFanState
class ThermostatMode
class ThermostatOperatingState
class ThermostatSetpoint
class Version
class WakeUp
class ZWavePlusInfo

Detailed Description

The Node class describes a Z-Wave node object...typically a device on the Z-Wave network.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SecurityFlag_Security 
SecurityFlag_Controller 
SecurityFlag_SpecificDevice 
SecurityFlag_RoutingSlave 
SecurityFlag_BeamCapability 
SecurityFlag_Sensor250ms 
SecurityFlag_Sensor1000ms 
SecurityFlag_OptionalFunctionality 

◆ anonymous enum

anonymous enum
Enumerator
NodeBroadcast 

◆ QueryStage

Enumerator
QueryStage_None 

Query process hasn't started for this node

QueryStage_ProtocolInfo 

Retrieve protocol information

QueryStage_Probe 

Ping device to see if alive

QueryStage_WakeUp 

Start wake up process if a sleeping node

QueryStage_ManufacturerSpecific1 

Retrieve manufacturer name and product ids if ProtocolInfo lets us

QueryStage_NodeInfo 

Retrieve info about supported, controlled command classes

QueryStage_NodePlusInfo 

Retrieve ZWave+ info and update device classes

QueryStage_SecurityReport 

Retrieve a list of Command Classes that require Security

QueryStage_ManufacturerSpecific2 

Retrieve manufacturer name and product ids

QueryStage_Versions 

Retrieve version information

QueryStage_Instances 

Retrieve information about multiple command class instances

QueryStage_Static 

Retrieve static information (doesn't change)

QueryStage_CacheLoad 

Ping a device upon restarting with cached config for the device

QueryStage_Probe1 
QueryStage_Associations 

< Depreciated name. /todo Remove in 2.0 timeframe Retrieve information about associations

QueryStage_Neighbors 

Retrieve node neighbor list

QueryStage_Session 

Retrieve session information (changes infrequently)

QueryStage_Dynamic 

Retrieve dynamic information (changes frequently)

QueryStage_Configuration 

Retrieve configurable parameter information (only done on request)

QueryStage_Complete 

Query process is completed for this node

Constructor & Destructor Documentation

◆ Node()

Node::Node ( uint32 const _homeId,
uint8 const _nodeId )

Constructor initializes the node object, associating it with a specific network (_homeId) and network node (_nodeId).

Parameters
_homeIdThe homeId of the network to which this node is connected.
_nodeIdThe nodeId of this node.

◆ ~Node()

Node::~Node ( )
virtual

Destructor cleans up memory allocated to node and its child objects.

Member Function Documentation

◆ AdvanceQueries()

void Node::AdvanceQueries ( )

This function advances the query process (see Remarks below for more detail on the process). It iterates through the various query stages enumerated in Node::QueryStage.

Remarks
For OpenZWave to discover everything about a node, we have to follow a certain order of queries, because the results of one stage may affect what is requested in the next stage. The stage is saved with the node data, so that any incomplete queries can be restarted the next time the application runs.

The individual command classes also store some state information as to whether they have had a response to certain queries. This state information is initialized by the SetStaticRequests call in QueryStage_None. It is also saved, so we do not need to request state from every command class if some have previously responded.

◆ AllQueriesCompleted()

bool OpenZWave::Node::AllQueriesCompleted ( ) const
inline

◆ ApplicationCommandHandler()

void Node::ApplicationCommandHandler ( uint8 const * _data,
bool encrypted )

◆ ClearAddingNode()

void OpenZWave::Node::ClearAddingNode ( )
inline

◆ CreateValueBool()

bool Node::CreateValueBool ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
bool const _default,
uint8 const _pollIntensity )

◆ CreateValueButton()

bool Node::CreateValueButton ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
uint8 const _pollIntensity )

◆ CreateValueByte()

bool Node::CreateValueByte ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
uint8 const _default,
uint8 const _pollIntensity )

◆ CreateValueDecimal()

bool Node::CreateValueDecimal ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
string const & _default,
uint8 const _pollIntensity )

◆ CreateValueFromXML()

bool Node::CreateValueFromXML ( uint8 const _commandClassId,
TiXmlElement const * _valueElement )

◆ CreateValueID()

ValueID Node::CreateValueID ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
ValueID::ValueType const _type )

◆ CreateValueInt()

bool Node::CreateValueInt ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
int32 const _default,
uint8 const _pollIntensity )

◆ CreateValueList()

bool Node::CreateValueList ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
uint8 const _size,
vector< ValueList::Item > const & _items,
int32 const _default,
uint8 const _pollIntensity )

◆ CreateValueRaw()

bool Node::CreateValueRaw ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
uint8 const * _default,
uint8 const _length,
uint8 const _pollIntensity )

◆ CreateValueSchedule()

bool Node::CreateValueSchedule ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
uint8 const _pollIntensity )

◆ CreateValueShort()

bool Node::CreateValueShort ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
int16 const _default,
uint8 const _pollIntensity )

◆ CreateValueString()

bool Node::CreateValueString ( ValueID::ValueGenre const _genre,
uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex,
string const & _label,
string const & _units,
bool const _readOnly,
bool const _writeOnly,
string const & _default,
uint8 const _pollIntensity )

◆ GenerateNonceKey()

uint8 * Node::GenerateNonceKey ( )

◆ GetBasic()

uint8 OpenZWave::Node::GetBasic ( ) const
inline

◆ GetCommandClass()

CommandClass * Node::GetCommandClass ( uint8 const _commandClassId) const

This function retrieves a pointer to the requested command class object (if supported by this node).

Parameters
_commandClassIdClass ID (a single byte value) identifying the command class requested.
Returns
Pointer to the requested CommandClass object if supported, otherwise NULL.
See also
CommandClass, m_commandClassMap

◆ GetCurrentQueryStage()

Node::QueryStage OpenZWave::Node::GetCurrentQueryStage ( )
inline

Returns the current query stage enum.

Returns
Enum value with the current query stage.
See also
m_queryStage

◆ GetGeneric()

uint8 OpenZWave::Node::GetGeneric ( ) const
inline

◆ GetMaxBaudRate()

uint32 OpenZWave::Node::GetMaxBaudRate ( ) const
inline

◆ GetNeighbors()

uint32 Node::GetNeighbors ( uint8 ** o_associations)

◆ GetNodeId()

uint8 OpenZWave::Node::GetNodeId ( ) const
inline

◆ GetNonceKey()

uint8 * Node::GetNonceKey ( uint32 nonceid)

◆ GetQueryStageName()

string Node::GetQueryStageName ( QueryStage const _stage)

Returns the specified query stage string.

Parameters
_stageThe query stage.
Returns
Specified query stage string.
See also
m_queryStage, m_queryPending

◆ GetSecurity()

uint8 OpenZWave::Node::GetSecurity ( ) const
inline

◆ GetSpecific()

uint8 OpenZWave::Node::GetSpecific ( ) const
inline

◆ GetType()

string const & OpenZWave::Node::GetType ( ) const
inline

◆ GetValue() [1/2]

Value * Node::GetValue ( uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex )

◆ GetValue() [2/2]

Value * Node::GetValue ( ValueID const & _id)

◆ GetVersion()

uint8 OpenZWave::Node::GetVersion ( ) const
inline

◆ IsAddingNode()

bool OpenZWave::Node::IsAddingNode ( ) const
inline

◆ IsBeamingDevice()

bool OpenZWave::Node::IsBeamingDevice ( ) const
inline

◆ IsController()

bool OpenZWave::Node::IsController ( ) const
inline

◆ IsFrequentListeningDevice()

bool OpenZWave::Node::IsFrequentListeningDevice ( ) const
inline

◆ IsListeningDevice()

bool OpenZWave::Node::IsListeningDevice ( ) const
inline

◆ IsNodeAlive()

bool OpenZWave::Node::IsNodeAlive ( ) const
inline

Returns whether the library thinks a node is functioning properly

Returns
boolean status of node.

◆ IsNodeReset()

bool Node::IsNodeReset ( )

◆ IsNodeZWavePlus()

bool OpenZWave::Node::IsNodeZWavePlus ( ) const
inline

◆ IsRoutingDevice()

bool OpenZWave::Node::IsRoutingDevice ( ) const
inline

◆ IsSecurityDevice()

bool OpenZWave::Node::IsSecurityDevice ( ) const
inline

◆ NodeInfoReceived()

bool OpenZWave::Node::NodeInfoReceived ( ) const
inline

◆ ProtocolInfoReceived()

bool OpenZWave::Node::ProtocolInfoReceived ( ) const
inline

◆ QueryStageComplete()

void Node::QueryStageComplete ( QueryStage const _stage)

Signal that a specific query stage has been completed for this node. This will only work if the query process for this node is indeed at the specified stage. Otherwise, the function returns with no action.

Parameters
_stageThe current stage of the query process.

◆ QueryStageRetry()

void Node::QueryStageRetry ( QueryStage const _stage,
uint8 const _maxAttempts = 0 )

Retry the specified query stage (up to _maxAttempts retries). This will only work if the query process for this node is indeed at the specified stage. Otherwise, the function returns with no action.

Parameters
_stageThe query stage to retry.
_maxAttempts

◆ ReadValueFromXML()

void Node::ReadValueFromXML ( uint8 const _commandClassId,
TiXmlElement const * _valueElement )

◆ RemoveValue()

bool Node::RemoveValue ( uint8 const _commandClassId,
uint8 const _instance,
uint8 const _valueIndex )

◆ RemoveValueList()

void Node::RemoveValueList ( ValueList * _value)

◆ SetAddingNode()

void OpenZWave::Node::SetAddingNode ( )
inline

◆ SetLevel()

void Node::SetLevel ( uint8 const _level)

◆ SetNodeAlive()

void Node::SetNodeAlive ( bool const _isAlive)

Handle dead node detection tracking. Use this routine to set state of nodes. Tracks state as well as send notifications.

◆ SetNodeOff()

void Node::SetNodeOff ( )

◆ SetNodeOn()

void Node::SetNodeOn ( )

◆ SetNodePlusInfoReceived()

void OpenZWave::Node::SetNodePlusInfoReceived ( const bool _received)
inline

◆ SetProtocolInfo()

void Node::SetProtocolInfo ( uint8 const * _protocolInfo,
uint8 const _length )

this function is called when the Node is added via a AddNode request. the ProtocolInfo field contains the devices classes and the CommandClasses that the node supports, so we can build a pretty good Node out of that info.

Parameters
_protocolInfoByte 0 - Basic Device Class Byte 1 - Generic Device Class, Byte 2 - Specific Device Classes Remaining Bytes - Supported Command Classes
_lengthlength of the _protocolInfo field.

◆ SetQueryStage()

void Node::SetQueryStage ( QueryStage const _stage,
bool const _advance = true )

This function sets the query stage for the node (but only to an earlier stage). If a later stage is specified than the current one, it is ignored.

Parameters
_stageThe desired query stage.
See also
m_queryStage, m_queryPending

◆ SetSecured()

void Node::SetSecured ( bool secure)

◆ SetSecuredClasses()

void Node::SetSecuredClasses ( uint8 const * _data,
uint8 const _length )

This function sets up Secured Command Classes. It iterates over the existing command classes marking them as Secured if they exist, and if they don't, it creates new Command Classes and sets them up as Secured

Parameters
_dataa list of Command Classes that are Secured by the Device
_lengththe length of the _data string

◆ UpdateNodeInfo()

void Node::UpdateNodeInfo ( uint8 const * _data,
uint8 const _length )

◆ UpdateProtocolInfo()

void Node::UpdateProtocolInfo ( uint8 const * _data)

This function handles a response to the FUNC_ID_ZW_GET_NODE_PROTOCOL_INFO command for this node. If protocol information has already been retrieved for the node, the function simply returns. Otherwise, it populates several member variables about the device at this node:

  • m_routing (whether it is a routing node (capable of passing commands along to other nodes in the network) or not
  • m_maxBaudRate (the maximum baud rate at which this device can communicate)
  • m_version (TODO)
  • m_security (whether device supports security features)
  • m_listening (device is powered and listening constantly)
  • m_frequentListening (device can be woken up with a beam)
  • m_beaming (device is beam capable)

◆ Alarm

friend class Alarm
friend

◆ Association

friend class Association
friend

◆ AssociationCommandConfiguration

friend class AssociationCommandConfiguration
friend

◆ Basic

friend class Basic
friend

◆ Battery

friend class Battery
friend

◆ ClimateControlSchedule

friend class ClimateControlSchedule
friend

◆ Clock

friend class Clock
friend

◆ CommandClass

friend class CommandClass
friend

◆ ControllerReplication

friend class ControllerReplication
friend

◆ Driver

friend class Driver
friend

◆ EnergyProduction

friend class EnergyProduction
friend

◆ Group

friend class Group
friend

◆ Hail

friend class Hail
friend

◆ Indicator

friend class Indicator
friend

◆ Language

friend class Language
friend

◆ Lock

friend class Lock
friend

◆ Manager

friend class Manager
friend

◆ ManufacturerSpecific

friend class ManufacturerSpecific
friend

◆ Meter

friend class Meter
friend

◆ MeterPulse

friend class MeterPulse
friend

◆ MultiChannelAssociation

friend class MultiChannelAssociation
friend

◆ MultiInstance

friend class MultiInstance
friend

◆ NodeNaming

friend class NodeNaming
friend

◆ Protection

friend class Protection
friend

◆ Security

friend class Security
friend

◆ SensorAlarm

friend class SensorAlarm
friend

◆ SensorBinary

friend class SensorBinary
friend

◆ SensorMultilevel

friend class SensorMultilevel
friend

◆ SwitchAll

friend class SwitchAll
friend

◆ SwitchBinary

friend class SwitchBinary
friend

◆ SwitchMultilevel

friend class SwitchMultilevel
friend

◆ SwitchToggleBinary

friend class SwitchToggleBinary
friend

◆ SwitchToggleMultilevel

friend class SwitchToggleMultilevel
friend

◆ ThermostatFanMode

friend class ThermostatFanMode
friend

◆ ThermostatFanState

friend class ThermostatFanState
friend

◆ ThermostatMode

friend class ThermostatMode
friend

◆ ThermostatOperatingState

friend class ThermostatOperatingState
friend

◆ ThermostatSetpoint

friend class ThermostatSetpoint
friend

◆ Value

friend class Value
friend

◆ ValueButton

friend class ValueButton
friend

◆ Version

friend class Version
friend

◆ WakeUp

friend class WakeUp
friend

◆ ZWavePlusInfo

friend class ZWavePlusInfo
friend

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