telephonyserverplugins/multimodetsy/test/Te_LoopBack/Te_LoopBackcoddinits.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-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 // Test the TSY with a series of slightly strange modem initialisation responses
       
    15 // This file implements various odd initialization sequences and modem responses 
       
    16 // to test the TSY.
       
    17 // See CDataCall.cpp for fully documented test scenario.
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file
       
    23 */
       
    24 
       
    25 
       
    26 #include <e32test.h>
       
    27 #include <mmretrieve.h>
       
    28 #include <etelmm.h>
       
    29 #include "Te_LoopBackcoddinits.h"
       
    30 #include "../../hayes/TSYCONFG.H" // for KInternetAccessPoint
       
    31 
       
    32 //
       
    33 // Test-side class
       
    34 // With the assistance of the base class, this class must start the emulator
       
    35 // and drive the ETel API.
       
    36 //
       
    37 CTestDriveOddInit* CTestDriveOddInit::NewL(const TScriptList aScriptListEntry)
       
    38 	{
       
    39 	CTestDriveOddInit* aA = new(ELeave) CTestDriveOddInit(aScriptListEntry);
       
    40 	CleanupStack::PushL(aA);
       
    41 	aA->ConstructL();
       
    42 	CleanupStack::Pop();
       
    43 	return (aA);
       
    44 	}
       
    45 
       
    46 CTestDriveOddInit::CTestDriveOddInit(const TScriptList aScriptListEntry) :
       
    47 	iScriptListEntry(aScriptListEntry)
       
    48 	{}
       
    49 
       
    50 CTestDriveOddInit::~CTestDriveOddInit()
       
    51 	{}
       
    52 
       
    53 TInt CTestDriveOddInit::RunTestL()
       
    54 	{
       
    55 	iCurrentScript = iScriptListEntry;
       
    56 	return StartEmulatorL();
       
    57 	}
       
    58 
       
    59 TInt CTestDriveOddInit::DriveETelApiL()
       
    60 //
       
    61 // This function contains the real meat of the Client-side test code
       
    62 //
       
    63 	{
       
    64 	TRequestStatus reqStatus;
       
    65 	RMobilePhone::TMMTableSettings tableSettings;
       
    66 	tableSettings.iLocId=KInternetAccessPoint;
       
    67 	RMobilePhone::TMMTableSettingsPckg tableSettingsPckg(tableSettings);
       
    68 	iPhone.InitialiseMM(reqStatus , tableSettingsPckg); 	
       
    69 	User::WaitForRequest(reqStatus);
       
    70 	TESTL(reqStatus==KErrNone);
       
    71 
       
    72 	return (KErrNone);
       
    73 	}
       
    74 
       
    75 //
       
    76 // Emulator-side class
       
    77 // With the assistance of the base class, this class must run the designated script
       
    78 //
       
    79 CTestOddInit* CTestOddInit::NewL(const TScript* aScript)
       
    80 	{
       
    81 	CTestOddInit* aA = new (ELeave) CTestOddInit(aScript);
       
    82 	CleanupStack::PushL(aA);
       
    83 	aA->ConstructL();
       
    84 	CleanupStack::Pop();
       
    85 	return (aA);
       
    86 	}
       
    87 
       
    88 CTestOddInit::CTestOddInit(const TScript* aScript) :
       
    89 	iScript(aScript)
       
    90 	{}
       
    91 
       
    92 void CTestOddInit::ConstructL()
       
    93 	{
       
    94 	CATScriptEng::ConstructL();
       
    95 	}
       
    96 
       
    97 CTestOddInit::~CTestOddInit()
       
    98 	{}
       
    99 
       
   100 TInt CTestOddInit::Start()
       
   101 	{
       
   102 	StartScript(iScript);
       
   103 	return (KErrNone);
       
   104 	}
       
   105 
       
   106 void CTestOddInit::SpecificAlgorithmL(TInt /* aParam */)
       
   107 	{
       
   108 	}
       
   109 
       
   110 void CTestOddInit::Complete(TInt aError)
       
   111 	{
       
   112 	iReturnValue=aError;
       
   113 	CActiveScheduler::Stop();
       
   114 	}