MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / HandleMsg

Method HandleMsg

cpp/src/command_classes/ThermostatFanState.cpp:119–142  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

117// Handle a message from the Z-Wave network
118//-----------------------------------------------------------------------------
119bool ThermostatFanState::HandleMsg
120(
121 uint8 const* _data,
122 uint32 const _length,
123 uint32 const _instance // = 1
124)
125{
126 if( ThermostatFanStateCmd_Report == (ThermostatFanStateCmd)_data[0] )
127 {
128 // We have received the thermostat fan state from the Z-Wave device
129 if( ValueString* valueString = static_cast<ValueString*>( GetValue( _instance, 0 ) ) )
130 {
131 /* No need bounds checking as the state can only be a single byte - No larger than our Char array anyway */
132 uint8 state = (_data[1]&0x0f);
133
134 valueString->OnValueRefreshed( c_stateName[state] );
135 valueString->Release();
136 Log::Write( LogLevel_Info, GetNodeId(), "Received thermostat fan state: %s", valueString->GetValue().c_str() );
137 }
138 return true;
139 }
140
141 return false;
142}
143
144//-----------------------------------------------------------------------------
145// <ThermostatFanState::CreateVars>

Callers

nothing calls this directly

Calls 6

WriteFunction · 0.85
GetNodeIdFunction · 0.70
OnValueRefreshedMethod · 0.45
ReleaseMethod · 0.45
c_strMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected