----------------------------------------------------------------------------- Set a new value in the device -----------------------------------------------------------------------------
| 236 | // Set a new value in the device |
| 237 | //----------------------------------------------------------------------------- |
| 238 | bool 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 | |
| 261 | bool ValueBitSet::SetBit |
| 262 | ( |