OpenZWave Library
1.6.1914
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
src
command_classes
CommandClasses.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// CommandClasses.h
4
//
5
// Singleton holding methods to create each command class object
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 _CommandClasses_H
29
#define _CommandClasses_H
30
31
#include <string>
32
#include <map>
33
#include <list>
34
#include "
Defs.h
"
35
36
namespace
OpenZWave
37
{
38
namespace
Internal
39
{
40
namespace
CC
41
{
42
class
CommandClass
;
43
47
class
CommandClasses
48
{
49
public
:
50
typedef
CommandClass
* (*pfnCreateCommandClass_t)(
uint32
const
_homeId,
uint8
const
_nodeId);
51
52
static
void
RegisterCommandClasses
();
53
static
CommandClass
*
CreateCommandClass
(
uint8
const
_commandClassId,
uint32
const
_homeId,
uint8
const
_nodeId);
54
55
static
bool
IsSupported
(
uint8
const
_commandClassId);
56
static
string
GetName
(
uint8
const
_commandClassId);
57
static
list<uint8>
GetAdvertisedCommandClasses
();
58
private
:
59
CommandClasses();
60
CommandClasses(CommandClasses
const
&);
// prevent copy
61
CommandClasses& operator =(CommandClasses
const
&);
// prevent assignment
62
63
static
CommandClasses& Get()
64
{
65
static
CommandClasses instance;
66
return
instance;
67
}
68
69
void
Register(
uint8
const
_commandClassId,
string
const
& _commandClassName,
pfnCreateCommandClass_t
_create,
bool
advertised =
false
);
70
void
ParseCommandClassOption(
string
const
& _optionStr,
bool
const
_include);
71
uint8
GetCommandClassId(
string
const
& _name);
72
73
pfnCreateCommandClass_t
m_commandClassCreators[256];
74
map<string, uint8> m_namesToIDs;
75
/* a list of CommandClasses that are advertised on the controllers NIF packet and can be controlled
76
* via other Nodes
77
*/
78
list<uint8> m_advertisedCommandClasses;
79
80
// m_supportedCommandClasses uses single bits to mark whether OpenZWave supports a command class
81
// Checking this is not the same as looking for non-NULL entried in m_commandClassCreators, since
82
// this may be modified by the program options --Include and --Ingnore to filter out support
83
// for unwanted command classes.
84
uint32
m_supportedCommandClasses[8];
85
};
86
}
// namespace CC
87
}
// namespace Internal
88
}
// namespace OpenZWave
89
90
#endif
Defs.h
uint32
unsigned int uint32
Definition
Defs.h:91
uint8
unsigned char uint8
Definition
Defs.h:85
OpenZWave::Internal::CC::CommandClass
Base class for all Z-Wave command classes.
Definition
CommandClass.h:61
OpenZWave::Internal::CC::CommandClasses::RegisterCommandClasses
static void RegisterCommandClasses()
Definition
CommandClasses.cpp:184
OpenZWave::Internal::CC::CommandClasses::CreateCommandClass
static CommandClass * CreateCommandClass(uint8 const _commandClassId, uint32 const _homeId, uint8 const _nodeId)
Definition
CommandClasses.cpp:165
OpenZWave::Internal::CC::CommandClasses::pfnCreateCommandClass_t
CommandClass *(* pfnCreateCommandClass_t)(uint32 const _homeId, uint8 const _nodeId)
Definition
CommandClasses.h:50
OpenZWave::Internal::CC::CommandClasses::GetAdvertisedCommandClasses
static list< uint8 > GetAdvertisedCommandClasses()
Definition
CommandClasses.cpp:326
OpenZWave::Internal::CC::CommandClasses::GetName
static string GetName(uint8 const _commandClassId)
Definition
CommandClasses.cpp:130
OpenZWave::Internal::CC::CommandClasses::IsSupported
static bool IsSupported(uint8 const _commandClassId)
Definition
CommandClasses.cpp:125
OpenZWave::Internal::CC
Definition
Alarm.cpp:54
OpenZWave::Internal
Definition
Bitfield.cpp:33
OpenZWave
Definition
Bitfield.cpp:31
Generated on
for OpenZWave Library by
1.17.0