----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------
| 115 | // Handle a message from the Z-Wave network |
| 116 | //----------------------------------------------------------------------------- |
| 117 | bool ThermostatOperatingState::HandleMsg |
| 118 | ( |
| 119 | uint8 const* _data, |
| 120 | uint32 const _length, |
| 121 | uint32 const _instance // = 1 |
| 122 | ) |
| 123 | { |
| 124 | if( ThermostatOperatingStateCmd_Report == (ThermostatOperatingStateCmd)_data[0] ) |
| 125 | { |
| 126 | // We have received the thermostat operating state from the Z-Wave device |
| 127 | if( ValueString* valueString = static_cast<ValueString*>( GetValue( _instance, 0 ) ) ) |
| 128 | { |
| 129 | /* no need bounds checking on c_stateName here, as it can only be 1 Byte anyway */ |
| 130 | valueString->OnValueRefreshed( c_stateName[_data[1]&0x0f] ); |
| 131 | valueString->Release(); |
| 132 | Log::Write( LogLevel_Info, GetNodeId(), "Received thermostat operating state: %s", valueString->GetValue().c_str() ); |
| 133 | } |
| 134 | return true; |
| 135 | } |
| 136 | |
| 137 | return false; |
| 138 | } |
| 139 | |
| 140 | //----------------------------------------------------------------------------- |
| 141 | // <ThermostatOperatingState::CreateVars> |