| 283 | return ret; |
| 284 | } |
| 285 | bool 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 | |
| 310 | bool ValueBitSet::SetBitMask |
| 311 | ( |