telephonyserverplugins/multimodetsy/test/Te_LoopBack/Te_LoopBackCCalls.h
changeset 0 3553901f7fa8
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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent 
       
    19 */
       
    20 
       
    21 #ifndef __CCALLS_H__
       
    22 #define __CCALLS_H__
       
    23 
       
    24 #include "Te_LoopbackTestStepBase.h"
       
    25 #include "Te_LoopBackScriptEng.h"
       
    26 
       
    27 //
       
    28 // First a Script where everything is in order
       
    29 //
       
    30 const struct TScript KAllCallsScript[]= {
       
    31 	{	ERxString,	(TText8*)"AT\r",		0, ERxEvent	},
       
    32 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    33 
       
    34 	{	EIfRxStringJmp, (TText8*)"AT\r",	1, 0	},
       
    35 
       
    36 	{	ERxString, (TText8*)"AT+FCLASS=?",	0, ERxEvent	},
       
    37 	{	ETxString, (TText8*)"0,1,2\r",		0, ETxEvent|EFailIfTimeOut	},
       
    38 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    39 
       
    40 //
       
    41 // The initialisation string - we don't care what it is
       
    42 //
       
    43 	{	ERxString, (TText8*)"AT",			0, ERxEvent	},
       
    44 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    45 
       
    46 	{	ERxString, (TText8*)"AT+CNMI=,0",   0, ERxEvent	},
       
    47 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    48 
       
    49 	{	ERxString, (TText8*)"ATS7?",		0, ERxEvent	},
       
    50 	{	ETxString, (TText8*)"050\r",		0, ETxEvent|EFailIfTimeOut	},
       
    51 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    52 
       
    53 	{	ERxString, (TText8*)"ATS0=0",		0, ERxEvent	},
       
    54 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    55 
       
    56 	{	ERxString, (TText8*)"AT+CGMI",	0, ERxEvent	},
       
    57 	{	ETxString, (TText8*)"ERICSSON\r",	0, ETxEvent|EFailIfTimeOut	},
       
    58 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    59 
       
    60 	{	ERxString, (TText8*)"AT+CGMM",	0, ERxEvent	},
       
    61 	{	ETxString, (TText8*)"1100801\r",	0, ETxEvent|EFailIfTimeOut	},
       
    62 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    63 
       
    64 	{	ERxString, (TText8*)"AT+CGMR",	0, ERxEvent	},
       
    65 	{	ETxString, (TText8*)"9808261341\r",	0, ETxEvent|EFailIfTimeOut	},
       
    66 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    67 
       
    68 	{	ERxString, (TText8*)"AT+CGSN",	0, ERxEvent	},
       
    69 	{	ETxString, (TText8*)"520002512954000\r",	0, ETxEvent|EFailIfTimeOut	},
       
    70 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    71 
       
    72 	{	ERxString, (TText8*)"AT+CIMI",	0, ERxEvent	},
       
    73 	{	ETxString, (TText8*)"ERROR\r",	0, ETxEvent|EFailIfTimeOut	},
       
    74 
       
    75 	{	ERxString, (TText8*)"AT+CMGF=?",	0, ERxEvent	},
       
    76 	{	ETxString, (TText8*)"+CMGF: (0)\r",	0, ETxEvent|EFailIfTimeOut	},
       
    77 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    78 
       
    79 	{	ERxString, (TText8*)"AT+CMGF=0",	0, ERxEvent	},
       
    80 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    81 
       
    82 	{	ERxString, (TText8*)"AT+CPMS=?",	0, ERxEvent	},
       
    83 	{	ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\")\r",	0, ETxEvent|EFailIfTimeOut	},
       
    84 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    85 
       
    86 	{	ERxString, (TText8*)"AT+CPMS?",	0, ERxEvent	},
       
    87 	{	ETxString, (TText8*)"+CPMS: \"SM\",0,15,\"SM\",0,15\r",	0, ETxEvent|EFailIfTimeOut	},
       
    88 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    89 
       
    90 	{	ERxString, (TText8*)"AT+CPBS=?",	0, ERxEvent	},
       
    91 	{	ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r",	0, ETxEvent|EFailIfTimeOut	},
       
    92 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    93 
       
    94 	{	ERxString, (TText8*)"AT+CREG=0",	0, ERxEvent	},
       
    95 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
    96 
       
    97 	{	ERxString, (TText8*)"AT+CREG=2",	0, ERxEvent	},
       
    98 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
    99 
       
   100 	{	ERxString, (TText8*)"AT+CREG=1",	0, ERxEvent	},
       
   101 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   102 
       
   103 	{	ERxString, (TText8*)"AT+CREG?",	0, ERxEvent	},
       
   104 	{	ETxString, (TText8*)"ERROR\r",	0, ETxEvent|EFailIfTimeOut	},
       
   105 	
       
   106 	{	ERxString, (TText8*)"AT+CRC=1",		0, ERxEvent	},
       
   107 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   108 
       
   109 	{	ERxString, (TText8*)"AT+COPS?",	0, ERxEvent	},
       
   110 	{	ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r",	0, ETxEvent|EFailIfTimeOut	},
       
   111 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   112 
       
   113 	{	ERxString, (TText8*)"AT+CBC",	0, ERxEvent	},
       
   114 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   115 
       
   116 	{	ERxString, (TText8*)"AT+CSQ",	0, ERxEvent	},
       
   117 	{	ETxString, (TText8*)"+CSQ: 31,99\r",		0, ETxEvent|EFailIfTimeOut	},
       
   118 	{	ETxStringOK, NULL,				0, ETxEvent|EFailIfTimeOut	},
       
   119 
       
   120 	{	ERxString, (TText8*)"AT+CGCLASS",	0, ERxEvent	},
       
   121 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   122 
       
   123 	{	ERxString, (TText8*)"AT+CGCLASS",	0, ERxEvent	},
       
   124 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   125 
       
   126 	{	ERxString, (TText8*)"AT+CGQREQ",	0, ERxEvent	},
       
   127 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   128 
       
   129 	{	ERxString, (TText8*)"AT+CGATT",	0, ERxEvent	},
       
   130 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   131 
       
   132 	{	ERxString, (TText8*)"AT+CNMI=?",	0, ERxEvent	},
       
   133 	{	ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r",	0, ETxEvent|EFailIfTimeOut	},
       
   134 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   135 
       
   136 	{	ERxString, (TText8*)"AT+CBST=?",	0, ERxEvent	},
       
   137 	{	ETxString, (TText8*)"+CBST: (0-7,12,14-16,34,36,38,39,43,47-51,65,66,68,70,71,75,79-81),(0,2),(1)\r",	0, ETxEvent|EFailIfTimeOut	},
       
   138 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   139 
       
   140 	{	ERxString, (TText8*)"AT+CSCA?",		0, ERxEvent	},
       
   141 	{	ETxString, (TText8*)"+CSCA: \"441632960000\",145",	0, ETxEvent|EFailIfTimeOut	},
       
   142 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   143 
       
   144 	{	ERxString, (TText8*)"AT+CGREG=1",	0, ERxEvent	},
       
   145 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   146 
       
   147 	{	ERxString, (TText8*)"AT*ECAM=1",	0, ERxEvent	},
       
   148 	{	ETxString, (TText8*)"ERROR\r",		0, ETxEvent|EFailIfTimeOut	},
       
   149 
       
   150 //	Start the Voice Call tests. Incoming call indication
       
   151 	{	ETxString, (TText8*)"\r\n+CRING: VOICE\r\n",	0, ETxEvent|EFailIfTimeOut	},
       
   152 
       
   153 	{	ERxString, (TText8*)"AT",			0, ERxEvent	},
       
   154 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   155 
       
   156 //	Answer incoming call
       
   157 	{	ERxString, (TText8*)"ATA",			0, ERxEvent	},
       
   158 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   159 
       
   160 	{	ERxString, (TText8*)"AT+",			0, ERxEvent	},
       
   161 	{	ETxString, (TText8*)"ERROR",		0, ETxEvent|EFailIfTimeOut	},
       
   162 
       
   163 //	Wait a short while then Hang up the call
       
   164 	{	EWait,		NULL,					4, ETimeOutEvent},
       
   165 	{	ERxString, (TText8*)"ATH",			0, ERxEvent	},
       
   166 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   167 
       
   168 //	Start the Data Call tests. Incoming call indication. Wait a short while before 
       
   169 //	starting the test, otherwise the incoming call indication will be received before
       
   170 //	the data test has started and the data line will not yet have been created.
       
   171 	{	EWait,		NULL,					20, ETimeOutEvent},
       
   172 	{	ETxString, (TText8*)"\r\n+CRING: REL ASYNC\r\n",	0, ETxEvent|EFailIfTimeOut	},
       
   173 	{	ERxString, (TText8*)"AT+FCLASS=0",	0, ERxEvent	},
       
   174 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   175 
       
   176 	{	ERxString, (TText8*)"ATM0L0X3S8=0",	0, ERxEvent	},
       
   177 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   178 
       
   179 // This is the Data Init String
       
   180 	{	ERxString, (TText8*)"AT345678901234567890123456789012345678901234567890",	0, ERxEvent	},
       
   181 	{	ETxStringOK, NULL,						0, ETxEvent|EFailIfTimeOut	},
       
   182 	{	ERxString, (TText8*)"AT",			0, ERxEvent	},
       
   183 	{	ETxStringOK, NULL,					0, ETxEvent|EFailIfTimeOut	},
       
   184 
       
   185 //	Answer incoming data call
       
   186 	{	ERxString, (TText8*)"ATA",	0, ERxEvent	},
       
   187 	{	ETxString, (TText8*)"\r\nCONNECT 9600\r\n",	0, ETxEvent|EFailIfTimeOut	},
       
   188 
       
   189 //	Data stream that is being written to the serial port
       
   190 	{	ERxString, (TText8*)"Telephony Test Code\r\n",		0, ERxEvent	},
       
   191 
       
   192 //	The data port has now been loaned and recovered (data transmission has taken place)
       
   193 	{	ERxString, (TText8*)"AT",	0, ERxEvent	},
       
   194 
       
   195 //	The Escape sequence 
       
   196 	{	ERxString, (TText8*)"+++",	0, ERxEvent	},
       
   197 	{	ETxStringOK, NULL,			0, ETxEvent|EFailIfTimeOut	},
       
   198 
       
   199 //	Should now be in on-line Command mode
       
   200 	{	ERxString, (TText8*)"AT",	0, ERxEvent	},
       
   201 	{	ETxStringOK, NULL,			0, ETxEvent|EFailIfTimeOut	},
       
   202 
       
   203 	{	ERxString, (TText8*)"ATO",	0, ERxEvent	},
       
   204 	{	ETxString, (TText8*)"\r\nCONNECT 9600\r\n",	0, ETxEvent|EFailIfTimeOut	},
       
   205 
       
   206 //	Should be in on-line Data mode. Hang up the data call
       
   207 	{	ERxString, (TText8*)"ATH",	0, ERxEvent	},
       
   208 	{	ETxStringOK, NULL,			0, ETxEvent|EFailIfTimeOut	},
       
   209 
       
   210 	{	EWait,		NULL,			2, ETimeOutEvent},
       
   211 	{	EComplete,	 NULL,					0, 0	}
       
   212 	};
       
   213 
       
   214 class CTestDriveAllCalls : public CTestBase
       
   215 	{
       
   216 public:
       
   217 	static CTestDriveAllCalls* NewL(const TScriptList aScriptListEntry);
       
   218 	virtual TInt RunTestL();
       
   219 
       
   220 protected:
       
   221 	virtual TInt DriveETelApiL();
       
   222 
       
   223 private:
       
   224 	CTestDriveAllCalls(const TScriptList aScriptListEntry);
       
   225 	void TestVoiceCallL();
       
   226 	void TestCancelRequestsL();
       
   227 	void TestDataCallL();
       
   228 
       
   229 	TScriptList iScriptListEntry;
       
   230 	};
       
   231 
       
   232 class CTestAllCalls : public CATScriptEng
       
   233 	{
       
   234 public:
       
   235 	static CTestAllCalls* NewL(const TScript* aScript);
       
   236 	virtual void SpecificAlgorithmL(TInt aParam);
       
   237 	virtual void Complete(TInt aError);
       
   238 	virtual TInt Start();
       
   239 
       
   240 private:
       
   241 	CTestAllCalls(const TScript* aScript);
       
   242 	void ConstructL();
       
   243 
       
   244 	const TScript* iScript;
       
   245 	};
       
   246 
       
   247 #endif