// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
/**
@file
@internalComponent
*/
#ifndef __CSCA_H__
#define __CSCA_H__
#include <e32test.h>
#include <etelmm.h>
#include <mmlist.h>
#include <mmretrieve.h>
#include "Te_LoopbackTestStepBase.h"
#include "Te_LoopBackScriptEng.h"
#include "Te_LoopbackCWrapGetSmspList.h"
// Constants
_LIT(KSCAddressA,"447785016005");
// Scripts
const struct TScript KScaSimpleScript[]= {
{ ERxString, (TText8*)"AT\r", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ EIfRxStringJmp, (TText8*)"AT\r", 1, 0 },
{ ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent },
{ ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
//
// The initialisation string - we don't care what it is
//
{ ERxString, (TText8*)"AT", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"ATS7?", 0, ERxEvent },
{ ETxString, (TText8*)"050\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"ATS0=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMI", 0, ERxEvent },
{ ETxString, (TText8*)"ERICSSON\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMM", 0, ERxEvent },
{ ETxString, (TText8*)"1100801\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMR", 0, ERxEvent },
{ ETxString, (TText8*)"9808261341\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGSN", 0, ERxEvent },
{ ETxString, (TText8*)"520002512954000\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CIMI", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CMGF: (0)\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPMS: \"SM\",0,15,\"SM\",0,15\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG=1", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG?", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+COPS?", 0, ERxEvent },
{ ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CBC", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CSQ", 0, ERxEvent },
{ ETxString, (TText8*)"+CSQ: 15,99\r",0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGATT", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent },
{ 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 },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT*ECAM=1", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
// Change the default SC Address
{ ERxString, (TText8*)"AT+CSCA=\"441632960000\"", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
// Attempt to read current default SC Address
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
// Done
{ EWait, NULL, 5, ETimeOutEvent},
{ EComplete, NULL, 0, 0 }
};
const struct TScript KSca8210StyleScript[]= {
{ ERxString, (TText8*)"AT\r", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ EIfRxStringJmp, (TText8*)"AT\r", 1, 0 },
{ ERxString, (TText8*)"AT+FCLASS=?", 0, ERxEvent },
{ ETxString, (TText8*)"0,1,2\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
//
// The initialisation string - we don't care what it is
//
{ ERxString, (TText8*)"AT", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CNMI=,0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"ATS7?", 0, ERxEvent },
{ ETxString, (TText8*)"060\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"ATS0=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMI", 0, ERxEvent },
{ ETxString, (TText8*)"Nokia Mobile Phones\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMM", 0, ERxEvent },
{ ETxString, (TText8*)"Nokia 8210\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGMR", 0, ERxEvent },
{ ETxString, (TText8*)"SW5.11\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGSN", 0, ERxEvent },
{ ETxString, (TText8*)"448902103708860\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CIMI", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CMGF=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CMGF: (0,1)\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CMGF=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPMS=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPMS: (\"ME\",\"SM\"),(\"ME\",\"SM\"),(\"SM\")\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPMS?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPMS: \"SM\",14,15,\"SM\",14,15,\"SM\",14,15\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CPBS=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CPBS: (\"ME\",\"SM\",\"FD\",\"ON\",\"EN\",\"MC\",\"DC\",\"RC\")\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG=0", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG=2", 0, ERxEvent },
{ ETxString, (TText8*)"OK\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CREG?", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CRC=1", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+COPS?", 0, ERxEvent },
{ ETxString, (TText8*)"+COPS: 0,0,\"UK VODAFONE\"\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CBC", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CSQ", 0, ERxEvent },
{ ETxString, (TText8*)"+CSQ: 15,99\r",0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGCLASS", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGQREQ", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGATT", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CNMI=?", 0, ERxEvent },
{ ETxString, (TText8*)"+CNMI: (0-2),(0,1,3),(0),(0),(0,1)\r", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CBST=?", 0, ERxEvent },
{ 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 },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CGREG=1", 0, ERxEvent },
{ ETxString, (TText8*)"ERROR\r", 0, ETxEvent|EFailIfTimeOut },
{ ERxString, (TText8*)"AT+CSCA=\"441632960000\"", 0, ERxEvent },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
// Attempt to read current default SC Address
{ ERxString, (TText8*)"AT+CSCA?", 0, ERxEvent },
{ ETxString, (TText8*)"+CSCA: \"441632960000\",145", 0, ETxEvent|EFailIfTimeOut },
{ ETxStringOK, NULL, 0, ETxEvent|EFailIfTimeOut },
// Done
{ EWait, NULL, 5, ETimeOutEvent},
{ EComplete, NULL, 0, 0 }
};
// Driver class
class CTestDriveSca : public CTestBase
{
public:
static CTestDriveSca* NewL(const TScriptList aScriptListEntry);
~CTestDriveSca();
virtual TInt RunTestL();
protected:
virtual TInt DriveETelApiL();
private:
CTestDriveSca(const TScriptList aScriptListEntry);
void DisplayMobileAddr(RMobilePhone::TMobileAddress aMobileAddr);
void DisplaySmspEntry(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry);
void GetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry,RMobileSmsMessaging& aSms);
void SetSmspListL(RMobileSmsMessaging::TMobileSmspEntryV1& aSmspEntry,RMobileSmsMessaging& aSms);
TScriptList iScriptListEntry;
};
#endif