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

Method GetNodeClassInformation

cpp/src/Manager.cpp:1544–1583  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Helper method to return whether a particular class is available in a node -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1542// Helper method to return whether a particular class is available in a node
1543//-----------------------------------------------------------------------------
1544bool Manager::GetNodeClassInformation
1545(
1546 uint32 const _homeId,
1547 uint8 const _nodeId,
1548 uint8 const _commandClassId,
1549 string *_className,
1550 uint8 *_classVersion
1551)
1552{
1553 bool result = false;
1554
1555 if( Driver* driver = GetDriver( _homeId ) )
1556 {
1557 Node *node;
1558
1559 // Need to lock and unlock nodes to check this information
1560 LockGuard LG(driver->m_nodeMutex);
1561
1562 if( ( node = driver->GetNode( _nodeId ) ) != NULL )
1563 {
1564 CommandClass *cc;
1565 if( node->NodeInfoReceived() && ( ( cc = node->GetCommandClass( _commandClassId ) ) != NULL ) )
1566 {
1567 if( _className )
1568 {
1569 *_className = cc->GetCommandClassName();
1570 }
1571 if( _classVersion )
1572 {
1573 *_classVersion = cc->GetVersion();
1574 }
1575 // Positive result
1576 result = true;
1577 }
1578 }
1579
1580 }
1581
1582 return result;
1583}
1584
1585//-----------------------------------------------------------------------------
1586// <Manager::IsNodeAwake>

Callers

nothing calls this directly

Calls 5

GetNodeMethod · 0.80
NodeInfoReceivedMethod · 0.80
GetCommandClassMethod · 0.80
GetCommandClassNameMethod · 0.45
GetVersionMethod · 0.45

Tested by

no test coverage detected