| OpenZWave Library 1.6.0

NotificationCCTypes.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // NotificationCCTypes.h
4 //
5 // NotificationCCTypes for Notification Command Class
6 //
7 // Copyright (c) 2018 Justin Hammond <justin@dynam.ac>
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 NOTIFICATIONCCTYPES_H
29 #define NOTIFICATIONCCTYPES_H
30
31 #include <cstdio>
32 #include <string>
33 #include <map>
34 #include "Defs.h"
35 #include "Driver.h"
36 #include "command_classes/CommandClass.h"
37
38 namespace OpenZWave
39 {
40
41 class NotificationCCTypes
42 {
43 public:
44 enum NotificationEventParamTypes {
45 NEPT_Location = 0x01,
46 NEPT_List,
47 NEPT_UserCodeReport,
48 NEPT_Byte,
49 NEPT_String,
50 NEPT_Time
51 };
52
53 class NotificationEventParams {
54 public:
55 uint32 id;
56 string name;
57 NotificationEventParamTypes type;
58 std::map<uint32, string> ListItems;
59 };
60 class NotificationEvents {
61 public:
62 uint32 id;
63 string name;
64 std::map<uint32, NotificationCCTypes::NotificationEventParams* > EventParams;
65 };
66 class NotificationTypes {
67 public:
68 uint32 id;
69 string name;
70 std::map<uint32, NotificationCCTypes::NotificationEvents *> Events;
71 };
72
73
74 //-----------------------------------------------------------------------------
75 // Construction
76 //-----------------------------------------------------------------------------
77 private:
78 NotificationCCTypes();
79 ~NotificationCCTypes();
80 static void ReadXML();
81 public:
82 static NotificationCCTypes* Get();
83 static bool Create();
84 static string GetEventParamNames(NotificationEventParamTypes);
85 string GetAlarmType(uint32);
86 string GetEventForAlarmType(uint32, uint32);
87 const NotificationTypes *GetAlarmNotificationTypes(uint32);
88 const NotificationEvents *GetAlarmNotificationEvents(uint32, uint32);
89 const std::map<uint32, NotificationCCTypes::NotificationEventParams* > GetAlarmNotificationEventParams(uint32, uint32);
90
91 //-----------------------------------------------------------------------------
92 // Instance Functions
93 //-----------------------------------------------------------------------------
94 private:
95 static NotificationCCTypes* m_instance;
96 static std::map<uint32, NotificationCCTypes::NotificationTypes *> Notifications;
97 static uint32 m_revision;
98 };
99
100 };
101 #endif // VALUEHELP_H
uint32
unsigned int uint32
Definition: Defs.h:95
OpenZWave::NotificationCCTypes::GetAlarmType
string GetAlarmType(uint32)
Definition: NotificationCCTypes.cpp:287
Driver.h
OpenZWave::NotificationCCTypes
Definition: NotificationCCTypes.h:42
OpenZWave::NotificationCCTypes::NEPT_Time
@ NEPT_Time
Definition: NotificationCCTypes.h:50
OpenZWave::NotificationCCTypes::NEPT_List
@ NEPT_List
Definition: NotificationCCTypes.h:46
OpenZWave::NotificationCCTypes::NotificationEvents::name
string name
Definition: NotificationCCTypes.h:63
OpenZWave::NotificationCCTypes::NotificationTypes
Definition: NotificationCCTypes.h:66
OpenZWave::NotificationCCTypes::NotificationTypes::Events
std::map< uint32, NotificationCCTypes::NotificationEvents * > Events
Definition: NotificationCCTypes.h:70
OpenZWave::NotificationCCTypes::NEPT_Byte
@ NEPT_Byte
Definition: NotificationCCTypes.h:48
OpenZWave::NotificationCCTypes::NotificationEvents
Definition: NotificationCCTypes.h:60
OpenZWave::NotificationCCTypes::NotificationEvents::id
uint32 id
Definition: NotificationCCTypes.h:62
OpenZWave::NotificationCCTypes::NotificationEventParams::id
uint32 id
Definition: NotificationCCTypes.h:55
OpenZWave::NotificationCCTypes::NEPT_Location
@ NEPT_Location
Definition: NotificationCCTypes.h:45
OpenZWave::NotificationCCTypes::NEPT_String
@ NEPT_String
Definition: NotificationCCTypes.h:49
OpenZWave::NotificationCCTypes::GetAlarmNotificationTypes
const NotificationTypes * GetAlarmNotificationTypes(uint32)
Definition: NotificationCCTypes.cpp:314
OpenZWave::NotificationCCTypes::Get
static NotificationCCTypes * Get()
Definition: NotificationCCTypes.cpp:374
OpenZWave::NotificationCCTypes::GetAlarmNotificationEvents
const NotificationEvents * GetAlarmNotificationEvents(uint32, uint32)
Definition: NotificationCCTypes.cpp:329
OpenZWave::NotificationCCTypes::NotificationEventParams
Definition: NotificationCCTypes.h:53
CommandClass.h
OpenZWave::NotificationCCTypes::NotificationEventParams::type
NotificationEventParamTypes type
Definition: NotificationCCTypes.h:57
OpenZWave::NotificationCCTypes::Create
static bool Create()
Definition: NotificationCCTypes.cpp:359
OpenZWave::NotificationCCTypes::NotificationEventParams::ListItems
std::map< uint32, string > ListItems
Definition: NotificationCCTypes.h:58
OpenZWave::NotificationCCTypes::GetEventParamNames
static string GetEventParamNames(NotificationEventParamTypes)
Definition: NotificationCCTypes.cpp:259
OpenZWave::NotificationCCTypes::NotificationTypes::name
string name
Definition: NotificationCCTypes.h:69
OpenZWave::NotificationCCTypes::NotificationEventParamTypes
NotificationEventParamTypes
Definition: NotificationCCTypes.h:44
OpenZWave::NotificationCCTypes::GetEventForAlarmType
string GetEventForAlarmType(uint32, uint32)
Definition: NotificationCCTypes.cpp:299
OpenZWave::NotificationCCTypes::NotificationEventParams::name
string name
Definition: NotificationCCTypes.h:56
Defs.h
OpenZWave::NotificationCCTypes::NotificationTypes::id
uint32 id
Definition: NotificationCCTypes.h:68
OpenZWave::NotificationCCTypes::GetAlarmNotificationEventParams
const std::map< uint32, NotificationCCTypes::NotificationEventParams * > GetAlarmNotificationEventParams(uint32, uint32)
Definition: NotificationCCTypes.cpp:344
OpenZWave
Definition: Bitfield.h:35
OpenZWave::NotificationCCTypes::NEPT_UserCodeReport
@ NEPT_UserCodeReport
Definition: NotificationCCTypes.h:47
OpenZWave::NotificationCCTypes::NotificationEvents::EventParams
std::map< uint32, NotificationCCTypes::NotificationEventParams * > EventParams
Definition: NotificationCCTypes.h:64