| 259 | } |
| 260 | |
| 261 | bool 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 | } |
| 285 | bool ValueBitSet::ClearBit |
| 286 | ( |
| 287 | uint8 const _idx |