1 /* |
|
2 * Copyright (c) 2009-2010 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 * Declaration of packetdata interface implementation |
|
16 * for "Packetdata" plugin |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef PACKETDATA_PLUGIN_H |
|
21 #define PACKETDATA_PLUGIN_H |
|
22 |
|
23 #include <cmpluginbaseeng.h> |
|
24 #include <cmpluginpacketdatadef.h> |
|
25 |
|
26 /** |
|
27 * CCmPluginPacketData defines the functionality of packetdata bearer support. |
|
28 * Most of the API is inherited from CCmPluginBaseEng class. |
|
29 */ |
|
30 NONSHARABLE_CLASS( CCmPluginPacketData ) : public CCmPluginBaseEng |
|
31 { |
|
32 |
|
33 public: |
|
34 /** |
|
35 * Two phased constructor. |
|
36 * @return Returns the packetdata plugin object. |
|
37 */ |
|
38 static CCmPluginPacketData* NewL( TCmPluginInitParam* aInitParam ); |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 virtual ~CCmPluginPacketData(); |
|
44 |
|
45 public: // From CCmPluginBaseEng |
|
46 /** |
|
47 * Creates a new instance of packetdata bearer plugin. The instance |
|
48 * created represents a bearer, not a connection method. |
|
49 * @param aInitParam Initialization data. |
|
50 * @return Returns CCmPluginBaseEng type pointer which represents pure |
|
51 * bearer instance for the cmm server. |
|
52 */ |
|
53 virtual CCmPluginBaseEng* CreateInstanceL( |
|
54 TCmPluginInitParam& aInitParam ) const; |
|
55 |
|
56 /** |
|
57 * Following GetBearerInfoXXXL methods return the values of the |
|
58 * requested attributes. These values are packetdata specific |
|
59 * so they don't vary between packetdata Connection Methods. |
|
60 * @param aAttribute An attribute identifier. |
|
61 * @return Returns the value requested. If not found leaves with |
|
62 * KErrNotFound error code. |
|
63 */ |
|
64 |
|
65 virtual TUint32 GetBearerInfoIntL( TUint32 aAttribute ) const; |
|
66 |
|
67 virtual TBool GetBearerInfoBoolL( TUint32 aAttribute ) const; |
|
68 |
|
69 virtual HBufC* GetBearerInfoStringL( TUint32 aAttribute ) const; |
|
70 |
|
71 virtual HBufC8* GetBearerInfoString8L( TUint32 aAttribute ) const; |
|
72 |
|
73 /** |
|
74 * Checks if the plug-in can handle the Connection Method identified |
|
75 * with parameter aIapId. |
|
76 * @param aIapId IAPId of the Connection Method to be checked. |
|
77 * @return ETrue if plug-in can handle the IAP, otherwise EFalse. |
|
78 */ |
|
79 virtual TBool CanHandleIapIdL( TUint32 aIapId ) const; |
|
80 |
|
81 /** |
|
82 * Checks if the plug-in can handle the given IAP record. |
|
83 * @param aIapRecord IAP record to be checked |
|
84 * @return ETrue if plug-in can handle the IAP, otherwise EFalse. |
|
85 */ |
|
86 virtual TBool CanHandleIapIdL( |
|
87 CommsDat::CCDIAPRecord *aIapRecord ) const; |
|
88 |
|
89 public: // From CCmPluginBaseEng concerning a Connection Method |
|
90 /** |
|
91 * Before generic side starts to request plugins to load records |
|
92 * it calls this to give a possibility make some preparations |
|
93 * if needed. |
|
94 */ |
|
95 virtual void PreparePluginToLoadRecordsL(); |
|
96 |
|
97 /** |
|
98 * Before generic side starts to request plugins to update records |
|
99 * it calls this to give a possibility make some preparations |
|
100 * if needed. |
|
101 * @param aGenRecordArray An array of generic records to be updated. |
|
102 * @param aBearerSpecRecordArray An array of bearer specific records |
|
103 * to be updated. |
|
104 */ |
|
105 virtual void PreparePluginToUpdateRecordsL( |
|
106 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
107 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
108 |
|
109 /** |
|
110 * Creates the CCDWCDMAPacketServiceRecord type service record. |
|
111 */ |
|
112 virtual void CreateServiceRecordL(); |
|
113 |
|
114 /** |
|
115 * Loads the service record. Service record pointer is stored to |
|
116 * plugins generic side implementation(CCmPluginBaseEng). |
|
117 */ |
|
118 virtual void LoadServiceRecordL(); |
|
119 |
|
120 /** |
|
121 * Returns the service record id of this Connection Method. |
|
122 * @return Returns the id of the service record id of this Connection Method. |
|
123 */ |
|
124 virtual TUint32 ServiceRecordId() const; |
|
125 |
|
126 /** |
|
127 * Returns the service record name of the Connection Method. |
|
128 * @param aServiceName Name of the service record which CM's iap record |
|
129 * points to. |
|
130 */ |
|
131 virtual void ServiceRecordNameLC( HBufC* &aServiceName ); |
|
132 |
|
133 /** |
|
134 * Writes the service record data to CommsDat. |
|
135 * @param aGenRecordArray An array containing pointers to service |
|
136 * record of the Connection Method. |
|
137 * @param aBearerSpecRecordArray An array containing pointers to bearer |
|
138 * specific records of the Connection Method. |
|
139 */ |
|
140 virtual void UpdateServiceRecordL( |
|
141 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
142 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
143 |
|
144 /** |
|
145 * Creates packetdata specific default records. |
|
146 */ |
|
147 virtual void CreateBearerRecordsL(); |
|
148 |
|
149 /** |
|
150 * Loads packetdata specific records of the Connection Method. |
|
151 */ |
|
152 virtual void LoadBearerRecordsL(); |
|
153 |
|
154 /** |
|
155 * Returns the bearer record id of the Connection Method. |
|
156 * @param aRecordId Id of the bearer record this CM's iap record |
|
157 * points to. |
|
158 */ |
|
159 virtual void BearerRecordIdL( TUint32& aRecordId ); |
|
160 |
|
161 /** |
|
162 * Returns the bearer record name of the Connection Method. |
|
163 * @param aBearerName Name of the bearer record this CM's iap record |
|
164 * points to. |
|
165 */ |
|
166 virtual void BearerRecordNameLC( HBufC* &aBearerName ); |
|
167 |
|
168 /** |
|
169 * Writes packetdata specific record data to CommsDat. |
|
170 * @param aGenRecordArray An array containing pointers to generic records |
|
171 * of the Connection Method. |
|
172 * @param aBearerSpecRecordArray An array containing pointers to bearer |
|
173 * specific records to be written. |
|
174 */ |
|
175 virtual void UpdateBearerRecordsL( |
|
176 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
177 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
178 |
|
179 /** |
|
180 * Deletes packetdata specific records of the Connection Method. |
|
181 */ |
|
182 void DeleteBearerRecordsL(); |
|
183 |
|
184 /** |
|
185 * Releases the memory reserved by the packetdata specific records |
|
186 * of the Connection Method. |
|
187 */ |
|
188 virtual void ResetBearerRecords(); |
|
189 |
|
190 /** |
|
191 * Creates a copy of packetdata specific records and adds them to |
|
192 * aRecordArray. |
|
193 */ |
|
194 virtual void GetBearerSpecificRecordsL( |
|
195 RPointerArray<CommsDat::CCDRecordBase>& aRecordArray ); |
|
196 |
|
197 /** |
|
198 * Following GetBearerXXXXAttribute methods get only the |
|
199 * fields in records in pointer arrays(parameters). |
|
200 * @param aAttribute Identifier of the requested value. |
|
201 * @param aGenRecordArray An array containing pointers to generic |
|
202 * records of the Connection Method. |
|
203 * @param aBearerSpecRecordArray An array containing pointers to bearer |
|
204 * specific records of the Connection Method. aAttribute |
|
205 * parameter should identify one field(integer, boolean string) |
|
206 * in one of these records. |
|
207 * @return Returns the requested value. In error case leaves with |
|
208 * system-wide error code. |
|
209 */ |
|
210 |
|
211 virtual TUint32 GetBearerIntAttributeL( |
|
212 TUint32 aAttribute, |
|
213 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
214 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
215 |
|
216 virtual TBool GetBearerBoolAttributeL( |
|
217 TUint32 aAttribute, |
|
218 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
219 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
220 |
|
221 |
|
222 virtual HBufC* GetBearerStringAttributeL( |
|
223 TUint32 aAttribute, |
|
224 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
225 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
226 |
|
227 virtual HBufC8* GetBearerString8AttributeL( |
|
228 TUint32 aAttribute, |
|
229 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
230 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
231 |
|
232 /** |
|
233 * Following SetBearerXXXXAttribute methods set only the |
|
234 * fields in records in pointer arrays(parameters). They are not |
|
235 * allowed to update the original records in plugins. |
|
236 * @param aAttribute Identifier of the field to set. |
|
237 * @param aValue The value to set. |
|
238 * @param aGenRecordArray An array containing pointers to generic |
|
239 * records of the Connection Method. |
|
240 * @param aBearerSpecRecordArray An array containing pointers to bearer |
|
241 * specific records of the Connection Method. aAttribute |
|
242 * parameter should identify one field(integer, boolean string) |
|
243 * in one of these records. |
|
244 * @return None. |
|
245 */ |
|
246 |
|
247 virtual void SetBearerIntAttributeL( |
|
248 TUint32 aAttribute, TUint32 aValue, |
|
249 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
250 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
251 |
|
252 virtual void SetBearerBoolAttributeL( |
|
253 TUint32 aAttribute, TBool aValue, |
|
254 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
255 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
256 |
|
257 virtual void SetBearerStringAttributeL( |
|
258 TUint32 aAttribute, const TDesC16& aValue, |
|
259 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
260 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
261 |
|
262 virtual void SetBearerString8AttributeL( |
|
263 TUint32 aAttribute, const TDesC8& aValue, |
|
264 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
265 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
266 |
|
267 /** |
|
268 * Bearer is requested by the server if it uses CommsDat tables which |
|
269 * should be observed for possible changes to be able to keep the |
|
270 * data in memory in up to date. |
|
271 * @param aTableIdArray A reference to an array where to add those |
|
272 * table ids. |
|
273 */ |
|
274 virtual void GetBearerTableIdsToBeObservedL( |
|
275 RArray<TUint32>& aTableIdArray ) const; |
|
276 |
|
277 private: // Constructors |
|
278 |
|
279 /** |
|
280 * Constructor |
|
281 */ |
|
282 CCmPluginPacketData( |
|
283 TCmPluginInitParam* aInitParam, |
|
284 TBool aOutgoing ); |
|
285 |
|
286 /** |
|
287 * Second phase constructor |
|
288 */ |
|
289 void ConstructL(); |
|
290 |
|
291 private: |
|
292 /** |
|
293 * Adds Service record with default values to record array. |
|
294 * @param aRecordArray The array where to add the service record. |
|
295 */ |
|
296 void GetDefaultServiceRecordL( |
|
297 RPointerArray<CommsDat::CCDRecordBase>& aRecordArray ); |
|
298 |
|
299 /** |
|
300 * Adds QoS record with default values to record array. |
|
301 * @param aRecordArray The array where to add the QoS record. |
|
302 */ |
|
303 void GetDefaultQosRecordL( |
|
304 RPointerArray<CommsDat::CCDRecordBase>& aRecordArray ); |
|
305 |
|
306 /** |
|
307 * Returns a reference to service record of the Connection Method. |
|
308 */ |
|
309 CommsDat::CCDWCDMAPacketServiceRecord& ServiceRecord() const; |
|
310 |
|
311 /** |
|
312 * Makes needed preparations before copying records. |
|
313 * @param aCopyInstance Instance of the plugin where to copy. |
|
314 */ |
|
315 virtual void PrepareToCopyDataL( CCmPluginBaseEng* aCopyInstance ); |
|
316 |
|
317 /** |
|
318 * Copies the service record. |
|
319 * @return Returns a pointer to service record created. |
|
320 */ |
|
321 CommsDat::CCDRecordBase* CopyServiceRecordL(); |
|
322 |
|
323 /** |
|
324 * Copies the bearer specific records to copy instance. |
|
325 * @param aCopyInstance Instance of the plugin where to copy. |
|
326 */ |
|
327 virtual void CopyBearerRecordsL( CCmPluginBaseEng* aCopyInstance ); |
|
328 |
|
329 |
|
330 /** |
|
331 * Gets an integer value from service record. |
|
332 * @param aAttribute An indentifier to know the field in the record. |
|
333 * @param aGenRecordArray Array of records where the service record |
|
334 * can be found. |
|
335 * @return Returns an integer if the requested attribute |
|
336 * is found. Otherwise leaves with error code KErrNotFound. |
|
337 */ |
|
338 TUint32 GetServiceIntAttributeL( |
|
339 TUint32 aAttribute, |
|
340 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray ); |
|
341 |
|
342 /** |
|
343 * Gets a string value from service record. Ownership of the return |
|
344 * value is passed to the caller. |
|
345 * @param aAttribute An indentifier to know the field in the record. |
|
346 * @param aGenRecordArray Array of records where the service record |
|
347 * can be found. |
|
348 * @return Returns a pointer to an buffer if the requested attribute |
|
349 * is found. Otherwise leaves with error code KErrNotFound. |
|
350 */ |
|
351 HBufC* GetServiceStringAttributeL( |
|
352 TUint32 aAttribute, |
|
353 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray ); |
|
354 |
|
355 /** |
|
356 * Sets integer value to service record. |
|
357 * @param aAttribute An indentifier to know the field in the record. |
|
358 * @param aValue A value to set. |
|
359 * @param aGenRecordArray Array of records where the service record |
|
360 * can be found. |
|
361 */ |
|
362 void SetServiceIntAttributeL( |
|
363 TUint32 aAttribute, |
|
364 TUint32 aValue, |
|
365 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray ); |
|
366 |
|
367 /** |
|
368 * Gets an integer value from packetdata specific record. |
|
369 * @param aAttribute An indentifier to know the field in the record. |
|
370 * @param aBearerSpecRecordArray Array of records where the service |
|
371 * record can be found. |
|
372 * @return Returns an integer if the requested attribute |
|
373 * is found. Otherwise leaves with error code KErrNotFound. |
|
374 */ |
|
375 TUint32 GetQosIntAttributeL( |
|
376 TUint32 aAttribute, |
|
377 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
378 |
|
379 /** |
|
380 * Sets an integer value to packetdata specific record. |
|
381 * @param aAttribute An indentifier to know the field in the record. |
|
382 * @param aValue The value to be set. |
|
383 * @param aBearerSpecRecordArray Array of records where the service |
|
384 * record can be found. |
|
385 * @return Returns an integer if the requested attribute |
|
386 * is found. Otherwise leaves with error code KErrNotFound. |
|
387 */ |
|
388 void SetQosIntAttributeL( |
|
389 TUint32 aAttribute, |
|
390 TUint32 aValue, |
|
391 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
392 |
|
393 /** |
|
394 * Sets the PDP-type. |
|
395 * @param aPdpType Pdp type to set. |
|
396 * @param aServiceRecord Pointer to the service record where to save the |
|
397 * pdp type. |
|
398 */ |
|
399 void SetPDPTypeL( |
|
400 RPacketContext::TProtocolType aPdpType, |
|
401 CommsDat::CCDWCDMAPacketServiceRecord* aServiceRecord ); |
|
402 |
|
403 /** |
|
404 * Sets the daemon name for the Connection Method. |
|
405 * @param aGenRecordArray An array containing pointers to generic records |
|
406 * of the Connection Method. |
|
407 * @param aBearerSpecRecordArray An array containing pointers to bearer |
|
408 * specific records of the Connection Method. |
|
409 */ |
|
410 void SetDaemonNameL( |
|
411 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
|
412 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ); |
|
413 |
|
414 /** |
|
415 * Returns the default priority value identified with the parameter. |
|
416 * @param aAttribute Indentifies the default priority value requested. |
|
417 */ |
|
418 TUint32 GetDefPriorityL( const TUint32 aAttribute ) const; |
|
419 |
|
420 private: |
|
421 /** |
|
422 * Checks if the packetdata network is available. |
|
423 * @return Returns ETrue if the network is available. Otherwise returns |
|
424 * EFalse. |
|
425 */ |
|
426 TBool CheckNetworkCoverageL() const; |
|
427 |
|
428 private: // Data |
|
429 /** |
|
430 * Boolean to define if this is outgoing or incoming packetdata cm. |
|
431 */ |
|
432 TBool iOutgoing; |
|
433 |
|
434 /** |
|
435 * ID of the bearer record of the IAP. |
|
436 */ |
|
437 TUint32 iBearerRecordId; |
|
438 |
|
439 /** |
|
440 * Name of the bearer record of the IAP. |
|
441 */ |
|
442 HBufC* iBearerRecordName; |
|
443 |
|
444 /** |
|
445 * Pointer to the QoS record of the IAP. |
|
446 */ |
|
447 CommsDat::CCDUmtsR99QoSAndOnTableRecord* iPacketDataQoSRecord; |
|
448 |
|
449 /** |
|
450 * Bearer priority table ID. |
|
451 */ |
|
452 CommsDat::TMDBElementId iBearerPriorityTableId; |
|
453 }; |
|
454 |
|
455 #endif // PACKETDATA_PLUGIN_H |
|