----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------
| 107 | // Handle a message from the Z-Wave network |
| 108 | //----------------------------------------------------------------------------- |
| 109 | bool Protection::HandleMsg |
| 110 | ( |
| 111 | uint8 const* _data, |
| 112 | uint32 const _length, |
| 113 | uint32 const _instance // = 1 |
| 114 | ) |
| 115 | { |
| 116 | if (ProtectionCmd_Report == (ProtectionCmd)_data[0]) |
| 117 | { |
| 118 | int8 stateValue = _data[1]; |
| 119 | if (stateValue > 2) /* size of c_protectionStateNames minus Invalid */ |
| 120 | { |
| 121 | Log::Write (LogLevel_Warning, GetNodeId(), "State Value was greater than range. Setting to Invalid"); |
| 122 | stateValue = 3; |
| 123 | } |
| 124 | Log::Write( LogLevel_Info, GetNodeId(), "Received a Protection report: %s", c_protectionStateNames[_data[1]] ); |
| 125 | if( ValueList* value = static_cast<ValueList*>( GetValue( _instance, 0 ) ) ) |
| 126 | { |
| 127 | value->OnValueRefreshed( (int)_data[1] ); |
| 128 | value->Release(); |
| 129 | } |
| 130 | |
| 131 | return true; |
| 132 | } |
| 133 | |
| 134 | return false; |
| 135 | } |
| 136 | |
| 137 | //----------------------------------------------------------------------------- |
| 138 | // <Protection::SetValue> |
nothing calls this directly
no test coverage detected