----------------------------------------------------------------------------- Instruct the driver to refresh this value by sending a message to the device -----------------------------------------------------------------------------
| 3246 | // Instruct the driver to refresh this value by sending a message to the device |
| 3247 | //----------------------------------------------------------------------------- |
| 3248 | bool 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> |
no test coverage detected