OpenZWave Library
1.4.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
src
command_classes
Basic.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// Basic.h
4
//
5
// Implementation of the Z-Wave COMMAND_CLASS_BASIC
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 _Basic_H
29
#define _Basic_H
30
31
#include "
command_classes/CommandClass.h
"
32
33
namespace
OpenZWave
34
{
35
class
ValueByte
;
36
39
class
Basic:
public
CommandClass
40
{
41
public
:
42
static
CommandClass
*
Create
(
uint32
const
_homeId,
uint8
const
_nodeId ){
return
new
Basic( _homeId, _nodeId ); }
43
virtual
~Basic
(){}
44
45
static
uint8
const
StaticGetCommandClassId
(){
return
0x20; }
46
static
string
const
StaticGetCommandClassName
(){
return
"COMMAND_CLASS_BASIC"
; }
47
48
bool
SetMapping
(
uint8
const
_commandClassId,
bool
const
_doLog =
true
);
// Map COMMAND_CLASS_BASIC messages to another command class
49
uint8
GetMapping
(){
return
m_mapping; }
50
51
// From CommandClass
52
virtual
void
ReadXML
( TiXmlElement
const
* _ccElement );
53
virtual
void
WriteXML
( TiXmlElement* _ccElement );
54
virtual
bool
RequestState
(
uint32
const
_requestFlags,
uint8
const
_instance,
Driver::MsgQueue
const
_queue );
55
virtual
bool
RequestValue
(
uint32
const
_requestFlags,
uint8
const
_index,
uint8
const
_instance,
Driver::MsgQueue
const
_queue );
56
virtual
uint8
const
GetCommandClassId
()
const
{
return
StaticGetCommandClassId
(); }
57
virtual
string
const
GetCommandClassName
()
const
{
return
StaticGetCommandClassName
(); }
58
virtual
bool
HandleMsg
(
uint8
const
* _data,
uint32
const
_length,
uint32
const
_instance = 1 );
59
virtual
bool
SetValue
(
Value
const
& _value );
60
61
void
Set
(
uint8
const
_level );
62
63
protected
:
64
virtual
void
CreateVars
(
uint8
const
_instance );
65
66
private
:
67
Basic
(
uint32
const
_homeId,
uint8
const
_nodeId );
68
69
uint8
m_mapping;
70
bool
m_ignoreMapping;
71
bool
m_setAsReport;
72
std::vector<int> m_instances;
73
};
74
75
}
// namespace OpenZWave
76
77
#endif
78
CommandClass.h
uint32
unsigned int uint32
Definition
Defs.h:80
uint8
unsigned char uint8
Definition
Defs.h:74
OpenZWave::Basic
Implements COMMAND_CLASS_BASIC (0x20), a Z-Wave device command class.
Definition
Basic.h:40
OpenZWave::Basic::SetValue
virtual bool SetValue(Value const &_value)
Definition
Basic.cpp:243
OpenZWave::Basic::StaticGetCommandClassId
static uint8 const StaticGetCommandClassId()
Definition
Basic.h:45
OpenZWave::Basic::GetCommandClassId
virtual uint8 const GetCommandClassId() const
Definition
Basic.h:56
OpenZWave::Basic::RequestValue
virtual bool RequestValue(uint32 const _requestFlags, uint8 const _index, uint8 const _instance, Driver::MsgQueue const _queue)
Definition
Basic.cpp:154
OpenZWave::Basic::StaticGetCommandClassName
static string const StaticGetCommandClassName()
Definition
Basic.h:46
OpenZWave::Basic::GetCommandClassName
virtual string const GetCommandClassName() const
Definition
Basic.h:57
OpenZWave::Basic::GetMapping
uint8 GetMapping()
Definition
Basic.h:49
OpenZWave::Basic::SetMapping
bool SetMapping(uint8 const _commandClassId, bool const _doLog=true)
Definition
Basic.cpp:302
OpenZWave::Basic::~Basic
virtual ~Basic()
Definition
Basic.h:43
OpenZWave::Basic::Create
static CommandClass * Create(uint32 const _homeId, uint8 const _nodeId)
Definition
Basic.h:42
OpenZWave::Basic::ReadXML
virtual void ReadXML(TiXmlElement const *_ccElement)
Definition
Basic.cpp:73
OpenZWave::Basic::Set
void Set(uint8 const _level)
Definition
Basic.cpp:284
OpenZWave::Basic::RequestState
virtual bool RequestState(uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue)
Definition
Basic.cpp:135
OpenZWave::Basic::CreateVars
virtual void CreateVars(uint8 const _instance)
Definition
Basic.cpp:272
OpenZWave::Basic::HandleMsg
virtual bool HandleMsg(uint8 const *_data, uint32 const _length, uint32 const _instance=1)
Definition
Basic.cpp:183
OpenZWave::Basic::WriteXML
virtual void WriteXML(TiXmlElement *_ccElement)
Definition
Basic.cpp:106
OpenZWave::CommandClass::CommandClass
CommandClass(uint32 const _homeId, uint8 const _nodeId)
Definition
CommandClass.cpp:55
OpenZWave::Driver::MsgQueue
MsgQueue
Definition
Driver.h:566
OpenZWave::ValueByte
Byte value sent to/received from a node.
Definition
ValueByte.h:45
OpenZWave::Value
Base class for values associated with a node.
Definition
Value.h:48
OpenZWave
Definition
Bitfield.h:35
Generated on
for OpenZWave Library by
1.18.0