OpenZWave Library  1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MultiInstance.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // MultiInstance.h
4 //
5 // Implementation of the Z-Wave COMMAND_CLASS_MULTI_INSTANCE
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 _MultiInstance_H
29 #define _MultiInstance_H
30 
31 #include <set>
33 
34 namespace OpenZWave
35 {
39  {
40  public:
42  {
46 
47  // Version 2
55  };
56 
58  {
62  };
63 
64  static CommandClass* Create( uint32 const _homeId, uint8 const _nodeId ){ return new MultiInstance( _homeId, _nodeId ); }
65  virtual ~MultiInstance(){}
66 
67  static uint8 const StaticGetCommandClassId(){ return 0x60; }
68  static string const StaticGetCommandClassName(){ return "COMMAND_CLASS_MULTI_INSTANCE/CHANNEL"; }
69 
70  bool RequestInstances();
71 
72  // From CommandClass
73  virtual void ReadXML( TiXmlElement const* _ccElement );
74  virtual void WriteXML( TiXmlElement* _ccElement );
75  virtual uint8 const GetCommandClassId()const{ return StaticGetCommandClassId(); }
76  virtual string const GetCommandClassName()const{ return StaticGetCommandClassName(); }
77  virtual bool HandleMsg( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 );
78  virtual uint8 GetMaxVersion(){ return 2; }
79 
80  MultiInstanceMapping GetEndPointMap(){ return m_endPointMap; }
81 
82  private:
83  MultiInstance( uint32 const _homeId, uint8 const _nodeId );
84 
85  void HandleMultiInstanceReport( uint8 const* _data, uint32 const _length );
86  void HandleMultiInstanceEncap( uint8 const* _data, uint32 const _length );
87  void HandleMultiChannelEndPointReport( uint8 const* _data, uint32 const _length );
88  void HandleMultiChannelCapabilityReport( uint8 const* _data, uint32 const _length );
89  void HandleMultiChannelEndPointFindReport( uint8 const* _data, uint32 const _length );
90  void HandleMultiChannelEncap( uint8 const* _data, uint32 const _length );
91 
92  bool m_numEndPointsCanChange;
93  bool m_endPointsAreSameClass;
94  uint8 m_numEndPoints;
95 
96  // Finding endpoints
97  uint8 m_endPointFindIndex;
98  uint8 m_numEndPointsFound;
99  set<uint8> m_endPointCommandClasses;
100 
101  // configuration
102  uint8 m_numEndPointsHint; // for nodes that do not report correct number of end points
103  MultiInstanceMapping m_endPointMap; // Determine how to map end points to value id instances
104  bool m_endPointFindSupported; // for nodes that (someday may) support endpointfind
105  bool m_ignoreUnsolicitedMultiChannelCapabilityReport;
106  bool m_uniqueendpoints;
107  };
108 
109 } // namespace OpenZWave
110 
111 #endif
112 
virtual void ReadXML(TiXmlElement const *_ccElement)
Definition: MultiInstance.cpp:104
bool RequestInstances()
Definition: MultiInstance.cpp:192
virtual bool HandleMsg(uint8 const *_data, uint32 const _length, uint32 const _instance=1)
Definition: MultiInstance.cpp:250
static string const StaticGetCommandClassName()
Definition: MultiInstance.h:68
Definition: MultiInstance.h:59
virtual uint8 const GetCommandClassId() const
Definition: MultiInstance.h:75
MultiInstanceMapping GetEndPointMap()
Definition: MultiInstance.h:80
virtual uint8 GetMaxVersion()
Definition: MultiInstance.h:78
virtual void WriteXML(TiXmlElement *_ccElement)
Definition: MultiInstance.cpp:157
Base class for all Z-Wave command classes.
Definition: CommandClass.h:46
static CommandClass * Create(uint32 const _homeId, uint8 const _nodeId)
Definition: MultiInstance.h:64
unsigned int uint32
Definition: Defs.h:80
MultiInstanceMapping
Definition: MultiInstance.h:57
static uint8 const StaticGetCommandClassId()
Definition: MultiInstance.h:67
virtual ~MultiInstance()
Definition: MultiInstance.h:65
virtual string const GetCommandClassName() const
Definition: MultiInstance.h:76
Implements COMMAND_CLASS_MULTI_INSTANCE (0x60), a Z-Wave device command class.
Definition: MultiInstance.h:38
MultiInstanceCmd
Definition: MultiInstance.h:41
unsigned char uint8
Definition: Defs.h:74