24
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
* Name : CSatTsy.h
|
|
16 |
* Part of : Common SIM ATK TSY / commonsimatktsy
|
|
17 |
* Main entry point for Etel requests
|
|
18 |
* Version : 1.0
|
|
19 |
*
|
|
20 |
*/
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
#ifndef CSATTSY_H
|
|
25 |
#define CSATTSY_H
|
|
26 |
|
|
27 |
// INCLUDES
|
|
28 |
#include <e32base.h> // Etel base
|
|
29 |
#include <etelsat.h> // Etel sat
|
|
30 |
#include <ctsy/serviceapi/ctsysatmessagingbase.h> // SatMessaging Base class
|
|
31 |
|
|
32 |
#include "CSatTimer.h" // SatTimer class
|
|
33 |
// CONSTANTS
|
|
34 |
// Max address length
|
|
35 |
const TUint8 KAddrMaxLength = 255;
|
|
36 |
const TUint8 KCountryCodeLength = 3;
|
|
37 |
|
|
38 |
// FORWARD DECLARATIONS
|
|
39 |
class CMmPhoneTsy;
|
|
40 |
class CMmSmsTsy;
|
|
41 |
class CSatMessageRouterBase;
|
|
42 |
class CSatCCTsy;
|
|
43 |
class CSatIconTsy;
|
|
44 |
class CMmMessageRouterBase;
|
|
45 |
class CMmMessageManagerBase;
|
|
46 |
class CMmMessageManager;
|
|
47 |
class CSatTsyReqHandleStore;
|
|
48 |
class CSatNotificationsTsy;
|
|
49 |
class CSatDataDownloadTsy;
|
|
50 |
class CSatEventDownloadTsy;
|
|
51 |
class CTsySatMessaging;
|
|
52 |
|
|
53 |
class MMessageRouter;
|
|
54 |
class MCtsySatService;
|
|
55 |
class MmMessageManagerCallback;
|
|
56 |
|
|
57 |
|
|
58 |
// DESCRIPTION
|
|
59 |
// SAT TSY class.
|
|
60 |
//
|
|
61 |
// This class is a main entry point for all the requests coming from Etel.
|
|
62 |
// The requests are routed to specific Tsy if such exists, otherwise the
|
|
63 |
// request is handled here by calling the corresponding method directly.
|
|
64 |
// e.g. SMS message sending and menu selection SAT features are handled here.
|
|
65 |
// The functions that are not supported are completed at arrival.
|
|
66 |
|
|
67 |
/*
|
|
68 |
* @lib Commonsimatktsy
|
|
69 |
* @since 3.1
|
|
70 |
*/
|
|
71 |
NONSHARABLE_CLASS ( CSatTsy ) : public CTsySatMessagingBase
|
|
72 |
{
|
|
73 |
public: // Enumerations
|
|
74 |
|
|
75 |
enum TSatRequestTypes
|
|
76 |
{
|
|
77 |
ESatReqHandleUnknown, // 0
|
|
78 |
ESatNotifyDisplayTextPCmdReqType,
|
|
79 |
ESatNotifyProactiveSimSessionEndReqType,
|
|
80 |
ESatNotifyGetInkeyPCmdReqType,
|
|
81 |
ESatNotifyGetInputPCmdReqType,
|
|
82 |
ESatNotifyPlayTonePCmdReqType,
|
|
83 |
ESatNotifySetUpMenuPCmdReqType,
|
|
84 |
ESatNotifySelectItemPCmdReqType,
|
|
85 |
ESatNotifySendSmPCmdReqType,
|
|
86 |
ESatNotifySendSsPCmdReqType,
|
|
87 |
ESatNotifySetUpEventListPCmdReqType,
|
|
88 |
ESatNotifySendDtmfPCmdReqType,
|
|
89 |
ESatNotifyPollingOffPCmdReqType,
|
|
90 |
ESatNotifyPollIntervalPCmdReqType,
|
|
91 |
ESatNotifySendUssdPCmdReqType,
|
|
92 |
ESatNotifySetUpIdleModeTextPCmdReqType,
|
|
93 |
ESatNotifyLaunchBrowserPCmdReqType,
|
|
94 |
ESatNotifyCallControlRequestPCmdReqType,
|
|
95 |
ESatNotifySetUpCallPCmdReqType,
|
|
96 |
ESatNotifyLanguageNotificationPCmdReqType,
|
|
97 |
ESatNotifyLocalInfoPCmdReqType,
|
|
98 |
ESatNotifyRefreshPCmdReqType,
|
|
99 |
ESatNotifyRefreshRequiredPCmdReqType,
|
|
100 |
ESatNotifyOpenChannelPCmdReqType,
|
|
101 |
ESatNotifyGetChannelStatusPCmdReqType,
|
|
102 |
ESatNotifyMoSmControlRequestPCmdReqType,
|
|
103 |
ESatNotifyCloseChannelPCmdReqType,
|
|
104 |
ESatNotifySendDataPCmdReqType,
|
|
105 |
ESatNotifyReceiveDataPCmdReqType,
|
|
106 |
ESatGetIconReqType,
|
|
107 |
ESatGetImageInstanceReqType,
|
|
108 |
ESatGetClutReqType,
|
|
109 |
ESatTerminalRspReqType,
|
|
110 |
ESatSendMessageNoLoggingReqType,
|
|
111 |
// ATTENTION:: Declare constant for those requests that need
|
|
112 |
// own request handle record in iSatTsyReqHandleStore above the
|
|
113 |
// following!
|
|
114 |
ESatMaxNumOfRequests
|
|
115 |
};
|
|
116 |
|
|
117 |
/*
|
|
118 |
* This structure contains data needed for LocationStatus
|
|
119 |
* envelope. (used by EventDownload and MoSmContol)
|
|
120 |
*/
|
|
121 |
struct TLocationStatusEnvelope
|
|
122 |
{
|
|
123 |
TUint8 iLocationStatus; // Location satus
|
|
124 |
TBuf8<KCountryCodeLength> iCountryCode; // Country code
|
|
125 |
TUint16 iLocationAreaCode;// Location area code
|
|
126 |
TUint16 iCellId; // Cell id
|
|
127 |
};
|
|
128 |
|
|
129 |
public: // Constructors and destructor
|
|
130 |
|
|
131 |
/**
|
|
132 |
* Two-phased constructor.
|
|
133 |
* @param aMmPhoneTsy: Pointer to TSY phone object
|
|
134 |
* @param aMmMessageRouter: Pointer to Message router base in Common TSY
|
|
135 |
* @param aName: Sat application fixed name
|
|
136 |
* @param aTsySatMessaging: SAT messaging pointer
|
|
137 |
* @return CSatTsy
|
|
138 |
*/
|
|
139 |
static CSatTsy* NewL( MMessageRouter& aMmMessageRouter, MCtsySatService& aSatService);
|
|
140 |
|
|
141 |
/**
|
|
142 |
* Destructor.
|
|
143 |
*/
|
|
144 |
~CSatTsy();
|
|
145 |
|
|
146 |
private:
|
|
147 |
|
|
148 |
/**
|
|
149 |
* C++ default constructor.
|
|
150 |
* @param aMmPhone: Pointer to TSY phone object
|
|
151 |
* @param aName: Sat application fixed name
|
|
152 |
* @param aTsySatMessaging: Sat messaging pointer
|
|
153 |
*/
|
|
154 |
CSatTsy( MMessageRouter& aMmMessageRouter, MCtsySatService& SatService);
|
|
155 |
|
|
156 |
/**
|
|
157 |
* By default EPOC constructor is private.
|
|
158 |
* @param aMmPhoneTsy: Pointer to TSY phone object
|
|
159 |
*/
|
|
160 |
void ConstructL();
|
|
161 |
|
|
162 |
public: // Functions from base classes
|
|
163 |
|
|
164 |
/**
|
|
165 |
* Command handler for Etel messages.
|
|
166 |
* @param aTsyReqHandle: Tsy request handle
|
|
167 |
* @param aIpc: command identifier
|
|
168 |
* @param aPackage: Data pointer
|
|
169 |
* @return status
|
|
170 |
*/
|
|
171 |
TInt ExtFunc( const TTsyReqHandle aTsyReqHandle,
|
|
172 |
const TInt aIpc, const TDataPackage& aPackage );
|
|
173 |
|
|
174 |
/**
|
|
175 |
* Saves the request type to request handle table
|
|
176 |
* @param aTsyReqHandle: Tsy request handle
|
|
177 |
* @param aSatRequestType: Request type to be saved
|
|
178 |
*/
|
|
179 |
void SaveReqHandle( const TTsyReqHandle aTsyReqHandle,
|
|
180 |
const TSatRequestTypes aSatRequestType );
|
|
181 |
|
|
182 |
/**
|
|
183 |
* ReqMode method for checking what modes this component supports
|
|
184 |
* @param aIpc: Command identifier
|
|
185 |
* @return reqmode
|
|
186 |
*/
|
|
187 |
CTelObject::TReqMode ReqModeL( const TInt aIPC );
|
|
188 |
|
|
189 |
/**
|
|
190 |
* Cancels the ongoing service
|
|
191 |
* @param aIpc: Command identifier
|
|
192 |
* @param aTsyReqHandle: Tsy request handle
|
|
193 |
* @return status
|
|
194 |
*/
|
|
195 |
TInt CancelService( const TInt aIpc,
|
|
196 |
const TTsyReqHandle aTsyReqHandle );
|
|
197 |
|
|
198 |
/**
|
|
199 |
* Register given command, checks if the command is supported
|
|
200 |
* @param aIpc: Command identifier
|
|
201 |
* @return status
|
|
202 |
*/
|
|
203 |
TInt RegisterNotification( const TInt aIpc );
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Deregisters given command, checks if the command is supported
|
|
207 |
* @param aIpc: Command identifier
|
|
208 |
* @return status
|
|
209 |
*/
|
|
210 |
TInt DeregisterNotification( const TInt aIpc );
|
|
211 |
|
|
212 |
/**
|
|
213 |
* Returns number of slots to be used for given IPC
|
|
214 |
* @param aIpc: Command identifier
|
|
215 |
* @return status
|
|
216 |
*/
|
|
217 |
TInt NumberOfSlotsL( const TInt aIpc );
|
|
218 |
|
|
219 |
public: // New functions
|
|
220 |
|
|
221 |
/**
|
|
222 |
* Completes requests to ETel
|
|
223 |
* @param aReqHandle: Registered req handle
|
|
224 |
* @param aRet: return value
|
|
225 |
*/
|
|
226 |
void ReqCompleted( TTsyReqHandle aReqHandle,
|
|
227 |
TInt aRet );
|
|
228 |
/**
|
|
229 |
* Cache call connected envelope
|
|
230 |
* @param aEnvelope Call connected envelope
|
|
231 |
*/
|
|
232 |
void StoreCallConnectedEvent( const TDesC8& aEnvelope );
|
|
233 |
|
|
234 |
/**
|
|
235 |
* Set Status of SetUpCall command to CSatEventDownloadTsy class.
|
|
236 |
* @param aStatus status of Set up Call proactive command
|
|
237 |
*/
|
|
238 |
void SetSetUpCallStatus( const TBool aStatus );
|
|
239 |
|
|
240 |
/**
|
|
241 |
* Set up events to report for USIM.
|
|
242 |
* @param aEvents: bit mask
|
|
243 |
*/
|
|
244 |
void SetUpEventList( TUint32 aEvents );
|
|
245 |
|
|
246 |
/**
|
|
247 |
* Returns pointer to the message manager
|
|
248 |
* @return CMmMessageManager*: pointer to the requested object
|
|
249 |
*/
|
|
250 |
CMmMessageManagerBase* MessageManager();
|
|
251 |
|
|
252 |
/**
|
|
253 |
* Returns pointer to the Call Control TSY
|
|
254 |
* @return CSatCCTsy*: pointer to the requested object
|
|
255 |
*/
|
|
256 |
CSatCCTsy* SatCCTsy();
|
|
257 |
|
|
258 |
/**
|
|
259 |
* Get pointer to SAT request handle
|
|
260 |
* @return CSatTsyReqHandleStore*:
|
|
261 |
*/
|
|
262 |
CSatTsyReqHandleStore* GetSatReqHandleStore();
|
|
263 |
|
|
264 |
/**
|
|
265 |
* Get pointer to request handle type
|
|
266 |
* @return pointer to request handle type
|
|
267 |
*/
|
|
268 |
TSatRequestTypes* GetReqHandleType();
|
|
269 |
|
|
270 |
/**
|
|
271 |
* Reports to CSatCCTsy whether call or SS has been activated by PCmd
|
|
272 |
* @param aAddress: Destination address of proactive command or NULL
|
|
273 |
*/
|
|
274 |
void StoreProactiveAddress( const TDesC8* aAddress );
|
|
275 |
|
|
276 |
/**
|
|
277 |
* Set Internal TON and NPI
|
|
278 |
* @param aTonNpi: TON and NPI
|
|
279 |
*/
|
|
280 |
void SetTonNpi( const TUint8 aTonNpi );
|
|
281 |
|
|
282 |
MmMessageManagerCallback* GetMessageManagerCallback();
|
|
283 |
|
|
284 |
public: //from MStkTsySatService
|
|
285 |
/**
|
|
286 |
* From MStkTsySatService
|
|
287 |
* Dummy implementation for CompleteSendSmsMessage function
|
|
288 |
*
|
|
289 |
* @param aError Error value
|
|
290 |
* @return Return always KErrNone
|
|
291 |
*/
|
|
292 |
virtual TInt CompleteSendSmsMessage( TInt aError );
|
|
293 |
|
|
294 |
/**
|
|
295 |
* From MStkTsySatService
|
|
296 |
* Dummy implementation for IsMoSmControlBySimActivated function
|
|
297 |
*
|
|
298 |
* @return Return always EFalse
|
|
299 |
*/
|
|
300 |
virtual TBool IsMoSmControlBySimActivated();
|
|
301 |
|
|
302 |
#ifdef USING_CTSY_DISPATCHER
|
|
303 |
public: //from MStkTsyCallOrigin
|
|
304 |
/**
|
|
305 |
* From MStkTsyCallOrigin
|
|
306 |
* Dummy implementation for IsSimOriginatedCall function
|
|
307 |
*
|
|
308 |
* @param aAddress The number whose origin is required.
|
|
309 |
* @return ETrue if call originates from a Proactive Command
|
|
310 |
*/
|
|
311 |
virtual TBool IsSimOriginatedCall( const TDesC8& aAddress );
|
|
312 |
#endif //USING_CTSY_DISPATCHER
|
|
313 |
private:
|
|
314 |
|
|
315 |
/**
|
|
316 |
* Handles extended client requests. Uses TRAP to ensure functioning on
|
|
317 |
* memory allocation failure
|
|
318 |
* @param aTsyReqHandle: TSY request handle
|
|
319 |
* @param aIpc: Request IPC number
|
|
320 |
* @param aPackage: Packaged request parameters
|
|
321 |
* @return result of the request
|
|
322 |
*/
|
|
323 |
TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle,
|
|
324 |
const TInt aIpc, const TDataPackage& aPackage );
|
|
325 |
|
|
326 |
/**
|
|
327 |
* Menu selection command handler from client application.
|
|
328 |
* @param aTsyReqHandle: TSY request handle
|
|
329 |
* @param aSelection: Packed menu item nr and help item indicator
|
|
330 |
* @return status
|
|
331 |
*/
|
|
332 |
TInt MenuSelectionL( TTsyReqHandle aTsyReqHandle,
|
|
333 |
RSat::TMenuSelectionV1Pckg* aSelection );
|
|
334 |
|
|
335 |
/**
|
|
336 |
* Send SMS No Logging command handler from client application.
|
|
337 |
* @param aMsg pointer to msg
|
|
338 |
* @param aTsyReqHandle TsyReqHandle
|
|
339 |
* @return status
|
|
340 |
*/
|
|
341 |
TInt SendMessageNoLogging( TDes8* aMsg, TTsyReqHandle aTsyReqHandle );
|
|
342 |
|
|
343 |
private: // Data
|
|
344 |
|
|
345 |
// A table for SAT request handles
|
|
346 |
TTsyReqHandle iSatReqHandles[ESatMaxNumOfRequests];
|
|
347 |
// Request handle type
|
|
348 |
TSatRequestTypes iReqHandleType;
|
|
349 |
// Request handle array type
|
|
350 |
TSatRequestTypes iReqHandleArrayType;
|
|
351 |
// Message manager
|
|
352 |
CMmMessageManagerBase* iMessageManager;
|
|
353 |
// SMS messaging class pointer for sending SMS messages
|
|
354 |
CMmSmsTsy* iMmSmsTsy;
|
|
355 |
// Store for request handles
|
|
356 |
CSatTsyReqHandleStore* iSatReqHandleStore;
|
|
357 |
|
|
358 |
// Pointer to the CCTsy class
|
|
359 |
CSatCCTsy* iSatCCTsy;
|
|
360 |
// Pointer to the IconTsy class
|
|
361 |
CSatIconTsy* iSatIconTsy;
|
|
362 |
// Pointer to the NotificationsTsy class
|
|
363 |
CSatNotificationsTsy* iSatNotificationsTsy;
|
|
364 |
// Pointer to the DataDownloadTsy class
|
|
365 |
CSatDataDownloadTsy* iSatDataDownloadTsy;
|
|
366 |
// Pointer to the EventDownloadTsy class
|
|
367 |
CSatEventDownloadTsy* iSatEventDownloadTsy;
|
|
368 |
|
|
369 |
MMessageRouter& iMessageRouter;
|
|
370 |
MCtsySatService& iSatService;
|
|
371 |
|
|
372 |
};
|
|
373 |
|
|
374 |
#endif // CSATTSY_H
|
|
375 |
|
|
376 |
// End of File
|