telephonyprotocols/umtsgprsscpr/spudtel/src/cspudcontextelem.cpp
author hgs
Mon, 28 Jun 2010 17:02:18 +0100
changeset 45 28dbf5a297f4
parent 44 8b72faa1200f
permissions -rw-r--r--
201024_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
// spud context element
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 "cspudcontextelem.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    24
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    25
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    26
@param aId - pdp context id
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    27
@param aFactory - reference to etel driver factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    28
@param aPdpFsmInterface reference to pdp fsm interface
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    29
@return new spud context element
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    30
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    31
CSpudContextElem* CSpudContextElem::NewL(TContextId aId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    32
									CEtelDriverFactory& aFactory, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    33
									CPdpFsmInterface& aPdpFsmInterface)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    34
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    35
	CSpudContextElem *me = new(ELeave) CSpudContextElem();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    36
	CleanupStack::PushL(me);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    37
	me->ConstructL(aId, aFactory, aPdpFsmInterface);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    38
	CleanupStack::Pop(me);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    39
	return me;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    40
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    41
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    42
/** 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    43
@param aId - pdp context id
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    44
@param aFactory - reference to etel driver factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    45
@param aPdpFsmInterface reference to pdp fsm interface
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    46
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    47
void CSpudContextElem::ConstructL(TContextId aId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    48
								CEtelDriverFactory& aFactory, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    49
								CPdpFsmInterface& aPdpFsmInterface)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    50
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    51
	iContext = new(ELeave) CEtelDriverContext(aId, aFactory);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    52
	iPdpStatusChangeNotifier = new(ELeave) CPdpStatusChangeNotifier(aId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    53
													iContext->PacketContext(), 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    54
													aPdpFsmInterface);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    55
	iQoSChangeNotifier = new(ELeave) CQoSChangeNotifier(aId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    56
													iContext->PacketQoS(), 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    57
													aPdpFsmInterface);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    58
	iPdpConfigChangeNotifier = new(ELeave) CPdpConfigChangeNotifier(aId, 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    59
													iContext->PacketContext(), 
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    60
													aPdpFsmInterface);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    61
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    62
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    63
CSpudContextElem::~CSpudContextElem()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    64
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    65
	delete iPdpStatusChangeNotifier;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    66
	delete iQoSChangeNotifier;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    67
	delete iPdpConfigChangeNotifier;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    68
	delete iContext;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    69
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    70
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    71
/** starts all notifiers */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    72
void CSpudContextElem::Start()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    73
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    74
	iPdpStatusChangeNotifier->Start();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    75
	iQoSChangeNotifier->Start();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    76
	iPdpConfigChangeNotifier->Start();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    77
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    78
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    79
/** cancels all notifiers */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    80
void CSpudContextElem::Cancel()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    81
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    82
	iPdpStatusChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    83
	iQoSChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    84
	iPdpConfigChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    85
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    86
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    87
/** Get LastErrorCause
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    88
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    89
@param aLastErrorCause - LastErrorCause to get
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    90
*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    91
void CSpudContextElem::GetLastErrorCause(TInt& aLastErrorCause)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    92
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    93
	RPacketContext &aPacketContext = iContext->PacketContext();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    94
	aPacketContext.GetLastErrorCause(aLastErrorCause);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    95
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    96
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    97
void CSpudContextElem::PdpStatusChangeNotifierCancel()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    98
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    99
	iPdpStatusChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   100
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   101
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   102
void CSpudContextElem::QoSChangeNotifierCancel()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   103
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   104
	iQoSChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   105
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   106
void CSpudContextElem::PdpConfigChangeNotifierCancel()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   107
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   108
	iPdpConfigChangeNotifier->Cancel();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   109
	}