telephonyprotocols/umtsgprsscpr/spudfsm/src/tpdpstateopen.cpp
author hgs
Thu, 29 Jul 2010 12:12:57 +0100
changeset 56 ab72d5c1d770
parent 44 8b72faa1200f
permissions -rw-r--r--
201029_05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     2
// All rights reserved.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     7
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     8
// Initial Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    10
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    11
// Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    12
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    13
// Description:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    14
// Open state
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    15
// 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    16
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    17
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    18
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    19
 @file 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    20
 @internalComponent
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    21
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    22
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    23
#include <etelpckt.h>
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    24
#include <networking/umtsnifcontrolif.h>
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    25
#include "tpdpstates.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    26
#include "spudfsmdebuglogger.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    27
#include "pdpfsmnmspace.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    28
#include "PDPFSM.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    29
#include "cpdpfsm.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    30
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    31
TInt TPdpStateOpen::Input (CPdpFsm& aFsm, const TInt aOperation, const TInt aErrorCode)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    32
{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    33
	SPUDFSMVERBOSE_FNLOG("TPdpStateOpen::Input()");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    34
	SPUDFSMVERBOSE_LOG2(_L("aOperation : %S(%d)"), LogOperation(aFsm, aOperation), aOperation);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    35
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    36
	switch (aOperation)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    37
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    38
	case PdpFsm::EQoSProfileChangeNetwork:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    39
//		//RPacketQoS::TQoSR99_R4Negotiated
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    40
		SpudManNotify (aFsm, KContextParametersChangeEvent, KErrNone);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    41
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    42
	case PdpFsm::EConfigGPRSChangeNetwork:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    43
//		//RPacketContext::TContextConfigGPRS
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    44
		SpudManNotify (aFsm, KContextParametersChangeEvent, KErrNone);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    45
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    46
	case PdpFsm::EContextStatusChangeNetwork:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    47
		if (aFsm.iContextStatus == RPacketContext::EStatusSuspended)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    48
    		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    49
			aFsm.ChangeStateToSuspended();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    50
			SpudManNotify(aFsm, KContextBlockedEvent, KErrNone); 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    51
    		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    52
		else if (aFsm.iContextStatus == RPacketContext::EStatusDeleted)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    53
    		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    54
			aFsm.ChangeStateToClosing();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    55
			EtelDriverInput(aFsm, EtelDriver::EContextDelete);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    56
    		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    57
		else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    58
    		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    59
			// no change in state - the upper layer must change the state if it needs to
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    60
			SpudManNotify (aFsm, KContextParametersChangeEvent, aErrorCode);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    61
    		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    62
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    63
	case SpudMan::EContextDelete:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    64
		aFsm.ChangeStateToClosing();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    65
		EtelDriverInput(aFsm, EtelDriver::EContextDelete);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    66
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    67
	case SpudMan::EContextQoSSet:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    68
		aFsm.ChangeStateToChangingQoS();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    69
		EtelDriverInput(aFsm, EtelDriver::ESetQoS);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    70
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    71
	case SpudMan::EContextModifyActive:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    72
		aFsm.ChangeStateToModifingActive();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    73
		EtelDriverInput(aFsm, EtelDriver::EModifyActive);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    74
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    75
	case SpudMan::EContextTFTModify:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    76
		aFsm.ChangeStateToChangingTFT();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    77
		EtelDriverInput(aFsm, EtelDriver::EChangeTft);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    78
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    79
	case SpudMan::ESuspend: // think this is superfluous - DAN will see at review :)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    80
		aFsm.ChangeStateToSuspended();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    81
		SpudManNotify(aFsm, KContextBlockedEvent, KErrNone);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    82
		return KErrNone;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    83
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    84
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    85
	// default error handling
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    86
	return TPdpState::Input(aFsm, aOperation, aErrorCode);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    87
}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    88
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    89