telephonyprotocols/pdplayer/umts/spudtel/src/cqoschangenotifier.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 // QoS change notifier implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "cqoschangenotifier.h"
       
    24 #include "spudteldebuglogger.h"
       
    25 #include <pcktcs.h>
       
    26 
       
    27 
       
    28 /** c'tor 
       
    29 
       
    30 @param aId - pdp context id
       
    31 @param aPacketQoS - etel packet QoS 
       
    32 @param aPdpFsmInterface - pdp fsm interface
       
    33 */
       
    34 CQoSChangeNotifier::CQoSChangeNotifier(TContextId aId, 
       
    35 									RPacketQoS& aPacketQoS, 
       
    36 									CPdpFsmInterface& aPdpFsmInterface)
       
    37 : CEtelDriverNotifier(aPdpFsmInterface),
       
    38   iId(aId),
       
    39   iPacketQoS(aPacketQoS),
       
    40   iProfilePckg(iProfileBuffer)
       
    41   
       
    42 	{
       
    43 	SPUDTEL_FNLOG("CQoSChangeNotifier::CQoSChangeNotifier()");
       
    44 	}
       
    45 	
       
    46 CQoSChangeNotifier::~CQoSChangeNotifier()
       
    47 	{
       
    48 	SPUDTEL_FNLOG("CQoSChangeNotifier::~CQoSChangeNotifier()");
       
    49 	Cancel();
       
    50 	}
       
    51 	
       
    52 /** starts notification */
       
    53 void CQoSChangeNotifier::Start()
       
    54 	{
       
    55 	SPUDTEL_FNLOG("CQoSChangeNotifier::Start()");
       
    56 	if (!IsActive())
       
    57 		{ 
       
    58 		iPacketQoS.NotifyProfileChanged(iStatus, iProfilePckg); 
       
    59 		SetActive();
       
    60 		SPUDTEL_FNLOG("CQoSChangeNotifier::Start(), iPacketQoS.NotifyProfileChanged()");
       
    61 		}
       
    62 	}
       
    63 	
       
    64 /** stops notification */	
       
    65 void CQoSChangeNotifier::DoCancel()
       
    66 	{
       
    67 	if (IsActive())
       
    68 		{ 
       
    69 		SPUDTELVERBOSE_INFO_LOG(
       
    70 			_L("CQoSChangeNotifier::DoCancel EPacketQoSNotifyProfileChanged"));
       
    71 		iPacketQoS.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
       
    72 		}
       
    73 	}
       
    74 
       
    75 /** notifies pdp fsm 
       
    76 
       
    77 @param aStatus - request status
       
    78 */
       
    79 void CQoSChangeNotifier::Notify(const TRequestStatus& aStatus)
       
    80 	{
       
    81 	if(aStatus == KErrNone)
       
    82 		{
       
    83 		SPUDTELVERBOSE_INFO_LOG(_L("FSM set QoSProfile"));
       
    84 
       
    85 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
    86         iPdpFsmInterface.Set(iId, iProfileBuffer.NegotiatedQoSR5());
       
    87 
       
    88 #else
       
    89 // !SYMBIAN_NETWORKING_UMTSR5
       
    90 
       
    91         iPdpFsmInterface.Set(iId, iProfileBuffer.NegotiatedQoSR99_R4());
       
    92 #endif
       
    93 // SYMBIAN_NETWORKING_UMTSR5
       
    94 
       
    95 		SPUDTELVERBOSE_INFO_LOG(_L("FSM input EQoSProfileChangeNetwork"));
       
    96 		iPdpFsmInterface.Input(iId, PdpFsm::EQoSProfileChangeNetwork);
       
    97 		}
       
    98 	else
       
    99 		{ 
       
   100 		SPUDTEL_ERROR_LOG(_L("CQoSChangeNotifier::Notify(), error: %d"), aStatus.Int());
       
   101 		ASSERT(aStatus == KErrCancel); 
       
   102 		}
       
   103 	}
       
   104 
       
   105 
       
   106