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

Method Set

cpp/src/value_classes/ValueBitSet.cpp:238–259  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Set a new value in the device -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

236// Set a new value in the device
237//-----------------------------------------------------------------------------
238bool ValueBitSet::Set
239(
240 uint32 const _value
241)
242{
243 if (_value & ~ m_BitMask) {
244 Log::Write(LogLevel_Warning, m_id.GetNodeId(), "Set: Value %d is not valid with BitMask %d", _value, m_BitMask);
245 return false;
246 }
247 // create a temporary copy of this value to be submitted to the Set() call and set its value to the function param
248 ValueBitSet* tempValue = new ValueBitSet( *this );
249
250 tempValue->m_value.SetValue(_value);
251
252 // Set the value in the device.
253 bool ret = ((Value*)tempValue)->Set();
254
255 // clean up the temporary value
256 delete tempValue;
257
258 return ret;
259}
260
261bool ValueBitSet::SetBit
262(

Callers 2

SetBitMethod · 0.45
ClearBitMethod · 0.45

Calls 3

WriteFunction · 0.85
GetNodeIdMethod · 0.80
SetValueMethod · 0.45

Tested by

no test coverage detected