|
1 // Copyright (c) 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 // @file atdialvoice.h |
|
15 // This contains CATDialVoice which dial a voice call. |
|
16 // |
|
17 |
|
18 #ifndef ATDIALVOICE_H_ |
|
19 #define ATDIALVOICE_H_ |
|
20 |
|
21 //system include |
|
22 #include <etelmm.h> |
|
23 |
|
24 //user include |
|
25 #include "atcommandbase.h" |
|
26 #include "unsolicitedparams.h" |
|
27 #include "athangup.h" |
|
28 #include "allcallreleasecompleteobserver.h" |
|
29 |
|
30 class CATDialVoice : public CAtCommandBase, public MAllCallReleaseCompleteObserver |
|
31 { |
|
32 public: |
|
33 |
|
34 /** |
|
35 * static NewL |
|
36 * |
|
37 * @param aGloblePhone |
|
38 * @param aCtsyDispatcherCallback |
|
39 */ |
|
40 static CATDialVoice* NewL(CGlobalPhonemanager& aGloblePhone, |
|
41 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
42 |
|
43 /** |
|
44 * static NewLC |
|
45 * |
|
46 * @param aGloblePhone |
|
47 * @param aCtsyDispatcherCallback |
|
48 */ |
|
49 static CATDialVoice* NewLC(CGlobalPhonemanager& aGloblePhone, |
|
50 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
51 |
|
52 /** |
|
53 * Destructor |
|
54 * |
|
55 */ |
|
56 virtual ~CATDialVoice(); |
|
57 |
|
58 /** |
|
59 * Virtual function. Inherited from CAtCommandBase |
|
60 * |
|
61 * Execute AT Command |
|
62 */ |
|
63 virtual void ExecuteCommand(); |
|
64 |
|
65 /** |
|
66 * Virtual function. Inherited from CAtCommandBase |
|
67 * |
|
68 * @param aResponseBuf Line buf reading from baseband |
|
69 */ |
|
70 virtual void ParseResponseL(const TDesC8& aResponseBuf); |
|
71 |
|
72 /** |
|
73 * Will be called by AT Manager whenever a event was triggered |
|
74 * |
|
75 * @param aEventSource |
|
76 * @param aStatus |
|
77 */ |
|
78 virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus); |
|
79 |
|
80 /** |
|
81 * Start AT request |
|
82 * |
|
83 */ |
|
84 virtual void StartRequest(); |
|
85 |
|
86 /** |
|
87 * set telephone number |
|
88 * |
|
89 * @param aTelNum |
|
90 */ |
|
91 void SetTelephoneNumber(const TDesC8& aTelNum); |
|
92 |
|
93 /** |
|
94 * ETrue : Emergency call |
|
95 * EFalse : Normal call |
|
96 */ |
|
97 void SetEmergnecyCallFlag(TBool aIsEmergencyCall = EFalse); |
|
98 |
|
99 /** |
|
100 * Init member |
|
101 * |
|
102 */ |
|
103 void InitVariable(); |
|
104 |
|
105 /** |
|
106 * From MAllCallReleaseCompleteObserver |
|
107 * |
|
108 * @param aError |
|
109 */ |
|
110 virtual void ReleaseAllCallComplete(TInt aError); |
|
111 |
|
112 protected: |
|
113 |
|
114 /** |
|
115 * Constructor |
|
116 * |
|
117 * @param aGloblePhone |
|
118 * @param aCtsyDispatcherCallback |
|
119 */ |
|
120 CATDialVoice(CGlobalPhonemanager& aGloblePhone, |
|
121 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
122 |
|
123 /** |
|
124 * 2nd Constructor |
|
125 * |
|
126 */ |
|
127 void ConstructL(); |
|
128 |
|
129 /** |
|
130 * The last execute end of this command |
|
131 * |
|
132 */ |
|
133 virtual void Complete(); |
|
134 |
|
135 /** |
|
136 * Parse +Wind at command |
|
137 * |
|
138 * @param aParams class TUnsolicitedParams |
|
139 * @param aCommandBuf buffer of at command |
|
140 */ |
|
141 TInt ParseUnsolicitedCommandBufL(TUnsolicitedParams& aParams, const TDesC8& aCommandBuf); |
|
142 |
|
143 /** |
|
144 * Parse +Wind at command |
|
145 * |
|
146 * @param aParams class TUnsolicitedParams |
|
147 */ |
|
148 TInt ProcessUnsolicitedCallCreated(const TUnsolicitedParams& aParams); |
|
149 private: |
|
150 /** |
|
151 * Handle IO errors |
|
152 * |
|
153 */ |
|
154 void HandleIOError(); |
|
155 |
|
156 /** |
|
157 * Handle response error |
|
158 * |
|
159 */ |
|
160 void HandleResponseError(); |
|
161 |
|
162 /** |
|
163 * Handle call dialing complete |
|
164 * |
|
165 */ |
|
166 void HandleDiallingComplete(); |
|
167 |
|
168 /** |
|
169 * Handle call connecting complete |
|
170 * |
|
171 */ |
|
172 void HandleConnectingComplete(); |
|
173 |
|
174 /** |
|
175 * Handle call connected complete |
|
176 * |
|
177 */ |
|
178 void HandleConnectedComplete(); |
|
179 |
|
180 private: |
|
181 |
|
182 /** |
|
183 * Dial voice call step |
|
184 * |
|
185 */ |
|
186 enum TDialVoicStep |
|
187 { |
|
188 EATDialNotInProgress, |
|
189 EATWaitForWriteComplete, |
|
190 EATWaitForDiallingComplete, |
|
191 EATWaitForConnectingComplete, |
|
192 EATWaitForConnectedComplete |
|
193 }; |
|
194 |
|
195 private: |
|
196 |
|
197 /** |
|
198 * Telephony number |
|
199 * |
|
200 */ |
|
201 TBuf8<RMobilePhone::KMaxMobileTelNumberSize> iTelNum; |
|
202 |
|
203 /** |
|
204 * call id |
|
205 * |
|
206 */ |
|
207 TInt iCallId; |
|
208 |
|
209 /** |
|
210 * I/O error when Read or Write |
|
211 * include timeout |
|
212 */ |
|
213 TInt iStatus; |
|
214 |
|
215 /** |
|
216 * At Command return errors |
|
217 * |
|
218 */ |
|
219 TInt iResult; |
|
220 |
|
221 /** |
|
222 * OK response is founded |
|
223 * |
|
224 */ |
|
225 TBool iOKFounded; |
|
226 |
|
227 /** |
|
228 * State about reading and writing |
|
229 * |
|
230 */ |
|
231 TDialVoicStep iDialStep; |
|
232 |
|
233 /** |
|
234 * True : Emergency Call |
|
235 * False : Normal Call |
|
236 * |
|
237 */ |
|
238 TBool iIsEmergencyCall; |
|
239 |
|
240 /** |
|
241 * When Emergency call release all call |
|
242 */ |
|
243 CATHangUp* iATH; |
|
244 }; |
|
245 |
|
246 #endif /*ATDIALVOICE_H_*/ |