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

Method AutoAssociate

cpp/src/Node.cpp:3103–3125  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Automatically associate the controller with certain groups -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3101// Automatically associate the controller with certain groups
3102//-----------------------------------------------------------------------------
3103void Node::AutoAssociate
3104(
3105)
3106{
3107 bool autoAssociate = false;
3108 Options::Get()->GetOptionAsBool( "Associate", &autoAssociate );
3109 if( autoAssociate )
3110 {
3111 // Try to automatically associate with any groups that have been flagged.
3112 uint8 controllerNodeId = GetDriver()->GetControllerNodeId();
3113
3114 for( map<uint8,Group*>::iterator it = m_groups.begin(); it != m_groups.end(); ++it )
3115 {
3116 Group* group = it->second;
3117 if( group->IsAuto() && !group->Contains( controllerNodeId ) )
3118 {
3119 // Associate the controller into the group
3120 Log::Write( LogLevel_Info, m_nodeId, "Adding the controller to group %d (%s) of node %d", group->GetIdx(), group->GetLabel().c_str(), GetNodeId() );
3121 group->AddAssociation( controllerNodeId );
3122 }
3123 }
3124 }
3125}
3126
3127//-----------------------------------------------------------------------------
3128// <Node::GetDriver>

Callers 2

HandleMsgMethod · 0.80
HandleMsgMethod · 0.80

Calls 13

WriteFunction · 0.85
GetOptionAsBoolMethod · 0.80
GetControllerNodeIdMethod · 0.80
IsAutoMethod · 0.80
ContainsMethod · 0.80
GetFunction · 0.70
GetNodeIdFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
GetIdxMethod · 0.45
c_strMethod · 0.45
GetLabelMethod · 0.45

Tested by

no test coverage detected