mtpdataproviders/mtppictbridgedp/src/cptptimer.cpp
changeset 49 c20dd21d1eb4
parent 0 d0791faffa3f
equal deleted inserted replaced
41:2c19c7cf5550 49:c20dd21d1eb4
    18 #include "cmtppictbridgeprinter.h"
    18 #include "cmtppictbridgeprinter.h"
    19 #include "cptpsession.h"
    19 #include "cptpsession.h"
    20 #include "cptpserver.h"
    20 #include "cptpserver.h"
    21 #include "ptpdef.h"
    21 #include "ptpdef.h"
    22 #include "mtppictbridgedpconst.h"
    22 #include "mtppictbridgedpconst.h"
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "cptptimerTraces.h"
       
    26 #endif
       
    27 
    23 
    28 
    24 // --------------------------------------------------------------------------
    29 // --------------------------------------------------------------------------
    25 // 
    30 // 
    26 // 
    31 // 
    27 // --------------------------------------------------------------------------
    32 // --------------------------------------------------------------------------
    51 // 
    56 // 
    52 // --------------------------------------------------------------------------
    57 // --------------------------------------------------------------------------
    53 //
    58 //
    54 void CPtpTimer::ConstructL()    
    59 void CPtpTimer::ConstructL()    
    55     {
    60     {
    56     __FLOG_OPEN(KMTPSubsystem, KPtpServerLog);
    61     OstTraceFunctionEntry0( CPTPTIMER_CONSTRUCTL_ENTRY );   
    57     __FLOG(_L8("CPtpTimer::ConstructL"));        
       
    58     CTimer::ConstructL();
    62     CTimer::ConstructL();
       
    63     OstTraceFunctionExit0( CPTPTIMER_CONSTRUCTL_EXIT );
    59     }
    64     }
    60 
    65 
    61 // --------------------------------------------------------------------------
    66 // --------------------------------------------------------------------------
    62 // 
    67 // 
    63 // 
    68 // 
    64 // --------------------------------------------------------------------------
    69 // --------------------------------------------------------------------------
    65 //
    70 //
    66 CPtpTimer::~CPtpTimer()
    71 CPtpTimer::~CPtpTimer()
    67     {
    72     {
    68     __FLOG(_L8("CPtpTimer::~"));        
    73     OstTraceFunctionEntry0( CPTPTIMER_CPTPTIMER_DES_ENTRY );
    69     Cancel();
    74     Cancel();
    70     __FLOG_CLOSE;
    75     OstTraceFunctionExit0( CPTPTIMER_CPTPTIMER_DES_EXIT );
    71     }
    76     }
    72     
    77     
    73 // --------------------------------------------------------------------------
    78 // --------------------------------------------------------------------------
    74 // 
    79 // 
    75 // --------------------------------------------------------------------------
    80 // --------------------------------------------------------------------------
    76 //    
    81 //    
    77 void CPtpTimer::RunL()
    82 void CPtpTimer::RunL()
    78     {
    83     {
    79     __FLOG(_L8(">>>CPtpTimer::RunL"));
    84     OstTraceFunctionEntry0( CPTPTIMER_RUNL_ENTRY );
    80     if (iStatus.Int() == KErrNone)
    85     if (iStatus.Int() == KErrNone)
    81         {
    86         {
    82         __FLOG(_L8("--- timer expired, because of:"));
    87         OstTrace0( TRACE_NORMAL, CPTPTIMER_RUNL, "--- timer expired, because of:" );
    83 
    88 
    84         if (iSession.ServerP()->Printer()->Status() == CMTPPictBridgePrinter::ENotConnected) // must be DPS discovery, since no other service is supported
    89         if (iSession.ServerP()->Printer()->Status() == CMTPPictBridgePrinter::ENotConnected) // must be DPS discovery, since no other service is supported
    85             {
    90             {
    86             __FLOG(_L8("--- Dps printer not available"));            
    91             OstTrace0( TRACE_NORMAL, DUP1_CPTPTIMER_RUNL, "--- Dps printer not available" );
    87             iSession.ServerP()->Printer()->NoDpsDiscovery();
    92             iSession.ServerP()->Printer()->NoDpsDiscovery();
    88             iSession.IsDpsPrinterCompleted(EPrinterNotAvailable);
    93             iSession.IsDpsPrinterCompleted(EPrinterNotAvailable);
    89             }
    94             }
    90         else if (iSession.ServerP()->Printer()->SendObjectPending())
    95         else if (iSession.ServerP()->Printer()->SendObjectPending())
    91             {
    96             {
    92             __FLOG(_L8("---SendObject timeout"));
    97             OstTrace0( TRACE_NORMAL, DUP2_CPTPTIMER_RUNL, "---SendObject timeout" );
    93             iSession.ServerP()->Printer()->DpsFileSent(KErrTimedOut);
    98             iSession.ServerP()->Printer()->DpsFileSent(KErrTimedOut);
    94             }
    99             }
    95         else 
   100         else 
    96             {
   101             {
    97             __FLOG(_L8("---something else, do not care"));
   102             OstTrace0( TRACE_NORMAL, DUP3_CPTPTIMER_RUNL, "---something else, do not care" );
    98             }    
   103             }    
    99         }
   104         }
   100     else if (iStatus.Int() == KErrCancel)
   105     else if (iStatus.Int() == KErrCancel)
   101         {
   106         {
   102         __FLOG(_L8("--- RunL Cancelled."));
   107         OstTrace0( TRACE_NORMAL, DUP4_CPTPTIMER_RUNL, "--- RunL Cancelled." );
   103         }
   108         }
   104     else 
   109     else 
   105         {
   110         {
   106         __FLOG_VA((_L8("!!!Error: Err %d returned."), iStatus.Int()));
   111         OstTrace1( TRACE_WARNING, DUP5_CPTPTIMER_RUNL, "!!!Error: Err %d returned.", iStatus.Int() );
   107         }
   112         }
   108     __FLOG(_L8("<<<CPtpTimer::RunL"));	
   113     OstTraceFunctionExit0( CPTPTIMER_RUNL_EXIT );
   109     }
   114     }
   110 
   115 
   111 // --------------------------------------------------------------------------
   116 // --------------------------------------------------------------------------
   112 // 
   117 // 
   113 // --------------------------------------------------------------------------
   118 // --------------------------------------------------------------------------
   114 #ifdef __FLOG_ACTIVE
   119 #ifdef OST_TRACE_COMPILER_IN_USE
   115 TInt CPtpTimer::RunError(TInt aErr)
   120 TInt CPtpTimer::RunError(TInt aErr)
   116 #else
   121 #else
   117 TInt CPtpTimer::RunError(TInt /*aErr*/)
   122 TInt CPtpTimer::RunError(TInt /*aErr*/)
   118 #endif
   123 #endif
   119     {
   124     {
   120     __FLOG_VA((_L8(">>>CPtpTimer::RunError %d"), aErr));
   125     OstTraceFunctionEntry0( CPTPTIMER_RUNERROR_ENTRY );
       
   126     OstTraceDef1( OST_TRACE_CATEGORY_PRODUCTION, TRACE_IMPORTANT, CPTPTIMER_RUNERROR, 
       
   127             "error code %d", aErr);
       
   128     OstTraceFunctionExit0( CPTPTIMER_RUNERROR_EXIT );
   121     return KErrNone;
   129     return KErrNone;
   122     }
   130     }