OpenZWave Library  1.6.943
ManufacturerSpecific.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // ManufacturerSpecific.h
4 //
5 // Implementation of the Z-Wave COMMAND_CLASS_MANUFACTURER_SPECIFIC
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 _ManufacturerSpecific_H
29 #define _ManufacturerSpecific_H
30 
31 #include <map>
33 
34 namespace OpenZWave
35 {
36  namespace Internal
37  {
38  namespace CC
39  {
40 
45  {
46  public:
47  static CommandClass* Create(uint32 const _homeId, uint8 const _nodeId)
48  {
49  return new ManufacturerSpecific(_homeId, _nodeId);
50  }
52  {
53  }
54 
56  {
57  return 0x72;
58  }
59  static string const StaticGetCommandClassName()
60  {
61  return "COMMAND_CLASS_MANUFACTURER_SPECIFIC";
62  }
63 
64  // From CommandClass
65  virtual bool RequestState(uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue) override;
66  virtual bool RequestValue(uint32 const _requestFlags, uint16 const _index, uint8 const _instance, Driver::MsgQueue const _queue) override;
67  virtual uint8 const GetCommandClassId() const override
68  {
69  return StaticGetCommandClassId();
70  }
71  virtual string const GetCommandClassName() const override
72  {
74  }
75  virtual bool HandleMsg(uint8 const* _data, uint32 const _length, uint32 const _instance = 1) override;
76  virtual uint8 GetMaxVersion() override
77  {
78  return 2;
79  }
80 
81  void SetProductDetails(uint16 _manufacturerId, uint16 _productType, uint16 _productId);
82  bool LoadConfigXML();
83 
84  void ReLoadConfigXML();
85 
87  void setFileConfigRevision(uint32 rev);
89 
90  protected:
91  virtual void CreateVars(uint8 const _instance) override;
92 
93  private:
94  ManufacturerSpecific(uint32 const _homeId, uint8 const _nodeId);
95 
96  uint32 m_fileConfigRevision;
97  uint32 m_loadedConfigRevision;
98  uint32 m_latestConfigRevision;
99  };
100  } // namespace CC
101  } // namespace Internal
102 } // namespace OpenZWave
103 
104 #endif
105 
Definition: Bitfield.cpp:30
MsgQueue
Definition: Driver.h:656
virtual uint8 const GetCommandClassId() const override
Definition: ManufacturerSpecific.h:67
unsigned short uint16
Definition: Defs.h:88
void ReLoadConfigXML()
Definition: ManufacturerSpecific.cpp:323
bool LoadConfigXML()
Definition: ManufacturerSpecific.cpp:272
static string const StaticGetCommandClassName()
Definition: ManufacturerSpecific.h:59
Base class for all Z-Wave command classes.
Definition: CommandClass.h:60
void setLoadedConfigRevision(uint32 rev)
Definition: ManufacturerSpecific.cpp:387
virtual bool RequestState(uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue) override
Definition: ManufacturerSpecific.cpp:82
virtual bool RequestValue(uint32 const _requestFlags, uint16 const _index, uint8 const _instance, Driver::MsgQueue const _queue) override
Definition: ManufacturerSpecific.cpp:129
unsigned int uint32
Definition: Defs.h:91
static uint8 const StaticGetCommandClassId()
Definition: ManufacturerSpecific.h:55
void SetProductDetails(uint16 _manufacturerId, uint16 _productType, uint16 _productId)
Definition: ManufacturerSpecific.cpp:155
virtual bool HandleMsg(uint8 const *_data, uint32 const _length, uint32 const _instance=1) override
Definition: ManufacturerSpecific.cpp:193
Implements COMMAND_CLASS_MANUFACTURER_SPECIFIC (0x72), a Z-Wave device command class.
Definition: ManufacturerSpecific.h:44
virtual string const GetCommandClassName() const override
Definition: ManufacturerSpecific.h:71
virtual void CreateVars(uint8 const _instance) override
Definition: ManufacturerSpecific.cpp:332
void setFileConfigRevision(uint32 rev)
Definition: ManufacturerSpecific.cpp:370
static CommandClass * Create(uint32 const _homeId, uint8 const _nodeId)
Definition: ManufacturerSpecific.h:47
virtual uint8 GetMaxVersion() override
Definition: ManufacturerSpecific.h:76
void setLatestConfigRevision(uint32 rev)
Definition: ManufacturerSpecific.cpp:352
virtual ~ManufacturerSpecific()
Definition: ManufacturerSpecific.h:51
unsigned char uint8
Definition: Defs.h:85