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

Method AppendValue

cpp/src/command_classes/CommandClass.cpp:618–636  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Add a value to a message as a sequence of bytes -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

616// Add a value to a message as a sequence of bytes
617//-----------------------------------------------------------------------------
618void CommandClass::AppendValue
619(
620 Msg* _msg,
621 string const& _value,
622 uint8 const _scale
623)const
624{
625 uint8 precision;
626 uint8 size;
627 int32 val = ValueToInteger( _value, &precision, &size );
628
629 _msg->Append( (precision<<c_precisionShift) | (_scale<<c_scaleShift) | size );
630
631 int32 shift = (size-1)<<3;
632 for( int32 i=size; i>0; --i, shift-=8 )
633 {
634 _msg->Append( (uint8)(val >> shift) );
635 }
636}
637
638//-----------------------------------------------------------------------------
639// <CommandClass::GetAppendValueSize>

Callers

nothing calls this directly

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected