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

Method HandleMsg

cpp/src/command_classes/DeviceResetLocally.cpp:47–75  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

45// Handle a message from the Z-Wave network
46//-----------------------------------------------------------------------------
47bool DeviceResetLocally::HandleMsg
48(
49 uint8 const* _data,
50 uint32 const _length,
51 uint32 const _instance // = 1
52)
53{
54 if( DeviceResetLocallyCmd_Notification == _data[0] )
55 {
56 // device has been reset
57 Log::Write( LogLevel_Info, GetNodeId(), "Received Device Reset Locally from node %d", GetNodeId() );
58
59 // send a NoOperation message to the node, this will fail since the node is no longer included in the network
60 // we must do this because the Controller will only remove failed nodes
61 if( Node* node = GetNodeUnsafe() )
62 {
63 if( NoOperation* noop = static_cast<NoOperation*>( node->GetCommandClass( NoOperation::StaticGetCommandClassId(), false ) ) )
64 {
65 noop->Set( true );
66 }
67 }
68 // the Controller now knows the node has failed
69 Manager::Get()->HasNodeFailed( GetHomeId(), GetNodeId() );
70 m_deviceReset = true;
71
72 return true;
73 }
74 return false;
75}
76

Callers

nothing calls this directly

Calls 7

WriteFunction · 0.85
GetCommandClassMethod · 0.80
HasNodeFailedMethod · 0.80
GetNodeIdFunction · 0.70
GetHomeIdFunction · 0.70
GetFunction · 0.50
SetMethod · 0.45

Tested by

no test coverage detected