|
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 : CSatNotificationsTsy.h |
|
16 * Part of : Common SIM ATK TSY / commonsimatktsy |
|
17 * Notifications-related functionality of Sat Tsy |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CSATNOTIFICATIONSTSY_H |
|
26 #define CSATNOTIFICATIONSTSY_H |
|
27 |
|
28 |
|
29 // INCLUDES |
|
30 #include <e32base.h> |
|
31 #include <etelsat.h> |
|
32 #include <et_tsy.h> |
|
33 #include "CSatTimer.h" // Timer class |
|
34 #include "TSatUtility.h" |
|
35 #include "TTlv.h" |
|
36 |
|
37 // CONSTANTS |
|
38 const TUint8 KSmsHeaderIndicatorMask = 0x40; |
|
39 |
|
40 const TUint8 KPlusMarkCharacterCode = 0x2B; |
|
41 const TUint8 KRefreshMasterFileHeader = 0x3F; |
|
42 const TUint8 KRefresh1StLevelDedicatedFileHeader = 0x7F; |
|
43 const TUint8 KRefresh2StLevelDedicatedFileHeader = 0x5F; |
|
44 |
|
45 const TUint8 KMask3 = 0x03; |
|
46 |
|
47 const TUint8 KMaskC0 = 0xC0; |
|
48 const TUint8 KMaskF3 = 0xF3; |
|
49 const TUint8 KMaskFB = 0xFB; |
|
50 const TUint8 KTPDUFieldStart = 0x04; |
|
51 const TUint8 KTonNpiBit8 = 0x80; |
|
52 |
|
53 const TUint8 KSmsVPFEnhanced = 0x08; |
|
54 const TUint8 KSmsVPFRelative = 0x10; |
|
55 const TUint8 KSmsVPFAbsolute = 0x18; |
|
56 const TUint8 KSATSmsMTISubmitOrSubmitReport = 0x01; |
|
57 |
|
58 const TUint8 KNoCause = 0x00; |
|
59 |
|
60 const TUint8 KOnlyIfNotBusy = 0x00; |
|
61 const TUint8 KOnlyIfNotBusyWithRedial = 0x01; |
|
62 const TUint8 KHoldOtherCalls = 0x02; |
|
63 const TUint8 KHoldOtherCallsWithRedial = 0x03; |
|
64 const TUint8 KDisconnectOtherCalls = 0x04; |
|
65 const TUint8 KDisconnectOtherCallsWithRedial = 0x05; |
|
66 |
|
67 const TUint8 KMTCall = 0x00; |
|
68 const TUint8 KCallConnected = 0x01; |
|
69 const TUint8 KCallDisconnected = 0x02; |
|
70 const TUint8 KLocationStatus = 0x03; |
|
71 const TUint8 KUserActivity = 0x04; |
|
72 const TUint8 KIdleScreenAvailable = 0x05; |
|
73 const TUint8 KCardReaderStatus = 0x06; |
|
74 const TUint8 KLanguageSelection = 0x07; |
|
75 const TUint8 KBrowserTermination = 0x08; |
|
76 const TUint8 KDataAvailable = 0x09; |
|
77 const TUint8 KChannelStatus = 0x0A; |
|
78 const TUint8 KAccessTechnologyChange = 0x0B; |
|
79 const TUint8 KDisplayParamsChanges = 0x0C; |
|
80 const TUint8 KLocalConnection = 0x0D; |
|
81 |
|
82 const TUint8 KDefaultPollInterval = 0x00; |
|
83 const TUint8 KMinPollInterval = 0x05; |
|
84 const TUint8 KMaxLegacyPollInterval = 0x19; |
|
85 const TUint8 KMaxPollInterval = 0xFF; |
|
86 |
|
87 const TUint8 KMinTimerValue = 0; |
|
88 const TUint KMaxTimerValueInSeconds = 86400; |
|
89 const TUint8 KDcsCbs7bitDefault = 0x0F; |
|
90 |
|
91 const TUint8 KLaunchBrowserCmdQualifierNotUsed = 0x01; |
|
92 const TUint8 KLaunchBrowserCmdQualifierReserved = 0x04; |
|
93 const TUint8 KCsdBearer = 0x01; |
|
94 const TUint8 KGprsBearer = 0x03; |
|
95 |
|
96 const TUint8 KSpecificLanguage = 0x01; |
|
97 const TUint8 KBipCsdBearer = 0x01; |
|
98 const TUint8 KBipGprsBearer = 0x02; |
|
99 const TUint8 KBipDefaultBearer = 0x03; |
|
100 const TUint8 KBipLocalLinkBearer = 0x04; |
|
101 const TUint8 KBipSendDataImmediately = 0x01; |
|
102 |
|
103 const TUint8 KMEIsInTheIdleState = 0x00; |
|
104 |
|
105 const TUint8 KMaxCommandDetailsLength = 5; |
|
106 |
|
107 // Maksimum value for get input string |
|
108 const TUint8 KGetInputStringMaxSize = 0xEF; |
|
109 |
|
110 // MACROS |
|
111 // None |
|
112 |
|
113 // DATA TYPES |
|
114 // None |
|
115 |
|
116 // FUNCTION PROTOTYPES |
|
117 // None |
|
118 |
|
119 // FORWARD DECLARATIONS |
|
120 class CSatTsy; |
|
121 class CSatTimer; |
|
122 class CMmMessageManagerBase; |
|
123 class CSatDataPackage; |
|
124 class CSatTsyReqHandleStore; |
|
125 class CSatNotifyDisplayText; |
|
126 class CSatNotifyGetInkey; |
|
127 class CSatNotifyGetInput; |
|
128 class CSatNotifyPlayTone; |
|
129 class CSatNotifySetUpMenu; |
|
130 class CSatNotifySelectItem; |
|
131 class CSatNotifySendSm; |
|
132 class CSatNotifySendSs; |
|
133 class CSatNotifySetUpEventList; |
|
134 class CSatNotifySendUssd; |
|
135 class CSatNotifySetUpIdleModeText; |
|
136 class CSatNotifyLaunchBrowser; |
|
137 class CSatNotifyPollInterval; |
|
138 class CSatNotifyCallControlRequest; |
|
139 class CSatNotifyTimerMgmt; |
|
140 class CSatNotifyLanguageNotification; |
|
141 class CSatNotifySendDtmf; |
|
142 class CSatNotifyPollingOff; |
|
143 class CSatNotifySetUpCall; |
|
144 class CSatNotifySimSessionEnd; |
|
145 class CSatNotifyLocalInfo; |
|
146 class CSatNotifyRefresh; |
|
147 class CSatNotifyOpenChannel; |
|
148 class CSatNotifyGetChannelStatus; |
|
149 class CSatNotifyMoSmControlRequest; |
|
150 class CSatNotifyCloseChannel; |
|
151 class CSatNotifySendData; |
|
152 class CSatNotifyReceiveData; |
|
153 class CSatNotifyMoreTime; |
|
154 |
|
155 // CLASS DECLARATION |
|
156 // None |
|
157 |
|
158 // DESCRIPTION |
|
159 /** |
|
160 * Each SAT proactive command has its own class (inherited from |
|
161 * MSatNotificationsBase), which holds the information |
|
162 * relevant to the command in question. All proactive command classes are |
|
163 * created when CSatNotificationsTsy object is created. This way each proactive |
|
164 * command is handled by its own notify class. The proactive commands are |
|
165 * encapsulated to individual classes in order to simplify the design and |
|
166 * updating. |
|
167 * |
|
168 * CSatNotificationsTsy contains Sat proactive command handling functionality. |
|
169 * |
|
170 * @lib Commonsimatktsy |
|
171 * @since 3.1 |
|
172 */ |
|
173 NONSHARABLE_CLASS ( CSatNotificationsTsy ) : public CBase |
|
174 { |
|
175 public: // Enumerations |
|
176 |
|
177 enum TCachedSimAtkFiles |
|
178 { |
|
179 ECacheEFSST = 0x01, // EF-SST, (U)SIM Service table |
|
180 ECacheEFCBMID = 0x02,// EF-CBMID, CB DataDownload message IDs |
|
181 // Next 0x04, 0x08 etc.. |
|
182 }; |
|
183 |
|
184 /** |
|
185 * The data in this structure is updated each time a notification |
|
186 * message is received from DOS. It provides the data needed for |
|
187 * sending the terminal response. |
|
188 * Additional info for NotifySetUpEventList, |
|
189 * CSatNotifyLocalInfo::CompleteTerminalRespL() |
|
190 * and CSatNotifyRefresh::CompleteTerminalRespDataL() |
|
191 * ServiceType for CSatNotifyRefresh::CompleteNotifyL() |
|
192 */ |
|
193 struct TTerminalRespData |
|
194 { |
|
195 // Proactive command number |
|
196 TUint8 iPCmdNumber; |
|
197 // Command details tlv |
|
198 TBuf8<KMaxCommandDetailsLength>iCommandDetails; |
|
199 // General result for NotifySetUpEventList |
|
200 TUint8 iGeneralResult; |
|
201 // Additional info |
|
202 TBuf<RSat::KAdditionalInfoMaxSize> iAdditionalInfo; |
|
203 }; |
|
204 |
|
205 |
|
206 /* |
|
207 * This structure contains the address data of the service center |
|
208 * needed for MO-SMS Control envelope. |
|
209 */ |
|
210 struct TAddressData |
|
211 { |
|
212 TPtrC8 iRPDestinationAddr; // RP Destination Address |
|
213 TPtrC8 iTPDestinationAddr; // TP Destination Address |
|
214 }; |
|
215 |
|
216 /** |
|
217 * The data in this structure is used for a response to the NAA for a |
|
218 * MO SM Control notification request. The possible values of the |
|
219 * result are defined in TSatUtility.h |
|
220 */ |
|
221 struct TMoSmCtrlData |
|
222 { |
|
223 TAddressData iAddressData; // RP and TP Destination addresses |
|
224 RSat::TAlphaId* iAlphaId; // Pointer to the Alpha ID object |
|
225 TBool iIsAlphaIdEmpty; // Declares id Alpha ID is empty |
|
226 TUint8 iResult; // MO SM Ctrl Result, |
|
227 }; |
|
228 |
|
229 |
|
230 /* |
|
231 * This structure contains local information. |
|
232 * Used in event handling and by CSatNotifyLocalInfo |
|
233 */ |
|
234 struct TLocalInformation |
|
235 { |
|
236 TUint16 iLocationAreaCode; // Location area code |
|
237 TUint16 iCellId; // Cell Id |
|
238 TBuf8<KOperatorCodeLength> iOperatorCode; // Operator code |
|
239 }; |
|
240 |
|
241 /** |
|
242 * This Structure provides Refresh specific information |
|
243 * Used: CSatNotifyRefresh::RefreshAllowed() |
|
244 */ |
|
245 struct TRefreshInfo |
|
246 { |
|
247 TBuf8<RSat::KRefreshedFileListMaxSize> iFileList; |
|
248 TBuf8<RSat::KAidMaxSize> iAid; |
|
249 TUint16 iInternalCache; |
|
250 }; |
|
251 /** |
|
252 * This Structure provides Ss and Ussd status |
|
253 * Used: CSatNotifyLaunchBrowser::SetSsStatus() |
|
254 */ |
|
255 enum TSsStatus |
|
256 { |
|
257 ENotBusy, |
|
258 ESsBusy, |
|
259 EUssdBusy |
|
260 }; |
|
261 public: |
|
262 |
|
263 /** |
|
264 * Two-phased constructor. |
|
265 * @param aSatTsy: Pointer to Sat TSY |
|
266 * @param aSatReqHandleStore: Pointer to request handle store |
|
267 * @return created object |
|
268 */ |
|
269 static CSatNotificationsTsy* NewL( CSatTsy* aSatTsy, |
|
270 CSatTsyReqHandleStore* aSatReqHandleStore ); |
|
271 |
|
272 /** |
|
273 * C++ Destructor. |
|
274 */ |
|
275 ~CSatNotificationsTsy(); |
|
276 |
|
277 private: |
|
278 |
|
279 /** |
|
280 * By default C++ constructor is private. |
|
281 * @param aSatTsy: Pointer to Sat TSY |
|
282 * @param aSatReqHandleStore: Pointer to request handle store |
|
283 */ |
|
284 CSatNotificationsTsy( CSatTsy* aSatTsy, |
|
285 CSatTsyReqHandleStore* aSatReqHandleStore ); |
|
286 |
|
287 /** |
|
288 * Class attributes are created in ConstructL. |
|
289 */ |
|
290 void ConstructL(); |
|
291 |
|
292 public: // New functions |
|
293 |
|
294 /** |
|
295 * Handles extended client requests. |
|
296 * @param aTsyReqHandle: Telephony service request handle |
|
297 * @param aIpc: Request IPC number |
|
298 * @param aPackage: Packed request parameters |
|
299 * @return Result of the request |
|
300 */ |
|
301 TInt DoExtFuncL( |
|
302 const TTsyReqHandle aTsyReqHandle, |
|
303 const TInt aIpc, |
|
304 const TDataPackage& aPackage ); |
|
305 |
|
306 /** |
|
307 * Cancels request that's IPC number and request handle are given in |
|
308 * parameters |
|
309 * @param aIpc: Request IPC number |
|
310 * @param aTsyReqHandle: TSY request handle |
|
311 * @return Result of the request |
|
312 */ |
|
313 TInt CancelService( const TInt aIpc, |
|
314 const TTsyReqHandle aTsyReqHandle ); |
|
315 |
|
316 /** |
|
317 * Sets PollingOff/PollInterval response data, calls CreateTerminalRespL |
|
318 * @param aDataPackage: Data |
|
319 * @param aErrorCode: error code possible values KErrNone/KErrArgument |
|
320 */ |
|
321 void SetPollingResultL( CSatDataPackage* aDataPackage, |
|
322 TInt aErrorCode ); |
|
323 |
|
324 /** |
|
325 * Set Polling Interval, sending a request to DOS |
|
326 * @param aValue: Polling interval in seconds |
|
327 */ |
|
328 void SetPollingIntervalL( TUint8 aValue ); |
|
329 |
|
330 /** |
|
331 * Timer Expiration handler |
|
332 * @param aTimerId: Timer identification |
|
333 * @param aTimerValue: Timer value |
|
334 * @return Success/Failure value |
|
335 */ |
|
336 TInt TimerExpirationL( TInt aTimerId, TUint32 aTimerValue ); |
|
337 |
|
338 /** |
|
339 * Returns pointer to SatTimer |
|
340 * @return Pointer to CSatTimer |
|
341 */ |
|
342 CSatTimer* GetSatTimer(); |
|
343 |
|
344 /** |
|
345 * Returns pointer to CSatNotifySetUpCall |
|
346 * @return Pointer to CSatNotifySetUpCall |
|
347 */ |
|
348 CSatNotifySetUpCall* SatNotifySetUpCall(); |
|
349 |
|
350 /** |
|
351 * Sets proactive command on going status |
|
352 * @param aDataPackage: Packed data |
|
353 * @param aResult: result |
|
354 */ |
|
355 void SetProactiveCommandOnGoingStatus( CSatDataPackage* aDataPackage, |
|
356 TInt aResult ); |
|
357 |
|
358 /** |
|
359 * Completes the notification request received from client |
|
360 * @param aDataPackage: Packed Bertlv data |
|
361 * @param aResult: result |
|
362 * @return KErrNone |
|
363 */ |
|
364 TInt CompletePCmdL( CSatDataPackage* aDataPackage, TInt aResult ); |
|
365 |
|
366 /* |
|
367 * Returns iIsMoSmsCtrlActivated |
|
368 * This is used by CSatTsy |
|
369 * @return ETrue if MO-SMS Control is activated |
|
370 */ |
|
371 TBool IsMoSmControlActivated(); |
|
372 |
|
373 /** |
|
374 * Set PollingOff value |
|
375 * @param aPollingOff: Polling off value |
|
376 */ |
|
377 void SetPollingOffStatus( TBool aPollingOff ); |
|
378 |
|
379 /** |
|
380 * Returns iPollingOff |
|
381 * This is used by CSatNotifyPollingOff and CSatNotifyPollInterval |
|
382 * @return ETrue if Polling is ON |
|
383 */ |
|
384 TBool PollingOffStatus( ); |
|
385 |
|
386 /** |
|
387 * Add Location Information simple TLV to TTlv |
|
388 * @param aTlv: Target for location information |
|
389 */ |
|
390 void AddLocationInformationToTlv( TTlv& aTlv ); |
|
391 |
|
392 /** |
|
393 * Passes Alpha Id for notification completion method |
|
394 * @param aAlphaId: Reference to the Alpha ID |
|
395 * @param aResult: Result of the call control request |
|
396 */ |
|
397 void NotifyClientForAlphaId( RSat::TAlphaIdBuf& aAlphaId, |
|
398 RSat::TControlResult aResult ); |
|
399 |
|
400 /** |
|
401 * Returns pointer to the request handle store |
|
402 */ |
|
403 CSatTsyReqHandleStore* RequestHandleStore(); |
|
404 |
|
405 protected: |
|
406 |
|
407 /** |
|
408 * Notifies DOS of being ready to receive indications, reguests |
|
409 * the wanted msg from pending state if exists |
|
410 * @param aPCmdMsgType: Notification msg type to be received. |
|
411 * @return success/failure if msg was found |
|
412 */ |
|
413 TInt NotifySatReadyForNotification( TUint8 aPCmdMsgType ); |
|
414 |
|
415 private: |
|
416 |
|
417 /** |
|
418 * Terminal response command handler from client application. |
|
419 * @param aPCmd: Proactive command Id |
|
420 * @param aRsp: Response structure |
|
421 * @param aTsyReqHandle: Telephony service request handle |
|
422 * @return KErrNone, KErrGeneral or KErrNotSupported |
|
423 */ |
|
424 TInt TerminalResponseL( RSat::TPCmd* aPCmd, TDes8* aRsp, |
|
425 TTsyReqHandle aTsyReqHandle ); |
|
426 |
|
427 /** |
|
428 * Completes terminal response |
|
429 * @param TInt aErrorCode: error/success code |
|
430 */ |
|
431 void CompleteTerminalResponse( TInt aErrorCode ); |
|
432 |
|
433 /** |
|
434 * Test if a command was performed successfully |
|
435 * @param aGeneralResult: General result value |
|
436 * @return ETrue if command performed successfully, else EFalse |
|
437 */ |
|
438 TBool CommandPerformedSuccessfully( TUint8 aGeneralResult ); |
|
439 |
|
440 /** |
|
441 * Cell broadcast data download from client application |
|
442 * @param aTsyReqHandle: Telephony service request handle |
|
443 * @return KErrNone |
|
444 */ |
|
445 TInt NotifyCbDownload( TTsyReqHandle aTsyReqHandle ); |
|
446 |
|
447 /** |
|
448 * Sms-Pp data download from client application |
|
449 * @param aTsyReqHandle: Telephony service request handle |
|
450 * @return KErrNone |
|
451 */ |
|
452 TInt NotifySmsPpDownload( TTsyReqHandle aTsyReqHandle ); |
|
453 |
|
454 protected: // Data |
|
455 |
|
456 // Pointer to Sat TSY |
|
457 CSatTsy* iSatTsy; |
|
458 // Timer class object |
|
459 CSatTimer* iSatTimer; |
|
460 |
|
461 private: // Data |
|
462 |
|
463 // Proactive command class pointers |
|
464 // created when this class is created, all classes |
|
465 // need pointers to this class |
|
466 CSatNotifyDisplayText* iNotifyDisplayText; |
|
467 CSatNotifyGetInkey* iNotifyGetInkey; |
|
468 CSatNotifyGetInput* iNotifyGetInput; |
|
469 CSatNotifyPlayTone* iNotifyPlayTone; |
|
470 CSatNotifySetUpMenu* iNotifySetUpMenu; |
|
471 CSatNotifySelectItem* iNotifySelectItem; |
|
472 CSatNotifySendSm* iNotifySendSm; |
|
473 CSatNotifySendSs* iNotifySendSs; |
|
474 CSatNotifySetUpEventList* iNotifySetUpEventList; |
|
475 CSatNotifySendUssd* iNotifySendUssd; |
|
476 CSatNotifySetUpIdleModeText* iNotifySetUpIdleModeText; |
|
477 CSatNotifyLaunchBrowser* iNotifyLaunchBrowser; |
|
478 CSatNotifyPollInterval* iNotifyPollInterval; |
|
479 CSatNotifyCallControlRequest* iNotifyCallControlRequest; |
|
480 CSatNotifySetUpCall* iNotifySetUpCall; |
|
481 CSatNotifyRefresh* iNotifyRefresh; |
|
482 CSatNotifySimSessionEnd* iNotifySimSessionEnd; |
|
483 CSatNotifySendDtmf* iNotifySendDtmf; |
|
484 CSatNotifyPollingOff* iNotifyPollingOff; |
|
485 CSatNotifyLocalInfo* iNotifyLocalInfo; |
|
486 CSatNotifyTimerMgmt* iNotifyTimerMgmt; |
|
487 CSatNotifyLanguageNotification* iNotifyLanguageNotification; |
|
488 CSatNotifyOpenChannel* iNotifyOpenChannel; |
|
489 CSatNotifyMoSmControlRequest* iNotifyMoSmControlRequest; |
|
490 CSatNotifyGetChannelStatus* iNotifyGetChannelStatus; |
|
491 CSatNotifyCloseChannel* iNotifyCloseChannel; |
|
492 CSatNotifySendData* iNotifySendData; |
|
493 CSatNotifyReceiveData* iNotifyReceiveData; |
|
494 CSatNotifyMoreTime* iNotifyMoreTime; |
|
495 |
|
496 // Terminal response data class |
|
497 TTerminalRespData iTerminalRespData; |
|
498 // Request handle store |
|
499 CSatTsyReqHandleStore* iSatReqHandleStore; |
|
500 // Message manager |
|
501 CMmMessageManagerBase* iMessageManager; |
|
502 // Flag is ETrue after Polling Off, EFalse after Polling Interval PCmd |
|
503 TBool iPollingOff; |
|
504 // Flag is set true if requested Poll Interval |
|
505 // is longer than KMaxLegacyPollInterval |
|
506 TBool iLongPollIntervalReq; |
|
507 |
|
508 private: // Friend classes |
|
509 |
|
510 // Notification classes |
|
511 friend class CSatNotifyDisplayText; |
|
512 friend class CSatNotifyGetInkey; |
|
513 friend class CSatNotifyGetInput; |
|
514 friend class CSatNotifyPlayTone; |
|
515 friend class CSatNotifySetUpMenu; |
|
516 friend class CSatNotifySelectItem; |
|
517 friend class CSatNotifySendSm; |
|
518 friend class CSatNotifySendSs; |
|
519 friend class CSatNotifySetUpEventList; |
|
520 friend class CSatNotifySendUssd; |
|
521 friend class CSatNotifySetUpIdleModeText; |
|
522 friend class CSatNotifyLaunchBrowser; |
|
523 friend class CSatNotifyPollInterval; |
|
524 friend class CSatNotifyCallControlRequest; |
|
525 friend class CSatNotifySetUpCall; |
|
526 friend class CSatNotifyRefresh; |
|
527 friend class CSatNotifySimSessionEnd; |
|
528 friend class CSatNotifySendDtmf; |
|
529 friend class CSatNotifyPollingOff; |
|
530 friend class CSatNotifyLocalInfo; |
|
531 friend class CSatNotifyTimerMgmt; |
|
532 friend class CSatNotifyLanguageNotification; |
|
533 friend class CSatNotifyOpenChannel; |
|
534 friend class CSatNotifyGetChannelStatus; |
|
535 friend class CSatNotifyMoSmControlRequest; |
|
536 friend class CSatNotifyCloseChannel; |
|
537 friend class CSatNotifySendData; |
|
538 friend class CSatNotifyReceiveData; |
|
539 friend class CSatNotifyMoreTime; |
|
540 }; |
|
541 |
|
542 #endif // CSATNOTIFICATIONSTSY_H |
|
543 |
|
544 // End of File |