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

Method HandleMsg

cpp/src/command_classes/SwitchToggleBinary.cpp:99–119  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

97// Handle a message from the Z-Wave network
98//-----------------------------------------------------------------------------
99bool SwitchToggleBinary::HandleMsg
100(
101 uint8 const* _data,
102 uint32 const _length,
103 uint32 const _instance // = 1
104)
105{
106 if( SwitchToggleBinaryCmd_Report == (SwitchToggleBinaryCmd)_data[0] )
107 {
108 Log::Write( LogLevel_Info, GetNodeId(), "Received SwitchToggleBinary report: %s", _data[1] ? "On" : "Off" );
109
110 if( ValueBool* value = static_cast<ValueBool*>( GetValue( _instance, 0 ) ) )
111 {
112 value->OnValueRefreshed( _data[1] != 0 );
113 value->Release();
114 }
115 return true;
116 }
117
118 return false;
119}
120
121//-----------------------------------------------------------------------------
122// <SwitchToggleBinary::SetValue>

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected