OpenZWave Library  1.5.0
Node.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // Node.h
4 //
5 // A node in the Z-Wave network
6 //
7 // Copyright (c) 2010 Mal Lansell <openzwave@lansell.org>
8 //
9 // SOFTWARE NOTICE AND LICENSE
10 //
11 // This file is part of OpenZWave.
12 //
13 // OpenZWave is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published
15 // by the Free Software Foundation, either version 3 of the License,
16 // or (at your option) any later version.
17 //
18 // OpenZWave is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25 //
26 //-----------------------------------------------------------------------------
27 
28 #ifndef _Node_H
29 #define _Node_H
30 
31 #include <string>
32 #include <vector>
33 #include <list>
34 #include <map>
35 #include "Defs.h"
36 #include "value_classes/ValueID.h"
38 #include "Msg.h"
39 #include "platform/TimeStamp.h"
40 #include "Group.h"
41 
42 class TiXmlElement;
43 
44 namespace OpenZWave
45 {
46  class CommandClass;
47  class Driver;
48  class Group;
49  class ValueStore;
50  class Value;
51  class ValueBool;
52  class ValueButton;
53  class ValueByte;
54  class ValueDecimal;
55  class ValueInt;
56  class ValueSchedule;
57  class ValueShort;
58  class ValueString;
59  class Mutex;
60  class ProductDescriptor;
61 
65  class Node
66  {
67  friend class Manager;
68  friend class Driver;
69  friend class Group;
70  friend class Value;
71  friend class ValueButton;
72  friend class Alarm;
73  friend class Association;
75  friend class Basic;
76  friend class Battery;
77  friend class ClimateControlSchedule;
78  friend class Clock;
79  friend class CommandClass;
80  friend class ControllerReplication;
81  friend class EnergyProduction;
82  friend class Hail;
83  friend class Indicator;
84  friend class Language;
85  friend class Lock;
86  friend class ManufacturerSpecific;
87  friend class ManufacturerSpecificDB;
88  friend class Meter;
89  friend class MeterPulse;
90  friend class MultiInstance;
92  friend class NodeNaming;
93  friend class Protection;
94  friend class Security;
95  friend class SensorAlarm;
96  friend class SensorBinary;
97  friend class SensorMultilevel;
98  friend class SwitchAll;
99  friend class SwitchBinary;
100  friend class SwitchMultilevel;
101  friend class SwitchToggleBinary;
103  friend class ThermostatFanMode;
104  friend class ThermostatFanState;
105  friend class ThermostatMode;
107  friend class ThermostatSetpoint;
108  friend class Version;
109  friend class WakeUp;
110  friend class ZWavePlusInfo;
111 
112  //-----------------------------------------------------------------------------
113  // Construction
114  //-----------------------------------------------------------------------------
115  public:
121  Node( uint32 const _homeId, uint8 const _nodeId );
124  virtual ~Node();
125 
126  private:
130  Driver* GetDriver()const;
131 
132  //-----------------------------------------------------------------------------
133  // Initialization
134  //-----------------------------------------------------------------------------
135  public:
137  {
158  };
159 
160 
177  void AdvanceQueries();
178 
185  void QueryStageComplete( QueryStage const _stage );
186 
194  void QueryStageRetry( QueryStage const _stage, uint8 const _maxAttempts = 0 ); // maxAttempts of zero means no limit
195 
202  void SetQueryStage( QueryStage const _stage, bool const _advance = true );
203 
209  Node::QueryStage GetCurrentQueryStage() { return m_queryStage; }
210 
217  string GetQueryStageName( QueryStage const _stage );
218 
223  bool IsNodeAlive()const{ return m_nodeAlive; }
224 
238  void UpdateProtocolInfo( uint8 const* _data );
246  void SetProtocolInfo(uint8 const* _protocolInfo, uint8 const _length);
247  void UpdateNodeInfo( uint8 const* _data, uint8 const _length );
248 
249  bool ProtocolInfoReceived()const{ return m_protocolInfoReceived; }
250  bool NodeInfoReceived()const{ return m_nodeInfoReceived; }
251  bool IsNodeZWavePlus()const{ return m_nodePlusInfoReceived; }
252 
253  bool AllQueriesCompleted()const{ return( QueryStage_Complete == m_queryStage ); }
254 
255  void SetNodePlusInfoReceived(const bool _received){ m_nodePlusInfoReceived = _received; }
256 
262  void SetNodeAlive( bool const _isAlive );
263 
264  private:
265  void SetStaticRequests();
266 
267  QueryStage m_queryStage;
268  bool m_queryPending;
269  bool m_queryConfiguration;
270  uint8 m_queryRetries;
271  bool m_protocolInfoReceived;
272  bool m_basicprotocolInfoReceived;
273  bool m_nodeInfoReceived;
274  bool m_nodePlusInfoReceived;
275  bool m_manufacturerSpecificClassReceived;
276  bool m_nodeInfoSupported;
277  bool m_refreshonNodeInfoFrame;
278  bool m_nodeAlive;
279 
280  //-----------------------------------------------------------------------------
281  // Capabilities
282  //-----------------------------------------------------------------------------
283  public:
284  // Security flags
285  enum
286  {
295  };
296 
297  // Node Ids
298  enum
299  {
301  };
302 
303  bool IsListeningDevice()const{ return m_listening; }
304  bool IsFrequentListeningDevice()const{ return m_frequentListening; }
305  bool IsBeamingDevice()const{ return m_beaming; }
306  bool IsRoutingDevice()const{ return m_routing; }
307  bool IsSecurityDevice()const{ return m_security; }
308  uint32 GetMaxBaudRate()const{ return m_maxBaudRate; }
309  uint8 GetVersion()const{ return m_version; }
310  uint8 GetSecurity()const{ return m_security; }
311 
312  uint8 GetNodeId()const{ return m_nodeId; }
313 
314  uint8 GetBasic()const{ return m_basic; }
315  uint8 GetGeneric()const{ return m_generic; }
316  uint8 GetSpecific()const{ return m_specific; }
317  string const& GetType()const{ return m_type; }
318  uint32 GetNeighbors( uint8** o_associations );
319  bool IsController()const{ return ( m_basic == 0x01 || m_basic == 0x02 ) && ( m_generic == 0x01 || m_generic == 0x02 ); }
320  bool IsAddingNode() const { return m_addingNode; } /* These three *AddingNode functions are used to tell if we this node is just being discovered. Currently used by the Security CC to initiate the Network Key Exchange */
321  void SetAddingNode() { m_addingNode = true; }
322  void ClearAddingNode() { m_addingNode = false; }
323  bool IsNodeReset();
324  private:
325  bool m_listening;
326  bool m_frequentListening;
327  bool m_beaming;
328  bool m_routing;
329  uint32 m_maxBaudRate;
330  uint8 m_version;
331  bool m_security;
332  uint32 m_homeId;
333  uint8 m_nodeId;
334  uint8 m_basic; //*< Basic device class (0x01-Controller, 0x02-Static Controller, 0x03-Slave, 0x04-Routing Slave
335  uint8 m_generic;
336  uint8 m_specific;
337  string m_type; // Label representing the specific/generic/basic value
338  uint8 m_neighbors[29]; // Bitmask containing the neighboring nodes
339  uint8 m_numRouteNodes; // number of node routes
340  uint8 m_routeNodes[5]; // nodes to route to
341  map<uint8,uint8> m_buttonMap; // Map button IDs into virtual node numbers
342  bool m_addingNode;
343 
344  //-----------------------------------------------------------------------------
345  // Device Naming
346  //-----------------------------------------------------------------------------
347  private:
348  // Manufacturer, Product and Name are stored here so they can be set by the
349  // user even if the device does not support the relevant command classes.
350  string GetManufacturerName()const{ return m_manufacturerName; }
351  string GetProductName()const{ return m_productName; }
352  string GetNodeName()const{ return m_nodeName; }
353  string GetLocation()const{ return m_location; }
354 
355 // string GetManufacturerId()const{ return std::to_string(m_manufacturerId); }
356  uint16 GetManufacturerId()const{ return m_manufacturerId; }
357 // string GetProductType()const{ return string(m_productType); }
358  uint16 GetProductType()const{ return m_productType; }
359 // string GetProductId()const{ return string(m_productId); }
360  uint16 GetProductId()const{ return m_productId; }
361 
362  void SetManufacturerName( string const& _manufacturerName ){ m_manufacturerName = _manufacturerName; }
363  void SetProductName( string const& _productName ){ m_productName = _productName; }
364  void SetNodeName( string const& _nodeName );
365  void SetLocation( string const& _location );
366 
367  void SetManufacturerId( uint16 const& _manufacturerId ){ m_manufacturerId = _manufacturerId; }
368  void SetProductType( uint16 const& _productType ){ m_productType = _productType; }
369  void SetProductId( uint16 const& _productId ){ m_productId = _productId; }
370 
371  string m_manufacturerName;
372  string m_productName;
373  string m_nodeName;
374  string m_location;
375 
376  uint16 m_manufacturerId;
377  uint16 m_productType;
378  uint16 m_productId;
379 
380  // zwave+ info
381  uint16 GetDeviceType() const { return m_deviceType; }
382  string GetDeviceTypeString();
383  uint8 GetRoleType() const { return m_role; }
384  string GetRoleTypeString();
385  uint8 GetNodeType() const { return m_nodeType; }
386  string GetNodeTypeString();
387 
388  uint16 m_deviceType;
389  uint8 m_role;
390  uint8 m_nodeType;
391 
392  //-----------------------------------------------------------------------------
393  // Command Classes
394  //-----------------------------------------------------------------------------
395  public:
402  CommandClass* GetCommandClass( uint8 const _commandClassId, bool advertised = false )const;
403  void ApplicationCommandHandler( uint8 const* _data, bool encrypted );
404 
411  void SetSecuredClasses( uint8 const* _data, uint8 const _length );
412  void SetSecured(bool secure);
413  private:
424  CommandClass* AddCommandClass( uint8 const _commandClassId, bool advertised = false);
431  void RemoveCommandClass( uint8 const _commandClassId );
432  void ReadXML( TiXmlElement const* _nodeElement );
433  void ReadDeviceProtocolXML( TiXmlElement const* _ccsElement );
434  void ReadCommandClassesXML( TiXmlElement const* _ccsElement );
435  void WriteXML( TiXmlElement* _nodeElement );
436 
437  map<uint8,CommandClass*> m_commandClassMap;
438  map<uint8,CommandClass*> m_advertisedCommandClassMap;
439  bool m_secured;
441  //-----------------------------------------------------------------------------
442  // Configuration Revision Related Classes
443  //-----------------------------------------------------------------------------
444  public:
445  void SetProductDetails(ProductDescriptor *product);
450  string getConfigPath();
455  uint32 getFileConfigRevision() { return m_fileConfigRevision; };
460  uint32 getLoadedConfigRevision() { return m_loadedConfigRevision; };
465  uint32 getLatestConfigRevision() { return m_latestConfigRevision; };
470  void setFileConfigRevision(uint32 rev);
485 
486  private:
487 
488 
489  ProductDescriptor *m_Product;
490 
491 
492  uint32 m_fileConfigRevision;
493  uint32 m_loadedConfigRevision;
494  uint32 m_latestConfigRevision;
495  //-----------------------------------------------------------------------------
496  // Basic commands (helpers that go through the basic command class)
497  //-----------------------------------------------------------------------------
498  public:
499  void SetLevel( uint8 const _level );
500 
501  //-----------------------------------------------------------------------------
502  // On/Off commands (helpers that go through the basic or switchall command class)
503  //-----------------------------------------------------------------------------
504  public:
505  void SetNodeOn();
506  void SetNodeOff();
507 
508  //-----------------------------------------------------------------------------
509  // Values (handled by the command classes)
510  //-----------------------------------------------------------------------------
511  public:
512  ValueID CreateValueID( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, ValueID::ValueType const _type );
513 
514  Value* GetValue( ValueID const& _id );
515  Value* GetValue( uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex );
516  bool RemoveValue( uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex );
517 
518  // Helpers for creating values
519  bool CreateValueBitSet( 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 );
520  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 );
521  bool CreateValueButton( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const& _label, uint8 const _pollIntensity );
522  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 );
523  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 );
524  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 );
525  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 );
526  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 );
527  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 );
528  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 );
529  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 );
530 
531  // helpers for removing values
532  void RemoveValueList( ValueList* _value );
533 
534  void ReadValueFromXML( uint8 const _commandClassId, TiXmlElement const* _valueElement );
535  bool CreateValueFromXML( uint8 const _commandClassId, TiXmlElement const* _valueElement );
536 
537  private:
538  ValueStore* GetValueStore()const{ return m_values; }
539 
540  ValueStore* m_values; // Values reported via command classes
541 
542  //-----------------------------------------------------------------------------
543  // Configuration Parameters (handled by the Configuration command class)
544  //-----------------------------------------------------------------------------
545  private:
546  bool SetConfigParam( uint8 const _param, int32 _value, uint8 const _size );
547  void RequestConfigParam( uint8 const _param );
548  bool RequestAllConfigParams( uint32 const _requestFlags );
549 
550  //-----------------------------------------------------------------------------
551  // Dynamic Values (used by query and other command classes for updating)
552  //-----------------------------------------------------------------------------
553  private:
554  bool RequestDynamicValues();
555  //-----------------------------------------------------------------------------
556  // Groups
557  //-----------------------------------------------------------------------------
558  private:
559  // The public interface is provided via the wrappers in the Manager class
560  uint8 GetNumGroups();
561  uint32 GetAssociations( uint8 const _groupIdx, uint8** o_associations );
562  uint32 GetAssociations( uint8 const _groupIdx, InstanceAssociation** o_associations );
563  uint8 GetMaxAssociations( uint8 const _groupIdx );
564  string GetGroupLabel( uint8 const _groupIdx );
565  void AddAssociation( uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 );
566  void RemoveAssociation( uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 );
567  void AutoAssociate();
568 
569  // The following methods are not exposed
570  Group* GetGroup( uint8 const _groupIdx ); // Get a pointer to a Group object. This must only be called while holding the node Lock.
571  void AddGroup( Group* _group ); // The groups are fixed properties of a device, so there is no need for a matching RemoveGroup.
572  void WriteGroups( TiXmlElement* _associationsElement ); // Write the group data out to XNL
573 
574  map<uint8,Group*> m_groups; // Maps group indices to Group objects.
575 
576  //-----------------------------------------------------------------------------
577  // Device Classes (static data read from the device_classes.xml file)
578  //-----------------------------------------------------------------------------
579  private:
580  // Container for device class info
581  class DeviceClass
582  {
583  public:
584  DeviceClass( TiXmlElement const* _el );
585  ~DeviceClass(){ delete [] m_mandatoryCommandClasses; }
586 
587  uint8 const* GetMandatoryCommandClasses(){ return m_mandatoryCommandClasses; }
588  uint8 GetBasicMapping(){ return m_basicMapping; }
589  string const& GetLabel(){ return m_label; }
590 
591  private:
592  uint8* m_mandatoryCommandClasses; // Zero terminated array of mandatory command classes for this device type.
593  uint8 m_basicMapping; // Command class that COMMAND_CLASS_BASIC maps on to, or zero if there is no mapping.
594  string m_label; // Descriptive label for the device.
595  };
596 
597  // Container for generic device class info
598  class GenericDeviceClass : public DeviceClass
599  {
600  public:
601  GenericDeviceClass( TiXmlElement const* _el );
602  ~GenericDeviceClass();
603 
604  DeviceClass* GetSpecificDeviceClass( uint8 const& _specific );
605 
606  private:
607  map<uint8,DeviceClass*> m_specificDeviceClasses;
608  };
609 
610 
611  bool SetDeviceClasses( uint8 const _basic, uint8 const _generic, uint8 const _specific ); // Set the device class data for the node
612  bool SetPlusDeviceClasses( uint8 const _role, uint8 const _nodeType, uint16 const _deviceType ); // Set the device class data for the node based on the Zwave+ info report
613  bool AddMandatoryCommandClasses( uint8 const* _commandClasses ); // Add mandatory command classes as specified in the device_classes.xml to the node.
614  void ReadDeviceClasses(); // Read the static device class data from the device_classes.xml file
615  string GetEndPointDeviceClassLabel( uint8 const _generic, uint8 const _specific );
616 
617  static bool s_deviceClassesLoaded; // True if the xml file has already been loaded
618  static map<uint8,string> s_basicDeviceClasses; // Map of basic device classes.
619  static map<uint8,GenericDeviceClass*> s_genericDeviceClasses; // Map of generic device classes.
620  static map<uint8,DeviceClass*> s_roleDeviceClasses; // Map of Zwave+ role device classes.
621  static map<uint16,DeviceClass*> s_deviceTypeClasses; // Map of Zwave+ device type device classes.
622  static map<uint8, DeviceClass*> s_nodeTypes; // Map of ZWave+ Node Types
623 
624 
625  //-----------------------------------------------------------------------------
626  // Statistics
627  //-----------------------------------------------------------------------------
628  public:
630  {
634  };
635 
636  struct NodeData
637  {
644  string m_sentTS;
645  string m_receivedTS;
650  uint8 m_quality; // Node quality measure
652  list<CommandClassData> m_ccData;
653  };
654 
655  private:
656  void GetNodeStatistics( NodeData* _data );
657 
658  uint32 m_sentCnt; // Number of messages sent from this node.
659  uint32 m_sentFailed; // Number of sent messages failed
660  uint32 m_retries; // Number of message retries
661  uint32 m_receivedCnt; // Number of messages received from this node.
662  uint32 m_receivedDups; // Number of duplicated messages received;
663  uint32 m_receivedUnsolicited; // Number of messages received unsolicited
664  uint32 m_lastRequestRTT; // Last message request RTT
665  uint32 m_lastResponseRTT; // Last message response RTT
666  TimeStamp m_sentTS; // Last message sent time
667  TimeStamp m_receivedTS; // Last message received time
668  uint32 m_averageRequestRTT; // Average Request round trip time.
669  uint32 m_averageResponseRTT; // Average Response round trip time.
670  uint8 m_quality; // Node quality measure
671  uint8 m_lastReceivedMessage[254]; // Place to hold last received message
672  uint8 m_errors; // Count errors for dead node detection
673 
674  //-----------------------------------------------------------------------------
675  // Encryption Related
676  //-----------------------------------------------------------------------------
677  public:
678 
680  uint8 *GetNonceKey(uint32 nonceid);
681 
682  private:
683  uint8 m_lastnonce;
684  uint8 m_nonces[8][8];
685 
686  //-----------------------------------------------------------------------------
687  // MetaData Related
688  //-----------------------------------------------------------------------------
689 
690  public:
698  {
705  };
706 
707  string const GetMetaData(MetaDataFields);
708  MetaDataFields const GetMetaDataId(string);
709  string const GetMetaDataString(MetaDataFields);
710 
711 
712  private:
713  void ReadMetaDataFromXML(TiXmlElement const* _valueElement);
714  void WriteMetaDataXML(TiXmlElement*);
715  map<MetaDataFields, string> m_metadata;
716  };
717 
718 
719 } //namespace OpenZWave
720 
721 #endif //_Node_H
string const GetMetaDataString(MetaDataFields)
Definition: Node.cpp:3851
Implements COMMAND_CLASS_SWITCH_BINARY (0x25), a Z-Wave device command class.
Definition: SwitchBinary.h:40
Implements COMMAND_CLASS_INDICATOR (0x87), a Z-Wave device command class.
Definition: Indicator.h:40
bool IsAddingNode() const
Definition: Node.h:320
Implements COMMAND_CLASS_ASSOCIATION (0x85), a Z-Wave device command class.
Definition: Association.h:39
bool IsFrequentListeningDevice() const
Definition: Node.h:304
Implements COMMAND_CLASS_THERMOSTAT_FAN_MODE (0x44), a Z-Wave device command class.
Definition: ThermostatFanMode.h:43
string const & GetType() const
Definition: Node.h:317
Implements COMMAND_CLASS_ASSOCIATION_COMMAND_CONFIGURATION (0x9b), a Z-Wave device command class.
Definition: AssociationCommandConfiguration.h:43
Definition: Bitfield.h:34
void QueryStageRetry(QueryStage const _stage, uint8 const _maxAttempts=0)
Definition: Node.cpp:770
Container that holds all of the values associated with a given node.
Definition: ValueStore.h:44
uint32 m_lastResponseRTT
Definition: Node.h:648
void SetProtocolInfo(uint8 const *_protocolInfo, uint8 const _length)
Definition: Node.cpp:1531
uint32 m_receivedCnt
Definition: Node.h:633
bool AllQueriesCompleted() const
Definition: Node.h:253
void checkLatestConfigRevision()
Definition: Node.cpp:3813
Implements COMMAND_CLASS_SECURITY (0x98), a Z-Wave device command class.
Definition: Security.h:64
ValueID CreateValueID(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, ValueID::ValueType const _type)
Definition: Node.cpp:2276
uint32 getFileConfigRevision()
Definition: Node.h:455
Implements COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72), a Z-Wave device command class.
Definition: ManufacturerSpecific.h:39
uint32 m_sentFailed
Definition: Node.h:639
unsigned short uint16
Definition: Defs.h:93
ValueType
Definition: ValueID.h:94
The _ManufacturerSpecificDB class handles the Config File Database that we use to configure devices.
Definition: ManufacturerSpecificDB.h:106
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)
Definition: Node.cpp:2411
Implements COMMAND_CLASS_METER_PULSE (0x35), a Z-Wave device command class.
Definition: MeterPulse.h:40
bool RemoveValue(uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex)
Definition: Node.cpp:2769
Implements COMMAND_CLASS_THERMOSTAT_SETPOINT (0x43), a Z-Wave device command class.
Definition: ThermostatSetpoint.h:42
void SetSecured(bool secure)
Definition: Node.cpp:1594
Implements COMMAND_CLASS_WAKE_UP (0x84), a Z-Wave device command class.
Definition: WakeUp.h:44
The main public interface to OpenZWave.
Definition: Manager.h:110
string GetQueryStageName(QueryStage const _stage)
Definition: Node.cpp:829
bool NodeInfoReceived() const
Definition: Node.h:250
MetaDataFields
Definition: Node.h:697
Implements COMMAND_CLASS_SENSOR_ALARM (0x9c), a Z-Wave device command class.
Definition: SensorAlarm.h:42
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)
Definition: Node.cpp:2471
uint32 GetNeighbors(uint8 **o_associations)
Definition: Node.cpp:841
bool ProtocolInfoReceived() const
Definition: Node.h:249
struct OpenZWave::InstanceAssociation InstanceAssociation
Implements COMMAND_CLASS_LOCK (0x76), a Z-Wave device command class.
Definition: Lock.h:40
Implements COMMAND_CLASS_SENSOR_BINARY (0x30), a Z-Wave device command class.
Definition: SensorBinary.h:40
QueryStage
Definition: Node.h:136
bool IsSecurityDevice() const
Definition: Node.h:307
void ClearAddingNode()
Definition: Node.h:322
friend class Group
Definition: Node.h:69
Implements COMMAND_CLASS_THERMOSTAT_FAN_STATE (0x45), a Z-Wave device command class.
Definition: ThermostatFanState.h:43
void ReadValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition: Node.cpp:2684
void SetNodeAlive(bool const _isAlive)
Definition: Node.cpp:1810
void SetSecuredClasses(uint8 const *_data, uint8 const _length)
Definition: Node.cpp:1601
Implements COMMAND_CLASS_METER (0x32), a Z-Wave device command class.
Definition: Meter.h:40
uint8 GetVersion() const
Definition: Node.h:309
Definition: ManufacturerSpecificDB.h:46
void SetProductDetails(ProductDescriptor *product)
Definition: Node.cpp:3724
uint8 m_commandClassId
Definition: Node.h:631
The Node class describes a Z-Wave node object...typically a device on the Z-Wave network.
Definition: Node.h:65
bool IsNodeAlive() const
Definition: Node.h:223
Implements COMMAND_CLASS_ALARM (0x71), a Z-Wave device command class.
Definition: Alarm.h:40
void setLoadedConfigRevision(uint32 rev)
Definition: Node.cpp:3775
void QueryStageComplete(QueryStage const _stage)
Definition: Node.cpp:742
list< CommandClassData > m_ccData
Definition: Node.h:652
Base class for all Z-Wave command classes.
Definition: CommandClass.h:54
bool IsController() const
Definition: Node.h:319
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)
Definition: Node.cpp:2381
uint8 * GetNonceKey(uint32 nonceid)
Definition: Node.cpp:3637
Implements COMMAND_CLASS_SWITCH_TOGGLE_BINARY (0x28), a Z-Wave device command class.
Definition: SwitchToggleBinary.h:40
Button value.
Definition: ValueButton.h:46
uint8 GetSecurity() const
Definition: Node.h:310
string m_sentTS
Definition: Node.h:644
signed short int16
Definition: Defs.h:92
bool IsNodeReset()
Definition: Node.cpp:3708
virtual ~Node()
Definition: Node.cpp:199
Implements COMMAND_CLASS_CLIMATE_CONTROL_SCHEDULE (0x46), a Z-Wave device command class.
Definition: ClimateControlSchedule.h:42
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)
Definition: Node.cpp:2325
string getConfigPath()
Definition: Node.cpp:3741
Implements COMMAND_CLASS_THERMOSTAT_MODE (0x40), a Z-Wave device command class.
Definition: ThermostatMode.h:43
Implements COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION (0x8E), a Z-Wave device command class.
Definition: MultiChannelAssociation.h:40
Definition: Node.h:629
string m_receivedTS
Definition: Node.h:645
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition: Driver.h:63
MetaDataFields const GetMetaDataId(string)
Definition: Node.cpp:3839
Definition: Node.h:636
signed int int32
Definition: Defs.h:95
void SetNodePlusInfoReceived(const bool _received)
Definition: Node.h:255
unsigned int uint32
Definition: Defs.h:96
Definition: Node.h:140
void SetNodeOn()
Definition: Node.cpp:2246
uint32 m_sentCnt
Definition: Node.h:638
uint32 m_sentCnt
Definition: Node.h:632
void setFileConfigRevision(uint32 rev)
Definition: Node.cpp:3756
Manages a group of devices (various nodes associated with each other).
Definition: Group.h:49
Implements COMMAND_CLASS_HAIL (0x82), a Z-Wave device command class.
Definition: Hail.h:38
void RemoveValueList(ValueList *_value)
Definition: Node.cpp:2623
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)
Definition: Node.cpp:2503
void AdvanceQueries()
Definition: Node.cpp:249
uint8 m_lastReceivedMessage[254]
Definition: Node.h:651
uint32 getLatestConfigRevision()
Definition: Node.h:465
bool CreateValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition: Node.cpp:2636
uint32 m_averageResponseRTT
Definition: Node.h:649
Implements COMMAND_CLASS_SWITCH_MULTILEVEL (0x26), a Z-Wave device command class.
Definition: SwitchMultilevel.h:42
uint32 GetMaxBaudRate() const
Definition: Node.h:308
void ApplicationCommandHandler(uint8 const *_data, bool encrypted)
Definition: Node.cpp:1927
void SetLevel(uint8 const _level)
Definition: Node.cpp:2224
Definition: Node.h:704
void SetQueryStage(QueryStage const _stage, bool const _advance=true)
Definition: Node.cpp:803
uint32 m_lastRequestRTT
Definition: Node.h:646
void UpdateNodeInfo(uint8 const *_data, uint8 const _length)
Definition: Node.cpp:1709
Implements COMMAND_CLASS_PROTECTION (0x75), a Z-Wave device command class.
Definition: Protection.h:40
Definition: Node.h:300
Provides a unique ID for a value reported by a Z-Wave device.The ValueID is used to uniquely identify...
Definition: ValueID.h:62
uint8 GetNodeId() const
Definition: Node.h:312
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)
Definition: Node.cpp:2534
bool IsBeamingDevice() const
Definition: Node.h:305
void SetAddingNode()
Definition: Node.h:321
bool IsNodeZWavePlus() const
Definition: Node.h:251
uint32 m_averageRequestRTT
Definition: Node.h:647
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)
Definition: Node.cpp:2593
Implements COMMAND_CLASS_BATTERY (0x80), a Z-Wave device command class.
Definition: Battery.h:40
void setLatestConfigRevision(uint32 rev)
Definition: Node.cpp:3794
Implements COMMAND_CLASS_SWITCH_ALL (0x27), a Z-Wave device command class.
Definition: SwitchAll.h:40
Node(uint32 const _homeId, uint8 const _nodeId)
Definition: Node.cpp:122
Node::QueryStage GetCurrentQueryStage()
Definition: Node.h:209
uint32 getLoadedConfigRevision()
Definition: Node.h:460
uint32 m_receivedUnsolicited
Definition: Node.h:643
uint8 * GenerateNonceKey()
Definition: Node.cpp:3597
Implements COMMAND_CLASS_CLOCK (0x81), a Z-Wave device command class.
Definition: Clock.h:41
Implements COMMAND_CLASS_SWITCH_TOGGLE_MULTILEVEL (0x29), a Z-Wave device command class.
Definition: SwitchToggleMultilevel.h:40
Implements COMMAND_CLASS_THERMOSTAT_OPERATING_STATE (0x42), a Z-Wave device command class.
Definition: ThermostatOperatingState.h:43
CommandClass * GetCommandClass(uint8 const _commandClassId, bool advertised=false) const
Definition: Node.cpp:1996
uint32 m_receivedCnt
Definition: Node.h:641
Implements COMMAND_CLASS_ENERGY_PRODUCTION (0x90), a Z-Wave device command class.
Definition: EnergyProduction.h:40
Implements COMMAND_CLASS_MULTI_INSTANCE (0x60), a Z-Wave device command class.
Definition: MultiInstance.h:39
Implements COMMAND_CLASS_LANGUAGE (0x89), a Z-Wave device command class.
Definition: Language.h:40
Implements a platform-independent TimeStamp.
Definition: TimeStamp.h:40
Base class for values associated with a node.
Definition: Value.h:48
uint8 GetGeneric() const
Definition: Node.h:315
Implements COMMAND_CLASS_ZWAVE_PLUS_INFO (0x5E), a Z-Wave device command class.
Definition: ZWavePlusInfo.h:38
Implements COMMAND_CLASS_VERSION (0x86), a Z-Wave device command class.
Definition: Version.h:40
void UpdateProtocolInfo(uint8 const *_data)
Definition: Node.cpp:1419
Implements COMMAND_CLASS_NODE_NAMING (0x77), a Z-Wave device command class.
Definition: NodeNaming.h:54
uint32 m_retries
Definition: Node.h:640
bool IsRoutingDevice() const
Definition: Node.h:306
Implements COMMAND_CLASS_SENSOR_MULTILEVEL (0x31), a Z-Wave device command class.
Definition: SensorMultilevel.h:40
void SetNodeOff()
Definition: Node.cpp:2261
Implements COMMAND_CLASS_CONTROLLER_REPLICATION (0x21), a Z-Wave device command class.
Definition: ControllerReplication.h:38
Definition: Node.h:138
bool IsListeningDevice() const
Definition: Node.h:303
bool CreateValueBitSet(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)
Definition: Node.cpp:2292
Implements COMMAND_CLASS_BASIC (0x20), a Z-Wave device command class.
Definition: Basic.h:40
Value * GetValue(ValueID const &_id)
Definition: Node.cpp:2738
uint8 GetBasic() const
Definition: Node.h:314
ValueGenre
Definition: ValueID.h:80
uint32 m_receivedDups
Definition: Node.h:642
string const GetMetaData(MetaDataFields)
Definition: Node.cpp:3828
bool CreateValueButton(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint8 const _valueIndex, string const &_label, uint8 const _pollIntensity)
Definition: Node.cpp:2355
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)
Definition: Node.cpp:2441
uint8 m_quality
Definition: Node.h:650
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)
Definition: Node.cpp:2563
List of values sent to/received from a node.
Definition: ValueList.h:46
friend class CommandClass
Definition: Node.h:79
uint8 GetSpecific() const
Definition: Node.h:316
unsigned char uint8
Definition: Defs.h:90