----------------------------------------------------------------------------- Set the device's wakeup interval -----------------------------------------------------------------------------
| 286 | // Set the device's wakeup interval |
| 287 | //----------------------------------------------------------------------------- |
| 288 | bool WakeUp::SetValue |
| 289 | ( |
| 290 | Value const& _value |
| 291 | ) |
| 292 | { |
| 293 | if( ValueID::ValueType_Int == _value.GetID().GetType() ) |
| 294 | { |
| 295 | ValueInt const* value = static_cast<ValueInt const*>(&_value); |
| 296 | |
| 297 | Msg* msg = new Msg( "WakeUpCmd_IntervalSet", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true ); |
| 298 | msg->Append( GetNodeId() ); |
| 299 | |
| 300 | if( GetNodeUnsafe()->GetCommandClass( MultiCmd::StaticGetCommandClassId() ) ) |
| 301 | { |
| 302 | msg->Append( 10 ); |
| 303 | msg->Append( MultiCmd::StaticGetCommandClassId() ); |
| 304 | msg->Append( MultiCmd::MultiCmdCmd_Encap ); |
| 305 | msg->Append( 1 ); |
| 306 | } |
| 307 | |
| 308 | int32 interval = value->GetValue(); |
| 309 | |
| 310 | msg->Append( 6 ); // length of command bytes following |
| 311 | msg->Append( GetCommandClassId() ); |
| 312 | msg->Append( WakeUpCmd_IntervalSet ); |
| 313 | msg->Append( (uint8)(( interval >> 16 ) & 0xff) ); |
| 314 | msg->Append( (uint8)(( interval >> 8 ) & 0xff) ); |
| 315 | msg->Append( (uint8)( interval & 0xff ) ); |
| 316 | msg->Append( GetDriver()->GetControllerNodeId() ); |
| 317 | msg->Append( GetDriver()->GetTransmitOptions() ); |
| 318 | GetDriver()->SendMsg( msg, Driver::MsgQueue_WakeUp ); |
| 319 | return true; |
| 320 | } |
| 321 | |
| 322 | return false; |
| 323 | } |
| 324 | |
| 325 | //----------------------------------------------------------------------------- |
| 326 | // <WakeUp::SetVersion> |
nothing calls this directly
no test coverage detected