mirror of
https://github.com/Fishwaldo/open-zwave.git
synced 2025-03-15 11:31:40 +00:00
Continue Rewrite of Notification CC - Issue #1395
This commit is contained in:
parent
44a959f2ac
commit
1f16a8fb71
9 changed files with 505 additions and 261 deletions
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<NotificationTypes xmlns='https://github.com/OpenZWave/open-zwave' Revision="1">
|
||||
<NotificationTypes xmlns='https://github.com/OpenZWave/open-zwave' Revision="2">
|
||||
<AlarmType id="1" name="Alarm_Smoke_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Smoke_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Smoke_Detected_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -23,9 +24,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_Smoke_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="2" name="Alarm_CO_Event">
|
||||
<AlarmEvent id="0" name="Alarm_CO_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_CO_Detected_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -34,8 +36,8 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_CO_Carbon_Monoxied_Test">
|
||||
<AlarmEventParam id="1" type="list" name="Result">
|
||||
<Item id="1" label="Ok"/>
|
||||
<Item id="2" label="Failed"/>
|
||||
<Item id="1" label="Ok" />
|
||||
<Item id="2" label="Failed" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_CO_Replacement_Required_Unspecified">
|
||||
|
@ -49,9 +51,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_CO_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="3" name="Alarm_CO2_Event">
|
||||
<AlarmEvent id="0" name="Alarm_CO2_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_CO2_Detected_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -60,8 +63,8 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_CO2_Carbon_Dioxide_Test">
|
||||
<AlarmEventParam id="1" type="list" name="Result">
|
||||
<Item id="1" label="Ok"/>
|
||||
<Item id="2" label="Failed"/>
|
||||
<Item id="1" label="Ok" />
|
||||
<Item id="2" label="Failed" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_CO2_Replacement_Required_Unspecified">
|
||||
|
@ -75,9 +78,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_CO2_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="4" name="Alarm_Heat_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Heat_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Heat_OverHeat_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -107,9 +111,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_Heat_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="5" name="Alarm_Flood_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Flood_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Flood_Leak_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -125,26 +130,27 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="6" name="Alarm_Flood_Flow">
|
||||
<AlarmEventParam id="1" type="list" name="Type">
|
||||
<Item id="1" label="No Data"/>
|
||||
<Item id="2" label="Below Low Threshold"/>
|
||||
<Item id="3" label="Above High Threshold"/>
|
||||
<Item id="4" label="Max"/>
|
||||
</AlarmEventParam>
|
||||
<Item id="1" label="No Data" />
|
||||
<Item id="2" label="Below Low Threshold" />
|
||||
<Item id="3" label="Above High Threshold" />
|
||||
<Item id="4" label="Max" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="7" name="Alarm_Flood_Pressure">
|
||||
<AlarmEventParam id="1" type="list" name="Type">
|
||||
<Item id="1" label="No Data"/>
|
||||
<Item id="2" label="Below Low Threshold"/>
|
||||
<Item id="3" label="Above High Threshold"/>
|
||||
<Item id="4" label="Max"/>
|
||||
</AlarmEventParam>
|
||||
<Item id="1" label="No Data" />
|
||||
<Item id="2" label="Below Low Threshold" />
|
||||
<Item id="3" label="Above High Threshold" />
|
||||
<Item id="4" label="Max" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Flood_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="6" name="Alarm_Access_Control_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Access_Control_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Access_Control_Manual_Lock">
|
||||
</AlarmEvent>
|
||||
|
@ -155,10 +161,10 @@
|
|||
<AlarmEvent id="4" name="Alarm_Access_Control_RF_Unlock">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="5" name="Alarm_Access_Control_Keypad_Lock">
|
||||
<AlarmEventParam id="1" type="usercodereport" name="User Code"/>
|
||||
<AlarmEventParam id="1" type="usercodereport" name="User Code" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="6" name="Alarm_Access_Control_Keypad_Unlock">
|
||||
<AlarmEventParam id="1" type="usercodereport" name="User Code"/>
|
||||
<AlarmEventParam id="1" type="usercodereport" name="User Code" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="7" name="Alarm_Access_Control_Manual_Not_Fully_Locked">
|
||||
</AlarmEvent>
|
||||
|
@ -196,13 +202,14 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="64" name="Alarm_Access_Control_Barrier_Initializing">
|
||||
<AlarmEventParam id="1" type="list" name="Progress">
|
||||
<Item id="0" label="Process Complete"/>
|
||||
<Item id="255" label="Performing Process"/>
|
||||
</AlarmEventParam>
|
||||
<Item id="0" label="Process Complete" />
|
||||
<Item id="255" label="Performing Process" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="65" name="Alarm_Access_Control_Barrier_Force_Exceeded">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="66" name="Alarm_Access_Control_Barrier_Motor_Time_Exceeded">
|
||||
<AlarmEventParam id="1" type="byte" name="Time Limit" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="67" name="Alarm_Access_Control_Barrier_Physical_Limits_Exceeded">
|
||||
</AlarmEvent>
|
||||
|
@ -213,12 +220,22 @@
|
|||
<AlarmEvent id="70" name="Alarm_Access_Control_Barrier_Malfunction">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="71" name="Alarm_Access_Control_Barrier_Vacaction_Mode">
|
||||
<AlarmEventParam id="1" type="list" name="Mode">
|
||||
<Item id="0" label="Disabled" />
|
||||
<Item id="255" label="Enabled" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="72" name="Alarm_Access_Control_Barrier_Saftey_Beam_Obstruction">
|
||||
<AlarmEventParam id="1" type="list" name="Obstruction">
|
||||
<Item id="0" label="No Obstruction" />
|
||||
<Item id="255" label="Obstruction" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="73" name="Alarm_Access_Control_Barrier_Sensor_Not_Detected">
|
||||
<AlarmEventParam id="1" type="byte" name="Sensor ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="74" name="Alarm_Access_Control_Barrier_Battery_Low">
|
||||
<AlarmEventParam id="1" type="byte" name="Sensor ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="75" name="Alarm_Access_Control_Barrier_Short_Wall_Station_Wires">
|
||||
</AlarmEvent>
|
||||
|
@ -227,9 +244,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_Access_Control_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="7" name="Alarm_HomeSecurity_Event">
|
||||
<AlarmEvent id="0" name="Alarm_HomeSecurity_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_HomeSecurity_Intrusion_Location">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
|
@ -255,9 +273,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_HomeSecurity_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="8" name="Alarm_Power_Management_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Power_Management_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Power_Management_PowerApplied">
|
||||
</AlarmEvent>
|
||||
|
@ -292,17 +311,20 @@
|
|||
<AlarmEvent id="254" name="Alarm_Power_Management_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="9" name="Alarm_System_Event">
|
||||
<AlarmEvent id="0" name="Alarm_System_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_System_Hardware_Failure">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="2" name="Alarm_System_Software_Failure">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_System_Hardware_Failure_Code">
|
||||
<AlarmEventParam id="1" type="string" name="Error Code" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_System_Software_Failure_Code">
|
||||
<AlarmEventParam id="1" type="string" name="Error Code" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="5" name="Alarm_System_Heartbeat">
|
||||
</AlarmEvent>
|
||||
|
@ -313,9 +335,10 @@
|
|||
<AlarmEvent id="254" name="Alarm_System_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="10" name="Alarm_Emergency_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Emergency_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Emergency_Police">
|
||||
</AlarmEvent>
|
||||
|
@ -326,22 +349,25 @@
|
|||
<AlarmEvent id="254" name="Alarm_Emergency_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="11" name="Alarm_Clock_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Clock_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Clock_Wakeup">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="2" name="Alarm_Clock_Timer">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_Clock_Time_Remaining">
|
||||
<AlarmEventParam id="1" type="duration" name="Seconds Remaining" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Clock_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="12" name="Alarm_Appliance_Event">
|
||||
<AlarmEvent id="0" name="Alarm_Appliance_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Appliance_Program_Started">
|
||||
</AlarmEvent>
|
||||
|
@ -387,10 +413,11 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Appliance_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
</AlarmType>
|
||||
|
||||
<AlarmType id="13" name="Alarm_HomeHealth">
|
||||
<AlarmEvent id="0" name="Alarm_HomeHealth_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_HomeHealth_Leaving_Bed">
|
||||
</AlarmEvent>
|
||||
|
@ -403,41 +430,70 @@
|
|||
<AlarmEvent id="5" name="Alarm_HomeHealth_Sitting_On_Edge_Of_Bed">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="6" name="Alarm_HomeHealth_Volatile_Organic_Level">
|
||||
<AlarmEventParam id="1" type="list" name="Pollution Level">
|
||||
<Item id="1" label="Clean" />
|
||||
<Item id="2" label="Slightly Polluted" />
|
||||
<Item id="3" label="Moderately polluted" />
|
||||
<Item id="4" label="Highly polluted" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_HomeHealth_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
</AlarmType>
|
||||
|
||||
<AlarmType id="14" name="Alarm_Siren">
|
||||
<AlarmEvent id="0" name="Alarm_Siren_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Siren_Active">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Siren_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
|
||||
<AlarmType id="15" name="Alarm_WaterValve">
|
||||
<AlarmEvent id="0" name="Alarm_WaterValve_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_WaterValve_Valve_Operation">
|
||||
<AlarmEventParam id="1" type="list" name="Status">
|
||||
<Item id="0" label="Off" />
|
||||
<Item id="1" label="On" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="2" name="Alarm_WaterValve_Master_Valve_Operation">
|
||||
<AlarmEventParam id="1" type="list" name="Status">
|
||||
<Item id="0" label="Off" />
|
||||
<Item id="1" label="On" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_WaterValve_Valve_Short_Circuit">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_WaterValve_Master_Valve_Short_Circuit">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="5" name="Alarm_WaterValve_Valve_Current_Alarm">
|
||||
<AlarmEventParam id="1" type="list" name="Type">
|
||||
<Item id="1" label="No Data" />
|
||||
<Item id="2" label="Below Low Threshold" />
|
||||
<Item id="3" label="Above High Threshold" />
|
||||
<Item id="4" label="Max" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="6" name="Alarm_WaterValve_Master_Valve_Current_Alarm">
|
||||
<AlarmEventParam id="1" type="list" name="Type">
|
||||
<Item id="1" label="No Data" />
|
||||
<Item id="2" label="Below Low Threshold" />
|
||||
<Item id="3" label="Above High Threshold" />
|
||||
<Item id="4" label="Max" />
|
||||
</AlarmEventParam>
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_WaterValve_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
</AlarmType>
|
||||
|
||||
<AlarmType id="16" name="Alarm_Weather">
|
||||
<AlarmEvent id="0" name="Alarm_Weather_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Weather_Rain">
|
||||
</AlarmEvent>
|
||||
|
@ -445,33 +501,41 @@
|
|||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Weather_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
</AlarmType>
|
||||
|
||||
<AlarmType id="17" name="Alarm_Irrigation">
|
||||
<AlarmEvent id="0" name="Alarm_Irrigation_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Irrigation_Schedule_Started">
|
||||
<AlarmEventParam id="1" type="byte" name="Schedule ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="2" name="Alarm_Irrigation_Schedule_Finished">
|
||||
<AlarmEventParam id="1" type="byte" name="Schedule ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_Irrigation_Valve_Table_Run_Started">
|
||||
<AlarmEventParam id="1" type="byte" name="Valve Table ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_Irrigation_Valve_Table_Run_Finished">
|
||||
<AlarmEventParam id="1" type="byte" name="Valve Table ID" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="5" name="Alarm_Irrigation_Device_Not_Configured">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="254" name="Alarm_Irrigation_Unknown_Event">
|
||||
</AlarmEvent>
|
||||
</AlarmType>
|
||||
|
||||
</AlarmType>
|
||||
|
||||
<AlarmType id="18" name="Alarm_Gas">
|
||||
<AlarmEvent id="0" name="Alarm_Gas_Clear">
|
||||
<AlarmEventParam id="1" type="byte" name="Previous Event" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="1" name="Alarm_Gas_Combustable_Gas_Detected">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="2" name="Alarm_Gas_Combustable_Gas_Detected_Unknown_Location">
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="3" name="Alarm_Gas_Toxic_Gas_Detected">
|
||||
<AlarmEventParam id="1" type="location" name="Location" />
|
||||
</AlarmEvent>
|
||||
<AlarmEvent id="4" name="Alarm_Gas_Toxic_Gas_Detected_Unknown_Location">
|
||||
</AlarmEvent>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<xs:element name='AlarmEvent'>
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref='NotificationTypes:AlarmEventParam' minOccurs='0' maxOccurs='unbounded' />
|
||||
<xs:element ref='NotificationTypes:AlarmEventParam' minOccurs='0' maxOccurs='1' />
|
||||
</xs:sequence>
|
||||
<xs:attribute name='id' type='xs:string' use='required' />
|
||||
<xs:attribute name='name' type='xs:string' use='required' />
|
||||
|
@ -41,7 +41,10 @@
|
|||
<xs:restriction base='xs:string'>
|
||||
<xs:enumeration value='location' />
|
||||
<xs:enumeration value='list' />
|
||||
<xs:enumeration value="usercodereport" />
|
||||
<xs:enumeration value='usercodereport' />
|
||||
<xs:enumeration value='byte' />
|
||||
<xs:enumeration value='string' />
|
||||
<xs:enumeration value='duration' />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
|
|
|
@ -88,8 +88,8 @@
|
|||
'md5' => '531baa80d4e43217688ff6be763ef429133f62fae07564556b614ac6fb68e78331ee4fb8f69cba72d2825dbf1ba5e5a355d0ae4af6df3894ccfb57e80faac977'
|
||||
},
|
||||
'config/NotificationCCTypes.xml' => {
|
||||
'Revision' => '1',
|
||||
'md5' => 'fff81d7aad83adae8da76ce4f3291054d913b953542338410da494d357f8e01e63aaf1c1ba455bcd4e7b9251093d73b72d7b3bb63d713aea9f27eb731a47ed44'
|
||||
'Revision' => '2',
|
||||
'md5' => '8a5f15445d5c9506fa6cf7c87eab9cbd93dc3ed9ed0e53cccad475057415ea7442972fc8650991a53dbf4b11afe4e23e270c49aeef0cd4c82a90b00e29b015ec'
|
||||
},
|
||||
'config/act/lfm20.xml' => {
|
||||
'Revision' => '1',
|
||||
|
|
|
@ -91,7 +91,6 @@ Manager* Manager::Create
|
|||
{
|
||||
s_instance = new Manager();
|
||||
}
|
||||
NotificationCCTypes::Get()->test();
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
|
@ -194,6 +193,7 @@ m_notificationMutex( new Mutex() )
|
|||
Scene::ReadScenes();
|
||||
Log::Write(LogLevel_Always, "OpenZwave Version %s Starting Up", getVersionAsString().c_str());
|
||||
Log::Write(LogLevel_Always, "Using Language Localization %s", Localization::Get()->GetSelectedLang().c_str());
|
||||
NotificationCCTypes::Create();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -188,6 +188,12 @@ void NotificationCCTypes::ReadXML
|
|||
}
|
||||
} else if (!strcasecmp(str, "usercodereport")) {
|
||||
aep->type = NotificationCCTypes::NEPT_UserCodeReport;
|
||||
} else if (!strcasecmp(str, "byte")) {
|
||||
aep->type = NotificationCCTypes::NEPT_Byte;
|
||||
} else if (!strcasecmp(str, "string")) {
|
||||
aep->type = NotificationCCTypes::NEPT_String;
|
||||
} else if (!strcasecmp(str, "duration")) {
|
||||
aep->type = NotificationCCTypes::NEPT_Time;
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, "NotificationCCTypes::ReadXML: Error in %s at line %d - unknown AlarmEventParam type attribute (%s)", nextElement->GetDocument()->GetUserData(), nextElement->Row(), str );
|
||||
nextElement = nextElement->NextSiblingElement();
|
||||
|
@ -249,7 +255,11 @@ void NotificationCCTypes::ReadXML
|
|||
|
||||
}
|
||||
|
||||
string NotificationCCTypes::GetEventParamNames(NotificationEventParamTypes type) {
|
||||
string NotificationCCTypes::GetEventParamNames
|
||||
(
|
||||
NotificationEventParamTypes type
|
||||
)
|
||||
{
|
||||
switch (type) {
|
||||
case NEPT_Location:
|
||||
return "Location";
|
||||
|
@ -260,11 +270,24 @@ string NotificationCCTypes::GetEventParamNames(NotificationEventParamTypes type)
|
|||
case NEPT_UserCodeReport:
|
||||
return "UserCodeReport";
|
||||
break;
|
||||
case NEPT_Byte:
|
||||
return "Byte";
|
||||
break;
|
||||
case NEPT_String:
|
||||
return "String";
|
||||
break;
|
||||
case NEPT_Time:
|
||||
return "Duration";
|
||||
break;
|
||||
};
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
string NotificationCCTypes::GetAlarmType(uint32 type) {
|
||||
string NotificationCCTypes::GetAlarmType
|
||||
(
|
||||
uint32 type
|
||||
)
|
||||
{
|
||||
if (Notifications.find(type) != Notifications.end()) {
|
||||
return Notifications.at(type)->name;
|
||||
}
|
||||
|
@ -272,6 +295,21 @@ string NotificationCCTypes::GetAlarmType(uint32 type) {
|
|||
return "Unknown";
|
||||
}
|
||||
|
||||
string NotificationCCTypes::GetEventForAlarmType
|
||||
(
|
||||
uint32 type,
|
||||
uint32 event
|
||||
)
|
||||
{
|
||||
if ( const NotificationCCTypes::NotificationEvents *ne = NotificationCCTypes::GetAlarmNotificationEvents(type, event)) {
|
||||
return ne->name;
|
||||
}
|
||||
Log::Write( LogLevel_Warning, "NotificationCCTypes::GetEventForAlarmType - Unknown AlarmType/Event %d/d", type, event);
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
|
||||
|
||||
const NotificationCCTypes::NotificationTypes* NotificationCCTypes::GetAlarmNotificationTypes
|
||||
(
|
||||
uint32 type
|
||||
|
@ -297,11 +335,40 @@ const NotificationCCTypes::NotificationEvents* NotificationCCTypes::GetAlarmNoti
|
|||
if (nt->Events.find(event) != nt->Events.end()) {
|
||||
return nt->Events.at(event);
|
||||
}
|
||||
Log::Write( LogLevel_Warning, "NotificationCCTypes::GetAlarmNotificationEvents - Uknown Alarm Event %d for Alarm Type %s (%d)", event, GetAlarmType(type).c_str(), type);
|
||||
Log::Write( LogLevel_Warning, "NotificationCCTypes::GetAlarmNotificationEvents - Unknown Alarm Event %d for Alarm Type %s (%d)", event, GetAlarmType(type).c_str(), type);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const std::map<uint32, NotificationCCTypes::NotificationEventParams* > NotificationCCTypes::GetAlarmNotificationEventParams
|
||||
(
|
||||
uint32 type,
|
||||
uint32 event
|
||||
)
|
||||
{
|
||||
if (const NotificationCCTypes::NotificationTypes *nt = GetAlarmNotificationTypes(type)) {
|
||||
if (nt->Events.find(event) != nt->Events.end()) {
|
||||
return nt->Events.at(event)->EventParams;
|
||||
}
|
||||
Log::Write( LogLevel_Warning, "NotificationCCTypes::GetAlarmNotificationEventParams - Unknown Alarm Event %d for Alarm Type %s (%d)", event, GetAlarmType(type).c_str(), type);
|
||||
}
|
||||
return std::map<uint32, NotificationCCTypes::NotificationEventParams* >();
|
||||
}
|
||||
|
||||
bool NotificationCCTypes::Create
|
||||
(
|
||||
)
|
||||
{
|
||||
if (m_instance != NULL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
m_instance = new NotificationCCTypes();
|
||||
ReadXML();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NotificationCCTypes *NotificationCCTypes::Get
|
||||
(
|
||||
|
|
|
@ -44,7 +44,10 @@ public:
|
|||
enum NotificationEventParamTypes {
|
||||
NEPT_Location = 0x01,
|
||||
NEPT_List,
|
||||
NEPT_UserCodeReport
|
||||
NEPT_UserCodeReport,
|
||||
NEPT_Byte,
|
||||
NEPT_String,
|
||||
NEPT_Time
|
||||
};
|
||||
|
||||
class NotificationEventParams {
|
||||
|
@ -77,11 +80,13 @@ private:
|
|||
static void ReadXML();
|
||||
public:
|
||||
static NotificationCCTypes* Get();
|
||||
static bool Create();
|
||||
static string GetEventParamNames(NotificationEventParamTypes);
|
||||
void test() { return; };
|
||||
string GetAlarmType(uint32);
|
||||
string GetEventForAlarmType(uint32, uint32);
|
||||
const NotificationTypes *GetAlarmNotificationTypes(uint32);
|
||||
const NotificationEvents *GetAlarmNotificationEvents(uint32, uint32);
|
||||
const std::map<uint32, NotificationCCTypes::NotificationEventParams* > GetAlarmNotificationEventParams(uint32, uint32);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Instance Functions
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "command_classes/CommandClasses.h"
|
||||
#include "command_classes/Alarm.h"
|
||||
#include "command_classes/NodeNaming.h"
|
||||
#include "command_classes/UserCode.h"
|
||||
#include "Defs.h"
|
||||
#include "Msg.h"
|
||||
#include "Node.h"
|
||||
|
@ -45,6 +46,7 @@
|
|||
#include "value_classes/ValueBool.h"
|
||||
#include "value_classes/ValueList.h"
|
||||
#include "value_classes/ValueString.h"
|
||||
#include "value_classes/ValueInt.h"
|
||||
using namespace OpenZWave;
|
||||
|
||||
enum AlarmCmd
|
||||
|
@ -62,11 +64,15 @@ enum AlarmCmd
|
|||
|
||||
enum
|
||||
{
|
||||
AlarmIndex_Type = 256,
|
||||
AlarmIndex_Level,
|
||||
AlarmIndex_SourceNodeId,
|
||||
AlarmIndex_Count,
|
||||
AlarmIndex_Params
|
||||
AlarmIndex_Type_ParamUserCodeid = 256,
|
||||
AlarmIndex_Type_ParamUserCodeEntered,
|
||||
AlarmIndex_Type_ParamLocation,
|
||||
AlarmIndex_Type_ParamList,
|
||||
AlarmIndex_Type_ParamByte,
|
||||
AlarmIndex_Type_ParamString,
|
||||
AlarmIndex_Type_Duration,
|
||||
AlarmIndex_Type = 512,
|
||||
AlarmIndex_Level
|
||||
};
|
||||
|
||||
|
||||
|
@ -147,7 +153,6 @@ bool Alarm::RequestValue
|
|||
Driver::MsgQueue const _queue
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
if( IsGetSupported() )
|
||||
{
|
||||
if( GetVersion() == 1 )
|
||||
|
@ -162,34 +167,27 @@ bool Alarm::RequestValue
|
|||
GetDriver()->SendMsg( msg, _queue );
|
||||
return true;
|
||||
}
|
||||
else
|
||||
else if (GetVersion() >= 3)
|
||||
{
|
||||
bool res = false;
|
||||
for( uint8 i = 0; i < Alarm_Count; i++ )
|
||||
{
|
||||
if( Value* value = GetValue( _instance, i + AlarmIndex_Count ) ) {
|
||||
value->Release();
|
||||
Msg* msg = new Msg( "AlarmCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( GetVersion() == 2 ? 4 : 5);
|
||||
msg->Append( GetCommandClassId() );
|
||||
msg->Append( AlarmCmd_Get );
|
||||
msg->Append( 0x00); // ? proprietary alarm ?
|
||||
msg->Append( i );
|
||||
if( GetVersion() > 2 )
|
||||
msg->Append(0x01); //get first event of type.
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
res = true;
|
||||
}
|
||||
}
|
||||
Msg* msg = new Msg( "AlarmCmd_Get", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() );
|
||||
msg->SetInstance( this, _instance );
|
||||
msg->Append( GetNodeId() );
|
||||
msg->Append( GetVersion() == 2 ? 4 : 5);
|
||||
msg->Append( GetCommandClassId() );
|
||||
msg->Append( AlarmCmd_Get );
|
||||
msg->Append( 0x00 ); /* we don't get Version 1/2 Alarm Types */
|
||||
msg->Append( 0xFF );
|
||||
if( GetVersion() > 2 )
|
||||
msg->Append(0x00); //get first event of type.
|
||||
msg->Append( GetDriver()->GetTransmitOptions() );
|
||||
GetDriver()->SendMsg( msg, _queue );
|
||||
res = true;
|
||||
return res;
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "AlarmCmd_Get Not Supported on this node");
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -204,42 +202,22 @@ bool Alarm::HandleMsg
|
|||
uint32 const _instance // = 1
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
if (AlarmCmd_Report == (AlarmCmd)_data[0])
|
||||
{
|
||||
// We have received a report from the Z-Wave device
|
||||
if( GetVersion() == 1 )
|
||||
if( GetVersion() == 1)
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received Alarm report: type=%d, level=%d", _data[1], _data[2] );
|
||||
|
||||
ValueByte* value;
|
||||
if( (value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_Type ) )) )
|
||||
if( ValueByte *value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_Type ) ) )
|
||||
{
|
||||
value->OnValueRefreshed( _data[1] );
|
||||
value->Release();
|
||||
}
|
||||
// For device on version 1 the level could have different value. This level value correspond to a list of alarm type.
|
||||
if ( Value* value = GetValue( _instance, AlarmIndex_Level ) )
|
||||
if ( ValueByte* value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_Level ) ) )
|
||||
{
|
||||
switch ( value->GetID().GetType() )
|
||||
{
|
||||
case ValueID::ValueType_Byte:
|
||||
{
|
||||
ValueByte* valueByte = static_cast<ValueByte*>( value );
|
||||
valueByte->OnValueRefreshed( _data[2] );
|
||||
break;
|
||||
}
|
||||
case ValueID::ValueType_List:
|
||||
{
|
||||
ValueList* valueList = static_cast<ValueList*>( value );
|
||||
valueList->OnValueRefreshed( _data[2] );
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Invalid type (%d) for Alarm Level %d", value->GetID().GetType(), _data[2] );
|
||||
}
|
||||
}
|
||||
value->OnValueRefreshed( _data[2] );
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
|
@ -247,153 +225,236 @@ bool Alarm::HandleMsg
|
|||
else if(( GetVersion() > 1 ) && ( _length >= 7 ))
|
||||
{
|
||||
// With Version=2, the data has more detailed information about the alarm
|
||||
if (m_v1Params) {
|
||||
|
||||
string alarm_type = ( _data[5] < Alarm_Count ) ? c_alarmTypeName[_data[5]] : "Unknown type";
|
||||
string alarm_event = ( c_Alarm_Events[_data[5]][_data[6]].empty() != true ) ? c_Alarm_Events[_data[5]][_data[6]] : "Unknown Event";
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received Notification report (v1): type:%d event:%d",
|
||||
_data[1], _data[2] );
|
||||
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received Alarm report: sensorSrcID=%d, type:%s event:%s, status=%s",
|
||||
_data[3], alarm_type.c_str(), alarm_event.c_str(), _data[4] == 0x00 ? "false" : "true" );
|
||||
|
||||
{
|
||||
ValueByte* value;
|
||||
|
||||
if( (value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_SourceNodeId ) )) )
|
||||
if( ValueByte *value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_Type ) ) )
|
||||
{
|
||||
value->OnValueRefreshed( _data[3] );
|
||||
value->OnValueRefreshed( _data[1] );
|
||||
value->Release();
|
||||
}
|
||||
// For device on version 1 the level could have different value. This level value correspond to a list of alarm type.
|
||||
if ( ValueByte* value = static_cast<ValueByte*>( GetValue( _instance, AlarmIndex_Level ) ) )
|
||||
{
|
||||
value->OnValueRefreshed( _data[2] );
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
{
|
||||
ValueList *valuel;
|
||||
/* ok. Its a AlarmCC/NotificationCC Version 2 or above. */
|
||||
bool NotificationStatus = false;
|
||||
if (_data[4] == 0xFF)
|
||||
NotificationStatus = true;
|
||||
|
||||
uint8 NotificationType = _data[5];
|
||||
uint8 NotificationEvent = _data[6];
|
||||
bool NotificationSequencePresent = (_data[7] & 0x80);
|
||||
uint8 EventParamLength = (_data[7] & 0x1F);
|
||||
uint8 NotificationSequence = 0;
|
||||
if (NotificationSequencePresent) {
|
||||
NotificationSequence = _data[7+EventParamLength];
|
||||
}
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received Notification report (>v1): Type: %s (%d) Event: %s (%d) Status: %s, Param Length: %d", NotificationCCTypes::Get()->GetAlarmType(NotificationType).c_str(), NotificationType, NotificationCCTypes::Get()->GetEventForAlarmType(NotificationType, NotificationEvent).c_str(), NotificationEvent, NotificationStatus ? "true" : "false", EventParamLength);
|
||||
if (NotificationSequencePresent)
|
||||
Log::Write ( LogLevel_Info, GetNodeId(), "\t Sequence Number: %d", NotificationSequence);
|
||||
|
||||
/* update the actual value */
|
||||
if ( ValueList *value = static_cast<ValueList *>( GetValue( _instance, NotificationType ) ) )
|
||||
{
|
||||
value->OnValueRefreshed(NotificationEvent);
|
||||
value->Release();
|
||||
} else {
|
||||
Log::Write ( LogLevel_Warning, GetNodeId(), "Couldn't Find a ValueList for Notification Type %d (%d)", NotificationType, _instance);
|
||||
}
|
||||
/* Reset Any of the Params that may have been previously set with another event */
|
||||
for (std::vector<uint32>::iterator it = m_ParamsSet.begin(); it != m_ParamsSet.end(); it++)
|
||||
{
|
||||
switch (*it) {
|
||||
case AlarmIndex_Type_ParamUserCodeid: {
|
||||
if (ValueByte *value = static_cast<ValueByte *>(GetValue(_instance, AlarmIndex_Type_ParamUserCodeid)))
|
||||
{
|
||||
value->OnValueRefreshed(0);
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_ParamUserCodeEntered: {
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamUserCodeEntered)))
|
||||
{
|
||||
value->OnValueRefreshed("");
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_ParamLocation: {
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamLocation)))
|
||||
{
|
||||
value->OnValueRefreshed("");
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_ParamList: {
|
||||
if (ValueList *value = static_cast<ValueList *>(GetValue(_instance, AlarmIndex_Type_ParamList)))
|
||||
{
|
||||
value->OnValueRefreshed(0);
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_ParamByte: {
|
||||
if (ValueByte *value = static_cast<ValueByte *>(GetValue(_instance, AlarmIndex_Type_ParamByte)))
|
||||
{
|
||||
value->OnValueRefreshed(0);
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_ParamString: {
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamString)))
|
||||
{
|
||||
value->OnValueRefreshed("");
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AlarmIndex_Type_Duration: {
|
||||
if (ValueInt *value = static_cast<ValueInt *>(GetValue(_instance, AlarmIndex_Type_Duration)))
|
||||
{
|
||||
value->OnValueRefreshed(0);
|
||||
value->Release();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
if( (valuel = static_cast<ValueList*>( GetValue( _instance, _data[5]+AlarmIndex_Count ) )) )
|
||||
{
|
||||
/* if status is 0, then the alarm is inactive */
|
||||
if (_data[4] == 0x00)
|
||||
valuel->OnValueRefreshed( 0 );
|
||||
else
|
||||
valuel->OnValueRefreshed( _data[6] );
|
||||
valuel->Release();
|
||||
}
|
||||
}
|
||||
/* if the length byte is greater than 1, then there are params */
|
||||
if (_data[7] > 0) {
|
||||
/* first, delete our old Temp ValueID's */
|
||||
for (multimap<uint8, uint8>::iterator it = m_TempValueIDs.begin(); it != m_TempValueIDs.end(); it++) {
|
||||
/* first is index, second is instance*/
|
||||
if (it->second == _instance) {
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->RemoveValue(GetCommandClassId(), _instance, it->first);
|
||||
m_TempValueIDs.erase(it);
|
||||
|
||||
m_ParamsSet.clear();
|
||||
/* do any Event Params that are sent over */
|
||||
if (EventParamLength > 0) {
|
||||
const std::map<uint32, NotificationCCTypes::NotificationEventParams* > nep = NotificationCCTypes::Get()->GetAlarmNotificationEventParams(NotificationType, NotificationEvent);
|
||||
if (nep.size() > 0) {
|
||||
if( Node* node = GetNodeUnsafe() ) {
|
||||
for (std::map<uint32, NotificationCCTypes::NotificationEventParams* >::const_iterator it = nep.begin(); it != nep.end(); it++) {
|
||||
switch (it->second->type) {
|
||||
case NotificationCCTypes::NEPT_Location: {
|
||||
/* _data[8] should be COMMAND_CLASS_NODE_NAMING
|
||||
* _data[9] should be NodeNamingCmd_Report (0x03)
|
||||
*/
|
||||
if ((_data[8] == NodeNaming::StaticGetCommandClassId()) && (_data[9] == 0x03) && EventParamLength > 2) {
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamLocation)))
|
||||
{
|
||||
value->OnValueRefreshed(ExtractString(&_data[10], EventParamLength-2));
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamLocation);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamLocation");
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Location Param didn't have correct Header, or was too small");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_List: {
|
||||
if (EventParamLength == 1) {
|
||||
if (ValueList *value = static_cast<ValueList *>(GetValue(_instance, AlarmIndex_Type_ParamList)))
|
||||
{
|
||||
value->OnValueRefreshed(_data[8]);
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamList);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamList");
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "List Param size was not equal to 1");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_UserCodeReport: {
|
||||
/* _data[8] should be COMMAND_CLASS_USER_CODE
|
||||
* _data[9] should be UserCodeCmd_Report (0x03)
|
||||
* _data[10] is the UserID
|
||||
* _data[11] is the UserID Status (Ignored)
|
||||
* _data[12] onwards is the UserCode Entered (minimum 4 Bytes)
|
||||
*/
|
||||
if ((EventParamLength >= 8 ) && (_data[8] == UserCode::StaticGetCommandClassId()) && (_data[9] == 0x03)) {
|
||||
if (ValueByte *value = static_cast<ValueByte *>(GetValue(_instance, AlarmIndex_Type_ParamUserCodeid)))
|
||||
{
|
||||
value->OnValueRefreshed(_data[11]);
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamUserCodeid);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamUserCodeid");
|
||||
}
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamUserCodeEntered)))
|
||||
{
|
||||
value->OnValueRefreshed(ExtractString(&_data[12], EventParamLength-4));
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamUserCodeEntered);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamUserCodeEntered");
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "UserCode Param didn't have correct Header, or was too small");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_Byte: {
|
||||
if (EventParamLength == 1) {
|
||||
if (ValueByte *value = static_cast<ValueByte *>(GetValue(_instance, AlarmIndex_Type_ParamByte)))
|
||||
{
|
||||
value->OnValueRefreshed(_data[8]);
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamByte);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamByte");
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Byte Param size was not equal to 1");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_String: {
|
||||
if (ValueString *value = static_cast<ValueString *>(GetValue(_instance, AlarmIndex_Type_ParamString)))
|
||||
{
|
||||
value->OnValueRefreshed(ExtractString(&_data[10], EventParamLength-2));
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_ParamString);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_ParamString");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_Time: {
|
||||
/* This is a Duration Entry, we will expose as seconds. Its 3 Bytes from the Event */
|
||||
if (EventParamLength == 3) {
|
||||
uint32 duration = (_data[10] * 3600) + (_data[11] * 60) + (_data[12]);
|
||||
if (ValueInt *value = static_cast<ValueInt *>(GetValue(_instance, AlarmIndex_Type_Duration)))
|
||||
{
|
||||
value->OnValueRefreshed(duration);
|
||||
value->Release();
|
||||
m_ParamsSet.push_back(AlarmIndex_Type_Duration);
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Couldn't Find AlarmIndex_Type_Duration");
|
||||
}
|
||||
} else {
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Duration Param size was not equal to 3");
|
||||
}
|
||||
node->CreateValueInt( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_Duration, it->second->name, "", true, false, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* figure out what type of extra data we have */
|
||||
switch (_data[5]) {
|
||||
/* these alarm types have params */
|
||||
case Alarm_Smoke:
|
||||
switch(_data[6]) {
|
||||
case Alarm_Smoke_Detected_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_CarbonMonoxide:
|
||||
switch(_data[6]) {
|
||||
case Alarm_CO_Detected_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_CarbonDioxide:
|
||||
switch(_data[6]) {
|
||||
case Alarm_CO2_Detected_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_Heat:
|
||||
switch(_data[6]) {
|
||||
case Alarm_Heat_OverHeat_Location:
|
||||
case Alarm_Heat_RapidTempRise_Location:
|
||||
case Alarm_Heat_UnderHeat_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_Flood:
|
||||
switch(_data[6]) {
|
||||
case Alarm_Flood_Leak_Location:
|
||||
case Alarm_Flood_Leak_UnknownLocation:
|
||||
case Alarm_Flood_Drop_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_Access_Control:
|
||||
switch(_data[6]) {
|
||||
case Alarm_Access_Control_Keypad_Lock:
|
||||
case Alarm_Access_Control_Keypad_Unlock:
|
||||
/* create version 1 ValueID's */
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "UserCode", "", true, false, _data[8], 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case Alarm_HomeSecurity:
|
||||
switch(_data[6]) {
|
||||
case Alarm_HomeSecurity_Intrusion_Location:
|
||||
case Alarm_HomeSecurity_GlassBreakage_Location:
|
||||
string location = ExtractString(&_data[8], _data[7]);
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
{
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, (AlarmIndex_Params+m_TempValueIDs.size()), "Location", "", true, false, location, 0 );
|
||||
m_TempValueIDs.insert(std::pair<uint8, uint8>(AlarmIndex_Params+m_TempValueIDs.size(), _instance));
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( AlarmCmd_SupportedReport == (AlarmCmd)_data[0] )
|
||||
{
|
||||
if( Node* node = GetNodeUnsafe() )
|
||||
|
@ -463,19 +524,7 @@ bool Alarm::HandleMsg
|
|||
uint8 numBytes = (_data[2] & 0x1F);
|
||||
vector<ValueList::Item> _items;
|
||||
/* always Add the Clear Event Type */
|
||||
if (const NotificationCCTypes::NotificationEvents *ne = NotificationCCTypes::Get()->GetAlarmNotificationEvents(type, 0)) {
|
||||
ValueList::Item item;
|
||||
item.m_value = ne->id;
|
||||
item.m_label = ne->name;
|
||||
_items.push_back( item );
|
||||
} else {
|
||||
/* it doesn't exist. This is a Config Error in the XML File */
|
||||
Log::Write( LogLevel_Warning, GetNodeId(), "Clear Event is Missing from NotificationCCTypes.xml for Alarm Type %s (%d)",NotificationCCTypes::Get()->GetAlarmType(type).c_str(), type);
|
||||
ValueList::Item item;
|
||||
item.m_value = 0;
|
||||
item.m_label = string("Clear");
|
||||
_items.push_back( item );
|
||||
}
|
||||
SetupEvents(type, 0, &_items, _instance);
|
||||
|
||||
for( uint32 i=0; i<numBytes; ++i )
|
||||
{
|
||||
|
@ -484,19 +533,7 @@ bool Alarm::HandleMsg
|
|||
if( ( _data[i+3] & (1<<bit) ) != 0 )
|
||||
{
|
||||
uint32 index = (int32)(i<<3) + bit;
|
||||
if (const NotificationCCTypes::NotificationEvents *ne = NotificationCCTypes::Get()->GetAlarmNotificationEvents(type, index)) {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "\tEvent Type %d: %s ", ne->id, ne->name.c_str());
|
||||
ValueList::Item item;
|
||||
item.m_value = ne->id;
|
||||
item.m_label = ne->name;
|
||||
_items.push_back( item );
|
||||
} else {
|
||||
Log::Write (LogLevel_Info, GetNodeId(), "\tEvent Type %d: Unknown", index);
|
||||
ValueList::Item item;
|
||||
item.m_value = index;
|
||||
item.m_label = string("Unknown");
|
||||
_items.push_back( item );
|
||||
}
|
||||
SetupEvents(type, index, &_items, _instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -511,3 +548,64 @@ bool Alarm::HandleMsg
|
|||
|
||||
return false;
|
||||
}
|
||||
void Alarm::SetupEvents
|
||||
(
|
||||
uint32 type,
|
||||
uint32 index,
|
||||
vector<ValueList::Item> *_items,
|
||||
uint32 const _instance
|
||||
)
|
||||
{
|
||||
if (const NotificationCCTypes::NotificationEvents *ne = NotificationCCTypes::Get()->GetAlarmNotificationEvents(type, index)) {
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "\tEvent Type %d: %s ", ne->id, ne->name.c_str());
|
||||
ValueList::Item item;
|
||||
item.m_value = ne->id;
|
||||
item.m_label = ne->name;
|
||||
_items->push_back( item );
|
||||
/* If there are Params - Lets create the correct types now */
|
||||
if ( Node* node = GetNodeUnsafe() ) {
|
||||
for (std::map<uint32, NotificationCCTypes::NotificationEventParams* >::const_iterator it = ne->EventParams.begin(); it != ne->EventParams.end(); it++ ) {
|
||||
switch (it->second->type) {
|
||||
case NotificationCCTypes::NEPT_Location: {
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamLocation, it->second->name, "", true, false, "", 0);
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_List: {
|
||||
vector<ValueList::Item> _Paramitems;
|
||||
for (std::map<uint32, string>::iterator it2 = it->second->ListItems.begin(); it2 != it->second->ListItems.end(); it++) {
|
||||
ValueList::Item Paramitem;
|
||||
Paramitem.m_value = ne->id;
|
||||
Paramitem.m_label = ne->name;
|
||||
_Paramitems.push_back( Paramitem );
|
||||
}
|
||||
node->CreateValueList( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamList, it->second->name, "", false, false, _Paramitems.size(), _Paramitems, 0, 0 );
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_UserCodeReport: {
|
||||
node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamUserCodeid, it->second->name, "", true, false, 0, 0);
|
||||
node->CreateValueString(ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamUserCodeEntered, it->second->name, "", true, false, "", 0);
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_Byte: {
|
||||
node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamByte, it->second->name, "", true, false, 0, 0);
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_String: {
|
||||
node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_ParamString, it->second->name, "", true, false, "", 0);
|
||||
break;
|
||||
}
|
||||
case NotificationCCTypes::NEPT_Time: {
|
||||
node->CreateValueInt( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type_Duration, it->second->name, "", true, false, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log::Write (LogLevel_Info, GetNodeId(), "\tEvent Type %d: Unknown", index);
|
||||
ValueList::Item item;
|
||||
item.m_value = index;
|
||||
item.m_label = string("Unknown");
|
||||
_items->push_back( item );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,8 +62,9 @@ namespace OpenZWave
|
|||
|
||||
private:
|
||||
Alarm( uint32 const _homeId, uint8 const _nodeId );
|
||||
|
||||
void SetupEvents(uint32 type, uint32 index, vector<ValueList::Item> *_items, uint32 const _instance);
|
||||
bool m_v1Params;
|
||||
std::vector<uint32> m_ParamsSet;
|
||||
};
|
||||
|
||||
} // namespace OpenZWave
|
||||
|
|
|
@ -702,12 +702,18 @@ void MultiInstance::HandleMultiChannelEncap
|
|||
if( CommandClass* pCommandClass = node->GetCommandClass( commandClassId ) )
|
||||
{
|
||||
uint8 instance = pCommandClass->GetInstance( endPoint );
|
||||
/* we can never have a 0 Instance */
|
||||
if (instance == 0)
|
||||
instance = 1;
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received a MultiChannelEncap from node %d, endpoint %d for Command Class %s", GetNodeId(), endPoint, pCommandClass->GetCommandClassName().c_str() );
|
||||
pCommandClass->HandleMsg( &_data[4], _length-4, instance );
|
||||
}
|
||||
else if (CommandClass* pCommandClass = node->GetCommandClass( commandClassId, true ) )
|
||||
{
|
||||
uint8 instance = pCommandClass->GetInstance( endPoint );
|
||||
/* we can never have a 0 Instance */
|
||||
if (instance == 0)
|
||||
instance = 1;
|
||||
Log::Write( LogLevel_Info, GetNodeId(), "Received a Incoming MultiChannelEncap from node %d, endpoint %d for Command Class %s", GetNodeId(), endPoint, pCommandClass->GetCommandClassName().c_str() );
|
||||
pCommandClass->HandleIncomingMsg( &_data[4], _length-4, instance );
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue