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

Method SetBit

cpp/src/value_classes/ValueBitSet.cpp:261–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261bool ValueBitSet::SetBit
262(
263 uint8 const _idx
264)
265{
266 /* is the bits valid */
267 if (!isValidBit(_idx)) {
268 Log::Write(LogLevel_Warning, m_id.GetNodeId(), "SetBit: Bit %d is not valid with BitMask %d", _idx, m_BitMask);
269 return false;
270 }
271
272 // create a temporary copy of this value to be submitted to the Set() call and set its value to the function param
273 ValueBitSet* tempValue = new ValueBitSet( *this );
274
275 tempValue->m_value.Set(_idx -1);
276
277 // Set the value in the device.
278 bool ret = ((Value*)tempValue)->Set();
279
280 // clean up the temporary value
281 delete tempValue;
282
283 return ret;
284}
285bool ValueBitSet::ClearBit
286(
287 uint8 const _idx

Callers 1

SetValueMethod · 0.80

Calls 3

WriteFunction · 0.85
GetNodeIdMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected