OpenZWave Library 1.6.1914
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;
43class TiXmlNode;
44
45namespace OpenZWave
46{
47 namespace Internal
48 {
49 namespace CC
50 {
51 class CommandClass;
52 class Association;
53 class AssociationCommandConfiguration;
54 class ControllerReplication;
55 class Hail;
56 class ManufacturerSpecific;
57 class MultiChannelAssociation;
58 class MultiInstance;
59 class NodeNaming;
60 class Version;
61 class ZWavePlusInfo;
62 }
63 namespace VC
64 {
65 class Value;
66 class ValueStore;
67 }
68 namespace Platform
69 {
70 class Mutex;
71 }
72 class ProductDescriptor;
73 class ManufacturerSpecificDB;
74 }
75 class Driver;
76 class Group;
77
81 class Node
82 {
83 friend class Manager;
84 friend class Driver;
85 friend class Group;
86 friend class Internal::VC::Value;
87 friend class ValueButton;
92 friend class Internal::CC::Hail;
100
101 //-----------------------------------------------------------------------------
102 // Construction
103 //-----------------------------------------------------------------------------
104 public:
110 Node(uint32 const _homeId, uint8 const _nodeId);
113 virtual ~Node();
114
115 private:
119 Driver* GetDriver() const;
120
121 //-----------------------------------------------------------------------------
122 // Initialization
123 //-----------------------------------------------------------------------------
124 public:
126 {
147 };
148
165 void AdvanceQueries();
166
173 void QueryStageComplete(QueryStage const _stage);
174
182 void QueryStageRetry(QueryStage const _stage, uint8 const _maxAttempts = 0); // maxAttempts of zero means no limit
183
190 void SetQueryStage(QueryStage const _stage, bool const _advance = true);
191
198 {
199 return m_queryStage;
200 }
201
208 string GetQueryStageName(QueryStage const _stage);
209
214 bool IsNodeAlive() const
215 {
216 return m_nodeAlive;
217 }
218
232 void UpdateProtocolInfo(uint8 const* _data);
240 void SetProtocolInfo(uint8 const* _protocolInfo, uint8 const _length);
241 void UpdateNodeInfo(uint8 const* _data, uint8 const _length);
242
244 {
245 return m_protocolInfoReceived;
246 }
247 bool NodeInfoReceived() const
248 {
249 return m_nodeInfoReceived;
250 }
251 bool IsNodeZWavePlus() const
252 {
253 return m_nodePlusInfoReceived;
254 }
255
257 {
258 return (QueryStage_Complete == m_queryStage);
259 }
260
261 void SetNodePlusInfoReceived(const bool _received)
262 {
263 m_nodePlusInfoReceived = _received;
264 }
265
271 void SetNodeAlive(bool const _isAlive);
272
273 private:
274 void SetStaticRequests();
275
276 QueryStage m_queryStage;
277 bool m_queryPending;
278 bool m_queryConfiguration;
279 uint8 m_queryRetries;
280 bool m_protocolInfoReceived;
281 bool m_basicprotocolInfoReceived;
282 bool m_nodeInfoReceived;
283 bool m_nodePlusInfoReceived;
284 bool m_manufacturerSpecificClassReceived;
285 bool m_nodeInfoSupported;
286 bool m_refreshonNodeInfoFrame;
287 bool m_nodeAlive;
288
289 //-----------------------------------------------------------------------------
290 // Capabilities
291 //-----------------------------------------------------------------------------
292 public:
293 // Security flags
294 enum
295 {
304 };
305
306 // Node Ids
307 enum
308 {
309 NodeBroadcast = 0xff
310 };
311
312 bool IsListeningDevice() const
313 {
314 return m_listening;
315 }
317 {
318 return m_frequentListening;
319 }
320 bool IsBeamingDevice() const
321 {
322 return m_beaming;
323 }
324 bool IsRoutingDevice() const
325 {
326 return m_routing;
327 }
328 bool IsSecurityDevice() const
329 {
330 return m_security;
331 }
333 {
334 return m_maxBaudRate;
335 }
337 {
338 return m_version;
339 }
341 {
342 return m_security;
343 }
344
346 {
347 return m_nodeId;
348 }
349
351 {
352 return m_basic;
353 }
354 string GetBasicString();
355 uint8 GetGeneric(uint8 const _instance) const;
356 string GetGenericString(uint8 const _instance);
357 uint8 GetSpecific(uint8 const _instance) const;
358 string GetSpecificString(uint8 const _instance);
359 string GetEndPointDeviceClassLabel(uint8 const _generic, uint8 const _specific);
360
361 string const& GetType() const
362 {
363 return m_type;
364 }
365 uint32 GetNeighbors(uint8** o_neighbors);
366 bool IsController() const
367 {
368 return (m_basic == 0x01 || m_basic == 0x02) && (m_generic == 0x01 || m_generic == 0x02);
369 }
370 bool IsAddingNode() const
371 {
372 return m_addingNode;
373 } /* 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 */
375 {
376 m_addingNode = true;
377 }
379 {
380 m_addingNode = false;
381 }
382 bool IsNodeReset();
383 private:
384 bool m_listening;
385 bool m_frequentListening;
386 bool m_beaming;
387 bool m_routing;
388 uint32 m_maxBaudRate;
389 uint8 m_version;
390 bool m_security;
391 uint32 m_homeId;
392 uint8 m_nodeId;
393 uint8 m_basic; //*< Basic device class (0x01-Controller, 0x02-Static Controller, 0x03-Slave, 0x04-Routing Slave
394 uint8 m_generic;
395 uint8 m_specific;
396 string m_type; // Label representing the specific/generic/basic value
397 uint8 m_neighbors[29]; // Bitmask containing the neighboring nodes
398 uint8 m_numRouteNodes; // number of node routes
399 uint8 m_routeNodes[5]; // nodes to route to
400 map<uint8, uint8> m_buttonMap; // Map button IDs into virtual node numbers
401 bool m_addingNode;
402
403 //-----------------------------------------------------------------------------
404 // Device Naming
405 //-----------------------------------------------------------------------------
406 private:
407 // Manufacturer, Product and Name are stored here so they can be set by the
408 // user even if the device does not support the relevant command classes.
409 string GetManufacturerName() const
410 {
411 return m_manufacturerName;
412 }
413 string GetProductName() const
414 {
415 return m_productName;
416 }
417 string GetNodeName() const
418 {
419 return m_nodeName;
420 }
421 string GetLocation() const
422 {
423 return m_location;
424 }
425
426// string GetManufacturerId()const{ return std::to_string(m_manufacturerId); }
427 uint16 GetManufacturerId() const
428 {
429 return m_manufacturerId;
430 }
431// string GetProductType()const{ return string(m_productType); }
432 uint16 GetProductType() const
433 {
434 return m_productType;
435 }
436// string GetProductId()const{ return string(m_productId); }
437 uint16 GetProductId() const
438 {
439 return m_productId;
440 }
441
442 void SetManufacturerName(string const& _manufacturerName)
443 {
444 m_manufacturerName = _manufacturerName;
445 }
446 void SetProductName(string const& _productName)
447 {
448 m_productName = _productName;
449 }
450 void SetNodeName(string const& _nodeName);
451 void SetLocation(string const& _location);
452
453 void SetManufacturerId(uint16 const& _manufacturerId)
454 {
455 m_manufacturerId = _manufacturerId;
456 }
457 void SetProductType(uint16 const& _productType)
458 {
459 m_productType = _productType;
460 }
461 void SetProductId(uint16 const& _productId)
462 {
463 m_productId = _productId;
464 }
465
466 string m_manufacturerName;
467 string m_productName;
468 string m_nodeName;
469 string m_location;
470
471 uint16 m_manufacturerId;
472 uint16 m_productType;
473 uint16 m_productId;
474
475 // zwave+ info
476 uint16 GetDeviceType() const
477 {
478 return m_deviceType;
479 }
480 string GetDeviceTypeString();
481 uint8 GetRoleType() const
482 {
483 return m_role;
484 }
485 string GetRoleTypeString();
486 uint8 GetNodeType() const
487 {
488 return m_nodeType;
489 }
490 string GetNodeTypeString();
491
492 uint16 m_deviceType;
493 uint8 m_role;
494 uint8 m_nodeType;
495
496 //-----------------------------------------------------------------------------
497 // Command Classes
498 //-----------------------------------------------------------------------------
499 public:
506 Internal::CC::CommandClass* GetCommandClass(uint8 const _commandClassId) const;
507 void ApplicationCommandHandler(uint8 const* _data, bool encrypted);
508
516 void SetSecuredClasses(uint8 const* _data, uint8 const _length, uint32 const _instance = 1);
517 void SetSecured(bool secure);
518 bool IsSecured();
523 void SetInstanceLabel(uint8 const _instance, char *label);
527 string GetInstanceLabel(uint8 const _ccid, uint8 const _instance);
528
532 uint8 GetNumInstances(uint8 const _ccid);
533
534 private:
544 Internal::CC::CommandClass* AddCommandClass(uint8 const _commandClassId);
551 void RemoveCommandClass(uint8 const _commandClassId);
552 void ReadXML(TiXmlElement const* _nodeElement);
553 void ReadDeviceProtocolXML(TiXmlElement const* _ccsElement);
554 void ReadCommandClassesXML(TiXmlElement const* _ccsElement);
555 void WriteXML(TiXmlElement* _nodeElement);
556
557 map<uint8, Internal::CC::CommandClass*> m_commandClassMap;
558 bool m_secured;
559 map<uint8, string> m_globalInstanceLabel;
561 TiXmlNode *m_nodeCache;
562 //-----------------------------------------------------------------------------
563 // Configuration Revision Related Classes
564 //-----------------------------------------------------------------------------
565 public:
566 void SetProductDetails(std::shared_ptr<Internal::ProductDescriptor> product);
571 string getConfigPath();
577 {
578 return m_fileConfigRevision;
579 }
580 ;
586 {
587 return m_loadedConfigRevision;
588 }
589 ;
595 {
596 return m_latestConfigRevision;
597 }
598 ;
618
619 private:
620
621 std::shared_ptr<Internal::ProductDescriptor> m_Product;
622
623 uint32 m_fileConfigRevision;
624 uint32 m_loadedConfigRevision;
625 uint32 m_latestConfigRevision;
626 //-----------------------------------------------------------------------------
627 // Basic commands (helpers that go through the basic command class)
628 //-----------------------------------------------------------------------------
629 public:
630 void SetLevel(uint8 const _level);
631
632 //-----------------------------------------------------------------------------
633 // On/Off commands (helpers that go through the basic or switchall command class)
634 //-----------------------------------------------------------------------------
635 public:
636 void SetNodeOn();
637 void SetNodeOff();
638
639 //-----------------------------------------------------------------------------
640 // Values (handled by the command classes)
641 //-----------------------------------------------------------------------------
642 public:
643 ValueID CreateValueID(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, ValueID::ValueType const _type);
644
646 Internal::VC::Value* GetValue(uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex);
647 bool RemoveValue(uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex);
648
649 // Helpers for creating values
650 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);
651 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);
652 bool CreateValueButton(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const& _label, uint8 const _pollIntensity);
653 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);
654 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);
655 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);
656 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<Internal::VC::ValueList::Item> const& _items, int32 const _default, uint8 const _pollIntensity);
657 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);
658 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);
659 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);
660 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);
661
662 // helpers for removing values
664
665 void ReadValueFromXML(uint8 const _commandClassId, TiXmlElement const* _valueElement);
666 bool CreateValueFromXML(uint8 const _commandClassId, TiXmlElement const* _valueElement);
667
668 private:
669 Internal::VC::ValueStore* GetValueStore() const
670 {
671 return m_values;
672 }
673
674 Internal::VC::ValueStore* m_values; // Values reported via command classes
675
676 //-----------------------------------------------------------------------------
677 // Configuration Parameters (handled by the Configuration command class)
678 //-----------------------------------------------------------------------------
679 private:
680 bool SetConfigParam(uint8 const _param, int32 _value, uint8 const _size);
681 void RequestConfigParam(uint8 const _param);
682 bool RequestAllConfigParams(uint32 const _requestFlags);
683
684 //-----------------------------------------------------------------------------
685 // Dynamic Values (used by query and other command classes for updating)
686 //-----------------------------------------------------------------------------
687 private:
688 bool RequestDynamicValues();
689 public:
690 //-----------------------------------------------------------------------------
691 // Refresh Dynamic Values from CommandClasses on Wakeup
692 //-----------------------------------------------------------------------------
694 //-----------------------------------------------------------------------------
695 // Groups
696 //-----------------------------------------------------------------------------
697 private:
698 // The public interface is provided via the wrappers in the Manager class
699 uint8 GetNumGroups();
700 uint32 GetAssociations(uint8 const _groupIdx, uint8** o_associations);
701 uint32 GetAssociations(uint8 const _groupIdx, InstanceAssociation** o_associations);
702 uint8 GetMaxAssociations(uint8 const _groupIdx);
703 bool IsMultiInstance(uint8 const _groupIdx);
704 string GetGroupLabel(uint8 const _groupIdx);
705 void AddAssociation(uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00);
706 void RemoveAssociation(uint8 const _groupIdx, uint8 const _targetNodeId, uint8 const _instance = 0x00);
707 void AutoAssociate();
708
709 // The following methods are not exposed
710 Group* GetGroup(uint8 const _groupIdx); // Get a pointer to a Group object. This must only be called while holding the node Lock.
711 void AddGroup(Group* _group); // The groups are fixed properties of a device, so there is no need for a matching RemoveGroup.
712 void WriteGroups(TiXmlElement* _associationsElement); // Write the group data out to XNL
713
714 map<uint8, Group*> m_groups; // Maps group indices to Group objects.
715
716 //-----------------------------------------------------------------------------
717 // Device Classes (static data read from the device_classes.xml file)
718 //-----------------------------------------------------------------------------
719 private:
720 // Container for device class info
721 class DeviceClass
722 {
723 public:
724 DeviceClass(TiXmlElement const* _el);
725 ~DeviceClass()
726 {
727 delete[] m_mandatoryCommandClasses;
728 }
729
730 uint8 const* GetMandatoryCommandClasses()
731 {
732 return m_mandatoryCommandClasses;
733 }
734 uint8 GetBasicMapping()
735 {
736 return m_basicMapping;
737 }
738 string const& GetLabel()
739 {
740 return m_label;
741 }
742
743 private:
744 uint8* m_mandatoryCommandClasses; // Zero terminated array of mandatory command classes for this device type.
745 uint8 m_basicMapping; // Command class that COMMAND_CLASS_BASIC maps on to, or zero if there is no mapping.
746 string m_label; // Descriptive label for the device.
747 };
748
749 // Container for generic device class info
750 class GenericDeviceClass: public DeviceClass
751 {
752 public:
753 GenericDeviceClass(TiXmlElement const* _el);
754 ~GenericDeviceClass();
755
756 DeviceClass* GetSpecificDeviceClass(uint8 const& _specific);
757
758 private:
759 map<uint8, DeviceClass*> m_specificDeviceClasses;
760 };
761
762 bool SetDeviceClasses(uint8 const _basic, uint8 const _generic, uint8 const _specific); // Set the device class data for the node
763 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
764 bool AddMandatoryCommandClasses(uint8 const* _commandClasses); // Add mandatory command classes as specified in the device_classes.xml to the node.
765 bool ReadDeviceClasses(); // Read the static device class data from the device_classes.xml file
766
767 static bool s_deviceClassesLoaded; // True if the xml file has already been loaded
768 static map<uint8, string> s_basicDeviceClasses; // Map of basic device classes.
769 static map<uint8, GenericDeviceClass*> s_genericDeviceClasses; // Map of generic device classes.
770 static map<uint8, DeviceClass*> s_roleDeviceClasses; // Map of Zwave+ role device classes.
771 static map<uint16, DeviceClass*> s_deviceTypeClasses; // Map of Zwave+ device type device classes.
772 static map<uint8, DeviceClass*> s_nodeTypes; // Map of ZWave+ Node Types
773
774 //-----------------------------------------------------------------------------
775 // Statistics
776 //-----------------------------------------------------------------------------
777 public:
779 {
783 };
784
785 struct NodeData
786 {
793 string m_sentTS;
799 uint8 m_quality; // Node quality measure
801 list<CommandClassData> m_ccData;
805 char m_rssi_1[8];
806 char m_rssi_2[8];
807 char m_rssi_3[8];
808 char m_rssi_4[8];
809 char m_rssi_5[8];
813 char m_routeUsed[9];
818 };
819
820 private:
821 void GetNodeStatistics(NodeData* _data);
822
823 uint32 m_sentCnt; // Number of messages sent from this node.
824 uint32 m_sentFailed; // Number of sent messages failed
825 uint32 m_retries; // Number of message retries
826 uint32 m_receivedCnt; // Number of messages received from this node.
827 uint32 m_receivedDups; // Number of duplicated messages received;
828 uint32 m_receivedUnsolicited; // Number of messages received unsolicited
829 uint32 m_lastRequestRTT; // Last message request RTT
830 uint32 m_lastResponseRTT; // Last message response RTT
831 Internal::Platform::TimeStamp m_sentTS; // Last message sent time
832 Internal::Platform::TimeStamp m_receivedTS; // Last message received time
833 uint32 m_averageRequestRTT; // Average Request round trip time.
834 uint32 m_averageResponseRTT; // Average Response round trip time.
835 uint8 m_quality; // Node quality measure
836 uint8 m_lastReceivedMessage[254]; // Place to hold last received message
837 uint8 m_errors;
838 bool m_txStatusReportSupported; // if Extended Status Reports are available
839 uint16 m_txTime; // Time Taken to Transmit the last frame
840 uint8 m_hops; // Hops taken in transmitting last frame
841 char m_rssi_1[8]; // RSSI Level of last transmission
842 char m_rssi_2[8]; // RSSI Level of last transmission
843 char m_rssi_3[8]; // RSSI Level of last transmission
844 char m_rssi_4[8]; // RSSI Level of last transmission
845 char m_rssi_5[8]; // RSSI Level of last transmission
846 uint8 m_ackChannel; // Channel we received the last ACK on
847 uint8 m_lastTxChannel; // Channel we transmitted the last frame on
848 TXSTATUS_ROUTING_SCHEME m_routeScheme; // The Scheme used to route the last frame
849 uint8 m_routeUsed[4]; // The Route Taken in the last frame
850 TXSTATUS_ROUTE_SPEED m_routeSpeed; // Baud Rate of the last frame
851 uint8 m_routeTries; // The number of attempts to route the last frame
852 uint8 m_lastFailedLinkFrom; // The last failed link from
853 uint8 m_lastFailedLinkTo; // The last failed link to
854
855 //-----------------------------------------------------------------------------
856 // Encryption Related
857 //-----------------------------------------------------------------------------
858 public:
859
861 uint8 *GetNonceKey(uint32 nonceid);
862
863 private:
864 uint8 m_lastnonce;
865 uint8 m_nonces[8][8];
866
867 //-----------------------------------------------------------------------------
868 // MetaData Related
869 //-----------------------------------------------------------------------------
870
871 public:
879 {
894 MetaData_Invalid = 255
895 };
896
898 {
899 string author;
900 string date;
903 };
904 string const GetMetaData(MetaDataFields);
906 string const GetMetaDataString(MetaDataFields);
907 ChangeLogEntry const GetChangeLog(uint32_t);
908
909 private:
910 void ReadMetaDataFromXML(TiXmlElement const* _valueElement);
911 void WriteMetaDataXML(TiXmlElement*);
912 map<MetaDataFields, string> m_metadata;
913 map<uint32_t, ChangeLogEntry> m_changeLog;
914 };
915
916} //namespace OpenZWave
917
918#endif //_Node_H
unsigned short uint16
Definition: Defs.h:88
unsigned int uint32
Definition: Defs.h:91
signed short int16
Definition: Defs.h:87
signed int int32
Definition: Defs.h:90
TXSTATUS_ROUTING_SCHEME
Definition: Defs.h:449
TXSTATUS_ROUTE_SPEED
Definition: Defs.h:462
unsigned char uint8
Definition: Defs.h:85
The Driver class handles communication between OpenZWave and a device attached via a serial port (typ...
Definition: Driver.h:85
Manages a group of devices (various nodes associated with each other).
Definition: Group.h:72
Implements COMMAND_CLASS_ASSOCIATION_COMMAND_CONFIGURATION (0x9b), a Z-Wave device command class.
Definition: AssociationCommandConfiguration.h:47
Implements COMMAND_CLASS_ASSOCIATION (0x85), a Z-Wave device command class.
Definition: Association.h:44
Base class for all Z-Wave command classes.
Definition: CommandClass.h:61
Implements COMMAND_CLASS_CONTROLLER_REPLICATION (0x21), a Z-Wave device command class.
Definition: ControllerReplication.h:44
Implements COMMAND_CLASS_HAIL (0x82), a Z-Wave device command class.
Definition: Hail.h:44
Implements COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72), a Z-Wave device command class.
Definition: ManufacturerSpecific.h:45
Implements COMMAND_CLASS_MULTI_CHANNEL_ASSOCIATION (0x8E), a Z-Wave device command class.
Definition: MultiChannelAssociation.h:46
Implements COMMAND_CLASS_MULTI_INSTANCE (0x60), a Z-Wave device command class.
Definition: MultiInstance.h:45
Implements COMMAND_CLASS_NODE_NAMING (0x77), a Z-Wave device command class.
Definition: NodeNaming.h:57
Implements COMMAND_CLASS_VERSION (0x86), a Z-Wave device command class.
Definition: Version.h:44
Implements COMMAND_CLASS_ZWAVEPLUS_INFO (0x5E), a Z-Wave device command class.
Definition: ZWavePlusInfo.h:44
The _ManufacturerSpecificDB class handles the Config File Database that we use to configure devices.
Definition: ManufacturerSpecificDB.h:117
Implements a platform-independent TimeStamp.
Definition: TimeStamp.h:45
List of values sent to/received from a node.
Definition: ValueList.h:49
Container that holds all of the values associated with a given node.
Definition: ValueStore.h:50
Base class for values associated with a node.
Definition: Value.h:55
The main public interface to OpenZWave.
Definition: Manager.h:109
The Node class describes a Z-Wave node object...typically a device on the Z-Wave network.
Definition: Node.h:82
Internal::CC::CommandClass * GetCommandClass(uint8 const _commandClassId) const
Definition: Node.cpp:2134
MetaDataFields GetMetaDataId(string)
Definition: Node.cpp:3855
uint8 GetNodeId() const
Definition: Node.h:345
void ClearAddingNode()
Definition: Node.h:378
void UpdateProtocolInfo(uint8 const *_data)
Definition: Node.cpp:1375
void RemoveValueList(Internal::VC::ValueList *_value)
Definition: Node.cpp:2606
uint32 getFileConfigRevision()
Definition: Node.h:576
bool CreateValueButton(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, string const &_label, uint8 const _pollIntensity)
Definition: Node.cpp:2445
bool ProtocolInfoReceived() const
Definition: Node.h:243
@ NodeBroadcast
Definition: Node.h:309
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:2481
uint8 GetGeneric(uint8 const _instance) const
Definition: Node.cpp:1660
string GetSpecificString(uint8 const _instance)
Definition: Node.cpp:1706
bool NodeInfoReceived() const
Definition: Node.h:247
void RefreshValuesOnWakeup()
Definition: Node.cpp:2340
string GetGenericString(uint8 const _instance)
Definition: Node.cpp:1670
@ SecurityFlag_OptionalFunctionality
Definition: Node.h:303
@ SecurityFlag_RoutingSlave
Definition: Node.h:299
@ SecurityFlag_Sensor250ms
Definition: Node.h:301
@ SecurityFlag_Sensor1000ms
Definition: Node.h:302
@ SecurityFlag_Controller
Definition: Node.h:297
@ SecurityFlag_Security
Definition: Node.h:296
@ SecurityFlag_BeamCapability
Definition: Node.h:300
@ SecurityFlag_SpecificDevice
Definition: Node.h:298
friend class Group
Definition: Node.h:85
void SetAddingNode()
Definition: Node.h:374
void SetSecuredClasses(uint8 const *_data, uint8 const _length, uint32 const _instance=1)
Definition: Node.cpp:1737
uint8 * GenerateNonceKey()
Definition: Node.cpp:3606
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:2427
bool IsController() const
Definition: Node.h:366
Internal::VC::Value * GetValue(ValueID const &_id)
Definition: Node.cpp:2759
void SetNodeAlive(bool const _isAlive)
Definition: Node.cpp:1936
void setLatestConfigRevision(uint32 rev)
Definition: Node.cpp:3799
void QueryStageRetry(QueryStage const _stage, uint8 const _maxAttempts=0)
Definition: Node.cpp:707
bool IsFrequentListeningDevice() const
Definition: Node.h:316
bool IsBeamingDevice() const
Definition: Node.h:320
bool IsRoutingDevice() const
Definition: Node.h:324
uint8 GetSecurity() const
Definition: Node.h:340
bool IsAddingNode() const
Definition: Node.h:370
bool RemoveValue(uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex)
Definition: Node.cpp:2797
void SetLevel(uint8 const _level)
Definition: Node.cpp:2355
void QueryStageComplete(QueryStage const _stage)
Definition: Node.cpp:682
uint32 getLoadedConfigRevision()
Definition: Node.h:585
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:2463
string GetQueryStageName(QueryStage const _stage)
Definition: Node.cpp:760
uint8 GetSpecific(uint8 const _instance) const
Definition: Node.cpp:1695
bool IsSecured()
Definition: Node.cpp:1588
uint8 * GetNonceKey(uint32 nonceid)
Definition: Node.cpp:3653
string const GetMetaDataString(MetaDataFields)
Definition: Node.cpp:3891
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:2552
Node(uint32 const _homeId, uint8 const _nodeId)
Definition: Node.cpp:101
uint8 GetBasic() const
Definition: Node.h:350
string GetInstanceLabel(uint8 const _ccid, uint8 const _instance)
Definition: Node.cpp:1601
QueryStage
Definition: Node.h:126
@ QueryStage_SecurityReport
Definition: Node.h:133
@ QueryStage_Session
Definition: Node.h:143
@ QueryStage_Probe1
Definition: Node.h:140
@ QueryStage_Complete
Definition: Node.h:146
@ QueryStage_ProtocolInfo
Definition: Node.h:128
@ QueryStage_NodeInfo
Definition: Node.h:131
@ QueryStage_CacheLoad
Definition: Node.h:139
@ QueryStage_Neighbors
Definition: Node.h:142
@ QueryStage_NodePlusInfo
Definition: Node.h:132
@ QueryStage_Probe
Definition: Node.h:129
@ QueryStage_Dynamic
Definition: Node.h:144
@ QueryStage_WakeUp
Definition: Node.h:130
@ QueryStage_Static
Definition: Node.h:138
@ QueryStage_ManufacturerSpecific2
Definition: Node.h:137
@ QueryStage_Instances
Definition: Node.h:136
@ QueryStage_ManufacturerSpecific1
Definition: Node.h:135
@ QueryStage_Versions
Definition: Node.h:134
@ QueryStage_None
Definition: Node.h:127
@ QueryStage_Configuration
Definition: Node.h:145
@ QueryStage_Associations
Definition: Node.h:141
void ReadValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition: Node.cpp:2706
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< Internal::VC::ValueList::Item > const &_items, int32 const _default, uint8 const _pollIntensity)
Definition: Node.cpp:2517
bool IsNodeReset()
Definition: Node.cpp:3731
uint32 GetMaxBaudRate() const
Definition: Node.h:332
ValueID CreateValueID(ValueID::ValueGenre const _genre, uint8 const _commandClassId, uint8 const _instance, uint16 const _valueIndex, ValueID::ValueType const _type)
Definition: Node.cpp:2400
void checkLatestConfigRevision()
Definition: Node.cpp:3814
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:2588
virtual ~Node()
Definition: Node.cpp:124
string const GetMetaData(MetaDataFields)
Definition: Node.cpp:3827
uint8 GetVersion() const
Definition: Node.h:336
bool IsListeningDevice() const
Definition: Node.h:312
bool AllQueriesCompleted() const
Definition: Node.h:256
bool CreateValueFromXML(uint8 const _commandClassId, TiXmlElement const *_valueElement)
Definition: Node.cpp:2616
void ApplicationCommandHandler(uint8 const *_data, bool encrypted)
Definition: Node.cpp:2042
uint8 GetNumInstances(uint8 const _ccid)
Definition: Node.cpp:1624
void SetNodeOn()
Definition: Node.cpp:2374
ChangeLogEntry const GetChangeLog(uint32_t)
Definition: Node.cpp:3840
void SetProductDetails(std::shared_ptr< Internal::ProductDescriptor > product)
Definition: Node.cpp:3745
void setLoadedConfigRevision(uint32 rev)
Definition: Node.cpp:3784
void SetNodeOff()
Definition: Node.cpp:2387
bool IsNodeZWavePlus() const
Definition: Node.h:251
string GetEndPointDeviceClassLabel(uint8 const _generic, uint8 const _specific)
Definition: Node.cpp:3001
string GetBasicString()
Definition: Node.cpp:1640
MetaDataFields
Definition: Node.h:879
@ MetaData_ExclusionHelp
Definition: Node.h:887
@ MetaData_OzwInfoPage_URL
Definition: Node.h:880
@ MetaData_InclusionHelp
Definition: Node.h:886
@ MetaData_ProductPic
Definition: Node.h:882
@ MetaData_Identifier
Definition: Node.h:893
@ MetaData_WakeupHelp
Definition: Node.h:889
@ MetaData_Frequency
Definition: Node.h:891
@ MetaData_ZWProductPage_URL
Definition: Node.h:881
@ MetaData_ProductSupport_URL
Definition: Node.h:890
@ MetaData_ProductPage_URL
Definition: Node.h:885
@ MetaData_Invalid
Definition: Node.h:894
@ MetaData_Name
Definition: Node.h:892
@ MetaData_ProductManual_URL
Definition: Node.h:884
@ MetaData_ResetHelp
Definition: Node.h:888
@ MetaData_Description
Definition: Node.h:883
void SetSecured(bool secure)
Definition: Node.cpp:1583
void SetInstanceLabel(uint8 const _instance, char *label)
Definition: Node.cpp:1593
void setFileConfigRevision(uint32 rev)
Definition: Node.cpp:3768
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:2570
uint32 getLatestConfigRevision()
Definition: Node.h:594
string const & GetType() const
Definition: Node.h:361
friend class Internal::CC::CommandClass
Definition: Node.h:90
Node::QueryStage GetCurrentQueryStage()
Definition: Node.h:197
void SetProtocolInfo(uint8 const *_protocolInfo, uint8 const _length)
Definition: Node.cpp:1513
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:2499
void UpdateNodeInfo(uint8 const *_data, uint8 const _length)
Definition: Node.cpp:1841
bool IsNodeAlive() const
Definition: Node.h:214
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:2534
void AdvanceQueries()
Definition: Node.cpp:173
string getConfigPath()
Definition: Node.cpp:3755
friend class ValueButton
Definition: Node.h:87
uint32 GetNeighbors(uint8 **o_neighbors)
Definition: Node.cpp:769
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:2409
void SetQueryStage(QueryStage const _stage, bool const _advance=true)
Definition: Node.cpp:737
void SetNodePlusInfoReceived(const bool _received)
Definition: Node.h:261
bool IsSecurityDevice() const
Definition: Node.h:328
Provides a unique ID for a value reported by a Z-Wave device.
Definition: ValueID.h:77
ValueType
Definition: ValueID.h:99
ValueGenre
Definition: ValueID.h:85
Definition: Bitfield.cpp:31
struct OpenZWave::InstanceAssociation InstanceAssociation
Definition: Node.h:898
int revision
Definition: Node.h:901
string date
Definition: Node.h:900
string author
Definition: Node.h:899
string description
Definition: Node.h:902
Definition: Node.h:779
uint32 m_receivedCnt
Definition: Node.h:782
uint32 m_sentCnt
Definition: Node.h:781
uint8 m_commandClassId
Definition: Node.h:780
Definition: Node.h:786
uint32 m_sentCnt
Definition: Node.h:787
TXSTATUS_ROUTING_SCHEME m_routeScheme
Definition: Node.h:812
char m_rssi_4[8]
Definition: Node.h:808
char m_rssi_2[8]
Definition: Node.h:806
uint32 m_retries
Definition: Node.h:789
bool m_txStatusReportSupported
Definition: Node.h:802
uint8 m_lastFailedLinkTo
Definition: Node.h:817
uint32 m_receivedUnsolicited
Definition: Node.h:792
uint32 m_lastResponseRTT
Definition: Node.h:797
uint32 m_lastRequestRTT
Definition: Node.h:795
uint32 m_sentFailed
Definition: Node.h:788
uint32 m_averageResponseRTT
Definition: Node.h:798
uint8 m_lastTxChannel
Definition: Node.h:811
uint32 m_receivedDups
Definition: Node.h:791
char m_rssi_5[8]
Definition: Node.h:809
uint32 m_averageRequestRTT
Definition: Node.h:796
string m_receivedTS
Definition: Node.h:794
uint8 m_routeTries
Definition: Node.h:815
char m_routeUsed[9]
Definition: Node.h:813
string m_sentTS
Definition: Node.h:793
uint8 m_ackChannel
Definition: Node.h:810
list< CommandClassData > m_ccData
Definition: Node.h:801
uint8 m_quality
Definition: Node.h:799
TXSTATUS_ROUTE_SPEED m_routeSpeed
Definition: Node.h:814
char m_rssi_3[8]
Definition: Node.h:807
uint16 m_txTime
Definition: Node.h:803
uint8 m_lastFailedLinkFrom
Definition: Node.h:816
uint32 m_receivedCnt
Definition: Node.h:790
char m_rssi_1[8]
Definition: Node.h:805
uint8 m_lastReceivedMessage[254]
Definition: Node.h:800
uint8 m_hops
Definition: Node.h:804