----------------------------------------------------------------------------- Used to enable wrapping with MultiInstance/MultiChannel during finalize. -----------------------------------------------------------------------------
| 93 | // Used to enable wrapping with MultiInstance/MultiChannel during finalize. |
| 94 | //----------------------------------------------------------------------------- |
| 95 | void 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> |
no test coverage detected