simpleengine/engine/src/simpleconnection.cpp
branchRCL_3
changeset 18 fbd2e7cec7ef
parent 17 2669f8761a99
equal deleted inserted replaced
17:2669f8761a99 18:fbd2e7cec7ef
    63 
    63 
    64 // ----------------------------------------------------------
    64 // ----------------------------------------------------------
    65 // CSimpleConnection::ConstructL
    65 // CSimpleConnection::ConstructL
    66 // ----------------------------------------------------------
    66 // ----------------------------------------------------------
    67 //
    67 //
    68 void CSimpleConnection::ConstructL()
    68 void CSimpleConnection::ConstructL( TInt32 aServiceId )
    69     {
    69     {
    70     // Create CSimpleSipConnection entity in simplesiputils.dll
    70     // Create CSimpleSipConnection entity in simplesiputils.dll
    71     iConnection = CSimpleSipConnection::NewL();
    71     iConnection = CSimpleSipConnection::NewL();
    72     // Set operation id ranges
    72     // Set operation id ranges
    73     iLimitLowerValue = TSimpleEngineUtils::OpIdRange();
    73     iLimitLowerValue = TSimpleEngineUtils::OpIdRange();
    77     // start to listen to status events
    77     // start to listen to status events
    78     IncreaseOpId();
    78     IncreaseOpId();
    79     CSimpleEngineRequest* req = CSimpleEngineRequest::NewL(
    79     CSimpleEngineRequest* req = CSimpleEngineRequest::NewL(
    80         *this, MSimpleEngineRequest::EListenEvents, iOpId );
    80         *this, MSimpleEngineRequest::EListenEvents, iOpId );
    81     CleanupStack::PushL( req );
    81     CleanupStack::PushL( req );
       
    82     if ( aServiceId )
       
    83         {
       
    84         iConnection->SetServiceId( aServiceId );
       
    85         }
    82     iConnection->DispatchReqL( *req );
    86     iConnection->DispatchReqL( *req );
    83     iRequestList.AddLast( *req );
    87     iRequestList.AddLast( *req );
    84     CleanupStack::Pop( req );
    88     CleanupStack::Pop( req );
    85     }
    89     }
    86 
    90 
    94 #ifdef _DEBUG
    98 #ifdef _DEBUG
    95     TSimpleLogger::Log(_L("SimpleConnection: NewL" ));
    99     TSimpleLogger::Log(_L("SimpleConnection: NewL" ));
    96 #endif
   100 #endif
    97     CSimpleConnection* self = new (ELeave) CSimpleConnection( aObserver );
   101     CSimpleConnection* self = new (ELeave) CSimpleConnection( aObserver );
    98     CleanupStack::PushL( self );
   102     CleanupStack::PushL( self );
    99     self->ConstructL();
   103     self->ConstructL( NULL );
       
   104     CleanupStack::Pop( self );
       
   105     return self;
       
   106     }
       
   107 
       
   108 // ----------------------------------------------------------
       
   109 // CSimpleConnection::NewL
       
   110 // ----------------------------------------------------------
       
   111 //
       
   112 CSimpleConnection* CSimpleConnection::NewL(
       
   113     MSimpleConnectionObserver& aObserver, TInt32 aServiceId )
       
   114     {
       
   115 #ifdef _DEBUG
       
   116     TSimpleLogger::Log(_L("SimpleConnection: NewL" ));
       
   117 #endif
       
   118     CSimpleConnection* self = new (ELeave) CSimpleConnection( aObserver );
       
   119     CleanupStack::PushL( self );
       
   120     self->ConstructL( aServiceId );
   100     CleanupStack::Pop( self );
   121     CleanupStack::Pop( self );
   101     return self;
   122     return self;
   102     }
   123     }
   103 
   124 
   104 // ----------------------------------------------------------
   125 // ----------------------------------------------------------