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

Method SetVersion

cpp/src/command_classes/CommandClass.cpp:844–865  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Made out-of-line to allow overriding -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

842// Made out-of-line to allow overriding
843//-----------------------------------------------------------------------------
844void CommandClass::SetVersion
845(
846 uint8 const _version
847)
848{
849 if( m_com.GetFlagByte(COMPAT_FLAG_FORCEVERSION) == 0 )
850 {
851 if( _version >= m_dom.GetFlagByte(STATE_FLAG_CCVERSION) )
852 {
853 m_dom.SetFlagByte(STATE_FLAG_CCVERSION, _version);
854 }
855 else {
856 Log::Write( LogLevel_Warning, GetNodeId(), "Trying to Downgrade Command Class %s version from %d to %d. Ignored", GetCommandClassName().c_str(), m_dom.GetFlagByte(STATE_FLAG_CCVERSION), _version);
857 }
858 }
859 else
860 {
861 m_dom.SetFlagByte(STATE_FLAG_CCVERSION, m_com.GetFlagByte(COMPAT_FLAG_FORCEVERSION));
862 Log::Write( LogLevel_Warning, GetNodeId(), "Attempt to update Command Class %s version from %d to %d. Ignored", GetCommandClassName().c_str(), m_dom.GetFlagByte(STATE_FLAG_CCVERSION), _version);
863 }
864
865}
866
867//-----------------------------------------------------------------------------
868// <CommandClass::refreshValuesOnWakeup>

Callers

nothing calls this directly

Calls 5

WriteFunction · 0.85
GetFlagByteMethod · 0.80
SetFlagByteMethod · 0.80
GetNodeIdFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected