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

Method RefreshValue

cpp/src/Manager.cpp:3248–3278  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Instruct the driver to refresh this value by sending a message to the device -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3246// Instruct the driver to refresh this value by sending a message to the device
3247//-----------------------------------------------------------------------------
3248bool Manager::RefreshValue
3249(
3250 ValueID const& _id
3251)
3252{
3253 bool bRet = false; // return value
3254
3255 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
3256 {
3257 Node *node;
3258
3259 // Need to lock and unlock nodes to check this information
3260 LockGuard LG(driver->m_nodeMutex);
3261
3262 if( (node = driver->GetNode( _id.GetNodeId() ) ) != NULL)
3263 {
3264 CommandClass* cc = node->GetCommandClass( _id.GetCommandClassId() );
3265 if (cc) {
3266 uint16_t index = _id.GetIndex();
3267 uint8 instance = _id.GetInstance();
3268 Log::Write( LogLevel_Info, "mgr, Refreshing node %d: %s index = %d instance = %d (to confirm a reported change)", node->m_nodeId, cc->GetCommandClassName().c_str(), index, instance );
3269 cc->RequestValue( 0, index, instance, Driver::MsgQueue_Send );
3270 bRet = true;
3271 } else {
3272 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to RefreshValue");
3273 bRet = false;
3274 }
3275 }
3276 }
3277 return bRet;
3278}
3279
3280//-----------------------------------------------------------------------------
3281// <Manager::SetChangeVerified>

Callers 1

VerifyRefreshedValueMethod · 0.80

Calls 9

WriteFunction · 0.85
GetNodeMethod · 0.80
GetNodeIdMethod · 0.80
GetCommandClassMethod · 0.80
GetInstanceMethod · 0.80
GetCommandClassIdMethod · 0.45
c_strMethod · 0.45
GetCommandClassNameMethod · 0.45
RequestValueMethod · 0.45

Tested by

no test coverage detected