|
1 // Copyright (c) 2001-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 _GPRS_H |
|
22 #define _GPRS_H |
|
23 |
|
24 #include <etelpckt.h> |
|
25 #include <pcktcs.h> |
|
26 #include <e32base.h> |
|
27 #include "et_tsy.h" |
|
28 #include <et_phone.h> |
|
29 |
|
30 class CATIO; |
|
31 class CATInit; |
|
32 class CPhoneGlobals; |
|
33 class CATGprsClass; |
|
34 class CATGprsDetach; |
|
35 class CATGprsAttach; |
|
36 class CATGprsNtwkRegStatus; |
|
37 class CATGprsNtwkRegStatusChange; |
|
38 class CGprsContext; |
|
39 class CGprsContextEntry; |
|
40 |
|
41 class CGprs :public CSubSessionExtBase |
|
42 /** |
|
43 This class implements the GPRS functionality supported in the RPacket APIs |
|
44 CGprs inherits from CSubSessionExtBase. It is intended for CPhoneGsm usage. |
|
45 This class contains a linked list of the contexts that it creates. |
|
46 @internalComponent |
|
47 */ |
|
48 { |
|
49 public: |
|
50 static CGprs* NewL(CATIO* iIo, CATInit* iInit, CPhoneGlobals* iPhoneGlobals); |
|
51 virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage); |
|
52 virtual TReqMode ReqModeL(const TInt aIpc); |
|
53 virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName); |
|
54 virtual CTelObject* OpenNewObjectL(TDes& aNewName); |
|
55 virtual TInt CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle); |
|
56 virtual void Init(); |
|
57 virtual TInt RegisterNotification(const TInt aIpc); |
|
58 virtual TInt DeregisterNotification(const TInt aIpc); |
|
59 virtual TInt NumberOfSlotsL(const TInt aIpc); |
|
60 RHandleBase* GlobalKernelObjectHandle(); |
|
61 TDes* NameOfLastAddedContext(); |
|
62 |
|
63 RPacketService::TStatus Status(); |
|
64 void SetStatus(RPacketService::TStatus aStatus); |
|
65 |
|
66 RPacketService::TRegistrationStatus RegistrationStatus(); |
|
67 void SetRegistrationStatus(RPacketService::TRegistrationStatus aStatus); |
|
68 |
|
69 TInt NumberOfContexts(); |
|
70 RPacketService::TMSClass CurrentMSClass(); |
|
71 void SetCurrentMSClass(RPacketService::TMSClass aMSClass); |
|
72 RPacketService::TMSClass MaxMSClass(); |
|
73 void SetContextConfigGPRS(const RPacketContext::TContextConfigGPRS* aContextConfigGPRS); |
|
74 void ContextConfigGPRS(RPacketContext::TContextConfigGPRS* aContextConfigGPRS); |
|
75 TInt MaxNumberOfContexts(); |
|
76 CGprsContext* Context(TInt aCount); |
|
77 void RemoveContext(CGprsContext* aContext); |
|
78 |
|
79 private: |
|
80 CGprs(CATIO* iIo, CATInit* iInit, CPhoneGlobals* iPhoneGlobals); |
|
81 virtual ~CGprs(); |
|
82 void ConstructL(); |
|
83 private: |
|
84 void AppendNewContextL(CGprsContext* aNewContext); |
|
85 void GenerateNewContextNameAndCid(TDes& aName, TInt& aCid); |
|
86 |
|
87 TInt NotifyContextAdded(const TTsyReqHandle aTsyReqHandle, TDes* aContextId); |
|
88 TInt NotifyContextAddedCancel(const TTsyReqHandle aTsyReqHandle); |
|
89 |
|
90 TInt Attach(const TTsyReqHandle aTsyReqHandle); |
|
91 TInt AttachCancel(const TTsyReqHandle aTsyReqHandle); |
|
92 |
|
93 TInt Detach(const TTsyReqHandle aTsyReqHandle); |
|
94 TInt DetachCancel(const TTsyReqHandle aTsyReqHandle); |
|
95 |
|
96 TInt GetStatus(const TTsyReqHandle aTsyReqHandle,RPacketService::TStatus* aGprsStatus); |
|
97 TInt NotifyStatusChange(const TTsyReqHandle aTsyReqHandle,RPacketService::TStatus* aGprsStatus); |
|
98 TInt NotifyStatusChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
99 |
|
100 TInt NotifyContextActivationRequested(const TTsyReqHandle aTsyReqHandle, RPacketContext::TProtocolType* aPdpType); |
|
101 TInt NotifyContextActivationRequestedCancel(const TTsyReqHandle aTsyReqHandle); |
|
102 |
|
103 TInt RejectActivationRequest(const TTsyReqHandle aTsyReqHandle); |
|
104 TInt RejectActivationRequestCancel(const TTsyReqHandle aTsyReqHandle); |
|
105 |
|
106 TInt EnumerateContexts(const TTsyReqHandle aTsyReqHandle,TInt* aCount, TInt* aMaxAllowed); |
|
107 TInt GetContextInfo(const TTsyReqHandle aTsyReqHandle,TInt aIndex,RPacketService::TContextInfo* aInfo); |
|
108 TInt GetContextInfoCancel(const TTsyReqHandle aTsyReqHandle); |
|
109 |
|
110 TInt GetNtwkRegStatus(const TTsyReqHandle aTsyReqHandle,RPacketService::TRegistrationStatus* aRegistrationStatus); |
|
111 TInt GetNtwkRegStatusCancel(const TTsyReqHandle aTsyReqHandle); |
|
112 TInt NotifyChangeOfNtwkRegStatus(const TTsyReqHandle aTsyReqHandle,RPacketService::TRegistrationStatus* aRegistrationStatus); |
|
113 TInt NotifyChangeOfNtwkRegStatusCancel(const TTsyReqHandle aTsyReqHandle); |
|
114 |
|
115 TInt GetMSClass(const TTsyReqHandle aTsyReqHandle, RPacketService::TMSClass* aCurrentClass, RPacketService::TMSClass* aMaxClass); |
|
116 TInt GetMSClassCancel(const TTsyReqHandle aTsyReqHandle); |
|
117 |
|
118 TInt SetMSClass(const TTsyReqHandle aTsyReqHandle, RPacketService::TMSClass* aClass); |
|
119 TInt SetMSClassCancel(const TTsyReqHandle aTsyReqHandle); |
|
120 |
|
121 TInt NotifyMSClassChange(const TTsyReqHandle aTsyReqHandle, RPacketService::TMSClass* aNewClass); |
|
122 TInt NotifyMSClassChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
123 |
|
124 TInt GetStaticCaps(const TTsyReqHandle aTsyReqHandle, TUint* aCaps,RPacketContext::TProtocolType* aPdpType); |
|
125 |
|
126 TInt GetDynamicCaps(const TTsyReqHandle aTsyReqHandle, RPacketService::TDynamicCapsFlags* aCaps); |
|
127 TInt NotifyDynamicCapsChange(const TTsyReqHandle aTsyReqHandle, RPacketService::TDynamicCapsFlags* aCaps); |
|
128 TInt NotifyDynamicCapsChangeCancel(const TTsyReqHandle aTsyReqHandle); |
|
129 |
|
130 TInt SetAttachMode(const TTsyReqHandle aTsyReqHandle, RPacketService::TAttachMode* aMode); |
|
131 TInt GetAttachMode(const TTsyReqHandle aTsyReqHandle, RPacketService::TAttachMode* aMode); |
|
132 |
|
133 TInt SetDefaultContextParams(const TTsyReqHandle aTsyReqHandle, const TDesC8* aPckg); |
|
134 TInt GetDefaultContextParams(const TTsyReqHandle aTsyReqHandle, TDes8* aPckg); |
|
135 |
|
136 private: |
|
137 TDblQue<CGprsContextEntry> iContexts; //< List of contexts. |
|
138 CATIO* iIo; //< Pointer to communication object. |
|
139 CATGprsAttach* iATGPRSAttach; //< Pointer to AT GPRS attach command object. |
|
140 CATGprsDetach* iATGprsDetach; //< Pointer to AT GPRS detach command object. |
|
141 CATInit* iInit; //< Pointer to AT phone init object. |
|
142 CATGprsClass* iATGprsClass; //< Pointer to AT GPRS MS class command object. |
|
143 CATGprsNtwkRegStatus* iATGprsNtwkRegStatus; //< Pointer to AT GPRS get current network registration command object. |
|
144 CATGprsNtwkRegStatusChange* iATGprsNtwkRegStatusChange; //< Pointer to AT machine which triggers notifications when phone changes reg status |
|
145 CPhoneGlobals* iPhoneGlobals; //< Pointer to phone globals that store phone wide parameters. |
|
146 |
|
147 // internal GPRS connection state. |
|
148 RPacketContext::TContextConfigGPRS iDefContextConfigGPRS; //< Internal state. Default context settings. |
|
149 RMutex iMutex; //< Synchronisation mutex |
|
150 }; |
|
151 |
|
152 class CGprsContext; |
|
153 |
|
154 class CGprsContextEntry : public CBase |
|
155 /** |
|
156 This class contains a CGprsContext pointer. It is intended to |
|
157 be part of CGprs's linked list of contexts |
|
158 CGprs inherits from CBase. This class is only intended to be part of the TDblQue list |
|
159 that CGprs has. |
|
160 @internalComponent |
|
161 */ |
|
162 { |
|
163 friend class CGprs; |
|
164 public: |
|
165 CGprsContextEntry(CGprsContext* aContext); |
|
166 ~CGprsContextEntry(); |
|
167 void Deque(); |
|
168 public: |
|
169 CGprsContext* iContext; //< Pointer to a context. |
|
170 private: |
|
171 TDblQueLink iLink; //< Link object. |
|
172 }; |
|
173 #endif |