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

Method HandleReplaceFailedNodeRequest

cpp/src/Driver.cpp:3684–3726  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3682// Process a request from the Z-Wave PC interface
3683//-----------------------------------------------------------------------------
3684void Driver::HandleReplaceFailedNodeRequest
3685(
3686 uint8* _data
3687)
3688{
3689 ControllerState state = ControllerState_Completed;
3690 uint8 nodeId = GetNodeNumber( m_currentMsg );
3691 switch( _data[3] )
3692 {
3693 case FAILED_NODE_OK:
3694 {
3695 Log::Write( LogLevel_Info, nodeId, "Received reply to FUNC_ID_ZW_REPLACE_FAILED_NODE - Node is OK, so command failed" );
3696 state = ControllerState_NodeOK;
3697 break;
3698 }
3699 case FAILED_NODE_REPLACE_WAITING:
3700 {
3701 Log::Write( LogLevel_Info, nodeId, "Received reply to FUNC_ID_ZW_REPLACE_FAILED_NODE - Waiting for new node" );
3702 state = ControllerState_Waiting;
3703 break;
3704 }
3705 case FAILED_NODE_REPLACE_DONE:
3706 {
3707 Log::Write( LogLevel_Info, nodeId, "Received reply to FUNC_ID_ZW_REPLACE_FAILED_NODE - Node successfully replaced" );
3708 state = ControllerState_Completed;
3709
3710 // Request new node info for this device
3711 if( m_currentControllerCommand != NULL )
3712 {
3713 InitNode( m_currentControllerCommand->m_controllerCommandNode, true );
3714 }
3715 break;
3716 }
3717 case FAILED_NODE_REPLACE_FAILED:
3718 {
3719 Log::Write( LogLevel_Info, nodeId, "Received reply to FUNC_ID_ZW_REPLACE_FAILED_NODE - Node replacement failed" );
3720 state = ControllerState_Failed;
3721 break;
3722 }
3723 }
3724
3725 UpdateControllerState( state );
3726}
3727
3728//-----------------------------------------------------------------------------
3729// <Driver::HandleApplicationCommandHandlerRequest>

Callers

nothing calls this directly

Calls 1

WriteFunction · 0.85

Tested by

no test coverage detected