telephonyprotocols/umtsgprsscpr/Test/te_spud/src/SpudManInterfaceTest.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 // The implementation of the SpudManInterface for SPUD FSM unit tests
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "InputRequestListener.h"
       
    24 #include <etelpckt.h>
       
    25 
       
    26 
       
    27 TSpudManInterfaceTest::TSpudManInterfaceTest(CInputRequestListener& aListener) : iListener(aListener)
       
    28 	{}
       
    29 
       
    30 /**
       
    31  Signals to the test execute thread that MSpudManInterface::Input has been called
       
    32  */
       
    33 void TSpudManInterfaceTest::Input(TContextId aPdpId, TInt aEvent, TInt aParam)
       
    34 	{
       
    35 	if (aEvent == KPdpFsmShuttingDown)
       
    36 	   {
       
    37 	   // This event requires no notification - In the real SpudMan it would cause SpudMan
       
    38 	   // to close down (NULL) the pointer to the PdpFsmInterface provided by the UmtsGprsSCPR.
       
    39 	   return;
       
    40 	   }
       
    41 	
       
    42 	// The aOperation parameters are broken up into those that are notifications and those that aren't
       
    43 	// Since notifications can happen anytime, separate request status members need to be kept for each one
       
    44 	// Other input requests happen serially, so only one request can be pending at any time
       
    45 	TRequestStatus *status = NULL;
       
    46 	
       
    47     // Here, rather than in the case statement due to rvct compiler warning
       
    48 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
    49     RPacketQoS::TQoSR5Negotiated neg;
       
    50 #else
       
    51     RPacketQoS::TQoSR99_R4Negotiated neg;
       
    52 #endif
       
    53 // SYMBIAN_NETWORKING_UMTSR5
       
    54 
       
    55 	switch (aEvent)
       
    56 		{
       
    57 	case KContextParametersChangeEvent:
       
    58 		iListener.iContextParametersEventData.iPdpId = aPdpId;
       
    59 		iListener.iPdpFsmInterface->Get(aPdpId, neg);
       
    60 		iListener.iContextParametersEventData.iNegotiated = neg;
       
    61 
       
    62 		iListener.iPdpFsmInterface->Get(aPdpId, iListener.iContextParametersEventData.iContextConfig);
       
    63 		status = &iListener.iFsmContextParameterChangeStatus;
       
    64 		break;
       
    65 	case KNetworkStatusEvent:
       
    66 		status = &iListener.iFsmNetworkStatusStatus;
       
    67 		break;
       
    68 	case KContextBlockedEvent:
       
    69 		iListener.iContextBlockedEventPdpId = aPdpId;
       
    70 		status = &iListener.iFsmContextSuspendedStatus;
       
    71 		break;
       
    72 	case KContextUnblockedEvent:
       
    73 		iListener.iContextUnblockedEventPdpId = aPdpId;
       
    74 		status = &iListener.iFsmContextResumedStatus;
       
    75 		break;
       
    76 	default:
       
    77 		iListener.iFsmInputResponseData.iPdpId = aPdpId;
       
    78 		iListener.iFsmInputResponseData.iEvent = aEvent;
       
    79 		iListener.iFsmInputResponseData.iParam = aParam;
       
    80 		status = &iListener.iFsmInputResponseStatus;
       
    81 		break;
       
    82 		}
       
    83 	iListener.iParentThread.RequestComplete(status, KErrNone);	
       
    84 	}
       
    85 
       
    86 void TSpudManInterfaceTest::SetContextTerminationErrorAndStop(TContextId /*aContextId*/, TInt /*aErrorCode*/)
       
    87    {/*Placeholder for unused function*/}