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

Method HandleMultiInstanceEncap

cpp/src/command_classes/MultiInstance.cpp:256–283  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

254// Handle a message from the Z-Wave network
255//-----------------------------------------------------------------------------
256void MultiInstance::HandleMultiInstanceEncap
257(
258 uint8 const* _data,
259 uint32 const _length
260)
261{
262 if( Node* node = GetNodeUnsafe() )
263 {
264 uint8 instance = _data[1];
265 if( GetVersion() > 1 )
266 {
267 instance &= 0x7f;
268 }
269 uint8 commandClassId = _data[2];
270
271 if( CommandClass* pCommandClass = node->GetCommandClass( commandClassId ) )
272 {
273 Log::Write( LogLevel_Info, GetNodeId(), "Received a MultiInstanceEncap from node %d, instance %d, for Command Class %s", GetNodeId(), instance, pCommandClass->GetCommandClassName().c_str() );
274 pCommandClass->ReceivedCntIncr();
275 pCommandClass->HandleMsg( &_data[3], _length-3, instance );
276 }
277 else
278 {
279 Log::Write( LogLevel_Warning, GetNodeId(), "Received invalid MultiInstanceReport from node %d. Attempting to process as MultiChannel", GetNodeId());
280 HandleMultiChannelEncap( _data, _length );
281 }
282 }
283}
284
285//-----------------------------------------------------------------------------
286// <MultiInstance::HandleMultiChannelEndPointReport>

Callers

nothing calls this directly

Calls 7

GetVersionFunction · 0.85
WriteFunction · 0.85
GetCommandClassMethod · 0.80
GetNodeIdFunction · 0.70
c_strMethod · 0.45
GetCommandClassNameMethod · 0.45
HandleMsgMethod · 0.45

Tested by

no test coverage detected