|
1 /** |
|
2 * Copyright (c) 2003-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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file CTelBearer.h |
|
22 @internalComponent |
|
23 */ |
|
24 |
|
25 #if !defined (__CTELBEARER_H__) |
|
26 #define __CTELBEARER_H__ |
|
27 |
|
28 #include <comms-infras/cbearerbase.h> |
|
29 #include <etelmm.h> |
|
30 #include <etelpckt.h> |
|
31 #include "sigstrgth.h" |
|
32 #include "asynwrap.h" |
|
33 |
|
34 _LIT(KTsyNameExtension,".tsy"); ///< KTsyNameExtension holds the extension for tsy. |
|
35 |
|
36 NONSHARABLE_CLASS(CTelBearer) : public CBearerBase, public MAsyncRequestsObserver |
|
37 /** |
|
38 The class checks the availability of the telephony bearers (i.e. CSD and PSD (either GPRS or CDMA)) |
|
39 |
|
40 @internalComponent |
|
41 */ |
|
42 { |
|
43 public: |
|
44 virtual ~CTelBearer(); |
|
45 static CTelBearer* NewLC(MBearerObserver* aObserver); |
|
46 static CTelBearer* NewL(MBearerObserver* aObserver); |
|
47 |
|
48 /** implementation of base class pure virtual */ |
|
49 virtual TBool StartChecking(); |
|
50 |
|
51 /** implementation of base class pure virtual */ |
|
52 virtual TBool StartChecking(TBool aIsReconnect); |
|
53 |
|
54 /** implementation of base class pure virtual */ |
|
55 virtual TBool StopChecking(); |
|
56 |
|
57 /** implementation of base class pure virtual */ |
|
58 virtual void Disconnect(); |
|
59 |
|
60 /** override of base-class function */ |
|
61 TInt SecondPhaseAvailability(); |
|
62 |
|
63 /** implementation of MAsyncRequestObserver interface */ |
|
64 void ETelAsyncRequestsComplete(TETelAsyncRequestData aRequestData); |
|
65 |
|
66 protected: |
|
67 CTelBearer(MBearerObserver* aObserver); |
|
68 void ConstructL(); |
|
69 |
|
70 /** implementation of base class pure virtual */ |
|
71 virtual void AssignSupportedBearerSet(); |
|
72 |
|
73 private: |
|
74 void GetBearerSupportL(); |
|
75 void OpenTelephonyL(); |
|
76 void OpenPhoneL(RTelServer& aTelServer, const TDesC& aTsyName, RMobilePhone& aMmPhone); |
|
77 void CloseTelephony(); |
|
78 void RetrievePhoneCapsL(); |
|
79 void RetrieveNetworkModeL(); |
|
80 void RetrievePacketSupportL(); |
|
81 |
|
82 void CalculateAvailableBearerSet(); |
|
83 TBool CsdAvailable() const; |
|
84 TBool PhoneAttachedAndRegistered() const; |
|
85 TBool MsClassSupportsPsd() const; |
|
86 |
|
87 void CheckBearerSupport(); |
|
88 static TInt StartCheckingCb(TAny* aThisPtr); |
|
89 |
|
90 private: |
|
91 |
|
92 /** State of ETEL server connection */ |
|
93 enum TTelServerState |
|
94 { |
|
95 ENotConnected, |
|
96 EServerConnected, |
|
97 EPhoneModuleLoaded, |
|
98 EPhoneOpen, |
|
99 EPacketOpen |
|
100 }; |
|
101 |
|
102 private: |
|
103 CAsyncCallBack* iStartCheckingCb; |
|
104 TBool iIsReconnect; |
|
105 RTelServer iTelServer; |
|
106 TTelServerState iTelServerState; |
|
107 HBufC* iTsyName; |
|
108 RMobilePhone iMmPhone; |
|
109 CAgentSignalStrengthWatcher* iSigStrengthWatcher; |
|
110 RPhone::TCaps iPhoneCaps; |
|
111 TUint32 iPhoneMultimodeCaps; |
|
112 RMobilePhone::TMobilePhoneNetworkMode iNetworkMode; |
|
113 RPacketService iPacket; |
|
114 RPacketService::TStatus iPacketDataNetworkStatus; |
|
115 RPacketService::TAttachMode iPacketAttachMode; |
|
116 CASyncEtelRequestWrapper* iETelServerRequestsWrapper; |
|
117 RPacketService::TMSClass iMsClass; |
|
118 RPacketService::TRegistrationStatus iNetworkRegStatus; |
|
119 }; |
|
120 |
|
121 #endif // __CTELBEARER_H__ |
|
122 |