|
1 // Copyright (c) 2008-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 @internalAll |
|
19 */ |
|
20 |
|
21 #ifndef __CPHONEDISPATCHER_H_ |
|
22 #define __CPHONEDISPATCHER_H_ |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <e32base.h> |
|
27 #include <e32def.h> |
|
28 #include <etelmm.h> |
|
29 |
|
30 #include <ctsy/ltsy/mltsydispatchfactory.h> |
|
31 |
|
32 |
|
33 #include "requestqueueoneshot.h" |
|
34 #include <ctsy/ltsy/ltsylogger.h> |
|
35 #include "mdispatchercallback.h" |
|
36 #include <ctsy/serviceapi/cmmutility.h> |
|
37 #include <ctsy/rmmcustomapi.h> |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CMmDataPackage; |
|
41 class MmMessageManagerCallback; |
|
42 class CMobilePhoneNetworkListV2; |
|
43 class TDispatcherHolder; |
|
44 |
|
45 class MLtsyDispatchPhoneGetFdnStatus; |
|
46 class MLtsyDispatchPhoneGetNetworkRegistrationStatus; |
|
47 class MLtsyDispatchPhoneGetHomeNetwork; |
|
48 class MLtsyDispatchPhoneBootNotifyModemStatusReady; |
|
49 class MLtsyDispatchPhoneBootNotifySimStatusReady; |
|
50 class MLtsyDispatchPhoneSimRefreshRegister; |
|
51 |
|
52 class MLtsyDispatchPhoneGetServiceProviderName; |
|
53 class MLtsyDispatchPhoneGetPhoneId; |
|
54 class MLtsyDispatchPhoneGetDetectedNetworks; |
|
55 class MLtsyDispatchPhoneGetDetectedNetworksCancel; |
|
56 class MLtsyDispatchPhoneSelectNetwork; |
|
57 class MLtsyDispatchPhoneSelectNetworkCancel; |
|
58 class MLtsyDispatchPhoneSetNetworkSelectionSetting; |
|
59 class MBootSequenceCallbacks; |
|
60 class MLtsyDispatchPhoneGetCurrentNetworkInfo; |
|
61 class MLtsyDispatchPhoneGetNetworkMode; |
|
62 class MLtsyDispatchPhoneGetNitzInfo; |
|
63 class MLtsyDispatchPhoneGetSignalStrength; |
|
64 class MLtsyDispatchPhoneGetBatteryInfo; |
|
65 class MLtsyDispatchPhoneNspsWakeup; |
|
66 class MLtsyDispatchPhoneSetSystemNetworkMode; |
|
67 class MLtsyDispatchPhoneGetCurrentSystemNetworkModes; |
|
68 class MLtsyDispatchPhoneResetNetServer; |
|
69 class MLtsyDispatchPhoneSetAlwaysOnMode; |
|
70 class MLtsyDispatchPhoneSetDriveMode; |
|
71 class MLtsyDispatchPhoneGetHspaStatus; |
|
72 class MLtsyDispatchPhoneSetHspaStatus; |
|
73 class MLtsyDispatchPhoneGetNetworkProviderName; |
|
74 class MLtsyDispatchPhoneGetOperatorName; |
|
75 class MLtsyDispatchPhoneGetCellInfo; |
|
76 class MLtsyDispatchPhoneRegisterCellInfoChangeNotification; |
|
77 class MLtsyDispatchPhoneGetPhoneCellInfo; |
|
78 class MLtsyDispatchPhoneGetUsimServiceSupport; |
|
79 class MLtsyDispatchPhoneGetCurrentActiveUsimApplication; |
|
80 class MLtsyDispatchPhoneTerminateAllCalls; |
|
81 class MLtsyDispatchPhoneGetSystemNetworkBand; |
|
82 class MLtsyDispatchPhoneSetSystemNetworkBand; |
|
83 |
|
84 const TUint KPhoneIdReqOriginPhoneFu = 0x1; |
|
85 const TUint KPhoneIdReqOriginSatFu = 0x2; |
|
86 |
|
87 |
|
88 // CLASS DECLARATION |
|
89 |
|
90 /** |
|
91 * This class is responsible for packing and unpacking data belonging |
|
92 * to Phone related requests to the Licensee LTSY. |
|
93 */ |
|
94 class CPhoneDispatcher : public CBase, public MDispatcherCallback |
|
95 { |
|
96 public: |
|
97 |
|
98 virtual ~CPhoneDispatcher(); |
|
99 |
|
100 static CPhoneDispatcher* NewL( |
|
101 MLtsyDispatchFactoryV1& aLtsyFactory, |
|
102 MmMessageManagerCallback& aMessageManagerCallback, |
|
103 MmMessageManagerCallback& aSatMessageManagerCallback, |
|
104 CRequestQueueOneShot& aRequestAsyncOneShot, |
|
105 MBootSequenceCallbacks& aBootSequenceObserver); |
|
106 |
|
107 static CPhoneDispatcher* NewLC( |
|
108 MLtsyDispatchFactoryV1& aLtsyFactory, |
|
109 MmMessageManagerCallback& aMessageManagerCallback, |
|
110 MmMessageManagerCallback& aSatMessageManagerCallback, |
|
111 CRequestQueueOneShot& aRequestAsyncOneShot, |
|
112 MBootSequenceCallbacks& aBootSequenceObserver); |
|
113 |
|
114 // Dispatcher functions for dispatching requests DOWN to the Licensee LTSY |
|
115 |
|
116 TInt DispatchGetFdnStatusL(); |
|
117 TInt DispatchGetNetworkRegistrationStatusL(); |
|
118 TInt DispatchGetHomeNetworkL(); |
|
119 TInt DispatchBootNotifyModemStatusReadyL(); |
|
120 TInt DispatchBootNotifySimStatusReadyL(); |
|
121 TInt DispatchSimRefreshRegisterL(const CMmDataPackage* aDataPackage); |
|
122 TInt DispatchGetServiceProviderNameL(); |
|
123 TInt DispatchGetPhoneIdL(TUint aRequestOrigin); |
|
124 TInt DispatchGetDetectedNetworksL(); |
|
125 TInt DispatchGetDetectedNetworksCancelL(); |
|
126 TInt DispatchSelectNetworkL(const CMmDataPackage* aDataPackage); |
|
127 TInt DispatchSelectNetworkCancelL(); |
|
128 TInt DispatchSetNetworkSelectionSettingL(const CMmDataPackage* aDataPackage); |
|
129 TInt DispatchNspsWakeupL(); |
|
130 TInt DispatchSetSystemNetworkModeL(const CMmDataPackage* aDataPackage); |
|
131 TInt DispatchGetCurrentSystemNetworkModesL(); |
|
132 TInt DispatchResetNetServerL(); |
|
133 TInt DispatchSetAlwaysOnModeL(const CMmDataPackage* aDataPackage); |
|
134 TInt DispatchSetDriveModeL(const CMmDataPackage* aDataPackage); |
|
135 TInt DispatchGetHspaStatusL(); |
|
136 TInt DispatchSetHspaStatusL(const CMmDataPackage* aDataPackage); |
|
137 TInt DispatchGetNetworkProviderNameL(); |
|
138 TInt DispatchGetOperatorNameL(); |
|
139 TInt DispatchGetCellInfoL(); |
|
140 TInt DispatchRegisterCellInfoChangeNotificationL(); |
|
141 TInt DispatchGetPhoneCellInfoL(); |
|
142 TInt DispatchGetUsimServiceSupportL(const CMmDataPackage* aDataPackage); |
|
143 TInt DispatchGetCurrentActiveUsimApplicationL(); |
|
144 TInt DispatchTerminateAllCallsL(const CMmDataPackage* aDataPackage); |
|
145 TInt DispatchGetSystemNetworkBandL(); |
|
146 TInt DispatchSetSystemNetworkBandL(const CMmDataPackage* aDataPackage); |
|
147 |
|
148 |
|
149 // These getters are internal to CtsyDispatcher |
|
150 TInt DispatchGetCurrentNetworkInfoL(); |
|
151 TInt DispatchGetNetworkModeL(); |
|
152 TInt DispatchGetNitzInfoL(); |
|
153 TInt DispatchGetSignalStrengthL(); |
|
154 TInt DispatchGetBatteryInfoL(); |
|
155 |
|
156 |
|
157 // Complete functions for receiving completions UP from the Licensee LTSY |
|
158 // via the CCtsyDispatcherCallback object. |
|
159 |
|
160 void CallbackBootNotifyModemStatusReady(TInt aError, TRfStateInfo aRfStatus); |
|
161 void CallbackBootNotifySimStatusReady(TInt aError); |
|
162 void CallbackSimRefreshRegister(TInt aError); |
|
163 void CallbackGetFdnStatus(TInt aError, RMobilePhone::TMobilePhoneFdnStatus aFdnStatus); |
|
164 void CallbackGetNetworkRegistrationStatus(TInt aError, RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus); |
|
165 void CallbackGetHomeNetwork(TInt aError,const RMobilePhone::TMobilePhoneNetworkInfoV5& aNetworkInfo); |
|
166 void CallbackNotifyNetworkRegistrationStatusChange(TInt aError, RMobilePhone::TMobilePhoneRegistrationStatus aRegStatus); |
|
167 |
|
168 void CallbackNotifyNetworkModeChange(TInt aError, RMobilePhone::TMobilePhoneNetworkMode aNetworkMode); |
|
169 void CallbackNotifyEgprsInfoChange(TInt aError, TBool aEdgeSupported); |
|
170 void CallbackNotifySignalStrengthChange(TInt aError, TInt32 aSignalStrength, TInt8 aBar); |
|
171 void CallbackNotifyNitzInfoChange(TInt aError, const RMobilePhone::TMobilePhoneNITZ& aNitzInfo); |
|
172 void CallbackNotifyBatteryInfoChange(TInt aError, const RMobilePhone::TMobilePhoneBatteryInfoV1& aBatteryInfo); |
|
173 void CallbackNotifyCurrentNetworkChange(TInt aError, const RMobilePhone::TMobilePhoneNetworkInfoV5& aNetworkInfo, const RMobilePhone::TMobilePhoneLocationAreaV1& aLocationArea); |
|
174 void CallbackNotifyRfStatusChange(TInt aError, TRfStateInfo aRfStatus); |
|
175 void CallbackGetServiceProviderName(TInt aError, const RMobilePhone::TMobilePhoneServiceProviderNameV2& aServiceProvider); |
|
176 void CallbackGetPhoneId(TInt aError, const RMobilePhone::TMobilePhoneIdentityV1& aPhoneId); |
|
177 void CallbackGetDetectedNetworks(TInt aError, const CMobilePhoneNetworkListV2& aPhoneNetworkList); |
|
178 void CallbackGetDetectedNetworksCancel(TInt aError); |
|
179 void CallbackSelectNetwork(TInt aError); |
|
180 void CallbackSelectNetworkCancel(TInt aError); |
|
181 void CallbackSetNetworkSelectionSetting(TInt aError, RMobilePhone::TMobilePhoneSelectionMethod aSelectionMethod); |
|
182 void CallbackGetCurrentNetworkInfo(TInt aError, const RMobilePhone::TMobilePhoneNetworkInfoV5& aNetworkInfo, const RMobilePhone::TMobilePhoneLocationAreaV1& aLocationArea); |
|
183 void CallbackGetNetworkMode(TInt aError, RMobilePhone::TMobilePhoneNetworkMode aNetworkMode); |
|
184 void CallbackGetNitzInfo(TInt aError, const RMobilePhone::TMobilePhoneNITZ& aNitzInfo); |
|
185 void CallbackGetSignalStrength(TInt aError, TInt32 aSignalStrength, TInt8 aBar); |
|
186 void CallbackGetBatteryInfo(TInt aError, const RMobilePhone::TMobilePhoneBatteryInfoV1& aBatteryInfo); |
|
187 void CallbackNotifyNetworkSelectionSettingChange(TInt aError, RMobilePhone::TMobilePhoneSelectionMethod aSelectionMethod); |
|
188 void CallbackNotifyNspsStatusChange(TInt aError, TBool aEnabled); |
|
189 void CallbackNspsWakeup(TInt aError); |
|
190 void CallbackSetSystemNetworkMode(TInt aError); |
|
191 void CallbackGetCurrentSystemNetworkModes(TInt aError, TUint32 aCurrentSystemNetworkModes); |
|
192 void CallbackNotifyRauEvent(TInt aError, RMmCustomAPI::TRauEventStatus aRauEvent); |
|
193 void CallbackNotifyNetworkConnectionFailure(TInt aError); |
|
194 void CallbackNotifyCellInfoChanged(TInt aError); |
|
195 void CallbackNotifyDtmfEvent(TInt aError, RMmCustomAPI::TDtmfEventType aType, |
|
196 RMmCustomAPI::TDtmfEvent aEvent, TChar aTone); |
|
197 void CallbackNotifyDtmfEvent(TInt aError, RMobilePhone::TMobilePhoneDTMFEvent aEventType); |
|
198 void CallbackNotifyCellInfoChanged(TInt aError, const RMmCustomAPI::TMmCellInfo::TGSMCellInfo& aInfo); |
|
199 void CallbackNotifyCellInfoChanged(TInt aError, const RMmCustomAPI::TMmCellInfo::TWCDMACellInfo& aInfo); |
|
200 void CallbackResetNetServer(TInt aError); |
|
201 void CallbackSetAlwaysOnMode(TInt aError); |
|
202 void CallbackSetDriveMode(TInt aError); |
|
203 void CallbackGetHspaStatus(TInt aError, RMmCustomAPI::THSxPAStatus aStatus); |
|
204 void CallbackSetHspaStatus(TInt aError); |
|
205 void CallbackNotifyHspaStatusChanged(TInt aError, RMmCustomAPI::THSxPAStatus aStatus); |
|
206 void CallbackGetNetworkProviderName(TInt aError, const TDesC& aName); |
|
207 void CallbackGetOperatorName(TInt aError, RMmCustomAPI::TOperatorNameType aType, const TDesC& aName); |
|
208 void CallbackGetCellInfo(TInt aError); |
|
209 void CallbackGetCellInfo(TInt aError,const RMmCustomAPI::TMmCellInfo::TGSMCellInfo &aInfo); |
|
210 void CallbackGetCellInfo(TInt aError,const RMmCustomAPI::TMmCellInfo::TWCDMACellInfo &aInfo); |
|
211 void CallbackRegisterCellInfoChangeNotification(TInt aError); |
|
212 void CallbackGetPhoneCellInfo(TInt aError, const RMobilePhone::TMobilePhoneCellInfoV9& aCellInfo); |
|
213 void CallbackGetUsimServiceSupport(TInt aError, TInt aApplicationNumber, TBool aSupported); |
|
214 void CallbackGetCurrentActiveUsimApplication(TInt aError, const TDesC8& aAid); |
|
215 void CallbackTerminateAllCalls(TInt aError); |
|
216 void CallbackGetSystemNetworkBand(TInt aError, RMmCustomAPI::TBandSelection aBand, RMmCustomAPI::TNetworkModeCaps aMode); |
|
217 void CallbackSetSystemNetworkBand(TInt aError); |
|
218 |
|
219 // From MDispatcherCallback |
|
220 void CallbackSync(CRequestQueueOneShot::TIpcDataPackage& aIpcDataPackage); |
|
221 |
|
222 // Other public functions |
|
223 void SetDispatcherHolder(TDispatcherHolder& aDispatcherHolder); |
|
224 |
|
225 private: |
|
226 |
|
227 CPhoneDispatcher(MLtsyDispatchFactoryV1& aLtsyFactory, |
|
228 MmMessageManagerCallback& aMessageManagerCallback, |
|
229 MmMessageManagerCallback& aSatMessageManagerCallback, |
|
230 CRequestQueueOneShot& aRequestAsyncOneShot, |
|
231 MBootSequenceCallbacks& aBootSequenceObserver); |
|
232 |
|
233 void ConstructL(); |
|
234 private: // Not owned |
|
235 |
|
236 MLtsyDispatchFactoryV1& iLtsyFactoryV1; |
|
237 MmMessageManagerCallback& iMessageManagerCallback; |
|
238 MmMessageManagerCallback& iSatMessageManagerCallback; |
|
239 CRequestQueueOneShot& iRequestAsyncOneShot; |
|
240 MBootSequenceCallbacks& iBootSequenceObserver; |
|
241 TDispatcherHolder* iDispatcherHolder; |
|
242 |
|
243 // Interfaces in the Licensee LTSY, not owned by this object |
|
244 |
|
245 MLtsyDispatchPhoneGetFdnStatus* iLtsyDispatchPhoneGetFdnStatus; |
|
246 MLtsyDispatchPhoneGetNetworkRegistrationStatus* iLtsyDispatchPhoneGetNetworkRegistrationStatus; |
|
247 MLtsyDispatchPhoneGetHomeNetwork* iLtsyDispatchPhoneGetHomeNetwork; |
|
248 MLtsyDispatchPhoneBootNotifyModemStatusReady* iLtsyDispatchPhoneBootNotifyModemStatusReady; |
|
249 MLtsyDispatchPhoneBootNotifySimStatusReady* iLtsyDispatchPhoneBootNotifySimStatusReady; |
|
250 MLtsyDispatchPhoneSimRefreshRegister* iLtsyDispatchPhoneSimRefreshRegister; |
|
251 |
|
252 MLtsyDispatchPhoneGetServiceProviderName* iLtsyDispatchPhoneGetServiceProviderName; |
|
253 MLtsyDispatchPhoneGetPhoneId* iLtsyDispatchPhoneGetPhoneId; |
|
254 MLtsyDispatchPhoneGetDetectedNetworks* iLtsyDispatchPhoneGetDetectedNetworks; |
|
255 MLtsyDispatchPhoneGetDetectedNetworksCancel* iLtsyDispatchPhoneGetDetectedNetworksCancel; |
|
256 MLtsyDispatchPhoneSelectNetwork* iLtsyDispatchPhoneSelectNetwork; |
|
257 MLtsyDispatchPhoneSelectNetworkCancel* iLtsyDispatchPhoneSelectNetworkCancel; |
|
258 MLtsyDispatchPhoneSetNetworkSelectionSetting* iLtsyDispatchPhoneSetNetworkSelectionSetting; |
|
259 MLtsyDispatchPhoneGetCurrentNetworkInfo* iLtsyDispatchPhoneGetCurrentNetworkInfo; |
|
260 MLtsyDispatchPhoneGetNetworkMode* iLtsyDispatchPhoneGetNetworkMode; |
|
261 MLtsyDispatchPhoneGetNitzInfo* iLtsyDispatchPhoneGetNitzInfo; |
|
262 MLtsyDispatchPhoneGetSignalStrength* iLtsyDispatchPhoneGetSignalStrength; |
|
263 MLtsyDispatchPhoneGetBatteryInfo* iLtsyDispatchPhoneGetBatteryInfo; |
|
264 MLtsyDispatchPhoneNspsWakeup* iLtsyDispatchPhoneNspsWakeup; |
|
265 MLtsyDispatchPhoneSetSystemNetworkMode* iLtsyDispatchPhoneSetSystemNetworkMode; |
|
266 MLtsyDispatchPhoneGetCurrentSystemNetworkModes* iLtsyDispatchPhoneGetCurrentSystemNetworkModes; |
|
267 MLtsyDispatchPhoneResetNetServer* iLtsyDispatchPhoneResetNetServer; |
|
268 MLtsyDispatchPhoneSetAlwaysOnMode* iLtsyDispatchPhoneSetAlwaysOnMode; |
|
269 MLtsyDispatchPhoneSetDriveMode* iLtsyDispatchPhoneSetDriveMode; |
|
270 MLtsyDispatchPhoneGetHspaStatus* iLtsyDispatchPhoneGetHspaStatus; |
|
271 MLtsyDispatchPhoneSetHspaStatus* iLtsyDispatchPhoneSetHspaStatus; |
|
272 MLtsyDispatchPhoneGetNetworkProviderName* iLtsyDispatchPhoneGetNetworkProviderName; |
|
273 MLtsyDispatchPhoneGetOperatorName* iLtsyDispatchPhoneGetOperatorName; |
|
274 MLtsyDispatchPhoneGetCellInfo* iLtsyDispatchPhoneGetCellInfo; |
|
275 MLtsyDispatchPhoneRegisterCellInfoChangeNotification* iLtsyDispatchPhoneRegisterCellInfoChangeNotification; |
|
276 MLtsyDispatchPhoneGetPhoneCellInfo* iLtsyDispatchPhoneGetPhoneCellInfo; |
|
277 MLtsyDispatchPhoneGetUsimServiceSupport* iLtsyDispatchPhoneGetUsimServiceSupport; |
|
278 MLtsyDispatchPhoneGetCurrentActiveUsimApplication* iLtsyDispatchPhoneGetCurrentActiveUsimApplication; |
|
279 MLtsyDispatchPhoneTerminateAllCalls* iLtsyDispatchPhoneTerminateAllCalls; |
|
280 MLtsyDispatchPhoneGetSystemNetworkBand* iLtsyDispatchPhoneGetSystemNetworkBand; |
|
281 MLtsyDispatchPhoneSetSystemNetworkBand* iLtsyDispatchPhoneSetSystemNetworkBand; |
|
282 |
|
283 private: |
|
284 TUint iPhoneIdReqOrigin; //to prevent two requests being fired off if sat and phone both |
|
285 //request id while the other is in progress. Also to only complete |
|
286 //the appropriate request. |
|
287 |
|
288 RMmCustomAPI::TMmCellInfo *iCellInfo; // Since this object is very big we will create it once in the heap. |
|
289 |
|
290 }; // class CPhoneDispatcher |
|
291 |
|
292 #endif // __CPHONEDISPATCHER_H_ |
|
293 |