telephonyprotocols/rawipnif/rawipnif2/src/BinderBase.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
       
    22 
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "BinderBaseTraces.h"
       
    26 #endif
       
    27 
    22 #include <nifmbuf.h>
    28 #include <nifmbuf.h>
    23 #include "BinderBase.h"
    29 #include "BinderBase.h"
    24 #include "RawIP2Flow.h"
    30 #include "RawIP2Flow.h"
    25 #include "BcaController.h"
    31 #include "BcaController.h"
    26 
    32 
    27 CBinderBase::CBinderBase(CRawIP2Flow& aFlow, CBttLogger* aTheLogger)
    33 CBinderBase::CBinderBase(CRawIP2Flow& aFlow)
    28 /**
    34 /**
    29  * Constructor
    35  * Constructor
    30  *
    36  *
    31  * @param aNifMain A pointer to CRawIPFlow
    37  * @param aNifMain A pointer to CRawIPFlow
    32  */
    38  */
    33 	:iFlow(&aFlow),
    39 	:iFlow(&aFlow),
    34 	iTheLogger(aTheLogger),
       
    35 	iStarted(EFalse)
    40 	iStarted(EFalse)
    36 	{	
    41 	{	
    37 #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
    42 #ifdef RAWIP_HEADER_APPENDED_TO_PACKETS
    38 	iIPTagHeader = new (ELeave) CIPTagHeader(iTheLogger);
    43 	iIPTagHeader = new (ELeave) CIPTagHeader();
    39 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
    44 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
    40 	}
    45 	}
    41 
    46 
    42 CBinderBase::~CBinderBase()
    47 CBinderBase::~CBinderBase()
    43 /**
    48 /**
    53 void CBinderBase::SetType(TUint16 aType)
    58 void CBinderBase::SetType(TUint16 aType)
    54 {
    59 {
    55 /**
    60 /**
    56  *	Used to specify the type of the IP header.
    61  *	Used to specify the type of the IP header.
    57  */
    62  */
    58 	_LOG_L1C1(_L8("CBinderBase::SetType"));
    63 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBINDERBASE_SETTYPE_1, "CBinderBase::SetType");
    59 	
    64 	
    60 	iIPTagHeader->SetType(aType);	
    65 	iIPTagHeader->SetType(aType);	
    61 }
    66 }
    62 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
    67 #endif // RAWIP_HEADER_APPENDED_TO_PACKETS
    63 
    68 
   101  *
   106  *
   102  * @param aUpperReceiver A pointer to Upper layer Receive class
   107  * @param aUpperReceiver A pointer to Upper layer Receive class
   103  * @param aUpperControl A pointer to Upper layer control class
   108  * @param aUpperControl A pointer to Upper layer control class
   104  */
   109  */
   105 	{
   110 	{
   106     _LOG_L1C1(_L8("CBinderBase:\tBind()"));
   111     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBINDERBASE_BIND_1, "CBinderBase:\tBind()");
   107 
   112 
   108 	iUpperReceiver = aUpperReceiver;
   113 	iUpperReceiver = aUpperReceiver;
   109 	iUpperControl = aUpperControl;
   114 	iUpperControl = aUpperControl;
   110 	return this;
   115 	return this;
   111 	}
   116 	}
   112 
   117 
   113 void CBinderBase::Unbind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl)
   118 void CBinderBase::Unbind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl)
   114     {
   119     {
   115 	_LOG_L1C1(_L8("CBinderBase:\tUnbind()"));
   120 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBINDERBASE_UNBIND_1, "CBinderBase:\tUnbind()");
   116 	
   121 	
   117 #ifndef _DEBUG
   122 #ifndef _DEBUG
   118 	(void) aUpperReceiver;
   123 	(void) aUpperReceiver;
   119 	(void) aUpperControl;
   124 	(void) aUpperControl;
   120 #endif
   125 #endif
   130  * Indicates to the protocol layer that the NIF is ready to send packets.
   135  * Indicates to the protocol layer that the NIF is ready to send packets.
   131  *
   136  *
   132  * @param aProtocol A pointer to a protocol
   137  * @param aProtocol A pointer to a protocol
   133  */
   138  */
   134 	{
   139 	{
   135 	_LOG_L1C1(_L8("CBinderBase:\tStartSending()"));
   140 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBINDERBASE_STARTSENDING_1, "CBinderBase:\tStartSending()");
   136 
   141 
   137 	if (!iStarted)
   142 	if (!iStarted)
   138 		{
   143 		{
   139 		GetFlow().LinkLayerUp();
   144 		GetFlow().LinkLayerUp();
   140 		iStarted = ETrue;
   145 		iStarted = ETrue;
   150  * Indicates to the protocol layer that a fatal error has occured in the BCA.
   155  * Indicates to the protocol layer that a fatal error has occured in the BCA.
   151  *
   156  *
   152  * @param aProtocol A pointer to a protocol
   157  * @param aProtocol A pointer to a protocol
   153  */
   158  */
   154 	{
   159 	{
   155 	_LOG_L1C1(_L8("CBinderBase:\tError()"));
   160 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CBINDERBASE_ERROR_1, "CBinderBase:\tError()");
   156 
   161 
   157 	// Default implementation.
   162 	// Default implementation.
   158 	// Uses iProtocol instead aProtocol.
   163 	// Uses iProtocol instead aProtocol.
   159 	iUpperControl->Error(aErr);
   164 	iUpperControl->Error(aErr);
   160 	}
   165 	}