mtptransports/mtpcontroller/src/cmtpbearermonitor.cpp
changeset 49 c20dd21d1eb4
parent 37 d9d8313203af
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    22 
    22 
    23 #include "cmtpbearermonitor.h"
    23 #include "cmtpbearermonitor.h"
    24 #include <locodservicepluginobserver.h>
    24 #include <locodservicepluginobserver.h>
    25 
    25 
    26 #include "cmtpbluetoothcontroller.h"
    26 #include "cmtpbluetoothcontroller.h"
       
    27 #include "OstTraceDefinitions.h"
       
    28 #ifdef OST_TRACE_COMPILER_IN_USE
       
    29 #include "cmtpbearermonitorTraces.h"
       
    30 #endif
    27 
    31 
    28 __FLOG_STMT( _LIT8( KComponent, "mtpbearermonitor" ); )
       
    29 
    32 
    30 CMTPBearerMonitor* CMTPBearerMonitor::NewL( TLocodServicePluginParams& aParams )
    33 CMTPBearerMonitor* CMTPBearerMonitor::NewL( TLocodServicePluginParams& aParams )
    31     {
    34     {
    32     CMTPBearerMonitor* self = new( ELeave ) CMTPBearerMonitor( aParams );
    35     CMTPBearerMonitor* self = new( ELeave ) CMTPBearerMonitor( aParams );
    33     CleanupStack::PushL( self );
    36     CleanupStack::PushL( self );
    36     return self;
    39     return self;
    37     }
    40     }
    38 
    41 
    39 CMTPBearerMonitor::~CMTPBearerMonitor()
    42 CMTPBearerMonitor::~CMTPBearerMonitor()
    40     {
    43     {
       
    44     OstTraceFunctionEntry0( CMTPBEARERMONITOR_DES_ENTRY );
    41     iMTPControllers.ResetAndDestroy();
    45     iMTPControllers.ResetAndDestroy();
    42     iMTPControllers.Close();
    46     iMTPControllers.Close();
    43     __FLOG( _L8("+/-Dtor") );
    47     OstTraceFunctionExit0( CMTPBEARERMONITOR_DES_EXIT );
    44     __FLOG_CLOSE;
       
    45     }
    48     }
    46 
    49 
    47 void CMTPBearerMonitor::ManageServiceCompleted( TLocodBearer aBearer, TBool aStatus, TInt aError )
    50 void CMTPBearerMonitor::ManageServiceCompleted( TLocodBearer aBearer, TBool aStatus, TInt aError )
    48     {
    51     {
       
    52     OstTraceFunctionEntry0( CMTPBEARERMONITOR_MANAGESERVICECOMPLETED_ENTRY );
    49     Observer().ManageServiceCompleted( aBearer, aStatus, ImplementationUid(), aError );
    53     Observer().ManageServiceCompleted( aBearer, aStatus, ImplementationUid(), aError );
       
    54     OstTraceFunctionExit0( CMTPBEARERMONITOR_MANAGESERVICECOMPLETED_EXIT );
    50     }
    55     }
    51 
    56 
    52 void CMTPBearerMonitor::ManageService( TLocodBearer aBearer, TBool aStatus )
    57 void CMTPBearerMonitor::ManageService( TLocodBearer aBearer, TBool aStatus )
    53     {
    58     {
    54     __FLOG_2( _L8("+/-ManageService( 0x%08X, %d )"), aBearer, aStatus );
    59     OstTraceFunctionEntry0( CMTPBEARERMONITOR_MANAGESERVICE_ENTRY );
       
    60     OstTraceExt2( TRACE_NORMAL, CMTPBEARERMONITOR_MANAGESERVICE, "The bear is 0x%08X, The status is %d", aBearer, aStatus );
       
    61     
    55     TInt count = iMTPControllers.Count();
    62     TInt count = iMTPControllers.Count();
    56     TBool foundController = EFalse;
    63     TBool foundController = EFalse;
    57     for ( TInt i = 0; i < count; ++i )
    64     for ( TInt i = 0; i < count; ++i )
    58         {
    65         {
    59         if ( aBearer == iMTPControllers[i]->Bearer() )
    66         if ( aBearer == iMTPControllers[i]->Bearer() )
    64         }
    71         }
    65     if ( !foundController )
    72     if ( !foundController )
    66         {
    73         {
    67         ManageServiceCompleted( aBearer, aStatus, KErrNone );
    74         ManageServiceCompleted( aBearer, aStatus, KErrNone );
    68         }
    75         }
       
    76     OstTraceFunctionExit0( CMTPBEARERMONITOR_MANAGESERVICE_EXIT );
    69     }
    77     }
    70 
    78 
    71 CMTPBearerMonitor::CMTPBearerMonitor( TLocodServicePluginParams& aParams ):
    79 CMTPBearerMonitor::CMTPBearerMonitor( TLocodServicePluginParams& aParams ):
    72     CLocodServicePlugin( aParams )
    80     CLocodServicePlugin( aParams )
    73     {
    81     {
    74     __FLOG_OPEN( KMTPSubsystem, KComponent );
    82     OstTraceFunctionEntry0( CMTPBEARERMONITOR_CONS_ENTRY );
    75     __FLOG( _L8("+/-Ctor") );
    83     OstTraceFunctionExit0( CMTPBEARERMONITOR_CONS_EXIT );
    76     }
    84     }
    77 
    85 
    78 void CMTPBearerMonitor::ConstructL()
    86 void CMTPBearerMonitor::ConstructL()
    79     {
    87     {
    80     __FLOG( _L8("+ConstructL") );
    88     OstTraceFunctionEntry0( CMTPBEARERMONITOR_CONSTRUCTL_ENTRY );
    81     
       
    82     CMTPBluetoothController* btController = CMTPBluetoothController::NewL( *this );
    89     CMTPBluetoothController* btController = CMTPBluetoothController::NewL( *this );
    83     CleanupStack::PushL(btController);
    90 	CleanupStack::PushL(btController);
    84     iMTPControllers.AppendL( btController );
    91     iMTPControllers.AppendL( btController );
    85     CleanupStack::Pop(btController);
    92 	CleanupStack::Pop(btController);
    86     
    93     OstTraceFunctionExit0( CMTPBEARERMONITOR_CONSTRUCTL_EXIT );
    87     __FLOG( _L8("-ConstructL") );
       
    88     }
    94     }
    89 
    95