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

Method GetValueUnits

cpp/src/Manager.cpp:1812–1831  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Gets the units that the value is measured in -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1810// Gets the units that the value is measured in
1811//-----------------------------------------------------------------------------
1812string Manager::GetValueUnits
1813(
1814 ValueID const& _id
1815)
1816{
1817 string units;
1818 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
1819 {
1820 LockGuard LG(driver->m_nodeMutex);
1821 if( Value* value = driver->GetValue( _id ) )
1822 {
1823 units = value->GetUnits();
1824 value->Release();
1825 } else {
1826 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetValueUnits");
1827 }
1828 }
1829
1830 return units;
1831}
1832
1833//-----------------------------------------------------------------------------
1834// <Manager::SetValueUnits>

Callers 1

mainFunction · 0.80

Calls 2

GetValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected