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

Method SetValue

cpp/src/command_classes/WakeUp.cpp:288–323  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Set the device's wakeup interval -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

286// Set the device's wakeup interval
287//-----------------------------------------------------------------------------
288bool 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>

Callers

nothing calls this directly

Calls 7

GetCommandClassIdFunction · 0.85
GetCommandClassMethod · 0.80
GetControllerNodeIdMethod · 0.80
SendMsgMethod · 0.80
GetNodeIdFunction · 0.70
AppendMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected