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

Method HandleGetRoutingInfoResponse

cpp/src/Driver.cpp:3169–3200  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3167// Process a response from the Z-Wave PC interface
3168//-----------------------------------------------------------------------------
3169void Driver::HandleGetRoutingInfoResponse
3170(
3171 uint8* _data
3172)
3173{
3174 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), "Received reply to FUNC_ID_ZW_GET_ROUTING_INFO" );
3175
3176 LockGuard LG(m_nodeMutex);
3177 if( Node* node = GetNode( GetNodeNumber( m_currentMsg ) ) )
3178 {
3179 // copy the 29-byte bitmap received (29*8=232 possible nodes) into this node's neighbors member variable
3180 memcpy( node->m_neighbors, &_data[2], 29 );
3181 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), " Neighbors of this node are:" );
3182 bool bNeighbors = false;
3183 for( int by=0; by<29; by++ )
3184 {
3185 for( int bi=0; bi<8; bi++ )
3186 {
3187 if( (_data[2+by] & (0x01<<bi)) )
3188 {
3189 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), " Node %d", (by<<3)+bi+1 );
3190 bNeighbors = true;
3191 }
3192 }
3193 }
3194
3195 if( !bNeighbors )
3196 {
3197 Log::Write( LogLevel_Info, GetNodeNumber( m_currentMsg ), " (none reported)" );
3198 }
3199 }
3200}
3201
3202//-----------------------------------------------------------------------------
3203// <Driver::HandleSendDataRequest>

Callers

nothing calls this directly

Calls 1

WriteFunction · 0.85

Tested by

no test coverage detected