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

Method OnValueChanged

cpp/src/value_classes/Value.cpp:434–469  ·  view source on GitHub ↗

----------------------------------------------------------------------------- A value in a device has changed -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

432// A value in a device has changed
433//-----------------------------------------------------------------------------
434void Value::OnValueChanged
435(
436)
437{
438 if( IsWriteOnly() )
439 {
440 return;
441 }
442
443 if( Driver* driver = Manager::Get()->GetDriver( m_id.GetHomeId() ) )
444 {
445 m_isSet = true;
446
447 // Notify the watchers
448 Notification* notification = new Notification( Notification::Type_ValueChanged );
449 notification->SetValueId( m_id );
450 driver->QueueNotification( notification );
451 }
452 /* Call Back to the Command Class that this Value has changed, so we can search the
453 * TriggerRefreshValue vector to see if we should request any other values to be
454 * refreshed.
455 */
456 Node* node = NULL;
457 if( Driver* driver = Manager::Get()->GetDriver( m_id.GetHomeId() ) )
458 {
459 node = driver->GetNodeUnsafe( m_id.GetNodeId() );
460 if( node != NULL )
461 {
462 if( CommandClass* cc = node->GetCommandClass( m_id.GetCommandClassId() ) )
463 {
464 cc->CheckForRefreshValues(this);
465 }
466 }
467 }
468
469}
470
471//-----------------------------------------------------------------------------
472// <Value::GetGenreEnumFromName>

Callers

nothing calls this directly

Calls 8

QueueNotificationMethod · 0.80
GetNodeIdMethod · 0.80
GetCommandClassMethod · 0.80
CheckForRefreshValuesMethod · 0.80
GetFunction · 0.50
GetDriverMethod · 0.45
GetNodeUnsafeMethod · 0.45
GetCommandClassIdMethod · 0.45

Tested by

no test coverage detected