OpenZWave Library: CentralScene.h Source File

| OpenZWave Library 1.6.0

CentralScene.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2//
3// CentralScene.h
4//
5// Implementation of the Z-Wave COMMAND_CLASS_CENTRAL_SCENE
6//
7// Copyright (c) 2012 Greg Satz <satz@iranger.com>
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 _CentralScene_H
29#define _CentralScene_H
30
31#include "command_classes/CommandClass.h"
32#include "TimerThread.h"
33
34namespace OpenZWave
35{
36 class ValueByte;
37
41 class CentralScene: public CommandClass, private Timer
42 {
43 public:
44 static CommandClass* Create( uint32 const _homeId, uint8 const _nodeId ){ return new CentralScene( _homeId, _nodeId ); }
45 virtual ~CentralScene(){}
46
48 static uint8 const StaticGetCommandClassId(){ return 0x5B; }
50 static string const StaticGetCommandClassName(){ return "COMMAND_CLASS_CENTRAL_SCENE"; }
51
52 // From CommandClass
54 virtual uint8 const GetCommandClassId()const{ return StaticGetCommandClassId(); }
56 virtual string const GetCommandClassName()const{ return StaticGetCommandClassName(); }
57 virtual uint8 GetMaxVersion(){ return 3; }
59 virtual bool HandleMsg( uint8 const* _data, uint32 const _length, uint32 const _instance = 1 );
61 void CreateVars( uint8 const _instance );
62 bool RequestState( uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue );
63 bool RequestValue( uint32 const _requestFlags, uint16 const _what, uint8 const _instance, Driver::MsgQueue const _queue );
64 bool SetValue( Value const& _value);
65 private:
73 void createSupportedKeyAttributesValues(uint8 keyAttributes, uint8 sceneNumber, uint8 instance);
74 void ClearScene(uint32 sceneID);
75 CentralScene( uint32 const _homeId, uint8 const _nodeId );
76 bool m_slowrefresh;
77 uint8 m_sequence;
78 std::map<uint32, uint32> m_TimersSet;
79 };
80
81} // namespace OpenZWave
82
83#endif
CommandClass.h
uint16
unsigned short uint16
Definition: Defs.h:92
uint32
unsigned int uint32
Definition: Defs.h:95
uint8
unsigned char uint8
Definition: Defs.h:89
TimerThread.h
OpenZWave::CentralScene
Implements COMMAND_CLASS_CENTRAL_SCENE (0x5B), a Z-Wave device command class.
Definition: CentralScene.h:42
OpenZWave::CentralScene::Create
static CommandClass * Create(uint32 const _homeId, uint8 const _nodeId)
Definition: CentralScene.h:44
OpenZWave::CentralScene::SetValue
bool SetValue(Value const &_value)
Definition: CentralScene.cpp:416
OpenZWave::CentralScene::RequestValue
bool RequestValue(uint32 const _requestFlags, uint16 const _what, uint8 const _instance, Driver::MsgQueue const _queue)
Definition: CentralScene.cpp:391
OpenZWave::CentralScene::RequestState
bool RequestState(uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue)
Definition: CentralScene.cpp:372
OpenZWave::CentralScene::GetCommandClassId
virtual uint8 const GetCommandClassId() const
Get command class ID (1 byte) identifying this command class. (Inherited from CommandClass)
Definition: CentralScene.h:54
OpenZWave::CentralScene::GetMaxVersion
virtual uint8 GetMaxVersion()
Definition: CentralScene.h:57
OpenZWave::CentralScene::StaticGetCommandClassId
static uint8 const StaticGetCommandClassId()
Get command class ID (1 byte) identifying this command class.
Definition: CentralScene.h:48
OpenZWave::CentralScene::~CentralScene
virtual ~CentralScene()
Definition: CentralScene.h:45
OpenZWave::CentralScene::GetCommandClassName
virtual string const GetCommandClassName() const
Get a string containing the name of this command class. (Inherited from CommandClass)
Definition: CentralScene.h:56
OpenZWave::CentralScene::CreateVars
void CreateVars(uint8 const _instance)
Create Default Vars for this CC.
Definition: CentralScene.cpp:545
OpenZWave::CentralScene::HandleMsg
virtual bool HandleMsg(uint8 const *_data, uint32 const _length, uint32 const _instance=1)
Handle a response to a message associated with this command class. (Inherited from CommandClass)
Definition: CentralScene.cpp:433
OpenZWave::CentralScene::StaticGetCommandClassName
static string const StaticGetCommandClassName()
Get a string containing the name of this command class.
Definition: CentralScene.h:50
OpenZWave::CommandClass
Base class for all Z-Wave command classes.
Definition: CommandClass.h:56
OpenZWave::Driver::MsgQueue
MsgQueue
Definition: Driver.h:592
OpenZWave::Timer
Timer SubClass for automatically registering/unregistering Timer Callbacks if the instance goes out o...
Definition: TimerThread.h:129
OpenZWave::Value
Base class for values associated with a node.
Definition: Value.h:49
OpenZWave
Definition: Bitfield.h:35