tracesrv/tracecore/btrace_handler/test/d_traceonactivation/src/TraceConnection.cpp
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 // Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "TraceOnActivation.h"
       
    17 #include "TraceCoreTraceActivationIf.h"
       
    18 #include "TraceConnection.h"
       
    19 
       
    20 #include <TraceCoreMessageSender.h>
       
    21 
       
    22 
       
    23 //---------------------------------------------------------------------------
       
    24 /**
       
    25     Constructor
       
    26 
       
    27 */
       
    28 DTraceConnection::DTraceConnection( )
       
    29 : iTcChannel( NULL )
       
    30     {
       
    31 
       
    32     }
       
    33 
       
    34 //---------------------------------------------------------------------------
       
    35 /**
       
    36     Constructor
       
    37 
       
    38     @param  aTcChannel  A pointer to the DTcChannel
       
    39 
       
    40 */
       
    41 DTraceConnection::DTraceConnection( DTcChannel* aTcChannel )
       
    42 : iTcChannel( aTcChannel )
       
    43     {
       
    44     }
       
    45     
       
    46 //---------------------------------------------------------------------------
       
    47 /**
       
    48     Destructor
       
    49 
       
    50 */
       
    51 DTraceConnection::~DTraceConnection()
       
    52     {
       
    53     }
       
    54     
       
    55 //---------------------------------------------------------------------------
       
    56 /**
       
    57     RegisterNotificationReceiver
       
    58 
       
    59     @param  aComponentId  ComponentId
       
    60     @param  aGroupId GroupId
       
    61 
       
    62 */
       
    63 TInt DTraceConnection::RegisterNotificationReceiver( TUint32 aComponentId, TInt32 aGroupId )
       
    64     {
       
    65     return MTraceCoreNotificationReceiver::RegisterNotificationReceiver( aComponentId, aGroupId );
       
    66     }
       
    67 
       
    68     
       
    69 //---------------------------------------------------------------------------
       
    70 /**
       
    71     UnregisterNotificationReceiver
       
    72 
       
    73     @param  aComponentId  ComponentId
       
    74     @param  aGroupId GroupId
       
    75 
       
    76 */
       
    77 void DTraceConnection::UnregisterNotificationReceiver( TUint32 aComponentId, TInt32 aGroupId  )
       
    78     {
       
    79     MTraceCoreNotificationReceiver::UnregisterNotificationReceiver( aComponentId, aGroupId );
       
    80     }    
       
    81 
       
    82 //---------------------------------------------------------------------------
       
    83 /**
       
    84     TraceActivated
       
    85 
       
    86     @param  aComponentId  ComponentId
       
    87     @param  aGroupId GroupId
       
    88 
       
    89 */
       
    90 void DTraceConnection::TraceActivated( TUint32 aComponentId, TUint16 aGroupId  )
       
    91     {
       
    92     if(iTcChannel)
       
    93         {
       
    94         iTcChannel->TraceActivated( aComponentId, aGroupId );
       
    95         }
       
    96     }
       
    97 
       
    98 //---------------------------------------------------------------------------
       
    99 /**
       
   100     TraceDeactivated
       
   101 
       
   102     @param  aComponentId  ComponentId
       
   103     @param  aGroupId GroupId
       
   104 
       
   105 */    
       
   106 void DTraceConnection::TraceDeactivated( TUint32 aComponentId, TUint16 aGroupId  )
       
   107     {
       
   108     if(iTcChannel)
       
   109         {
       
   110         iTcChannel->TraceDeactivated( aComponentId, aGroupId );
       
   111         }
       
   112     }
       
   113 
       
   114 //---------------------------------------------------------------------------
       
   115 
       
   116 void DTraceConnection::MessageReceived( TTraceMessage& /*aMsg*/ )
       
   117 	{
       
   118 	}
       
   119 
       
   120 
       
   121 TInt DTraceConnection::DoSendMessage( TTraceMessage &aMsg )
       
   122 	{
       
   123 	TInt err = KErrNotFound;
       
   124 	if ( iMessageSender )
       
   125 		{
       
   126 		err = iMessageSender->SendMessage( aMsg );
       
   127 		}	
       
   128 	return err;
       
   129 	}
       
   130