|
1 /** |
|
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 |
|
24 #if (!defined __WAPPROT_SUITE_STEP_BASE__) |
|
25 #define __WAPPROT_SUITE_STEP_BASE__ |
|
26 #include <test/testexecutestepbase.h> |
|
27 #include <connect/sbeclient.h> |
|
28 |
|
29 #include <es_sock.h> |
|
30 #include <es_wsms.h> |
|
31 #include <smsuaddr.h> |
|
32 #include <gsmumsg.h> |
|
33 #include <gsmubuf.h> |
|
34 |
|
35 #include <c32comm.h> |
|
36 #include <etel.h> |
|
37 #include <e32property.h> |
|
38 #include <simtsy.h> |
|
39 #include <smsuaddr.h> |
|
40 #include "WapProtSuiteDefs.h" |
|
41 #include "wap_sock.h" |
|
42 #include "smsustrm.h" |
|
43 |
|
44 #if defined (__WINS__) |
|
45 #define PDD_NAME _L("ECDRV") |
|
46 #define PDD_NAME2 _L("ECDRV") |
|
47 #define LDD_NAME _L("ECOMM") |
|
48 #else |
|
49 #define PDD_NAME _L("EUART1") |
|
50 #define LDD_NAME _L("ECOMM") |
|
51 #endif |
|
52 |
|
53 using namespace conn; |
|
54 |
|
55 |
|
56 // Location and name of the RSC file. |
|
57 _LIT(KSMSUResourceDir, "C:\\private\\101f7989\\sms\\"); |
|
58 _LIT(KSMSUResourceFile, "C:\\private\\101f7989\\sms\\smsu.rsc"); |
|
59 // Location of directory for reserving disk space |
|
60 _LIT(KTempDiskSpaceDirName, "C:\\sms\\temp\\"); |
|
61 |
|
62 class CWapProtSuiteStepBase : public CTestStep |
|
63 { |
|
64 public: |
|
65 virtual TVerdict doTestStepPreambleL(); |
|
66 virtual TVerdict doTestStepPostambleL(); |
|
67 |
|
68 |
|
69 |
|
70 //Utitilies |
|
71 void WaitForRecvL(RSocket& aSocket); |
|
72 CSmsMessage* RecvSmsL(RSocket& aSocket, TInt aIoctl = KIoctlReadMessageSucceeded); |
|
73 TUint64 SetHighLowLimitsAndDiskSpaceLevelL(TUint aHighDrop, TUint aLowDrop, TUint aFreeDrop, TUint64 aMax=0x7fffffff); |
|
74 void SetFreeDiskSpaceFromDropLevelL(TUint aFreeDrop); |
|
75 void SetLowHighLimitsInSmsuRscL(TInt64 aLowLimit, TInt64 aHighLimit); |
|
76 void SetFreeDiskSpaceL(TInt64 aNewFreeValue); |
|
77 void ReleaseDiskSpaceL(); |
|
78 void ReadWapPortSettingsL(TWapAddr &aWapAddr); |
|
79 void SetTestNumberL(); |
|
80 void SetWapAddrL(); |
|
81 void SetCodingSchemeL(); |
|
82 void SetMessageTypeL(); |
|
83 |
|
84 //Socket for receiving status reports |
|
85 void SetupStatusReportSocketL(); |
|
86 |
|
87 private: |
|
88 void CheckSmsMessageL(CSmsMessage& aSmsmessagebuf, TPtrC8& aScnumber); |
|
89 |
|
90 protected: |
|
91 void WaitForInitializeL(); |
|
92 void InternaliseSmsDataAndCheckL(TDes8& aBuffer , TPtrC8& aScnumber); |
|
93 TInt GetMessageParameterLengthL(RSocket& aSock); |
|
94 void GetMessageParameterL(RSocket& aSock, TPtr8& aParameterStorePtr); |
|
95 void OpenSocketLC(RSocketServ& aSocketServer, RSocket& aSocket, TUint aAddrFamily = KWAPSMSAddrFamily, TUint aProtocol =KWAPSMSDatagramProtocol); |
|
96 void OpenSocketL(RSocketServ& aSocketServer, RSocket& aSocket, TUint aAddrFamily = KWAPSMSAddrFamily, TUint aProtocol =KWAPSMSDatagramProtocol); |
|
97 |
|
98 protected: |
|
99 CActiveScheduler* iScheduler; |
|
100 CSBEClient* iSecureBackupEngine; |
|
101 RSocketServ iSocketServer; |
|
102 RSocket iSocket; |
|
103 RSocket iStatusReportSocket; |
|
104 TWapAddr iWapAddr; |
|
105 TWapSmsDataCodingScheme iCodingScheme; |
|
106 TSmsAddr iSmsAddr; |
|
107 }; |
|
108 |
|
109 #endif |