|
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 |
|
22 #ifndef __ATBASE_H |
|
23 #define __ATBASE_H |
|
24 |
|
25 #include "Te_LoopBackSCHAT.H" |
|
26 #include "Te_LoopBackATSTD.H" |
|
27 |
|
28 // Event sources which can be reported to the event signallers. |
|
29 enum TEventSource |
|
30 { |
|
31 EReadCompletion, //< A Read Has Completed |
|
32 EWriteCompletion, //< A Write Has Completed |
|
33 ETimeOutCompletion, //< A Timeout has occurred. |
|
34 ERestartSignal //< A Restart Signal has been received |
|
35 }; |
|
36 |
|
37 const TUint KTxBufferSize=400; |
|
38 const TUint KRxBufferSize=400; |
|
39 |
|
40 /** |
|
41 * This class is used to help manage data from the modem. Though a linked list of objects of |
|
42 * this class contained in the CATBase definition, this class is apparently unused in the |
|
43 * regression test harness. There is never a new called to create one of these objects in |
|
44 * code that is executed by the test harness. |
|
45 */ |
|
46 class CATParamListEntry : public CBase |
|
47 { |
|
48 public: |
|
49 CATParamListEntry(const TPtrC8& aPtr); |
|
50 ~CATParamListEntry(); |
|
51 void Deque(); |
|
52 public: |
|
53 TPtrC8 iResultPtr; //< Ptr into received buffer (not used in regression test harness) |
|
54 private: |
|
55 TDblQueLink iLink; //< Doubly linked list (apparently not used in regression test harness) |
|
56 friend class CATBase; |
|
57 }; |
|
58 |
|
59 class CATIO; |
|
60 class CCommChatString; |
|
61 /** |
|
62 * This class inherits from CBase and is the super-class of CATScriptEng (and thus all tests). |
|
63 * This is the lowest level Regression Test Harness class for emulator side functions. |
|
64 */ |
|
65 class CATBase : public CBase |
|
66 { |
|
67 public: |
|
68 void GenericEventSignal(TEventSource aEventSource, TInt aStatus); |
|
69 protected: |
|
70 static CATBase* NewL(); |
|
71 CATBase(); |
|
72 void ConstructL(); |
|
73 ~CATBase(); |
|
74 |
|
75 // Called by the Generic Event Signaller when no error has been detected to return event to |
|
76 // the inheriting class. |
|
77 virtual void EventSignal(TEventSource aEventSource)=0; |
|
78 |
|
79 // Called by the Generic Event Signaller when an error has been detected to return event to |
|
80 // the inheriting class. Complete methods typically shut down the Regression Test Harness. |
|
81 virtual void Complete(TInt aError)=0; |
|
82 void StandardWriteCompletionHandler(TEventSource aSource,TInt aLengthOfPause); |
|
83 void Write(const TPtrC8& aCommand,TInt aTimeOut = 5); |
|
84 void Write(const TPtrC8& aCommand,TInt aTimeOut,TInt aValue); |
|
85 void WriteExpectingResults(const TPtrC8& aCommand,TInt aTimeOut); |
|
86 void AddStdExpectStrings(); |
|
87 void ValidateExpectStringL(); |
|
88 void RemoveStdExpectStrings(); |
|
89 void ParseBufferLC(); |
|
90 protected: |
|
91 CCommChatString* iOKExpectString; //< Ptr to standard "OK" chat string, not currently initialized. |
|
92 CCommChatString* iErrorExpectString; //< Ptr to stander "ERROR" chat string, not currently initialized. |
|
93 CATIO* iIo; //< Ptr to CATIO object, new'ed in the ConstructL method. |
|
94 protected: |
|
95 TBuf8<KTxBufferSize> iTxBuffer; //< Used to write commands back to tsy from the scripts. |
|
96 TDblQue<CATParamListEntry> iRxResults; //< Doubly Linked List storing rx results (apparently not used). |
|
97 TPtrC8 iBuffer; //< Not currently used by regression test harness. |
|
98 TInputBufferMark iBufferMarker; //< Used as buffer marker in receive (from gsmtsy) buffer. |
|
99 }; |
|
100 |
|
101 #endif |