OpenZWave Library
1.6.1914
Toggle main menu visibility
Loading...
Searching...
No Matches
cpp
src
command_classes
Alarm.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// Alarm.h
4
//
5
// Implementation of the Z-Wave COMMAND_CLASS_ALARM
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 _Alarm_H
29
#define _Alarm_H
30
31
#include "
command_classes/CommandClass.h
"
32
#include "
TimerThread.h
"
33
34
namespace
OpenZWave
35
{
36
class
ValueByte;
37
namespace
Internal
38
{
39
namespace
CC
40
{
44
class
Alarm:
public
CommandClass
,
private
Timer
45
{
46
public
:
47
static
CommandClass
*
Create
(
uint32
const
_homeId,
uint8
const
_nodeId)
48
{
49
return
new
Alarm(_homeId, _nodeId);
50
}
51
virtual
~Alarm
()
52
{
53
}
54
56
static
uint8
const
StaticGetCommandClassId
()
57
{
58
return
0x71;
59
}
60
61
static
string
const
StaticGetCommandClassName
()
62
{
63
return
"COMMAND_CLASS_NOTIFICATION"
;
64
}
65
66
// From CommandClass
67
virtual
bool
RequestState
(
uint32
const
_requestFlags,
uint8
const
_instance,
Driver::MsgQueue
const
_queue)
override
;
68
virtual
bool
RequestValue
(
uint32
const
_requestFlags,
uint16
const
_index,
uint8
const
_instance,
Driver::MsgQueue
const
_queue)
override
;
70
virtual
uint8
const
GetCommandClassId
()
const override
71
{
72
return
StaticGetCommandClassId
();
73
}
74
75
virtual
string
const
GetCommandClassName
()
const override
76
{
77
return
StaticGetCommandClassName
();
78
}
79
80
virtual
bool
HandleMsg
(
uint8
const
* _data,
uint32
const
_length,
uint32
const
_instance = 1)
override
;
81
virtual
uint8
GetMaxVersion
()
override
82
{
83
return
8;
84
}
85
virtual
bool
SetValue
(
Internal::VC::Value
const
& _value)
override
;
86
87
private
:
88
Alarm
(
uint32
const
_homeId,
uint8
const
_nodeId);
89
void
SetupEvents(
uint32
type,
uint32
index, vector<Internal::VC::ValueList::Item> *_items,
uint32
const
_instance);
90
void
ClearAlarm(
uint32
type);
91
void
ClearEventParams(
uint32
const
_instance);
92
bool
m_v1Params;
93
std::vector<uint32> m_ParamsSet;
94
uint32
m_ClearTimeout;
95
std::map<uint32, uint32> m_TimersToInstances;
96
};
97
}
// namespace CommandClass
98
}
// namespace Internal
99
100
}
// namespace OpenZWave
101
102
#endif
CommandClass.h
uint16
unsigned short uint16
Definition
Defs.h:88
uint32
unsigned int uint32
Definition
Defs.h:91
uint8
unsigned char uint8
Definition
Defs.h:85
TimerThread.h
OpenZWave::Driver::MsgQueue
MsgQueue
Definition
Driver.h:660
OpenZWave::Internal::CC::Alarm
Implements COMMAND_CLASS_NOTIFICATION (0x71), a Z-Wave device command class.
Definition
Alarm.h:45
OpenZWave::Internal::CC::Alarm::SetValue
virtual bool SetValue(Internal::VC::Value const &_value) override
Definition
Alarm.cpp:130
OpenZWave::Internal::CC::Alarm::HandleMsg
virtual bool HandleMsg(uint8 const *_data, uint32 const _length, uint32 const _instance=1) override
Handle a response to a message associated with this command class. (Inherited from CommandClass).
Definition
Alarm.cpp:192
OpenZWave::Internal::CC::Alarm::Create
static CommandClass * Create(uint32 const _homeId, uint8 const _nodeId)
Definition
Alarm.h:47
OpenZWave::Internal::CC::Alarm::StaticGetCommandClassName
static string const StaticGetCommandClassName()
Get a string containing the name of this command class.
Definition
Alarm.h:61
OpenZWave::Internal::CC::Alarm::RequestValue
virtual bool RequestValue(uint32 const _requestFlags, uint16 const _index, uint8 const _instance, Driver::MsgQueue const _queue) override
Definition
Alarm.cpp:145
OpenZWave::Internal::CC::Alarm::RequestState
virtual bool RequestState(uint32 const _requestFlags, uint8 const _instance, Driver::MsgQueue const _queue) override
Definition
Alarm.cpp:86
OpenZWave::Internal::CC::Alarm::GetMaxVersion
virtual uint8 GetMaxVersion() override
Definition
Alarm.h:81
OpenZWave::Internal::CC::Alarm::~Alarm
virtual ~Alarm()
Definition
Alarm.h:51
OpenZWave::Internal::CC::Alarm::StaticGetCommandClassId
static uint8 const StaticGetCommandClassId()
Get command class ID (1 byte) identifying this command class.
Definition
Alarm.h:56
OpenZWave::Internal::CC::Alarm::GetCommandClassName
virtual string const GetCommandClassName() const override
Get a string containing the name of this command class. (Inherited from CommandClass).
Definition
Alarm.h:75
OpenZWave::Internal::CC::Alarm::GetCommandClassId
virtual uint8 const GetCommandClassId() const override
Get command class ID (1 byte) identifying this command class. (Inherited from CommandClass).
Definition
Alarm.h:70
OpenZWave::Internal::CC::CommandClass::CommandClass
CommandClass(uint32 const _homeId, uint8 const _nodeId)
Definition
CommandClass.cpp:62
OpenZWave::Internal::Timer::Timer
Timer(Driver *_driver)
Constructor with the _driver this instance is associated with.
Definition
TimerThread.cpp:177
OpenZWave::Internal::VC::Value
Base class for values associated with a node.
Definition
Value.h:55
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