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

Method SetInstance

cpp/src/Msg.cpp:95–126  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Used to enable wrapping with MultiInstance/MultiChannel during finalize. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

93// Used to enable wrapping with MultiInstance/MultiChannel during finalize.
94//-----------------------------------------------------------------------------
95void Msg::SetInstance
96(
97 CommandClass* _cc,
98 uint8 const _instance
99)
100{
101 // Determine whether we should encapsulate the message in MultiInstance or MultiCommand
102 if( Node* node = _cc->GetNodeUnsafe() )
103 {
104 MultiInstance* micc = static_cast<MultiInstance*>( node->GetCommandClass( MultiInstance::StaticGetCommandClassId() ) );
105 m_instance = _instance;
106 if( micc )
107 {
108 if( micc->GetVersion() > 1 )
109 {
110 m_endPoint = _cc->GetEndPoint( _instance );
111 if( m_endPoint != 0 )
112 {
113 // Set the flag bit to indicate MultiChannel rather than MultiInstance
114 m_flags |= m_MultiChannel;
115 m_expectedCommandClassId = MultiInstance::StaticGetCommandClassId();
116 }
117 }
118 else if( m_instance > 1 )
119 {
120 // Set the flag bit to indicate MultiInstance rather than MultiChannel
121 m_flags |= m_MultiInstance;
122 m_expectedCommandClassId = MultiInstance::StaticGetCommandClassId();
123 }
124 }
125 }
126}
127
128//-----------------------------------------------------------------------------
129// <Msg::Append>

Callers 6

AdvanceQueriesMethod · 0.45
UpdateProtocolInfoMethod · 0.45
SetSecuredClassesMethod · 0.45
UpdateNodeInfoMethod · 0.45
SetDeviceClassesMethod · 0.45

Calls 3

GetCommandClassMethod · 0.80
GetNodeUnsafeMethod · 0.45
GetVersionMethod · 0.45

Tested by

no test coverage detected