44
|
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 initializephone.h
|
|
15 |
//
|
|
16 |
|
|
17 |
#ifndef __INITIALIZEPHONE_H__
|
|
18 |
#define __INITIALIZEPHONE_H__
|
|
19 |
|
|
20 |
//user include
|
|
21 |
#include "atcommandcontrolbase.h"
|
|
22 |
#include "globalphonemanager.h"
|
|
23 |
#include "atipcrequestcompleteobserver.h"
|
|
24 |
|
|
25 |
// forward class
|
|
26 |
class CATGetModemStatus;
|
|
27 |
class CATNetworkRegistration;
|
|
28 |
class CATSIMCard;
|
|
29 |
class CATNetworkInfo;
|
|
30 |
class CATGetSignal;
|
|
31 |
class CATGetBattery;
|
|
32 |
class CATHelperCommand;
|
|
33 |
class CATNetworkRegStatusChange;
|
|
34 |
class CNotifyBatteryAndSignal;
|
|
35 |
class CGetCurrentNetworkInfo;
|
|
36 |
|
|
37 |
/**
|
|
38 |
* CInitializePhone inherits from the CATCommandControlBase class.
|
|
39 |
*
|
|
40 |
*/
|
|
41 |
class CInitializePhone : public CATCommandControlBase, public MIpcRequestCompleteObserver
|
|
42 |
{
|
|
43 |
public:
|
|
44 |
/**
|
|
45 |
* Two-phased constructor.
|
|
46 |
* @param aGloblePhone
|
|
47 |
* @param aCtsyDispatcherCallback
|
|
48 |
* @param aNtwkRegStatusChange
|
|
49 |
* @param aNotifyBatteryAndSignal
|
|
50 |
*/
|
|
51 |
static CInitializePhone* NewL(CGlobalPhonemanager& aGloblePhone,
|
|
52 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback,
|
|
53 |
CATNetworkRegStatusChange& aNtwkRegStatusChange,
|
|
54 |
CNotifyBatteryAndSignal& aNotifyBatteryAndSignal);
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Destructor
|
|
58 |
*
|
|
59 |
*/
|
|
60 |
~CInitializePhone();
|
|
61 |
|
|
62 |
virtual void AtCommandExecuteComplete(TAtEventSource aEventSource, TInt aStatus);
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Start this request
|
|
66 |
*/
|
|
67 |
void StartRequest();
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Execute next request stored in request list
|
|
71 |
*/
|
|
72 |
void ExecutePendingRequest();
|
|
73 |
|
|
74 |
/**
|
|
75 |
* Get the notification when one of the IPC request was complete
|
|
76 |
*/
|
|
77 |
virtual void NotifyIpcRequestComplete(TInt aIpcId);
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Append the IPC request to pending request list
|
|
81 |
*/
|
|
82 |
void AppendIpcRequestToPendingListL(TInt aIpc);
|
|
83 |
protected:
|
|
84 |
/**
|
|
85 |
* Constructor
|
|
86 |
*
|
|
87 |
* @param aGloblePhone
|
|
88 |
* @param aCtsyDispatcherCallback
|
|
89 |
* @param aNtwkRegStatusChange
|
|
90 |
* @param aNotifyBatteryAndSignal
|
|
91 |
*/
|
|
92 |
CInitializePhone(CGlobalPhonemanager& aGloblePhone,
|
|
93 |
CCtsyDispatcherCallback& aCtsyDispatcherCallback,
|
|
94 |
CATNetworkRegStatusChange& aNtwkRegStatusChange,
|
|
95 |
CNotifyBatteryAndSignal& aNotifyBatteryAndSignal);
|
|
96 |
/**
|
|
97 |
* 2nd Constructor
|
|
98 |
*/
|
|
99 |
void ConstructL();
|
|
100 |
|
|
101 |
private:
|
|
102 |
/**
|
|
103 |
* Execute next AT commane
|
|
104 |
*
|
|
105 |
* @param aATString The context of excuting aommand
|
|
106 |
* @param aATType Identify the Type of AT Command
|
|
107 |
*/
|
|
108 |
void ExecuteNextATHelpCommand(const TDesC8& aATString,TLtsyATCommandType aATType);
|
|
109 |
/**
|
|
110 |
* Start an AT Command
|
|
111 |
* @param aAtCommand the AT Command class
|
|
112 |
*/
|
|
113 |
void StartATCommand(CAtCommandBase* aAtCommand);
|
|
114 |
/**
|
|
115 |
* End an AT Command
|
|
116 |
* @param aAtCommand the AT Command class
|
|
117 |
*/
|
|
118 |
void CompleteATCommand(CAtCommandBase* aAtCommand);
|
|
119 |
/**
|
|
120 |
* Get modem status command finished
|
|
121 |
*/
|
|
122 |
void ModemStatusComplete(TInt aError);
|
|
123 |
/**
|
|
124 |
* Set oper format command finished
|
|
125 |
*/
|
|
126 |
void SetOperFormatComplete(const TInt aError);
|
|
127 |
/**
|
|
128 |
* Get network infomation command finished
|
|
129 |
*/
|
|
130 |
void NetworkInfoComplete();
|
|
131 |
/**
|
|
132 |
* Get phone's signal infomation command finished
|
|
133 |
*/
|
|
134 |
void GetSignalComplete(TInt aError);
|
|
135 |
/**
|
|
136 |
* Get phone's battery infomation command finished
|
|
137 |
*/
|
|
138 |
void GetBatteryComplete(TInt aError);
|
|
139 |
|
|
140 |
private:
|
|
141 |
/**
|
|
142 |
* AT type is used to identify AT command
|
|
143 |
*/
|
|
144 |
TInt iATType;
|
|
145 |
|
|
146 |
/**
|
|
147 |
* Check if the current executed pending request is still running
|
|
148 |
*/
|
|
149 |
TBool iIsPendingRequestStillRunning;
|
|
150 |
|
|
151 |
/**
|
|
152 |
* Get the current modem status
|
|
153 |
* Own
|
|
154 |
*/
|
|
155 |
CATGetModemStatus* iATGetModemStatus;
|
|
156 |
|
|
157 |
/**
|
|
158 |
* Get the current network registration status
|
|
159 |
* Own
|
|
160 |
*/
|
|
161 |
CATNetworkRegistration* iNetworkRegStatus;
|
|
162 |
|
|
163 |
/**
|
|
164 |
* Get the current SIM card status
|
|
165 |
* Own
|
|
166 |
*/
|
|
167 |
CATSIMCard* iATSIMCard;
|
|
168 |
|
|
169 |
/**
|
|
170 |
* Get the current signal level
|
|
171 |
* Own
|
|
172 |
*/
|
|
173 |
CATGetSignal* iATGetSignal;
|
|
174 |
|
|
175 |
/**
|
|
176 |
* Get the current battery level
|
|
177 |
* Own
|
|
178 |
*/
|
|
179 |
CATGetBattery* iATGetBattery;
|
|
180 |
|
|
181 |
/**
|
|
182 |
* Helper command for get a set of phone info
|
|
183 |
* Own
|
|
184 |
*/
|
|
185 |
CATHelperCommand* iATHelperCommand;
|
|
186 |
|
|
187 |
/**
|
|
188 |
* Get the current netwok info
|
|
189 |
* Own
|
|
190 |
*/
|
|
191 |
CGetCurrentNetworkInfo* iATGetCurNetworkInfo;
|
|
192 |
|
|
193 |
/**
|
|
194 |
* Notify the regisration status change
|
|
195 |
* Not Own
|
|
196 |
*/
|
|
197 |
CATNetworkRegStatusChange& iNtwkRegStatusChange;
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Not Own
|
|
201 |
*/
|
|
202 |
CNotifyBatteryAndSignal& iNotifyBatteryAndSignal;
|
|
203 |
|
|
204 |
/**
|
|
205 |
* Network infomation
|
|
206 |
*/
|
|
207 |
RMobilePhone::TMobilePhoneNetworkInfoV5 iNetworkInfo;
|
|
208 |
|
|
209 |
/**
|
|
210 |
* Battery infomation
|
|
211 |
*/
|
|
212 |
RMobilePhone::TMobilePhoneBatteryInfoV1 iBatteryInfo;
|
|
213 |
|
|
214 |
/**
|
|
215 |
* Signal infomation
|
|
216 |
*/
|
|
217 |
TTsySignalInfo iSignalInfo;
|
|
218 |
|
|
219 |
/**
|
|
220 |
* This store the IPC request which should be handled specially as those IPC requests would be coming together.
|
|
221 |
* So we should store one or another before one of those special IPC requests was complete and then execute next request
|
|
222 |
* retrived from this store.
|
|
223 |
*/
|
|
224 |
RArray<TInt> iPendingRequestList;
|
|
225 |
};
|
|
226 |
#endif //__INITIALIZEPHONE_H__
|