215 if ( iMetadata || iListener ) |
216 if ( iMetadata || iListener ) |
216 { |
217 { |
217 TRACE_FUNC_EXIT |
218 TRACE_FUNC_EXIT |
218 User::Leave( KErrGeneral ); |
219 User::Leave( KErrGeneral ); |
219 } |
220 } |
220 REComSession& ecomSession = REComSession::OpenL(); |
221 iEComSession = &REComSession::OpenL(); |
221 CleanupClosePushL( ecomSession ); |
|
222 TPckgBuf<TUid> ifUidPckgBuf; |
222 TPckgBuf<TUid> ifUidPckgBuf; |
223 TInt retTemp = ReadStructFromMessage( ifUidPckgBuf, |
223 TInt retTemp = ReadStructFromMessage( ifUidPckgBuf, |
224 EATExtConnectParamUid, |
224 EATExtConnectParamUid, |
225 aMessage ); |
225 aMessage ); |
226 if ( retTemp != KErrNone ) |
226 if ( retTemp != KErrNone ) |
237 { |
237 { |
238 TRACE_FUNC_EXIT |
238 TRACE_FUNC_EXIT |
239 User::Leave( retTemp ); |
239 User::Leave( retTemp ); |
240 } |
240 } |
241 // Create listener |
241 // Create listener |
242 CATExtListen* listener = CATExtListen::NewLC( ecomSession, this ); |
242 CATExtListen* listener = CATExtListen::NewLC( *iEComSession, this ); |
243 listener->AddInterfaceUid( ifUidPckgBuf() ); |
243 listener->AddInterfaceUid( ifUidPckgBuf() ); |
244 // Create metadata. Pass iListener to add the UIDs |
244 // Create metadata. Pass iListener to add the UIDs |
245 CATExtMetadata* metadata = CATExtMetadata::NewLC( ecomSession, |
245 CATExtMetadata* metadata = CATExtMetadata::NewLC( *iEComSession, |
246 listener, |
246 listener, |
247 *this ); |
247 *this ); |
248 metadata->CreateImplementationMetadataL( ifUidPckgBuf(), connectionName ); |
248 metadata->CreateImplementationMetadataL( ifUidPckgBuf(), connectionName ); |
249 listener->IssueRequest(); |
249 listener->IssueRequest(); |
250 CleanupStack::Pop( metadata ); |
250 CleanupStack::Pop( metadata ); |
251 CleanupStack::Pop( listener ); |
251 CleanupStack::Pop( listener ); |
252 CleanupStack::PopAndDestroy( &connectionName ); |
252 CleanupStack::PopAndDestroy( &connectionName ); |
253 CleanupStack::Pop( &ecomSession ); |
|
254 iEComSession = ecomSession; |
|
255 iListener = listener; |
253 iListener = listener; |
256 iMetadata = metadata; |
254 iMetadata = metadata; |
257 TRACE_FUNC_EXIT |
255 TRACE_FUNC_EXIT |
258 } |
256 } |
259 |
257 |