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

Method HandleMsg

cpp/src/command_classes/ThermostatOperatingState.cpp:117–138  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

115// Handle a message from the Z-Wave network
116//-----------------------------------------------------------------------------
117bool 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>

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