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

Method CheckForRefreshValues

cpp/src/command_classes/CommandClass.cpp:401–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399//-----------------------------------------------------------------------------
400
401bool CommandClass::CheckForRefreshValues (
402 Value const* _value
403)
404{
405 if (m_RefreshClassValues.empty())
406 {
407 //Log::Write(LogLevel_Debug, GetNodeId(), "Bailing out of CheckForRefreshValues");
408 return false;
409 }
410 Node* node = GetNodeUnsafe();
411 if( node != NULL )
412 {
413 for (uint32 i = 0; i < m_RefreshClassValues.size(); i++)
414 {
415 RefreshValue *rcc = m_RefreshClassValues.at(i);
416 //Log::Write(LogLevel_Debug, GetNodeId(), "Checking Value Against RefreshClassList: CommandClass %s = %s, Genre %d = %d, Instance %d = %d, Index %d = %d", CommandClasses::GetName(rcc->cc).c_str(), CommandClasses::GetName(_value->GetID().GetCommandClassId()).c_str(), rcc->genre, _value->GetID().GetGenre(), rcc->instance, _value->GetID().GetInstance(), rcc->index, _value->GetID().GetIndex());
417 if ((rcc->genre == _value->GetID().GetGenre()) && (rcc->instance == _value->GetID().GetInstance()) && (rcc->index == _value->GetID().GetIndex()) )
418 {
419 /* we got a match..... */
420 for (uint32 j = 0; j < rcc->RefreshClasses.size(); j++)
421 {
422 RefreshValue *arcc = rcc->RefreshClasses.at(j);
423 Log::Write(LogLevel_Debug, GetNodeId(), "Requesting Refresh of Value: CommandClass: %s Genre %d, Instance %d, Index %d", CommandClasses::GetName(arcc->cc).c_str(), arcc->genre, arcc->instance, arcc->index);
424 if( CommandClass* cc = node->GetCommandClass( arcc->cc ) )
425 {
426 cc->RequestValue(arcc->genre, arcc->index, arcc->instance, Driver::MsgQueue_Send);
427 }
428 }
429 }
430 }
431 }
432 else /* Driver */
433 {
434 Log::Write(LogLevel_Warning, GetNodeId(), "Can't get Node");
435 }
436 return true;
437}
438
439//-----------------------------------------------------------------------------
440// <CommandClass::WriteXML>

Callers 1

OnValueChangedMethod · 0.80

Calls 8

WriteFunction · 0.85
GetInstanceMethod · 0.80
GetCommandClassMethod · 0.80
GetNodeIdFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
RequestValueMethod · 0.45

Tested by

no test coverage detected