----------------------------------------------------------------------------- Request current state from the device -----------------------------------------------------------------------------
| 99 | // Request current state from the device |
| 100 | //----------------------------------------------------------------------------- |
| 101 | bool Alarm::RequestState |
| 102 | ( |
| 103 | uint32 const _requestFlags, |
| 104 | uint8 const _instance, |
| 105 | Driver::MsgQueue const _queue |
| 106 | ) |
| 107 | { |
| 108 | if( ( _requestFlags & RequestFlag_Static ) && HasStaticRequest( StaticRequest_Values ) ) |
| 109 | { |
| 110 | if( GetVersion() > 1 ) |
| 111 | { |
| 112 | // Request the supported alarm types |
| 113 | Msg* msg = new Msg( "AlarmCmd_SupportedGet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true, true, FUNC_ID_APPLICATION_COMMAND_HANDLER, GetCommandClassId() ); |
| 114 | msg->SetInstance( this, _instance ); |
| 115 | msg->Append( GetNodeId() ); |
| 116 | msg->Append( 2 ); |
| 117 | msg->Append( GetCommandClassId() ); |
| 118 | msg->Append( AlarmCmd_SupportedGet ); |
| 119 | msg->Append( GetDriver()->GetTransmitOptions() ); |
| 120 | GetDriver()->SendMsg( msg, _queue ); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | /* create version 1 ValueID's */ |
| 125 | if( Node* node = GetNodeUnsafe() ) |
| 126 | { |
| 127 | m_v1Params = true; |
| 128 | node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Type, "Alarm Type", "", true, false, 0, 0 ); |
| 129 | node->CreateValueByte( ValueID::ValueGenre_User, GetCommandClassId(), _instance, AlarmIndex_Level, "Alarm Level", "", true, false, 0, 0 ); |
| 130 | } |
| 131 | } |
| 132 | if (GetVersion() < 4) { |
| 133 | if ( Node* node = GetNodeUnsafe() ) { |
| 134 | node->CreateValueInt( ValueID::ValueGenre_Config, GetCommandClassId(), _instance, AlarmIndex_AutoClearEvents, "Automatically Clear Events", "ms", false, false, m_ClearTimeout, 0); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | } |
| 139 | |
| 140 | if( _requestFlags & RequestFlag_Dynamic ) |
| 141 | { |
| 142 | return RequestValue( _requestFlags, 0, _instance, _queue ); |
| 143 | } |
| 144 | |
| 145 | return false; |
| 146 | } |
| 147 | |
| 148 | bool Alarm::SetValue |
| 149 | ( |
nothing calls this directly
no test coverage detected