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

Method CheckAuto

cpp/src/Group.cpp:159–188  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Check if we should AutoAssociate for this group -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

157// Check if we should AutoAssociate for this group
158//-----------------------------------------------------------------------------
159void Group::CheckAuto
160(
161
162)
163{
164 // Auto-association by default is with group 1 or 255, with group 1 taking precedence.
165 // Group 255 is always created first, so if this is group 1, we need to turn off the
166 // auto flag in group 255. All this messing about is to support the various behaviours
167 // of certain Cooper devices.
168 if( m_groupIdx == 255 )
169 {
170 m_auto = true;
171 }
172 else if( m_groupIdx == 1 )
173 {
174 m_auto = true;
175
176 // Clear the flag from Group 255, if it exists.
177 if( Driver* driver = Manager::Get()->GetDriver( m_homeId ) )
178 {
179 if( Node* node = driver->GetNodeUnsafe( m_nodeId ) )
180 {
181 if( Group* group = node->GetGroup( 255 ) )
182 {
183 group->SetAuto( false );
184 }
185 }
186 }
187 }
188}
189
190
191

Callers

nothing calls this directly

Calls 5

GetGroupMethod · 0.80
SetAutoMethod · 0.80
GetFunction · 0.70
GetDriverMethod · 0.45
GetNodeUnsafeMethod · 0.45

Tested by

no test coverage detected