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

Method GetBitSetSize

cpp/src/Manager.cpp:3463–3493  ·  view source on GitHub ↗

----------------------------------------------------------------------------- <Manager::GetBitSetSize Gets the size of a BitMask (1, 2 or 4) -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3461// Gets the size of a BitMask (1, 2 or 4)
3462//-----------------------------------------------------------------------------
3463bool Manager::GetBitSetSize
3464(
3465 ValueID const& _id,
3466 uint8* o_size
3467)
3468{
3469 bool res = false;
3470
3471 if( o_size )
3472 {
3473 if( ValueID::ValueType_BitSet == _id.GetType() )
3474 {
3475 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
3476 {
3477 LockGuard LG(driver->m_nodeMutex);
3478 if( ValueBitSet* value = static_cast<ValueBitSet*>( driver->GetValue( _id ) ) )
3479 {
3480 *o_size = value->GetSize();
3481 value->Release();
3482 res = true;
3483 } else {
3484 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetBitSetSize");
3485 }
3486 }
3487 } else {
3488 OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to GetBitSetSize is not a BitSet Value");
3489 }
3490 }
3491
3492 return res;
3493}
3494
3495
3496

Callers

nothing calls this directly

Calls 3

GetValueMethod · 0.45
GetSizeMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected