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

Method TestNetwork

cpp/src/Driver.cpp:5925–5958  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Run a series of messages to a single node or every node on the network. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

5923// Run a series of messages to a single node or every node on the network.
5924//-----------------------------------------------------------------------------
5925void Driver::TestNetwork
5926(
5927 uint8 const _nodeId,
5928 uint32 const _count
5929)
5930{
5931 LockGuard LG(m_nodeMutex);
5932 if( _nodeId == 0 ) // send _count messages to every node
5933 {
5934 for( int i=0; i<256; ++i )
5935 {
5936 if( i == m_Controller_nodeId ) // ignore sending to ourself
5937 {
5938 continue;
5939 }
5940 if( m_nodes[i] != NULL )
5941 {
5942 NoOperation *noop = static_cast<NoOperation*>( m_nodes[i]->GetCommandClass( NoOperation::StaticGetCommandClassId() ) );
5943 for( int j=0; j < (int)_count; j++ )
5944 {
5945 noop->Set( true );
5946 }
5947 }
5948 }
5949 }
5950 else if( _nodeId != m_Controller_nodeId && m_nodes[_nodeId] != NULL )
5951 {
5952 NoOperation *noop = static_cast<NoOperation*>( m_nodes[_nodeId]->GetCommandClass( NoOperation::StaticGetCommandClassId() ) );
5953 for( int i=0; i < (int)_count; i++ )
5954 {
5955 noop->Set( true );
5956 }
5957 }
5958}
5959
5960//-----------------------------------------------------------------------------
5961// SwitchAll

Callers

nothing calls this directly

Calls 2

GetCommandClassMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected