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

Method HandleRemoveFailedNodeRequest

cpp/src/Driver.cpp:3639–3678  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Process a request from the Z-Wave PC interface -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3637// Process a request from the Z-Wave PC interface
3638//-----------------------------------------------------------------------------
3639void Driver::HandleRemoveFailedNodeRequest
3640(
3641 uint8* _data
3642)
3643{
3644 ControllerState state = ControllerState_Completed;
3645 uint8 nodeId = GetNodeNumber( m_currentMsg );
3646 switch( _data[3] )
3647 {
3648 case FAILED_NODE_OK:
3649 {
3650 Log::Write( LogLevel_Warning, nodeId, "WARNING: Received reply to FUNC_ID_ZW_REMOVE_FAILED_NODE_ID - Node %d is OK, so command failed", m_currentControllerCommand->m_controllerCommandNode );
3651 state = ControllerState_NodeOK;
3652 break;
3653 }
3654 case FAILED_NODE_REMOVED:
3655 {
3656 Log::Write( LogLevel_Info, nodeId, "Received reply to FUNC_ID_ZW_REMOVE_FAILED_NODE_ID - node %d successfully moved to failed nodes list", m_currentControllerCommand->m_controllerCommandNode );
3657 state = ControllerState_Completed;
3658 {
3659 LockGuard LG(m_nodeMutex);
3660 delete m_nodes[m_currentControllerCommand->m_controllerCommandNode];
3661 m_nodes[m_currentControllerCommand->m_controllerCommandNode] = NULL;
3662 }
3663 Notification* notification = new Notification( Notification::Type_NodeRemoved );
3664 notification->SetHomeAndNodeIds( m_homeId, m_currentControllerCommand->m_controllerCommandNode );
3665 QueueNotification( notification );
3666
3667 break;
3668 }
3669 case FAILED_NODE_NOT_REMOVED:
3670 {
3671 Log::Write( LogLevel_Warning, nodeId, "WARNING: Received reply to FUNC_ID_ZW_REMOVE_FAILED_NODE_ID - unable to move node %d to failed nodes list", m_currentControllerCommand->m_controllerCommandNode );
3672 state = ControllerState_Failed;
3673 break;
3674 }
3675 }
3676
3677 UpdateControllerState( state );
3678}
3679
3680//-----------------------------------------------------------------------------
3681// <Driver::HandleReplaceFailedNodeRequest>

Callers

nothing calls this directly

Calls 1

WriteFunction · 0.85

Tested by

no test coverage detected