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

Method SetDriverReady

cpp/src/Manager.cpp:430–468  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Move a driver from pending to ready, and notify any watchers -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

428// Move a driver from pending to ready, and notify any watchers
429//-----------------------------------------------------------------------------
430void Manager::SetDriverReady
431(
432 Driver* _driver,
433 bool success
434)
435{
436 // Search the pending list
437 bool found = false;
438 for( list<Driver*>::iterator it = m_pendingDrivers.begin(); it != m_pendingDrivers.end(); ++it )
439 {
440 if( (*it) == _driver )
441 {
442 // Remove the driver from the pending list
443 m_pendingDrivers.erase( it );
444 found = true;
445 break;
446 }
447 }
448
449 if( found )
450 {
451 if (success) {
452 Log::Write( LogLevel_Info, "mgr, Driver with Home ID of 0x%.8x is now ready.", _driver->GetHomeId() );
453 Log::Write( LogLevel_Info, "" );
454
455 // Add the driver to the ready map
456 m_readyDrivers[_driver->GetHomeId()] = _driver;
457
458 }
459
460
461 // Notify the watchers
462 Notification* notification = new Notification(success ? Notification::Type_DriverReady : Notification::Type_DriverFailed );
463 notification->SetHomeAndNodeIds( _driver->GetHomeId(), _driver->GetControllerNodeId() );
464 if (!success)
465 notification->SetComPort(_driver->GetControllerPath());
466 _driver->QueueNotification( notification );
467 }
468}
469
470//-----------------------------------------------------------------------------
471// <Manager::GetControllerNodeId>

Callers 1

Calls 6

WriteFunction · 0.85
GetControllerNodeIdMethod · 0.80
GetControllerPathMethod · 0.80
QueueNotificationMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected