----------------------------------------------------------------------------- Process a response from the Z-Wave PC interface -----------------------------------------------------------------------------
| 3072 | // Process a response from the Z-Wave PC interface |
| 3073 | //----------------------------------------------------------------------------- |
| 3074 | void Driver::HandleIsFailedNodeResponse |
| 3075 | ( |
| 3076 | uint8* _data |
| 3077 | ) |
| 3078 | { |
| 3079 | ControllerState state; |
| 3080 | uint8 nodeId = m_currentControllerCommand ? m_currentControllerCommand->m_controllerCommandNode : GetNodeNumber( m_currentMsg ); |
| 3081 | if( _data[2] ) |
| 3082 | { |
| 3083 | Log::Write( LogLevel_Warning, nodeId, "WARNING: Received reply to FUNC_ID_ZW_IS_FAILED_NODE_ID - node %d failed", nodeId ); |
| 3084 | state = ControllerState_NodeFailed; |
| 3085 | if( Node* node = GetNodeUnsafe( nodeId ) ) |
| 3086 | { |
| 3087 | if (node->IsNodeReset()) { |
| 3088 | /* a DeviceReset has Occured. Remove the Node */ |
| 3089 | if (!BeginControllerCommand(Driver::ControllerCommand_RemoveFailedNode, NULL, NULL, true, nodeId, 0)) |
| 3090 | Log::Write(LogLevel_Warning, nodeId, "RemoveFailedNode for DeviceResetLocally Command Failed"); |
| 3091 | |
| 3092 | Notification* notification = new Notification( Notification::Type_NodeReset ); |
| 3093 | notification->SetHomeAndNodeIds( m_homeId, nodeId ); |
| 3094 | QueueNotification( notification ); |
| 3095 | state = ControllerState_Completed; |
| 3096 | } else { |
| 3097 | node->SetNodeAlive( false ); |
| 3098 | } |
| 3099 | } |
| 3100 | } |
| 3101 | else |
| 3102 | { |
| 3103 | Log::Write( LogLevel_Warning, nodeId, "Received reply to FUNC_ID_ZW_IS_FAILED_NODE_ID - node %d has not failed", nodeId ); |
| 3104 | if( Node* node = GetNodeUnsafe( nodeId ) ) |
| 3105 | { |
| 3106 | node->SetNodeAlive( true ); |
| 3107 | } |
| 3108 | state = ControllerState_NodeOK; |
| 3109 | } |
| 3110 | UpdateControllerState( state ); |
| 3111 | } |
| 3112 | |
| 3113 | //----------------------------------------------------------------------------- |
| 3114 | // <Driver::HandleReplaceFailedNodeResponse> |
nothing calls this directly
no test coverage detected