OpenZWave Library 1.6.0
Loading...
Searching...
No Matches
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"
38#include "Msg.h"
39#include "platform/TimeStamp.h"
40#include "Group.h"
41
42class TiXmlElement;
43
44namespace 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;
78 friend class Clock;
79 friend class CommandClass;
81 friend class EnergyProduction;
82 friend class Hail;
83 friend class Indicator;
84 friend class Language;
85 friend class Lock;
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:
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 {
300 NodeBroadcast = 0xff
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
412 void SetSecuredClasses( uint8 const* _data, uint8 const _length, uint32 const _instance = 1);
413 void SetSecured(bool secure);
414 bool IsSecured();
419 void SetInstanceLabel(uint8 const _instance, char *label);
423 string GetInstanceLabel(uint8 const _ccid, uint8 const _instance);
424
428 uint8 GetNumInstances(uint8 const _ccid);
429 private:
440 CommandClass* AddCommandClass( uint8 const _commandClassId, bool advertised = false);
447 void RemoveCommandClass( uint8 const _commandClassId );
448 void ReadXML( TiXmlElement const* _nodeElement );
449 void ReadDeviceProtocolXML( TiXmlElement const* _ccsElement );
450 void ReadCommandClassesXML( TiXmlElement const* _ccsElement );
451 void WriteXML( TiXmlElement* _nodeElement );
452
453 map<uint8,CommandClass*> m_commandClassMap;
454 map<uint8,CommandClass*> m_advertisedCommandClassMap;
455 bool m_secured;
456 map<uint8, string> m_globalInstanceLabel;
457 //-----------------------------------------------------------------------------
458 // Configuration Revision Related Classes
459 //-----------------------------------------------------------------------------
460 public:
461 void SetProductDetails(ProductDescriptor *product);
466 string getConfigPath();
471 uint32 getFileConfigRevision() { return m_fileConfigRevision; };
476 uint32 getLoadedConfigRevision() { return m_loadedConfigRevision; };
481 uint32 getLatestConfigRevision() { return m_latestConfigRevision; };
501
502 private:
503
504
505 ProductDescriptor *m_Product;
506
507
508 uint32 m_fileConfigRevision;
509 uint32 m_loadedConfigRevision;
510 uint32 m_latestConfigRevision;
511 //-----------------------------------------------------------------------------
512 // Basic commands (helpers that go through the basic command class)
513 //-----------------------------------------------------------------------------
514 public:
515 void SetLevel( uint8 const _level );
516
517 //-----------------------------------------------------------------------------
518 // On/Off commands (helpers that go through the basic or switchall command class)
519 //-----------------------------------------------------------------------------
520 public:
521 void SetNodeOn();
522 void SetNodeOff();
523
524 //-----------------------------------------------------------------------------
525 // Values (handled by the command classes)
526 //-----------------------------------------------------------------------------
527 public:
528 ValueID CreateValueID( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, ValueID::ValueType const _type );
529
530 Value* GetValue( ValueID const& _id );
531 Value* GetValue( uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex );
532 bool RemoveValue( uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex );
533
534 // Helpers for creating values
535 bool CreateValueBitSet( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, int32 const _default, uint8 const _pollIntensity );
536 bool CreateValueBool( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, bool const _default, uint8 const _pollIntensity );
537 bool CreateValueButton( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, uint8 const _pollIntensity );
538 bool CreateValueByte( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, uint8 const _default, uint8 const _pollIntensity );
539 bool CreateValueDecimal( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, string const& _default, uint8 const _pollIntensity );
540 bool CreateValueInt( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, int32 const _default, uint8 const _pollIntensity );
541 bool CreateValueList( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 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 );
542 bool CreateValueRaw( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, uint8 const* _default, uint8 const _length, uint8 const _pollIntensity );
543 bool CreateValueSchedule( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, uint8 const _pollIntensity );
544 bool CreateValueShort( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, int16 const _default, uint8 const _pollIntensity );
545 bool CreateValueString( ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, string const& _units, bool const _readOnly, bool const _writeOnly, string const& _default, uint8 const _pollIntensity );
546
547 // helpers for removing values
548 void RemoveValueList( ValueList* _value );
549
550 void ReadValueFromXML( uint8 const _commandClassId, TiXmlElement const* _valueElement );
551 bool CreateValueFromXML( uint8 const _commandClassId, TiXmlElement const* _valueElement );
552
553 private:
554 ValueStore* GetValueStore()const{ return m_values; }
555
556 ValueStore* m_values; // Values reported via command classes
557
558 //-----------------------------------------------------------------------------
559 // Configuration Parameters (handled by the Configuration command class)
560 //-----------------------------------------------------------------------------
561 private:
562 bool SetConfigParam( uint8 const _param, int32 _value, uint8 const _size );
563 void RequestConfigParam( uint8 const _param );
564 bool RequestAllConfigParams( uint32 const _requestFlags );
565
566 //-----------------------------------------------------------------------------
567 // Dynamic Values (used by query and other command classes for updating)
568 //-----------------------------------------------------------------------------
569 private:
570 bool RequestDynamicValues();
571 public:
572 //-----------------------------------------------------------------------------
573 // Refresh Dynamic Values from CommandClasses on Wakeup
574 //-----------------------------------------------------------------------------
576 //-----------------------------------------------------------------------------
577 // Groups
578 //-----------------------------------------------------------------------------
579 private:
580 // The public interface is provided via the wrappers in the Manager class
581 uint8 GetNumGroups();
582 uint32 GetAssociations( uint8 const _groupIdx, uint8** o_associations );
583 uint32 GetAssociations( uint8 const _groupIdx, InstanceAssociation** o_associations );
584 uint8 GetMaxAssociations( uint8 const _groupIdx );
585 bool IsMultiInstance( uint8 const _groupIdx );
586 string GetGroupLabel( uint8 const _groupIdx );
587 void AddAssociation( uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 );
588 void RemoveAssociation( uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00 );
589 void AutoAssociate();
590
591 // The following methods are not exposed
592 Group* GetGroup( uint8 const _groupIdx ); // Get a pointer to a Group object. This must only be called while holding the node Lock.
593 void AddGroup( Group* _group ); // The groups are fixed properties of a device, so there is no need for a matching RemoveGroup.
594 void WriteGroups( TiXmlElement* _associationsElement ); // Write the group data out to XNL
595
596 map<uint8,Group*> m_groups; // Maps group indices to Group objects.
597
598 //-----------------------------------------------------------------------------
599 // Device Classes (static data read from the device_classes.xml file)
600 //-----------------------------------------------------------------------------
601 private:
602 // Container for device class info
603 class DeviceClass
604 {
605 public:
606 DeviceClass( TiXmlElement const* _el );
607 ~DeviceClass(){ delete [] m_mandatoryCommandClasses; }
608
609 uint8 const* GetMandatoryCommandClasses(){ return m_mandatoryCommandClasses; }
610 uint8 GetBasicMapping(){ return m_basicMapping; }
611 string const& GetLabel(){ return m_label; }
612
613 private:
614 uint8* m_mandatoryCommandClasses; // Zero terminated array of mandatory command classes for this device type.
615 uint8 m_basicMapping; // Command class that COMMAND_CLASS_BASIC maps on to, or zero if there is no mapping.
616 string m_label; // Descriptive label for the device.
617 };
618
619 // Container for generic device class info
620 class GenericDeviceClass : public DeviceClass
621 {
622 public:
623 GenericDeviceClass( TiXmlElement const* _el );
624 ~GenericDeviceClass();
625
626 DeviceClass* GetSpecificDeviceClass( uint8 const& _specific );
627
628 private:
629 map<uint8,DeviceClass*> m_specificDeviceClasses;
630 };
631
632
633 bool SetDeviceClasses( uint8 const _basic, uint8 const _generic, uint8 const _specific ); // Set the device class data for the node
634 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
635 bool AddMandatoryCommandClasses( uint8 const* _commandClasses ); // Add mandatory command classes as specified in the device_classes.xml to the node.
636 void ReadDeviceClasses(); // Read the static device class data from the device_classes.xml file
637 string GetEndPointDeviceClassLabel( uint8 const _generic, uint8 const _specific );
638
639 static bool s_deviceClassesLoaded; // True if the xml file has already been loaded
640 static map<uint8,string> s_basicDeviceClasses; // Map of basic device classes.
641 static map<uint8,GenericDeviceClass*> s_genericDeviceClasses; // Map of generic device classes.
642 static map<uint8,DeviceClass*> s_roleDeviceClasses; // Map of Zwave+ role device classes.
643 static map<uint16,DeviceClass*> s_deviceTypeClasses; // Map of Zwave+ device type device classes.
644 static map<uint8, DeviceClass*> s_nodeTypes; // Map of ZWave+ Node Types
645
646
647 //-----------------------------------------------------------------------------
648 // Statistics
649 //-----------------------------------------------------------------------------
650 public:
657
692
693 private:
694 void GetNodeStatistics( NodeData* _data );
695
696 uint32 m_sentCnt; // Number of messages sent from this node.
697 uint32 m_sentFailed; // Number of sent messages failed
698 uint32 m_retries; // Number of message retries
699 uint32 m_receivedCnt; // Number of messages received from this node.
700 uint32 m_receivedDups; // Number of duplicated messages received;
701 uint32 m_receivedUnsolicited; // Number of messages received unsolicited
702 uint32 m_lastRequestRTT; // Last message request RTT
703 uint32 m_lastResponseRTT; // Last message response RTT
704 TimeStamp m_sentTS; // Last message sent time
705 TimeStamp m_receivedTS; // Last message received time
706 uint32 m_averageRequestRTT; // Average Request round trip time.
707 uint32 m_averageResponseRTT; // Average Response round trip time.
708 uint8 m_quality; // Node quality measure
709 uint8 m_lastReceivedMessage[254]; // Place to hold last received message
710 uint8 m_errors;
711 bool m_txStatusReportSupported; // if Extended Status Reports are available
712 uint16 m_txTime; // Time Taken to Transmit the last frame
713 uint8 m_hops; // Hops taken in transmitting last frame
714 char m_rssi_1[8]; // RSSI Level of last transmission
715 char m_rssi_2[8]; // RSSI Level of last transmission
716 char m_rssi_3[8]; // RSSI Level of last transmission
717 char m_rssi_4[8]; // RSSI Level of last transmission
718 char m_rssi_5[8]; // RSSI Level of last transmission
719 uint8 m_ackChannel; // Channel we received the last ACK on
720 uint8 m_lastTxChannel; // Channel we transmitted the last frame on
721 TXSTATUS_ROUTING_SCHEME m_routeScheme; // The Scheme used to route the last frame
722 uint8 m_routeUsed[4]; // The Route Taken in the last frame
723 TXSTATUS_ROUTE_SPEED m_routeSpeed; // Baud Rate of the last frame
724 uint8 m_routeTries; // The number of attempts to route the last frame
725 uint8 m_lastFailedLinkFrom; // The last failed link from
726 uint8 m_lastFailedLinkTo; // The last failed link to
727
728
729 //-----------------------------------------------------------------------------
730 // Encryption Related
731 //-----------------------------------------------------------------------------
732 public:
733
735 uint8 *GetNonceKey(uint32 nonceid);
736
737 private:
738 uint8 m_lastnonce;
739 uint8 m_nonces[8][8];
740
741 //-----------------------------------------------------------------------------
742 // MetaData Related
743 //-----------------------------------------------------------------------------
744
745 public:
770
772 string author;
773 string date;
776 };
777 string const GetMetaData(MetaDataFields);
778 MetaDataFields const GetMetaDataId(string);
779 string const GetMetaDataString(MetaDataFields);
780 ChangeLogEntry const GetChangeLog(uint32_t);
781
782
783 private:
784 void ReadMetaDataFromXML(TiXmlElement const* _valueElement);
785 void WriteMetaDataXML(TiXmlElement*);
786 map<MetaDataFields, string> m_metadata;
787 map<uint32_t, ChangeLogEntry> m_changeLog;
788 };
789
790
791} //namespace OpenZWave
792
793#endif //_Node_H
unsigned short uint16
Definition Defs.h:92
unsigned int uint32
Definition Defs.h:95
signed short int16
Definition Defs.h:91
signed int int32
Definition Defs.h:94
TXSTATUS_ROUTING_SCHEME
Definition Defs.h:455
TXSTATUS_ROUTE_SPEED
Definition Defs.h:468
unsigned char uint8
Definition Defs.h:89
Implements COMMAND_CLASS_NOTIFICATION (0x71), a Z-Wave device command class.
Definition Alarm.h:42
Implements COMMAND_CLASS_ASSOCIATION_COMMAND_CONFIGURATION (0x9b), a Z-Wave device command class.
Definition AssociationCommandConfiguration.h:44
Implements COMMAND_CLASS_ASSOCIATION (0x85), a Z-Wave device command class.
Definition Association.h:40
Implements COMMAND_CLASS_BASIC (0x20), a Z-Wave device command class.
Definition Basic.h:41
Implements COMMAND_CLASS_BATTERY (0x80), a Z-Wave device command class.
Definition Battery.h:41
Implements COMMAND_CLASS_CLIMATE_CONTROL_SCHEDULE (0x46), a Z-Wave device command class.
Definition ClimateControlSchedule.h:43
Implements COMMAND_CLASS_CLOCK (0x81), a Z-Wave device command class.
Definition Clock.h:42
Base class for all Z-Wave command classes.
Definition CommandClass.h:56
Implements COMMAND_CLASS_CONTROLLER_REPLICATION (0x21), a Z-Wave device command class.
Definition ControllerReplication.h:39
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition Driver.h:65
Implements COMMAND_CLASS_ENERGY_PRODUCTION (0x90), a Z-Wave device command class.
Definition EnergyProduction.h:41
Manages a group of devices (various nodes associated with each other).
Definition Group.h:50
Implements COMMAND_CLASS_HAIL (0x82), a Z-Wave device command class.
Definition Hail.h:39
Implements COMMAND_CLASS_INDICATOR (0x87), a Z-Wave device command class.
Definition Indicator.h:41
Implements COMMAND_CLASS_LANGUAGE (0x89), a Z-Wave device command class.
Definition Language.h:41
Implements COMMAND_CLASS_LOCK (0x76), a Z-Wave device command class.
Definition Lock.h:41
The main public interface to OpenZWave.
Definition Manager.h:111
The _ManufacturerSpecificDB class handles the Config File Database that we use to configure devices.
Definition ManufacturerSpecificDB.h:106
Implements COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72), a Z-Wave device command class.
Definition ManufacturerSpecific.h:40
Implements COMMAND_CLASS_METER_PULSE (0x35), a Z-Wave device command class.
Definition MeterPulse.h:41
Implements COMMAND_CLASS_METER (0x32), a Z-Wave device command class.
Definition Meter.h:41
Implements COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION (0x8E), a Z-Wave device command class.
Definition MultiChannelAssociation.h:41
Implements COMMAND_CLASS_MULTI_INSTANCE (0x60), a Z-Wave device command class.
Definition MultiInstance.h:40
Implements COMMAND_CLASS_NODE_NAMING (0x77), a Z-Wave device command class.
Definition NodeNaming.h:55
The Node class describes a Z-Wave node object...typically a device on the Z-Wave network.
Definition Node.h:66
uint8 GetNodeId() const
Definition Node.h:312
void ClearAddingNode()
Definition Node.h:322
void UpdateProtocolInfo(uint8 const *_data)
Definition Node.cpp:1437
uint32 getFileConfigRevision()
Definition Node.h:471
bool CreateValueButton(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, uint8 const _pollIntensity)
Definition Node.cpp:2483
bool ProtocolInfoReceived() const
Definition Node.h:249
bool CreateValueDecimal(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, string const &_default, uint8 const _pollIntensity)
Definition Node.cpp:2539
bool NodeInfoReceived() const
Definition Node.h:250
CommandClass * GetCommandClass(uint8 const _commandClassId, bool advertised=false) const
Definition Node.cpp:2108
void RefreshValuesOnWakeup()
Definition Node.cpp:2335
friend class CommandClass
Definition Node.h:79
friend class Group
Definition Node.h:69
void SetAddingNode()
Definition Node.h:321
void SetSecuredClasses(uint8 const *_data, uint8 const _length, uint32 const _instance=1)
Definition Node.cpp:1682
uint8 * GenerateNonceKey()
Definition Node.cpp:3766
bool CreateValueBool(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, bool const _default, uint8 const _pollIntensity)
Definition Node.cpp:2453
bool IsController() const
Definition Node.h:319
void SetNodeAlive(bool const _isAlive)
Definition Node.cpp:1903
void setLatestConfigRevision(uint32 rev)
Definition Node.cpp:3963
void QueryStageRetry(QueryStage const _stage, uint8 const _maxAttempts=0)
Definition Node.cpp:788
bool IsFrequentListeningDevice() const
Definition Node.h:304
bool IsBeamingDevice() const
Definition Node.h:305
void RemoveValueList(ValueList *_value)
Definition Node.cpp:2750
bool IsRoutingDevice() const
Definition Node.h:306
Value * GetValue(ValueID const &_id)
Definition Node.cpp:2865
uint8 GetSecurity() const
Definition Node.h:310
bool IsAddingNode() const
Definition Node.h:320
bool RemoveValue(uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex)
Definition Node.cpp:2896
uint8 GetSpecific() const
Definition Node.h:316
void SetLevel(uint8 const _level)
Definition Node.cpp:2352
void QueryStageComplete(QueryStage const _stage)
Definition Node.cpp:760
uint32 getLoadedConfigRevision()
Definition Node.h:476
bool CreateValueByte(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const _default, uint8 const _pollIntensity)
Definition Node.cpp:2509
void SetProductDetails(ProductDescriptor *product)
Definition Node.cpp:3893
string GetQueryStageName(QueryStage const _stage)
Definition Node.cpp:847
@ NodeBroadcast
Definition Node.h:300
bool IsSecured()
Definition Node.cpp:1621
uint8 * GetNonceKey(uint32 nonceid)
Definition Node.cpp:3806
string const GetMetaDataString(MetaDataFields)
Definition Node.cpp:4050
bool CreateValueSchedule(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, uint8 const _pollIntensity)
Definition Node.cpp:2661
bool CreateValueList(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 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:2599
uint8 GetBasic() const
Definition Node.h:314
string GetInstanceLabel(uint8 const _ccid, uint8 const _instance)
Definition Node.cpp:1637
MetaDataFields const GetMetaDataId(string)
Definition Node.cpp:4029
QueryStage
Definition Node.h:137
@ QueryStage_SecurityReport
Definition Node.h:145
@ QueryStage_Session
Definition Node.h:154
@ QueryStage_Probe1
Definition Node.h:151
@ QueryStage_Complete
Definition Node.h:157
@ QueryStage_ProtocolInfo
Definition Node.h:139
@ QueryStage_NodeInfo
Definition Node.h:143
@ QueryStage_CacheLoad
Definition Node.h:150
@ QueryStage_Neighbors
Definition Node.h:153
@ QueryStage_NodePlusInfo
Definition Node.h:144
@ QueryStage_Probe
Definition Node.h:140
@ QueryStage_Dynamic
Definition Node.h:155
@ QueryStage_WakeUp
Definition Node.h:141
@ QueryStage_Static
Definition Node.h:149
@ QueryStage_ManufacturerSpecific2
Definition Node.h:146
@ QueryStage_Instances
Definition Node.h:148
@ QueryStage_ManufacturerSpecific1
Definition Node.h:142
@ QueryStage_Versions
Definition Node.h:147
@ QueryStage_None
Definition Node.h:138
@ QueryStage_Configuration
Definition Node.h:156
@ QueryStage_Associations
Definition Node.h:152
void ReadValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition Node.cpp:2811
bool IsNodeReset()
Definition Node.cpp:3877
uint32 GetMaxBaudRate() const
Definition Node.h:308
ValueID CreateValueID(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, ValueID::ValueType const _type)
Definition Node.cpp:2404
void checkLatestConfigRevision()
Definition Node.cpp:3982
bool CreateValueString(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, string const &_default, uint8 const _pollIntensity)
Definition Node.cpp:2720
virtual ~Node()
Definition Node.cpp:214
string const GetMetaData(MetaDataFields)
Definition Node.cpp:3998
uint8 GetVersion() const
Definition Node.h:309
bool IsListeningDevice() const
Definition Node.h:303
bool AllQueriesCompleted() const
Definition Node.h:253
bool CreateValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition Node.cpp:2763
void ApplicationCommandHandler(uint8 const *_data, bool encrypted)
Definition Node.cpp:2020
uint8 GetNumInstances(uint8 const _ccid)
Definition Node.cpp:1662
void SetNodeOn()
Definition Node.cpp:2374
ChangeLogEntry const GetChangeLog(uint32_t)
Definition Node.cpp:4013
uint8 GetGeneric() const
Definition Node.h:315
@ SecurityFlag_OptionalFunctionality
Definition Node.h:294
@ SecurityFlag_RoutingSlave
Definition Node.h:290
@ SecurityFlag_Sensor250ms
Definition Node.h:292
@ SecurityFlag_Sensor1000ms
Definition Node.h:293
@ SecurityFlag_Controller
Definition Node.h:288
@ SecurityFlag_Security
Definition Node.h:287
@ SecurityFlag_BeamCapability
Definition Node.h:291
@ SecurityFlag_SpecificDevice
Definition Node.h:289
void setLoadedConfigRevision(uint32 rev)
Definition Node.cpp:3944
void SetNodeOff()
Definition Node.cpp:2389
bool IsNodeZWavePlus() const
Definition Node.h:251
MetaDataFields
Definition Node.h:753
@ MetaData_ExclusionHelp
Definition Node.h:761
@ MetaData_OzwInfoPage_URL
Definition Node.h:754
@ MetaData_InclusionHelp
Definition Node.h:760
@ MetaData_ProductPic
Definition Node.h:756
@ MetaData_Identifier
Definition Node.h:767
@ MetaData_WakeupHelp
Definition Node.h:763
@ MetaData_Frequency
Definition Node.h:765
@ MetaData_ZWProductPage_URL
Definition Node.h:755
@ MetaData_ProductSupport_URL
Definition Node.h:764
@ MetaData_ProductPage_URL
Definition Node.h:759
@ MetaData_Invalid
Definition Node.h:768
@ MetaData_Name
Definition Node.h:766
@ MetaData_ProductManual_URL
Definition Node.h:758
@ MetaData_ResetHelp
Definition Node.h:762
@ MetaData_Description
Definition Node.h:757
void SetSecured(bool secure)
Definition Node.cpp:1613
void SetInstanceLabel(uint8 const _instance, char *label)
Definition Node.cpp:1628
void setFileConfigRevision(uint32 rev)
Definition Node.cpp:3925
bool CreateValueShort(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, int16 const _default, uint8 const _pollIntensity)
Definition Node.cpp:2690
uint32 getLatestConfigRevision()
Definition Node.h:481
string const & GetType() const
Definition Node.h:317
uint32 GetNeighbors(uint8 **o_associations)
Definition Node.cpp:859
Node::QueryStage GetCurrentQueryStage()
Definition Node.h:209
void SetProtocolInfo(uint8 const *_protocolInfo, uint8 const _length)
Definition Node.cpp:1549
bool CreateValueInt(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, int32 const _default, uint8 const _pollIntensity)
Definition Node.cpp:2569
void UpdateNodeInfo(uint8 const *_data, uint8 const _length)
Definition Node.cpp:1802
bool IsNodeAlive() const
Definition Node.h:223
bool CreateValueRaw(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 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:2630
void AdvanceQueries()
Definition Node.cpp:264
string getConfigPath()
Definition Node.cpp:3910
bool CreateValueBitSet(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, string const &_units, bool const _readOnly, bool const _writeOnly, int32 const _default, uint8 const _pollIntensity)
Definition Node.cpp:2420
void SetQueryStage(QueryStage const _stage, bool const _advance=true)
Definition Node.cpp:821
void SetNodePlusInfoReceived(const bool _received)
Definition Node.h:255
bool IsSecurityDevice() const
Definition Node.h:307
Definition ManufacturerSpecificDB.h:47
Implements COMMAND_CLASS_PROTECTION (0x75), a Z-Wave device command class.
Definition Protection.h:41
Implements COMMAND_CLASS_SECURITY (0x98), a Z-Wave device command class.
Definition Security.h:65
Implements COMMAND_CLASS_SENSOR_ALARM (0x9c), a Z-Wave device command class.
Definition SensorAlarm.h:43
Implements COMMAND_CLASS_SENSOR_BINARY (0x30), a Z-Wave device command class.
Definition SensorBinary.h:41
Implements COMMAND_CLASS_SENSOR_MULTILEVEL (0x31), a Z-Wave device command class.
Definition SensorMultilevel.h:41
Implements COMMAND_CLASS_SWITCH_ALL (0x27), a Z-Wave device command class.
Definition SwitchAll.h:41
Implements COMMAND_CLASS_SWITCH_BINARY (0x25), a Z-Wave device command class.
Definition SwitchBinary.h:41
Implements COMMAND_CLASS_SWITCH_MULTILEVEL (0x26), a Z-Wave device command class.
Definition SwitchMultilevel.h:43
Implements COMMAND_CLASS_SWITCH_TOGGLE_BINARY (0x28), a Z-Wave device command class.
Definition SwitchToggleBinary.h:41
Implements COMMAND_CLASS_SWITCH_TOGGLE_MULTILEVEL (0x29), a Z-Wave device command class.
Definition SwitchToggleMultilevel.h:41
Implements COMMAND_CLASS_THERMOSTAT_FAN_MODE (0x44), a Z-Wave device command class.
Definition ThermostatFanMode.h:44
Implements COMMAND_CLASS_THERMOSTAT_FAN_STATE (0x45), a Z-Wave device command class.
Definition ThermostatFanState.h:44
Implements COMMAND_CLASS_THERMOSTAT_MODE (0x40), a Z-Wave device command class.
Definition ThermostatMode.h:44
Implements COMMAND_CLASS_THERMOSTAT_OPERATING_STATE (0x42), a Z-Wave device command class.
Definition ThermostatOperatingState.h:44
Implements COMMAND_CLASS_THERMOSTAT_SETPOINT (0x43), a Z-Wave device command class.
Definition ThermostatSetpoint.h:43
Implements a platform-independent TimeStamp.
Definition TimeStamp.h:41
Button value.
Definition ValueButton.h:47
Provides a unique ID for a value reported by a Z-Wave device.
Definition ValueID.h:63
ValueType
Definition ValueID.h:95
ValueGenre
Definition ValueID.h:81
List of values sent to/received from a node.
Definition ValueList.h:47
Container that holds all of the values associated with a given node.
Definition ValueStore.h:45
Base class for values associated with a node.
Definition Value.h:49
Implements COMMAND_CLASS_VERSION (0x86), a Z-Wave device command class.
Definition Version.h:41
Implements COMMAND_CLASS_WAKE_UP (0x84), a Z-Wave device command class.
Definition WakeUp.h:46
Implements COMMAND_CLASS_ZWAVEPLUS_INFO (0x5E), a Z-Wave device command class.
Definition ZWavePlusInfo.h:39
Definition Bitfield.h:35
Definition Node.h:771
int revision
Definition Node.h:774
string date
Definition Node.h:773
string author
Definition Node.h:772
string description
Definition Node.h:775
uint32 m_receivedCnt
Definition Node.h:655
uint32 m_sentCnt
Definition Node.h:654
uint8 m_commandClassId
Definition Node.h:653
Definition Node.h:659
uint32 m_sentCnt
Definition Node.h:660
TXSTATUS_ROUTING_SCHEME m_routeScheme
Definition Node.h:685
char m_rssi_4[8]
Definition Node.h:681
char m_rssi_2[8]
Definition Node.h:679
uint32 m_retries
Definition Node.h:662
bool m_txStatusReportSupported
Definition Node.h:675
uint8 m_lastFailedLinkTo
Definition Node.h:690
uint32 m_receivedUnsolicited
Definition Node.h:665
uint32 m_lastResponseRTT
Definition Node.h:670
uint32 m_lastRequestRTT
Definition Node.h:668
uint32 m_sentFailed
Definition Node.h:661
uint32 m_averageResponseRTT
Definition Node.h:671
uint8 m_lastTxChannel
Definition Node.h:684
uint32 m_receivedDups
Definition Node.h:664
char m_rssi_5[8]
Definition Node.h:682
uint32 m_averageRequestRTT
Definition Node.h:669
string m_receivedTS
Definition Node.h:667
uint8 m_routeTries
Definition Node.h:688
char m_routeUsed[9]
Definition Node.h:686
string m_sentTS
Definition Node.h:666
uint8 m_ackChannel
Definition Node.h:683
list< CommandClassData > m_ccData
Definition Node.h:674
uint8 m_quality
Definition Node.h:672
TXSTATUS_ROUTE_SPEED m_routeSpeed
Definition Node.h:687
char m_rssi_3[8]
Definition Node.h:680
uint16 m_txTime
Definition Node.h:676
uint8 m_lastFailedLinkFrom
Definition Node.h:689
uint32 m_receivedCnt
Definition Node.h:663
char m_rssi_1[8]
Definition Node.h:678
uint8 m_lastReceivedMessage[254]
Definition Node.h:673
uint8 m_hops
Definition Node.h:677