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