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

Method HandleSendSlaveNodeInfoRequest

cpp/src/Driver.cpp:6751–6781  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

6749// Process a request from the Z-Wave PC interface
6750//-----------------------------------------------------------------------------
6751void Driver::HandleSendSlaveNodeInfoRequest
6752(
6753 uint8* _data
6754)
6755{
6756 if( m_currentControllerCommand == NULL )
6757 {
6758 return;
6759 }
6760 if( _data[3] == TRANSMIT_COMPLETE_OK ) // finish up
6761 {
6762 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), "SEND_SLAVE_NODE_INFO_COMPLETE OK" );
6763 SaveButtons();
6764 Notification* notification = new Notification( Notification::Type_CreateButton );
6765 notification->SetHomeAndNodeIds( m_homeId, m_currentControllerCommand->m_controllerCommandNode );
6766 notification->SetButtonId( m_currentControllerCommand->m_controllerCommandArg );
6767 QueueNotification( notification );
6768
6769 UpdateControllerState( ControllerState_Completed );
6770 RequestVirtualNeighbors( MsgQueue_Send );
6771 }
6772 else // error. try again
6773 {
6774 HandleErrorResponse( _data[3], m_currentControllerCommand->m_controllerCommandNode, "SLAVE_NODE_INFO_COMPLETE" );
6775 Node* node = GetNodeUnsafe( m_currentControllerCommand->m_controllerCommandNode );
6776 if( node != NULL)
6777 {
6778 SendVirtualNodeInfo( node->m_buttonMap[m_currentControllerCommand->m_controllerCommandArg], m_currentControllerCommand->m_controllerCommandNode );
6779 }
6780 }
6781}
6782
6783//-----------------------------------------------------------------------------
6784// <Driver::HandleApplicationSlaveCommandRequest>

Callers

nothing calls this directly

Calls 1

WriteFunction · 0.85

Tested by

no test coverage detected