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

Method CreateCommandClass

cpp/src/command_classes/CommandClasses.cpp:174–192  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Create a command class object using the registered method -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

172// Create a command class object using the registered method
173//-----------------------------------------------------------------------------
174CommandClass* CommandClasses::CreateCommandClass
175(
176 uint8 const _commandClassId,
177 uint32 const _homeId,
178 uint8 const _nodeId
179)
180{
181 // Get a pointer to the required CommandClass's Create method
182 pfnCreateCommandClass_t creator = Get().m_commandClassCreators[_commandClassId];
183 if( NULL == creator )
184 {
185 return NULL;
186 }
187
188 // Create an instance of the command class
189 CommandClass *cc = creator( _homeId, _nodeId);
190 Localization::Get()->SetupCommandClass(cc);
191 return cc;
192}
193
194//-----------------------------------------------------------------------------
195// <CommandClasses::RegisterCommandClasses>

Callers

nothing calls this directly

Calls 2

SetupCommandClassMethod · 0.80
GetFunction · 0.50

Tested by

no test coverage detected