----------------------------------------------------------------------------- Helper method to return whether a node is awake or sleeping -----------------------------------------------------------------------------
| 1587 | // Helper method to return whether a node is awake or sleeping |
| 1588 | //----------------------------------------------------------------------------- |
| 1589 | bool Manager::IsNodeAwake |
| 1590 | ( |
| 1591 | uint32 const _homeId, |
| 1592 | uint8 const _nodeId |
| 1593 | ) |
| 1594 | { |
| 1595 | if( IsNodeListeningDevice( _homeId, _nodeId ) ) |
| 1596 | { |
| 1597 | return true; // if listening then always awake |
| 1598 | } |
| 1599 | bool result = true; |
| 1600 | if( Driver* driver = GetDriver( _homeId ) ) |
| 1601 | { |
| 1602 | // Need to lock and unlock nodes to check this information |
| 1603 | LockGuard LG(driver->m_nodeMutex); |
| 1604 | |
| 1605 | if( Node* node = driver->GetNode( _nodeId ) ) |
| 1606 | { |
| 1607 | if( WakeUp* wcc = static_cast<WakeUp*>( node->GetCommandClass( WakeUp::StaticGetCommandClassId() ) ) ) |
| 1608 | { |
| 1609 | result = wcc->IsAwake(); |
| 1610 | } |
| 1611 | } |
| 1612 | } |
| 1613 | return result; |
| 1614 | } |
| 1615 | |
| 1616 | //----------------------------------------------------------------------------- |
| 1617 | // <Manager::IsNodeFailed> |
nothing calls this directly
no test coverage detected