----------------------------------------------------------------------------- Handle a message from the Z-Wave network -----------------------------------------------------------------------------
| 45 | // Handle a message from the Z-Wave network |
| 46 | //----------------------------------------------------------------------------- |
| 47 | bool 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 |
nothing calls this directly
no test coverage detected