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