telephonyprotocols/pdplayer/umts/spudtel/src/reteldriverinput.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-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".
    18 /**
    18 /**
    19  @file 
    19  @file 
    20  @internalComponent
    20  @internalComponent
    21 */
    21 */
    22 
    22 
       
    23 
       
    24 
       
    25 #include "OstTraceDefinitions.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "reteldriverinputTraces.h"
       
    28 #endif
       
    29 
    23 #include <e32def.h>
    30 #include <e32def.h>
    24 #include <e32std.h>
    31 #include <e32std.h>
    25 
    32 
    26 #include "ceteldriverfactory.h"
    33 #include "ceteldriverfactory.h"
    27 #include "ceteldrivercontext.h"
    34 #include "ceteldrivercontext.h"
    28 #include "reteldriverinput.h"
    35 #include "reteldriverinput.h"
    29 #include "spudteldebuglogger.h"
       
    30 
    36 
    31 using namespace EtelDriver;
    37 using namespace EtelDriver;
    32 
    38 
    33 REtelDriverInput::REtelDriverInput()
    39 REtelDriverInput::REtelDriverInput()
    34 : iDriverFactory(NULL)
    40 : iDriverFactory(NULL)
    36 	}
    42 	}
    37 
    43 
    38 
    44 
    39 REtelDriverInput::~REtelDriverInput()
    45 REtelDriverInput::~REtelDriverInput()
    40 	{
    46 	{
    41 	SPUDTEL_FNLOG("REtelDriverInput::~REtelDriverInput()");
    47 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_DTOR_1, "REtelDriverInput::~REtelDriverInput()");
    42 	
    48 	
    43 	if (iDriverFactory)
    49 	if (iDriverFactory)
    44 	   {
    50 	   {
    45 	   delete iDriverFactory;
    51 	   delete iDriverFactory;
    46 	   }	  
    52 	   }	  
    51 
    57 
    52 @param aPdpFsmInterface - reference to pdp FSM interface
    58 @param aPdpFsmInterface - reference to pdp FSM interface
    53 */
    59 */
    54 void REtelDriverInput::OpenL (CPdpFsmInterface& aPdpFsmInterface)
    60 void REtelDriverInput::OpenL (CPdpFsmInterface& aPdpFsmInterface)
    55 	{
    61 	{
    56 	SPUDTEL_FNLOG("REtelDriverInput::OpenL()");
    62 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_OPENL_1, "REtelDriverInput::OpenL()");
    57 
    63 
    58 	// internal check
    64 	// internal check
    59 	iDriverFactory = CEtelDriverFactory::NewL(aPdpFsmInterface);
    65 	iDriverFactory = CEtelDriverFactory::NewL(aPdpFsmInterface);
    60 	if (iDriverFactory)
    66 	if (iDriverFactory)
    61 		{
    67 		{
    66 
    72 
    67 /** closes eTel driver and frees underlying resources
    73 /** closes eTel driver and frees underlying resources
    68 */
    74 */
    69 void REtelDriverInput::Close()
    75 void REtelDriverInput::Close()
    70 	{
    76 	{
    71 	SPUDTEL_FNLOG("REtelDriverInput::Close()");
    77 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CLOSE_1, "REtelDriverInput::Close()");
    72 	
    78 	
    73 	// cancel all outstanding requests
    79 	// cancel all outstanding requests
    74 	if (iDriverFactory)
    80 	if (iDriverFactory)
    75 		{
    81 		{
    76 		CancelAllPdps();
    82 		CancelAllPdps();
    87 
    93 
    88 @param aPdpId - id of new pdp context
    94 @param aPdpId - id of new pdp context
    89 */
    95 */
    90 void REtelDriverInput::CreatePdpL (TContextId aPdpId,SpudMan::TPdpContextType aContextType)
    96 void REtelDriverInput::CreatePdpL (TContextId aPdpId,SpudMan::TPdpContextType aContextType)
    91 	{
    97 	{
    92 	SPUDTEL_FNLOG("REtelDriverInput::CreatePdpL()");
    98 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CREATEPDPL_1, "REtelDriverInput::CreatePdpL()");
    93 	SPUDTELVERBOSE_INFO_LOG1(_L("pdp id : %d"), aPdpId);
    99 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CREATEPDPL_2, "pdp id : %d", aPdpId);
    94 	
   100 	
    95 	ASSERT(iDriverFactory);
   101 	ASSERT(iDriverFactory);
    96 	iDriverFactory->CreatePdpL (aPdpId,aContextType );
   102 	iDriverFactory->CreatePdpL (aPdpId,aContextType );
    97 	}
   103 	}
    98 	
   104 	
   100 
   106 
   101 @param aPdpId - id of a pdp context
   107 @param aPdpId - id of a pdp context
   102 */
   108 */
   103 void REtelDriverInput::DeletePdp (TContextId aPdpId)
   109 void REtelDriverInput::DeletePdp (TContextId aPdpId)
   104 	{
   110 	{
   105 	SPUDTEL_FNLOG("REtelDriverInput::DeletePdp()");
   111 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_DELETEPDP_1, "REtelDriverInput::DeletePdp()");
   106 	SPUDTELVERBOSE_INFO_LOG1(_L("pdp id : %d"), aPdpId);
   112 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_DELETEPDP_2, "pdp id : %d", aPdpId);
   107 	
   113 	
   108 	if(iDriverFactory)
   114 	if(iDriverFactory)
   109     	{
   115     	{
   110     	iDriverFactory->FreePdp(aPdpId);	    
   116     	iDriverFactory->FreePdp(aPdpId);	    
   111     	}
   117     	}
   116 @param aPdpId - id of a pdp context
   122 @param aPdpId - id of a pdp context
   117 @param aOperation - etel driver operation
   123 @param aOperation - etel driver operation
   118 */
   124 */
   119 void REtelDriverInput::Input(TContextId aPdpId, TEtelInput aOperation)
   125 void REtelDriverInput::Input(TContextId aPdpId, TEtelInput aOperation)
   120 	{
   126 	{
   121 	SPUDTEL_FNLOG("REtelDriverInput::Input()");
   127 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_INPUT_1, "REtelDriverInput::Input()");
   122 	SPUDTEL_INFO_LOG2(_L("REtelDriverInput::Input: pdp id : %d, operation %d"), aPdpId, aOperation);
   128 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_INPUT_2, "REtelDriverInput::Input: pdp id : %d, operation %d", aPdpId, aOperation);
   123 	ASSERT(iDriverFactory);
   129 	ASSERT(iDriverFactory);
   124 	
   130 	
   125 	iDriverFactory->Context(aPdpId).Input(aOperation);
   131 	iDriverFactory->Context(aPdpId).Input(aOperation);
   126 	}
   132 	}
   127 
   133 
   129 
   135 
   130 @param aPdpId - id of a pdp context
   136 @param aPdpId - id of a pdp context
   131 */
   137 */
   132 void REtelDriverInput::CancelPdp (TContextId aPdpId)
   138 void REtelDriverInput::CancelPdp (TContextId aPdpId)
   133 	{
   139 	{
   134 	SPUDTEL_FNLOG("REtelDriverInput::CancelPdp()");
   140 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELPDP_1, "REtelDriverInput::CancelPdp()");
   135 	SPUDTEL_INFO_LOG1(_L("REtelDriverInput::CancelPdp: pdp id : %d"), aPdpId);
   141 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELPDP_2, "REtelDriverInput::CancelPdp: pdp id : %d", aPdpId);
   136 	ASSERT(iDriverFactory);
   142 	ASSERT(iDriverFactory);
   137 	
   143 	
   138 	iDriverFactory->Context(aPdpId).Cancel();
   144 	iDriverFactory->Context(aPdpId).Cancel();
   139 	}
   145 	}
   140 	
   146 	
   142 
   148 
   143 @param aPdpId - id of a pdp context
   149 @param aPdpId - id of a pdp context
   144 */
   150 */
   145 void REtelDriverInput::StartPdpNotifications(TContextId aPdpId)
   151 void REtelDriverInput::StartPdpNotifications(TContextId aPdpId)
   146 	{
   152 	{
   147 	SPUDTEL_FNLOG("REtelDriverInput::StartPdpNotifications()");
   153 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_STARTPDPNOTIFICATIONS_1, "REtelDriverInput::StartPdpNotifications()");
   148 	ASSERT(iDriverFactory);
   154 	ASSERT(iDriverFactory);
   149 
   155 
   150 	iDriverFactory->StartPdpNotifications(aPdpId);
   156 	iDriverFactory->StartPdpNotifications(aPdpId);
   151 	}
   157 	}
   152 	
   158 	
   154 
   160 
   155 @param aPdpId - id of a pdp context
   161 @param aPdpId - id of a pdp context
   156 */
   162 */
   157 void REtelDriverInput::CancelPdpNotifications (TContextId aPdpId)
   163 void REtelDriverInput::CancelPdpNotifications (TContextId aPdpId)
   158 	{
   164 	{
   159 	SPUDTEL_FNLOG("REtelDriverInput::CancelPdpNotifications()");
   165 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELPDPNOTIFICATIONS_1, "REtelDriverInput::CancelPdpNotifications()");
   160 	SPUDTEL_INFO_LOG1(_L("REtelDriverInput::CancelPdpNotifications: pdp id : %d"), aPdpId);
   166 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELPDPNOTIFICATIONS_2, "REtelDriverInput::CancelPdpNotifications: pdp id : %d", aPdpId);
   161 	ASSERT(iDriverFactory);
   167 	ASSERT(iDriverFactory);
   162 
   168 
   163 	iDriverFactory->CancelPdpNotifications (aPdpId);
   169 	iDriverFactory->CancelPdpNotifications (aPdpId);
   164 	}
   170 	}
   165 	
   171 	
   166 /** cancels last operations for all created pdp contexts */
   172 /** cancels last operations for all created pdp contexts */
   167 void REtelDriverInput::CancelAllPdps ()
   173 void REtelDriverInput::CancelAllPdps ()
   168 	{
   174 	{
   169 	SPUDTEL_FNLOG("REtelDriverInput::CancelAllPdps()");
   175 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELALLPDPS_1, "REtelDriverInput::CancelAllPdps()");
   170 	ASSERT(iDriverFactory);
   176 	ASSERT(iDriverFactory);
   171 	
   177 	
   172 	for(TContextId i = 0; i < static_cast<TContextId>(iDriverFactory->ContextCount()); i++)
   178 	for(TContextId i = 0; i < static_cast<TContextId>(iDriverFactory->ContextCount()); i++)
   173 		{
   179 		{
   174 		if (iDriverFactory->HasContext(i))
   180 		if (iDriverFactory->HasContext(i))
   179 	}
   185 	}
   180 
   186 
   181 /** cancels all notifications for all pdp contexts */
   187 /** cancels all notifications for all pdp contexts */
   182 void REtelDriverInput::CancelAllPdpNotifications ()
   188 void REtelDriverInput::CancelAllPdpNotifications ()
   183 	{
   189 	{
   184 	SPUDTEL_FNLOG("REtelDriverInput::CancelAllPdpNotifications()");
   190 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, RETELDRIVERINPUT_CANCELALLPDPNOTIFICATIONS_1, "REtelDriverInput::CancelAllPdpNotifications()");
   185 	ASSERT(iDriverFactory);
   191 	ASSERT(iDriverFactory);
   186 
   192 
   187 	iDriverFactory->CancelAllPdpNotifications();
   193 	iDriverFactory->CancelAllPdpNotifications();
   188 	}
   194 	}
   189 
   195