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

Method ClearBit

cpp/src/value_classes/ValueBitSet.cpp:285–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 return ret;
284}
285bool ValueBitSet::ClearBit
286(
287 uint8 const _idx
288)
289{
290
291 /* is the bits valid */
292 if (!isValidBit(_idx)) {
293 Log::Write(LogLevel_Warning, m_id.GetNodeId(), "ClearBit: Bit %d is not valid with BitMask %d", _idx, m_BitMask);
294 return false;
295 }
296
297 // create a temporary copy of this value to be submitted to the Set() call and set its value to the function param
298 ValueBitSet* tempValue = new ValueBitSet( *this );
299 tempValue->m_value.Clear(_idx -1);
300
301 // Set the value in the device.
302 bool ret = ((Value*)tempValue)->Set();
303
304 // clean up the temporary value
305 delete tempValue;
306
307 return ret;
308}
309
310bool ValueBitSet::SetBitMask
311(

Callers 1

SetValueMethod · 0.80

Calls 4

WriteFunction · 0.85
GetNodeIdMethod · 0.80
ClearMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected