|
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 // AT Command Base Class Header |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalAll |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef __ATCALL_H__ |
|
25 #define __ATCALL_H__ |
|
26 |
|
27 #include <cdblen.h> |
|
28 #include "ATBASE.H" |
|
29 /** |
|
30 @internalTechnology |
|
31 */ |
|
32 const TInt KDTRLowPeriod=500; // milliseconds |
|
33 const TInt KDTRHighSettle=200; |
|
34 /** |
|
35 @internalTechnology |
|
36 */ |
|
37 const TText8* const KBearerResponseStrings[]={ |
|
38 _S8("LAP-M"), |
|
39 _S8("LAPM"), |
|
40 _S8("ALT "), |
|
41 _S8("ALT-CELLULAR"), |
|
42 _S8("V.42bis"), |
|
43 _S8("CLASS 5"), |
|
44 NULL |
|
45 }; |
|
46 /** |
|
47 @internalTechnology |
|
48 */ |
|
49 const TText8* const KBearerSpeedResponseStrings[]={ |
|
50 _S8("57600"), |
|
51 _S8("33600"), |
|
52 _S8("31200"), |
|
53 _S8("19200"), |
|
54 _S8("14400"), |
|
55 _S8("12000"), |
|
56 _S8("9600"), |
|
57 _S8("7200"), |
|
58 _S8("4800"), |
|
59 _S8("2400"), |
|
60 _S8("1200"), |
|
61 _S8("75TX"), |
|
62 _S8("1200TX"), |
|
63 _S8("300"), |
|
64 NULL |
|
65 }; |
|
66 |
|
67 class CATInit; |
|
68 class CATCallAlterCommands : public CATCommands |
|
69 /** |
|
70 @internalTechnology |
|
71 */ |
|
72 { |
|
73 public: |
|
74 void CancelCommand(TTsyReqHandle aTsyReqHandle); |
|
75 protected: |
|
76 CATCallAlterCommands(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
77 void ConstructL(); |
|
78 ~CATCallAlterCommands(); |
|
79 TInt ChangeCallStatus(RMobileCall::TMobileCallStatus aCallStatus); |
|
80 virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams); |
|
81 virtual void Stop(TTsyReqHandle aTsyReqHandle)=0; |
|
82 virtual void CompleteWithIOError(TEventSource aSource,TInt aStatus); |
|
83 virtual void Complete(TInt aError,TEventSource aSource)=0; |
|
84 }; |
|
85 |
|
86 class CATCallConnectCommands : public CATCallAlterCommands |
|
87 /** |
|
88 @internalTechnology |
|
89 */ |
|
90 { |
|
91 public: |
|
92 TBool IsPreConnectInProgress(); |
|
93 protected: |
|
94 CATCallConnectCommands(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
95 ~CATCallConnectCommands(); |
|
96 TInt GetSpeakerControlAndVolumeValues(TDes8& aSpeakerCommand,TDes8& aVolumeCommand); |
|
97 void PreConnectEventSignal(TEventSource aSource); |
|
98 virtual void CompleteWithIOError(TEventSource aSource,TInt aStatus); |
|
99 protected: |
|
100 enum { |
|
101 ENotInProgress, //0 |
|
102 EATDataClassWaitForWriteComplete, //1 |
|
103 EATDataClassReadCompleted, //2 |
|
104 EATSendCallInit, //3 |
|
105 EATCallInitWaitForWriteComplete, //4 |
|
106 EATCallInitCompleted, //5 |
|
107 EATWaitForDataInitWrite, //6 |
|
108 EATWaitForDataInitOK, //7 |
|
109 EWaitForATCheckWrite, //8 |
|
110 EATWaitForATCheckOK, //9 |
|
111 EATInitCompleted, //10 |
|
112 ECancelling //11 |
|
113 } iPreConnectState; |
|
114 |
|
115 enum |
|
116 { |
|
117 ENoneCall, |
|
118 EDataCall, |
|
119 EVoiceCall, |
|
120 EFaxCall |
|
121 } iCallType; |
|
122 |
|
123 CCommChatString* iConnectExpectString; |
|
124 CCommChatString* iNoCarrierExpectString; |
|
125 private: |
|
126 TUint iRetryCounter; |
|
127 }; |
|
128 |
|
129 class CATVoiceCallConnectCommands : public CATCallConnectCommands |
|
130 /** |
|
131 @internalComponent |
|
132 */ |
|
133 { |
|
134 protected: |
|
135 CATVoiceCallConnectCommands(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
136 ~CATVoiceCallConnectCommands(); |
|
137 virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams); |
|
138 void AddCommonExpectStrings(); |
|
139 void RemoveCommonExpectStrings(); |
|
140 virtual void Complete(TInt aError,TEventSource aSource); |
|
141 }; |
|
142 |
|
143 class CATDataCallConnectCommands : public CATCallConnectCommands |
|
144 /** |
|
145 @internalTechnology |
|
146 */ |
|
147 { |
|
148 protected: |
|
149 CATDataCallConnectCommands(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
150 ~CATDataCallConnectCommands(); |
|
151 TInt ParseForBearerCapsResponse(); |
|
152 TInt ParseForBearerSpeedResponse(); |
|
153 void ParseForBearerServiceCapsResponseL(); // new function for CBST parsing |
|
154 |
|
155 TInt AddCommonExpectStrings(); |
|
156 void RemoveCommonExpectStrings(); |
|
157 virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams); |
|
158 virtual void Complete(TInt aError,TEventSource aSource); |
|
159 private: |
|
160 TBuf8<KCommsDbSvrMaxFieldLength> iConnectString; |
|
161 TInt SetBearerSpeed(TLex8& aLexString); |
|
162 TInt ConfigurePortForConnection(); |
|
163 TAny* iBearerServiceType; |
|
164 }; |
|
165 |
|
166 class CATFaxCallConnectCommands : public CATCallConnectCommands |
|
167 /** |
|
168 @internalComponent |
|
169 */ |
|
170 { |
|
171 protected: |
|
172 CATFaxCallConnectCommands(CATIO* aIo,CTelObject* aTelObject,CATInit* aInit,CPhoneGlobals* aPhoneGlobals); |
|
173 ~CATFaxCallConnectCommands(); |
|
174 virtual void Start(TTsyReqHandle aTsyReqHandle, TAny* aParams); |
|
175 virtual void Stop(TTsyReqHandle aTsyReqHandle); |
|
176 virtual void Complete(TInt aError,TEventSource aSource); |
|
177 virtual void CompleteSuccessfully()=0; |
|
178 }; |
|
179 |
|
180 #endif |