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

Method SetValue

cpp/src/command_classes/Meter.cpp:523–546  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Set the device's scale, or reset its accumulated values. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

521// Set the device's scale, or reset its accumulated values.
522//-----------------------------------------------------------------------------
523bool Meter::SetValue
524(
525 Value const& _value
526)
527{
528 if( MeterIndex_Reset == _value.GetID().GetIndex() )
529 {
530 ValueButton const* button = static_cast<ValueButton const*>(&_value);
531 if( button->IsPressed() )
532 {
533 Msg* msg = new Msg( "MeterCmd_Reset", GetNodeId(), REQUEST, FUNC_ID_ZW_SEND_DATA, true );
534 msg->SetInstance( this, _value.GetID().GetInstance() );
535 msg->Append( GetNodeId() );
536 msg->Append( 2 );
537 msg->Append( GetCommandClassId() );
538 msg->Append( MeterCmd_Reset );
539 msg->Append( GetDriver()->GetTransmitOptions() );
540 GetDriver()->SendMsg( msg, Driver::MsgQueue_Send );
541 return true;
542 }
543 }
544
545 return false;
546}
547
548//-----------------------------------------------------------------------------
549// <Meter::CreateVars>

Callers

nothing calls this directly

Calls 7

GetCommandClassIdFunction · 0.85
IsPressedMethod · 0.80
GetInstanceMethod · 0.80
SendMsgMethod · 0.80
GetNodeIdFunction · 0.70
SetInstanceMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected