telephonyprotocols/pdplayer/umts/spudfsm/src/tpdpstateinitialised.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
child 42 3adadc800673
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2004-2009 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 // Initialised state
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22  
       
    23 #include <networking/umtsnifcontrolif.h>
       
    24 #include "tpdpstates.h"
       
    25 #include "spudfsmdebuglogger.h"
       
    26 #include "pdpfsmnmspace.h"
       
    27 #include "cpdpfsm.h"
       
    28 #include "cpdpfsmfactory.h"
       
    29 #include "eteldrivernmspace.h"
       
    30 using namespace SpudMan;
       
    31 
       
    32 TInt TPdpStateInitialised::Input (CPdpFsm& aFsm, const TInt aOperation, const TInt aErrorCode)
       
    33 {
       
    34 	SPUDFSMVERBOSE_FNLOG("TPdpStateInitialised::Input()");
       
    35 	SPUDFSMVERBOSE_LOG2(_L("aOperation : %S(%d)"), LogOperation(aFsm, aOperation), aOperation);
       
    36 
       
    37 	switch (aOperation)
       
    38 	{
       
    39 	case SpudMan::ECreatePrimaryPDPContext:
       
    40 		aFsm.iContextType = SpudMan::EPrimary;
       
    41 
       
    42 		// have to ensure EOpenPhone is called the first time a primary context is created
       
    43 		if (iPdpFsmFactory->iEtelOpened == EFalse)
       
    44 			{
       
    45 			aFsm.ChangeStateToOpeningPhone();
       
    46 			EtelDriverInput(aFsm, EtelDriver::EOpenPhone);
       
    47 			}
       
    48 		else // just create the primary
       
    49 			{
       
    50 			aFsm.ChangeStateToCreatingPrimary();
       
    51 			EtelDriverInput (aFsm, EtelDriver::ECreate1ryPdpContext);
       
    52 			}
       
    53 	
       
    54 		return KErrNone;
       
    55 	case SpudMan::ECreateSecondaryPDPContext:
       
    56 		aFsm.ChangeStateToCreatingSecondary();
       
    57 
       
    58 		aFsm.iContextType = SpudMan::ESecondary;
       
    59 
       
    60 		EtelDriverInput (aFsm, EtelDriver::ECreate2ryPdpContext);
       
    61 	
       
    62 		return KErrNone;
       
    63 		
       
    64 		
       
    65 	case SpudMan::ECreateMbmsPDPContext:
       
    66 		aFsm.ChangeStateToCreatingMbms();
       
    67 		aFsm.iContextType = SpudMan::EMbms;
       
    68 		EtelDriverInput (aFsm, EtelDriver::ECreateMbmsPdpContext);
       
    69 		return KErrNone;
       
    70 		
       
    71 	// these stop the default actions which aren't of value in the Initialised state, although we 
       
    72 	// do not expect to see these here.
       
    73 	case PdpFsm::EContextDeleted:
       
    74 		return KErrNone;
       
    75 	case PdpFsm::EContextStatusChangeNetwork:
       
    76 		if (aFsm.iContextStatus == RPacketContext::EStatusDeleted)
       
    77 		{
       
    78 			return KErrNone;
       
    79 		}
       
    80 		break;
       
    81 	}
       
    82 
       
    83 	// default error handling
       
    84 	return TPdpState::Input(aFsm, aOperation, aErrorCode);
       
    85 
       
    86 }
       
    87 
       
    88