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

Method GetValueHelp

cpp/src/Manager.cpp:1860–1890  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Gets a help string describing the value's purpose and usage -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1858// Gets a help string describing the value's purpose and usage
1859//-----------------------------------------------------------------------------
1860string Manager::GetValueHelp
1861(
1862 ValueID const& _id,
1863 int32 _pos
1864)
1865{
1866 string help;
1867 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
1868 {
1869 LockGuard LG(driver->m_nodeMutex);
1870 if (_pos != -1) {
1871 if (_id.GetType() != ValueID::ValueType_BitSet) {
1872 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "ValueID passed to GetValueHelp is not a BitSet but a position was requested");
1873 return help;
1874 }
1875 ValueBitSet *value = static_cast<ValueBitSet *>(driver->GetValue( _id ));
1876 help = value->GetBitHelp(_pos);
1877 value->Release();
1878 return help;
1879 } else {
1880 if( Value* value = driver->GetValue( _id ) )
1881 {
1882 help = value->GetHelp();
1883 value->Release();
1884 return help;
1885 }
1886 }
1887 }
1888 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetValueHelp");
1889 return help;
1890}
1891
1892//-----------------------------------------------------------------------------
1893// <Manager::SetValueHelp>

Callers 2

GetHelpMethod · 0.45
mainFunction · 0.45

Calls 4

GetBitHelpMethod · 0.80
GetValueMethod · 0.45
ReleaseMethod · 0.45
GetHelpMethod · 0.45

Tested by

no test coverage detected