|
1 /* |
|
2 * Copyright (c) 2002 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 * RConnectionMonitor provides an interface for an application |
|
16 * to get information about active data connection. It also provides |
|
17 * a way to close any connection or all the connections. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __CONNECTIONMONITOR_H |
|
23 #define __CONNECTIONMONITOR_H |
|
24 |
|
25 // INCLUDES |
|
26 #include "musunittesting.h" |
|
27 |
|
28 #include <e32base.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // TInt Attributes |
|
33 // Used by GetIntAttribute |
|
34 const TUint KBearer =1; // TConnMonBearerType |
|
35 const TUint KNetworkStatus =2; // TConnMonNetworkStatus |
|
36 const TUint KConnectionStatus =3; // progress constants from nifvar.h |
|
37 const TUint KProtocolType =4; // TConnMonProtocolType |
|
38 const TUint KNetworkRegistration =5; // TConnMonNetworkRegistration |
|
39 const TUint KSignalStrength =6; // dBm |
|
40 const TUint KNetworkMode =7; // TConnMonNetworkMode |
|
41 const TUint KSecurityMode =8; // TConnMonSecurityMode |
|
42 const TUint KTrafficClass =30; // Qos - Not supported |
|
43 const TUint KDeliveryOrder =31; // Qos - Not supported |
|
44 const TUint KErroneousSDUDelivery =32; // Qos - Not supported |
|
45 const TUint KResidualBitErrorRatio =33; // Qos - Not supported |
|
46 const TUint KSDUErrorRatio =34; // Qos - Not supported |
|
47 |
|
48 // TUInt Attributes |
|
49 // Used by GetUintAttribute, SetUintAttribute |
|
50 const TUint KDownlinkData =100; // in bytes |
|
51 const TUint KUplinkData =101; // in bytes |
|
52 const TUint KIAPId =102; |
|
53 const TUint KNetworkIdentifier =103; |
|
54 const TUint KTransmitPower =104; // mW |
|
55 const TUint KMobilePhoneNetworkMode =105; // TConnMonMobilePhoneNetworkMode |
|
56 const TUint KMaximumBitrateDownlink =130; // Qos - Not supported |
|
57 const TUint KMaximumBitrateUplink =131; // Qos - Not supported |
|
58 const TUint KMaximumSDUSize =132; // Qos - Not supported |
|
59 const TUint KTransferDelay =133; // Qos - Not supported |
|
60 const TUint KGuaranteedBitrateDownlink =134; // Qos - Not supported |
|
61 const TUint KGuaranteedBitrateUplink =135; // Qos - Not supported |
|
62 const TUint KTrafficHandlingPriority =136; // Qos - Not supported |
|
63 const TUint KActivityTimeThreshold =150; // in seconds, minimum allowed is 5 |
|
64 const TUint KDownlinkDataThreshold =151; // in bytes, minimum allowed is 4096 |
|
65 const TUint KUplinkDataThreshold =152; // in bytes, minimum allowed is 4096 |
|
66 const TUint KBearerAvailabilityThreshold =153; // 1 means that events are 'ON', 0 means 'OFF' |
|
67 const TUint KSignalStrengthThreshold =154; // 1 means that events are 'ON', 0 means 'OFF' |
|
68 |
|
69 // TBool Attributes |
|
70 // Used by GetBoolAttribute, SetBoolAttribute |
|
71 const TUint KConnectionActive =200; |
|
72 const TUint KBearerAvailability =201; |
|
73 const TUint KConnectionStop =250; |
|
74 const TUint KConnectionStopAll =251; |
|
75 |
|
76 // TDes Attributes |
|
77 // Used by GetStringAttribute |
|
78 const TUint KIAPName =300; |
|
79 const TUint KAccessPointName =301; |
|
80 const TUint KTelNumber =302; |
|
81 const TUint KNetworkName =303; |
|
82 |
|
83 // TPckgBuf Attributes |
|
84 // Used by GetPckgAttribute |
|
85 const TUint KStartTime =400; // TTime |
|
86 const TUint KClientInfo =401; // TConnMonClientEnum (connections only) |
|
87 const TUint KNetworkNames =402; // TConnMonNetworkNames |
|
88 const TUint KIapAvailability =403; // TConnMonIapInfo |
|
89 const TUint KWLANNetworks =404; // TConnMonWLANNetworksPckg |
|
90 const TUint KSNAPsAvailability =405; // returns SNAPs ids in old iap-like way (see KIapAvailability) |
|
91 const TUint KAvailableSNAPsIds =406; // returns SNAPs ids in TConnMonIdsArrayPckg |
|
92 |
|
93 // Base value for plug-in specific attribute ids |
|
94 const TUint KConnMonPluginAttributeBase =3000000; |
|
95 |
|
96 // DATA TYPES |
|
97 |
|
98 // Bearer type |
|
99 enum TConnMonBearerType |
|
100 { |
|
101 EBearerUnknown = 0, |
|
102 EBearerCSD = 1, // CSD (GSM) |
|
103 EBearerWCDMA = 2, // PSD (WCDMA) |
|
104 EBearerLAN = 3, |
|
105 EBearerCDMA2000 = 4, |
|
106 EBearerGPRS = 5, |
|
107 EBearerHSCSD = 6, // HSCSD (GSM) |
|
108 EBearerEdgeGPRS = 7, |
|
109 EBearerWLAN = 8, |
|
110 EBearerBluetooth = 9, |
|
111 EBearerVirtual = 10, |
|
112 EBearerVirtualVPN = 11, |
|
113 EBearerWcdmaCSD = 12, // CSD (WCDMA) |
|
114 |
|
115 EBearerExternalCSD = 30, // ext CSD (GSM) |
|
116 EBearerExternalWCDMA = 31, // ext PSD (WCDMA) |
|
117 EBearerExternalLAN = 32, |
|
118 EBearerExternalCDMA2000 = 33, |
|
119 EBearerExternalGPRS = 34, |
|
120 EBearerExternalHSCSD = 35, // ext HSCSD (GSM) |
|
121 EBearerExternalEdgeGPRS = 36, |
|
122 EBearerExternalWLAN = 37, |
|
123 EBearerExternalBluetooth = 38, |
|
124 EBearerExternalWcdmaCSD = 39 // ext CSD (WCDMA) |
|
125 }; |
|
126 |
|
127 // Bearer specific general connection id |
|
128 enum TConnMonBearerId |
|
129 { |
|
130 EBearerIdAll = 0, |
|
131 EBearerIdGPRS = 2000000, // covers internal and external GPRS and EdgeGPRS |
|
132 EBearerIdWCDMA = 2000001, // covers internal and external PSD (WCDMA) |
|
133 EBearerIdCSD = 2000002, // covers internal and external CSD and HSCSD (GSM) |
|
134 EBearerIdGSM = 2000003, // union of EBearerIdGPRS and EBearerIdCSD |
|
135 EBearerIdWLAN = 2000004, |
|
136 EBearerIdLAN = 2000005, |
|
137 EBearerIdWcdmaCSD = 2000006, // covers internal and external CSD (WCDMA) |
|
138 EBearerIdCDMA2000 = 2000007, |
|
139 EBearerIdVirtualVPN = 2000008 |
|
140 }; |
|
141 |
|
142 // Network status |
|
143 enum TConnMonNetworkStatus |
|
144 { |
|
145 EConnMonStatusNotAvailable = 0, |
|
146 EConnMonStatusUnattached, |
|
147 EConnMonStatusAttached, |
|
148 EConnMonStatusActive, |
|
149 EConnMonStatusSuspended |
|
150 }; |
|
151 |
|
152 // Protocol Type (type of PDP) |
|
153 // It may not be available for some bearers (returns EProtocolTypeUnknown). |
|
154 enum TConnMonProtocolType |
|
155 { |
|
156 EProtocolTypeUnknown = 0, |
|
157 EProtocolTypeIPv4, |
|
158 EProtocolTypeIPv6, |
|
159 EProtocolTypeX25, |
|
160 EProtocolTypePPP, |
|
161 EProtocolTypeCDPD, |
|
162 EProtocolTypeIP // connection uses both IPv4 and IPv6 |
|
163 }; |
|
164 |
|
165 // Asyncronous request codes |
|
166 enum TConnMonAsyncRequest |
|
167 { |
|
168 EConnMonGetConnectionCount = 1, |
|
169 EConnMonGetIntAttribute, |
|
170 EConnMonGetUintAttribute, |
|
171 EConnMonGetBoolAttribute, |
|
172 EConnMonGetStringAttribute, |
|
173 EConnMonGetPckgAttribute |
|
174 }; |
|
175 |
|
176 // Events sent by Connection Monitor |
|
177 enum TConnMonEvent |
|
178 { |
|
179 EConnMonCreateConnection = 1, |
|
180 EConnMonDeleteConnection = 2, |
|
181 EConnMonCreateSubConnection = 3, |
|
182 EConnMonDeleteSubConnection = 4, |
|
183 EConnMonDownlinkDataThreshold = 5, |
|
184 EConnMonUplinkDataThreshold = 6, |
|
185 EConnMonNetworkStatusChange = 7, |
|
186 EConnMonConnectionStatusChange = 8, |
|
187 EConnMonConnectionActivityChange = 9, |
|
188 EConnMonNetworkRegistrationChange = 10, |
|
189 EConnMonBearerChange = 11, |
|
190 EConnMonSignalStrengthChange = 12, |
|
191 EConnMonBearerAvailabilityChange = 13, |
|
192 EConnMonIapAvailabilityChange = 14, |
|
193 EConnMonTransmitPowerChange = 15, |
|
194 EConnMonSNAPsAvailabilityChange = 16, |
|
195 EConnMonNewWLANNetworkDetected = 17, |
|
196 EConnMonOldWLANNetworkLost = 18, |
|
197 EConnMonPacketDataAvailable = 19, |
|
198 EConnMonPacketDataUnavailable = 20, |
|
199 EConnMonBearerInfoChange = 21, |
|
200 |
|
201 EConnMonPluginEventBase = 4000000 |
|
202 }; |
|
203 |
|
204 // Network registration status. Valid for CSD, GPRS and WCDMA. |
|
205 enum TConnMonNetworkRegistration |
|
206 { |
|
207 ENetworkRegistrationNotAvailable = 0, |
|
208 ENetworkRegistrationUnknown, |
|
209 ENetworkRegistrationNoService, |
|
210 ENetworkRegistrationEmergencyOnly, |
|
211 ENetworkRegistrationSearching, |
|
212 ENetworkRegistrationBusy, |
|
213 ENetworkRegistrationHomeNetwork, |
|
214 ENetworkRegistrationDenied, |
|
215 ENetworkRegistrationRoaming |
|
216 }; |
|
217 |
|
218 // Traffic class |
|
219 enum TQosTrafficClass |
|
220 { |
|
221 EQosTrafficClassConversational = 1, |
|
222 EQosTrafficClassStreaming, |
|
223 EQosTrafficClassInteractive, |
|
224 EQosTrafficClassBackground |
|
225 }; |
|
226 |
|
227 // Delivery order |
|
228 enum TQosDeliveryOrder |
|
229 { |
|
230 EQosDeliveryOrderYes = 1, |
|
231 EQosDeliveryOrderNo |
|
232 }; |
|
233 |
|
234 // Delivery of erroneous SDUs |
|
235 enum TQosErroneousSDUDelivery |
|
236 { |
|
237 EQosErroneousSDUDeliveryYes = 1, |
|
238 EQosErroneousSDUDeliveryNo, |
|
239 EQosErroneousSDUDeliveryUnspecified |
|
240 }; |
|
241 |
|
242 // Residual bit error ratio |
|
243 enum TQosBitErrorRatio |
|
244 { |
|
245 EQosBERFivePerHundred = 1, |
|
246 EQosBEROnePerHundred, |
|
247 EQosBERFivePerThousand, |
|
248 EQosBEROnePerThousand, |
|
249 EQosBEROnePerTenThousand, |
|
250 EQosBEROnePerMillion |
|
251 }; |
|
252 |
|
253 // SDU error ratio |
|
254 enum TQosSDUErrorRatio |
|
255 { |
|
256 EQosSDUErrorRatioOnePerHundred = 1, |
|
257 EQosSDUErrorRatioSevenPerThousand, |
|
258 EQosSDUErrorRatioOnePerThousand, |
|
259 EQosSDUErrorRatioOnePerTenThousand, |
|
260 EQosSDUErrorRatioOnePerHundredThousand |
|
261 }; |
|
262 |
|
263 // Client-server requests |
|
264 enum TConnMonRequests |
|
265 { |
|
266 EReqGetConnectionCount = 0, |
|
267 EReqGetConnectionInfo = 1, |
|
268 EReqGetSubConnectionInfo = 2, |
|
269 EReqGetIntAttribute = 3, |
|
270 EReqGetUintAttribute = 4, |
|
271 EReqGetBoolAttribute = 5, |
|
272 EReqGetStringAttribute = 6, |
|
273 EReqGetPckgAttribute = 7, |
|
274 EReqSetIntAttribute = 8, |
|
275 EReqSetUintAttribute = 9, |
|
276 EReqSetBoolAttribute = 10, |
|
277 EReqSetStringAttribute = 11, |
|
278 EReqSetPckgAttribute = 12, |
|
279 EReqCancelAsyncRequest = 13, |
|
280 EReqReceiveEvent = 14, |
|
281 EReqCancelReceiveEvent = 15, |
|
282 |
|
283 EReqPluginCreateSubSession = 500, |
|
284 EReqPluginCloseSubSession = 501, |
|
285 EReqPluginRegisterAttribute = 502, |
|
286 EReqPluginCancelRegisterAttribute = 503, |
|
287 EReqPluginEvent = 504, |
|
288 EReqPluginGetQuery = 505, |
|
289 EReqPluginCancelGetQuery = 506, |
|
290 EReqPluginAttribute = 507, |
|
291 |
|
292 EReqInternalSetThreshold = 600, |
|
293 EReqInternalResetThreshold = 601 |
|
294 }; |
|
295 |
|
296 // WLAN connection modes |
|
297 enum TConnMonNetworkMode |
|
298 { |
|
299 EConnMonInfraStructure = 0, |
|
300 EConnMonAdHoc = 1, |
|
301 EConnMonSecureInfra = 2 |
|
302 }; |
|
303 |
|
304 // WLAN connection security modes |
|
305 enum TConnMonSecurityMode |
|
306 { |
|
307 EConnMonSecurityOpen = 0, |
|
308 EConnMonSecurityWep = 1, |
|
309 EConnMonSecurity802d1x = 2, |
|
310 EConnMonSecurityWpa = 3, |
|
311 EConnMonSecurityWpaPsk = 4 |
|
312 }; |
|
313 |
|
314 /** Defines Current Network Modes. |
|
315 |
|
316 Modes: Common */ |
|
317 enum TConnMonMobilePhoneNetworkMode |
|
318 { |
|
319 /** Network mode is unknown. |
|
320 |
|
321 Modes: Common */ |
|
322 EConnMonNetworkModeUnknown = 0, |
|
323 /** ME is not registered. |
|
324 |
|
325 Modes: Common */ |
|
326 EConnMonNetworkModeUnregistered, |
|
327 /** GSM/GPRS or DCS1800 network. */ |
|
328 EConnMonNetworkModeGsm, |
|
329 /** AMPS network. |
|
330 |
|
331 Modes: CDMA */ |
|
332 EConnMonNetworkModeAmps, |
|
333 /** CDMA (IS-95) network. |
|
334 |
|
335 Modes: CDMA */ |
|
336 EConnMonNetworkModeCdma95, |
|
337 /** CDMA (cdma2000) network. |
|
338 |
|
339 Modes: CDMA */ |
|
340 EConnMonNetworkModeCdma2000, |
|
341 /** WCDMA (UTRA Frequency Division Duplex (FDD)) network. |
|
342 |
|
343 Modes: WCDMA */ |
|
344 EConnMonNetworkModeWcdma, |
|
345 /** TD-CDMA (UTRA Time Division Duplex (TDD)) network. |
|
346 |
|
347 Modes: WCDMA */ |
|
348 EConnMonNetworkModeTdcdma |
|
349 }; |
|
350 |
|
351 |
|
352 // Maximum size of a plug-in's attribute or event data |
|
353 const TUint KConnMonMaxPluginDataSize = 512; |
|
354 const TUint KConnMonMaxStringAttributeLength = 64; |
|
355 |
|
356 |
|
357 // Package class definition for getting the TTime |
|
358 typedef TPckgBuf< TTime > TConnMonTimeBuf; |
|
359 |
|
360 // Package class definition for getting the client information |
|
361 const TUint KConnMonMaxClientUids = 10; |
|
362 |
|
363 class TConnMonClientEnum |
|
364 { |
|
365 public: |
|
366 inline TConnMonClientEnum():iCount(0){} |
|
367 public: |
|
368 TUint iCount; |
|
369 TUid iUid[ KConnMonMaxClientUids ]; |
|
370 }; |
|
371 typedef TPckgBuf< TConnMonClientEnum > TConnMonClientEnumBuf; |
|
372 |
|
373 // Package class definition for getting network names |
|
374 const TUint KConnMonMaxNetworkCount = 10; |
|
375 |
|
376 class TConnMonNetwork |
|
377 { |
|
378 public: |
|
379 inline TConnMonNetwork():iType(0), iSignalStrength(0){} |
|
380 public: |
|
381 TBuf8< 32 > iName; |
|
382 TInt8 iType; // see TConnMonNetworkMode |
|
383 TUint8 iSignalStrength; |
|
384 }; |
|
385 |
|
386 class TConnMonNetworkNames |
|
387 { |
|
388 public: |
|
389 inline TConnMonNetworkNames():iCount(0){} |
|
390 inline TUint Count() {return iCount;} |
|
391 public: |
|
392 TUint iCount; |
|
393 TConnMonNetwork iNetwork[ KConnMonMaxNetworkCount ]; |
|
394 }; |
|
395 |
|
396 typedef TPckgBuf< TConnMonNetworkNames > TConnMonNetworkNamesBuf; |
|
397 |
|
398 // Package class definiton for getting available IAPs |
|
399 const TUint KConnMonMaxIAPCount = 25; |
|
400 |
|
401 class TConnMonIap |
|
402 { |
|
403 public: |
|
404 inline TConnMonIap():iIapId(0){} |
|
405 public: |
|
406 TUint iIapId; |
|
407 }; |
|
408 |
|
409 class TConnMonIapInfo |
|
410 { |
|
411 public: |
|
412 inline TConnMonIapInfo():iCount(0){} |
|
413 inline TUint Count() {return iCount;} |
|
414 public: |
|
415 TUint iCount; |
|
416 TConnMonIap iIap[ KConnMonMaxIAPCount ]; |
|
417 }; |
|
418 |
|
419 typedef TPckgBuf< TConnMonIapInfo > TConnMonIapInfoBuf; |
|
420 |
|
421 // Package class definiton for receiving event of SNAPs' availability change |
|
422 const TUint KConnMonMaxSNAPsCount = 25; |
|
423 |
|
424 class TConnMonSNAPId |
|
425 { |
|
426 public: |
|
427 inline TConnMonSNAPId():iSNAPId(0){} |
|
428 public: |
|
429 TUint iSNAPId; |
|
430 }; |
|
431 |
|
432 class TConnMonSNAPInfo |
|
433 { |
|
434 public: |
|
435 inline TConnMonSNAPInfo():iCount(0){} |
|
436 inline TUint Count() {return iCount;} |
|
437 public: |
|
438 TUint iCount; // amount of items in iSNAP |
|
439 TConnMonSNAPId iSNAP[ KConnMonMaxSNAPsCount ]; // array of ids of available SNAPs |
|
440 }; |
|
441 |
|
442 typedef TPckgBuf< TConnMonSNAPInfo > TConnMonSNAPInfoBuf; |
|
443 |
|
444 /** |
|
445 * Interface template for the class T serialization to/from HBuf/TPtr |
|
446 * Class T could be any type of class (T, C, etc) |
|
447 * |
|
448 * @since S60 v3.1 |
|
449 */ |
|
450 template <class T> |
|
451 class MDesSerializer |
|
452 { |
|
453 public: |
|
454 |
|
455 /** |
|
456 * Have to pack the object of class T to HBufC |
|
457 * Ownership of newly cleated pointer is transferred to caller |
|
458 * @since S60 v3.1 |
|
459 * @return pointer to heap descriptor |
|
460 */ |
|
461 virtual const HBufC* ToBuf() const = 0; |
|
462 |
|
463 /** |
|
464 * Have to unpack object of class T from aPtrC |
|
465 * @since S60 v3.1 |
|
466 * @return const pointer to heap descriptor |
|
467 */ |
|
468 static T FromPtrC(const TPtrC& aPtrC); |
|
469 |
|
470 }; |
|
471 |
|
472 /** |
|
473 * TConnMonWLANNetwork is a class, incapsulated WLAN network abstraction |
|
474 * Implements MDesSerializer interface to be able to be transferred through processes (client/server) |
|
475 * in object's size-independent manner, to meet backward/forward compatibility |
|
476 * |
|
477 * @since S60 v3.1 |
|
478 */ |
|
479 |
|
480 class TConnMonWLANNetwork: public MDesSerializer<TConnMonWLANNetwork> |
|
481 { |
|
482 public: |
|
483 |
|
484 // Length of the WLAN network name |
|
485 static const TUint KMaxNameLength = 32; |
|
486 |
|
487 // amount of additional fields in the buffer |
|
488 static const TUint KNumberOfExtraFields = 0; |
|
489 |
|
490 // defines max size of the object in TChar's |
|
491 static const TUint KMaxSize = ( |
|
492 sizeof(TUint) // length of name |
|
493 +sizeof(TBuf<KMaxNameLength>) // iName |
|
494 +sizeof(TUint) // iConnectionMode |
|
495 +sizeof(TUint) // iSignalStrength |
|
496 +sizeof(TUint) // iSecurityMode |
|
497 +sizeof(TUint) // length of buffer |
|
498 +sizeof(TInt)*KNumberOfExtraFields |
|
499 +sizeof(RArray<TInt>) // Array of extra fields |
|
500 )/ sizeof(TChar) + 1; // +1 is for rounding to bigger integer |
|
501 |
|
502 // defines shifts of fields inside the object, packed to a descriptor |
|
503 enum FieldsShifts |
|
504 { |
|
505 ENameLength = 0, |
|
506 EName = 1, |
|
507 // relatively to iName's end |
|
508 EConnectionMode = 1, |
|
509 ESignalStrength = 2, |
|
510 ESecurityMode = 3, |
|
511 EBufCounter = 4, |
|
512 EBufBase = 4/*, |
|
513 EBufParam0 = 5 */ |
|
514 }; |
|
515 |
|
516 /** |
|
517 * Default constructor |
|
518 * @param aName name of the network |
|
519 * @param aConectionMode ConnectionMode of the network |
|
520 * @param aSignalStrength Signal strength of the network |
|
521 * @param aSecurityMode Security mode of the network |
|
522 * @param aBuf Buffer of the additional fields |
|
523 * @since S60 v3.1 |
|
524 */ |
|
525 IMPORT_C TConnMonWLANNetwork(const TBuf<KMaxNameLength>& aName, TUint aConnectionMode, |
|
526 TUint aSignalStrength, TUint aSecurityMode, const RArray<TInt>& aBuf); |
|
527 |
|
528 /** |
|
529 * Destructor |
|
530 * |
|
531 */ |
|
532 IMPORT_C virtual ~TConnMonWLANNetwork(); |
|
533 |
|
534 /** |
|
535 * Compares two networks by iSignalStrength; |
|
536 * |
|
537 * @param aFirst to be compared with aSecond |
|
538 * @return 1 if aFirst less than aSecond; 0 if they are equal; -1 otherwise |
|
539 */ |
|
540 IMPORT_C static TInt LessBySignal(const TConnMonWLANNetwork& aFirst, const TConnMonWLANNetwork& aSecond); |
|
541 |
|
542 /** |
|
543 * Getters Name(), ConnectionMode(), SignalStrength(), SecurityMode(), Buf() |
|
544 * |
|
545 * @return copy of the fields |
|
546 */ |
|
547 inline TBuf<KMaxNameLength> Name() |
|
548 { |
|
549 return iName; |
|
550 }; |
|
551 inline TUint ConnectionMode() |
|
552 { |
|
553 return iConnectionMode; |
|
554 }; |
|
555 inline TUint SignalStrength() |
|
556 { |
|
557 return iSignalStrength; |
|
558 }; |
|
559 inline TUint SecurityMode() |
|
560 { |
|
561 return iSecurityMode; |
|
562 }; |
|
563 inline RArray<TInt> Buf() |
|
564 { |
|
565 return iBuf; |
|
566 }; |
|
567 |
|
568 // From MDesSerializer |
|
569 |
|
570 /** |
|
571 * See MDesSerializer |
|
572 */ |
|
573 IMPORT_C const HBufC* ToBuf() const; |
|
574 |
|
575 /** |
|
576 * See MDesSerializer |
|
577 */ |
|
578 IMPORT_C static TConnMonWLANNetwork FromPtrC(const TPtrC& aPtrC); |
|
579 |
|
580 // data |
|
581 private: |
|
582 |
|
583 TBuf<KMaxNameLength> iName; // Network name |
|
584 TUint iConnectionMode; // See TConnMonNetworkMode |
|
585 TUint iSignalStrength; // Signal strength |
|
586 TUint iSecurityMode; // See TConnMonSecurityMode |
|
587 RArray<TInt> iBuf; // For additional fields |
|
588 }; |
|
589 |
|
590 // Array of the WLAN networks |
|
591 typedef RArray<TConnMonWLANNetwork> RConnMonWLANNetworksArray; |
|
592 |
|
593 /** |
|
594 * Template for the package of array of items of class TConnMonWLANNetwork |
|
595 * |
|
596 * @since S60 v3.1 |
|
597 */ |
|
598 |
|
599 class ConnMonWLANNetworksArrayPckg |
|
600 { |
|
601 public: |
|
602 |
|
603 /** |
|
604 * Constructs the package of array of objects TConnMonWLANNetwork on the heap |
|
605 * |
|
606 * @param aRef Array of objects of class TConnMonWLANNetwork |
|
607 * @param aBufSize Size of the buffer, intended to contain the package |
|
608 */ |
|
609 ConnMonWLANNetworksArrayPckg(const RArray<TConnMonWLANNetwork>& aRef, TUint aBufSize); |
|
610 |
|
611 /** |
|
612 * Constructs empty package on the heap |
|
613 * |
|
614 * @param aBufSize Size of the buffer, intended to contain the package |
|
615 */ |
|
616 IMPORT_C ConnMonWLANNetworksArrayPckg(TUint aBufSize); |
|
617 |
|
618 /** |
|
619 * Destruction |
|
620 */ |
|
621 IMPORT_C virtual ~ConnMonWLANNetworksArrayPckg(); |
|
622 |
|
623 /** |
|
624 * Unpacks package to an array of objects of class TConnMonWLANNetwork |
|
625 * |
|
626 * @param aRef Array, intended to containing the unpacked objects |
|
627 */ |
|
628 IMPORT_C void UnpackToL(RArray<TConnMonWLANNetwork>& aRef) const; |
|
629 |
|
630 /** |
|
631 * Gets iBuf |
|
632 * |
|
633 * @return iBuf |
|
634 */ |
|
635 IMPORT_C HBufC* Buf() const; |
|
636 |
|
637 // data |
|
638 private: |
|
639 |
|
640 /** |
|
641 * Buffer on the heap, containing the package |
|
642 */ |
|
643 HBufC* iBuf; |
|
644 |
|
645 }; |
|
646 |
|
647 /** |
|
648 * Id |
|
649 * MDesSerializer - abstract interface for class serialization |
|
650 * ConnMonTId class declaration |
|
651 * |
|
652 * @since S60 v3.1 |
|
653 */ |
|
654 class TConnMonId : public MDesSerializer<TConnMonId> |
|
655 { |
|
656 |
|
657 public: |
|
658 |
|
659 // defines max size of the object in TChar's |
|
660 static const TUint KMaxSize = ( |
|
661 sizeof(TUid) // iId |
|
662 )/ sizeof(TChar) + 1; // +1 is for rounding to bigger integer |
|
663 |
|
664 // defines shifts of fields inside the object |
|
665 enum FieldsShifts |
|
666 { |
|
667 EId = 0 |
|
668 }; |
|
669 |
|
670 /** |
|
671 * Constructor. |
|
672 * @param aId ID |
|
673 */ |
|
674 IMPORT_C TConnMonId(TUint aId); |
|
675 |
|
676 /** |
|
677 * |
|
678 * iId getter |
|
679 * |
|
680 * @return iId |
|
681 */ |
|
682 IMPORT_C TUint Id() const; |
|
683 |
|
684 // From MDesSerializer |
|
685 |
|
686 /** |
|
687 * See MDesSerializer |
|
688 */ |
|
689 IMPORT_C const HBufC* ToBuf() const; |
|
690 |
|
691 /** |
|
692 * See MDesSerializer |
|
693 */ |
|
694 IMPORT_C static TConnMonId FromPtrC(const TPtrC& aPtrC); |
|
695 |
|
696 protected: |
|
697 |
|
698 private: |
|
699 |
|
700 protected: // data |
|
701 |
|
702 /** |
|
703 * ID |
|
704 */ |
|
705 const TUint iId; |
|
706 |
|
707 private: // data |
|
708 |
|
709 }; |
|
710 |
|
711 // Array of the ids |
|
712 typedef RArray<TConnMonId> RConnMonIdsArray; |
|
713 |
|
714 /** |
|
715 * Package of array of items of class TConnMonId |
|
716 * |
|
717 * @since S60 v3.1 |
|
718 */ |
|
719 |
|
720 class ConnMonIdsArrayPckg |
|
721 { |
|
722 public: |
|
723 |
|
724 /** |
|
725 * Constructs the package of array |
|
726 * |
|
727 * @param aRef Array to be packed |
|
728 * @param aBufSize Length of the buffer, intended to contain the package |
|
729 */ |
|
730 ConnMonIdsArrayPckg(const RArray<TConnMonId>& aRef, TUint aBufSize); |
|
731 |
|
732 /** |
|
733 * Constructs an empty package |
|
734 * |
|
735 * @param aBufSize Length of the buffer, intended to contain the package |
|
736 */ |
|
737 IMPORT_C ConnMonIdsArrayPckg(TUint aBufSize); |
|
738 |
|
739 /** |
|
740 * Destruction |
|
741 */ |
|
742 IMPORT_C virtual ~ConnMonIdsArrayPckg(); |
|
743 |
|
744 /** |
|
745 * Unpacks package to the array |
|
746 * |
|
747 * @param aRef Array, intended to containing the unpacked objects |
|
748 */ |
|
749 IMPORT_C void UnpackToL(RArray<TConnMonId>& aRef) const; |
|
750 |
|
751 /** |
|
752 * Gets iBuf |
|
753 * gettet returns not const |
|
754 * @return iBuf |
|
755 */ |
|
756 IMPORT_C HBufC* Buf() const; |
|
757 |
|
758 // data |
|
759 protected: |
|
760 |
|
761 /** |
|
762 * Buffer, containing the package |
|
763 */ |
|
764 HBufC* iBuf; |
|
765 |
|
766 }; |
|
767 |
|
768 // FORWARD DECLARATIONS |
|
769 class CConnMonEventBase; |
|
770 class CConnMonEventHandler; |
|
771 class CMusAvaTimer; |
|
772 |
|
773 // CLASS DECLARATION |
|
774 /** |
|
775 * MConnectionMonitorObserver |
|
776 * Client application must implement the MConnectionMonitorObserver interface |
|
777 * in order to receive notifications. MConnectionMonitorObserver::EventL() method |
|
778 * will be called every time an event arrives. |
|
779 * |
|
780 * @lib CONNMON.LIB |
|
781 * @since |
|
782 */ |
|
783 class MConnectionMonitorObserver |
|
784 { |
|
785 public: |
|
786 /** |
|
787 * Event method is called every time an event occures. |
|
788 * @since |
|
789 * @param aConnMonEvent The event information. |
|
790 * @return void |
|
791 */ |
|
792 virtual void EventL( const CConnMonEventBase &aConnMonEvent ) =0; |
|
793 }; |
|
794 |
|
795 /** |
|
796 * RConnectionMonitor |
|
797 * @lib CONNMON.LIB |
|
798 * @since |
|
799 */ |
|
800 class RConnectionMonitor : public RSessionBase |
|
801 { |
|
802 public: // Constructor |
|
803 inline RConnectionMonitor() : RSessionBase(), iHandler( 0 ), iPtrArray(), iIndex( 0 ) {}; |
|
804 |
|
805 public: // New methods |
|
806 /** |
|
807 * Connects the client to the Connection Monitor Server. It must be called |
|
808 * before any of other methods during the Connection Monitor session. |
|
809 * @since |
|
810 * @return KErrNone if succesfull, a system-wide error code if not. |
|
811 */ |
|
812 IMPORT_C TInt ConnectL(); |
|
813 |
|
814 /** |
|
815 * Closes the Connection Monitor session. An opened RConnectionMonitor must |
|
816 * be closed explicitily to prevent a resource (memory) leak. |
|
817 * @since |
|
818 * @return void |
|
819 */ |
|
820 IMPORT_C void Close(); |
|
821 |
|
822 /** |
|
823 * Gathers information on currently active connections. |
|
824 * @since |
|
825 * @param aConnectionCount On completion, contains the number of active connections. |
|
826 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
827 * @return void |
|
828 */ |
|
829 IMPORT_C void GetConnectionCount( TUint& aConnectionCount, TRequestStatus& aStatus ); |
|
830 |
|
831 /** |
|
832 * Gets the connection id and the count of the subconnections for the given index. |
|
833 * GetConnectionCount() must be called to gather the information on active |
|
834 * connections before calling this method. |
|
835 * @param aIndex Must be between 1 and the count returned by GetConnectionCount(). |
|
836 * @param aConnectionId On return, contains the connection id. |
|
837 * @param aSubConnectionCount On return, contains the number of subconnections. |
|
838 * @return void |
|
839 */ |
|
840 IMPORT_C TInt GetConnectionInfo( const TUint aIndex, |
|
841 TUint& aConnectionId, |
|
842 TUint& aSubConnectionCount ) const; |
|
843 |
|
844 /** |
|
845 * Gets the subconnection id for the given index. |
|
846 * @param aConnectionId Connection id. |
|
847 * @param aIndex Must be between 1 and the count returned by GetConnectionInfo(). |
|
848 * @param aSubConnectionId On return, contains the subconnection id. |
|
849 * @return KErrNone if successful, a system-wide error code if not. |
|
850 */ |
|
851 IMPORT_C TInt GetSubConnectionInfo( const TUint aConnectionId, |
|
852 const TUint aIndex, |
|
853 TUint& aSubConnectionId ) const; |
|
854 |
|
855 /** |
|
856 * Gets the value for a TInt attribute. |
|
857 * @param aConnectionId Connection id. |
|
858 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
859 * @param aAttribute Identifies the attribute to be retrived. |
|
860 * @param aValue On completion, contains the requested TInt attribute. |
|
861 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
862 * @return void. |
|
863 */ |
|
864 IMPORT_C void GetIntAttribute( const TUint aConnectionId, |
|
865 const TUint aSubConnectionId, |
|
866 const TUint aAttribute, |
|
867 TInt& aValue, |
|
868 TRequestStatus& aStatus ); |
|
869 |
|
870 /** |
|
871 * Gets the value for a TUint attribute. |
|
872 * @param aConnectionId Connection id. |
|
873 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
874 * @param aAttribute Identifies the attribute to be retrived. |
|
875 * @param aValue On completion, contains the requested TUint attribute. |
|
876 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
877 * @return void. |
|
878 */ |
|
879 IMPORT_C void GetUintAttribute( const TUint aConnectionId, |
|
880 const TUint aSubConnectionId, |
|
881 const TUint aAttribute, |
|
882 TUint& aValue, |
|
883 TRequestStatus& aStatus ); |
|
884 |
|
885 /** |
|
886 * Gets the value for a TBool attribute. |
|
887 * @param aConnectionId Connection id. |
|
888 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
889 * @param aAttribute Identifies the attribute to be retrived. |
|
890 * @param aValue On completion, contains the requested TBool attribute. |
|
891 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
892 * @return void. |
|
893 */ |
|
894 IMPORT_C void GetBoolAttribute( const TUint aConnectionId, |
|
895 const TUint aSubConnectionId, |
|
896 const TUint aAttribute, |
|
897 TBool& aValue, |
|
898 TRequestStatus& aStatus ); |
|
899 |
|
900 /** |
|
901 * Gets the value for a string attribute. |
|
902 * @param aConnectionId Connection id. |
|
903 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
904 * @param aAttribute Identifies the attribute to be retrived. |
|
905 * @param aValue On completion, contains the requested string. Use a 16-bit descriptor! |
|
906 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
907 * @return void. |
|
908 */ |
|
909 IMPORT_C void GetStringAttribute( const TUint aConnectionId, |
|
910 const TUint aSubConnectionId, |
|
911 const TUint aAttribute, |
|
912 TDes& aValue, |
|
913 TRequestStatus& aStatus ) const; |
|
914 |
|
915 /** |
|
916 * Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf). |
|
917 * @param aConnectionId Connection id. |
|
918 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
919 * @param aAttribute Identifies the attribute to be retrived. |
|
920 * @param aValue On completion, contains the requested packaged attribute. |
|
921 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
922 * @return void. |
|
923 */ |
|
924 IMPORT_C void GetPckgAttribute( const TUint aConnectionId, |
|
925 const TUint aSubConnectionId, |
|
926 const TUint aAttribute, |
|
927 TDes8& aValue, |
|
928 TRequestStatus& aStatus ) const; |
|
929 |
|
930 /** |
|
931 * Gets the value for a packaged attribute (TConnMonTimeBuf, TConnMonClientEnumBuf). |
|
932 * @param aConnectionId Connection id. |
|
933 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
934 * @param aAttribute Identifies the attribute to be retrived. |
|
935 * @param aValue On completion, contains the requested packaged attribute. |
|
936 * @param aStatus KErrNone if successful, a system-wide error code if not. |
|
937 * @return void. |
|
938 */ |
|
939 IMPORT_C void GetPckgAttribute( const TUint aConnectionId, |
|
940 const TUint aSubConnectionId, |
|
941 const TUint aAttribute, |
|
942 TDes16& aValue, |
|
943 TRequestStatus& aStatus ) const; |
|
944 |
|
945 /** |
|
946 * Sets the value for a TInt attribute. |
|
947 * @param aConnectionId Connection id. |
|
948 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
949 * @param aAttribute Identifies the attribute to be set. |
|
950 * @param aValue The value to be set. |
|
951 * @return KErrNone if successful, a system-wide error code if not. |
|
952 */ |
|
953 IMPORT_C TInt SetIntAttribute( const TUint aConnectionId, |
|
954 const TUint aSubConnectionId, |
|
955 const TUint aAttribute, |
|
956 const TInt aValue ) const; |
|
957 |
|
958 /** |
|
959 * Sets the value for a TUint attribute. |
|
960 * @param aConnectionId Connection id. |
|
961 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
962 * @param aAttribute Identifies the attribute to be set. |
|
963 * @param aValue The value to be set. |
|
964 * @return KErrNone if successful, a system-wide error code if not. |
|
965 */ |
|
966 IMPORT_C TInt SetUintAttribute( const TUint aConnectionId, |
|
967 const TUint aSubConnectionId, |
|
968 const TUint aAttribute, |
|
969 const TUint aValue ) const; |
|
970 |
|
971 /** |
|
972 * Sets the value for a TBool attribute. |
|
973 * This method can be used to stop a connection (KConnectionStop). |
|
974 * @param aConnectionId Connection id. |
|
975 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
976 * @param aAttribute Identifies the attribute to be set. |
|
977 * @param aValue The value to be set. |
|
978 * @return KErrNone if successful, a system-wide error code if not. |
|
979 */ |
|
980 IMPORT_C TInt SetBoolAttribute( const TUint aConnectionId, |
|
981 const TUint aSubConnectionId, |
|
982 const TUint aAttribute, |
|
983 const TBool aValue ) const; |
|
984 |
|
985 /** |
|
986 * Sets the value for a string attribute. |
|
987 * @param aConnectionId Connection id. |
|
988 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
989 * @param aAttribute Identifies the attribute to be set. |
|
990 * @param aValue The string value to be set. Must be a 16-bit descriptor!. |
|
991 * @return KErrNone if successful, a system-wide error code if not. |
|
992 */ |
|
993 IMPORT_C TInt SetStringAttribute( const TUint aConnectionId, |
|
994 const TUint aSubConnectionId, |
|
995 const TUint aAttribute, |
|
996 const TDes& aValue ) const; |
|
997 |
|
998 /** |
|
999 * Sets the value for a packaged attribute. |
|
1000 * @param aConnectionId Connection id. |
|
1001 * @param aSubConnectionId Subconnection id. If set to 0, method applies to connection. |
|
1002 * @param aAttribute Identifies the attribute to be set. |
|
1003 * @param aValue The value to be set. |
|
1004 * @return KErrNone if successful, a system-wide error code if not. |
|
1005 */ |
|
1006 IMPORT_C TInt SetPckgAttribute( const TUint aConnectionId, |
|
1007 const TUint aSubConnectionId, |
|
1008 const TUint aAttribute, |
|
1009 const TDes8& aValue ) const; |
|
1010 |
|
1011 /** |
|
1012 * Cancels an asyncronous request. |
|
1013 * @param aReqToCancel Identifies the request to be cancelled. |
|
1014 * Values are defined in TConnMonAsyncRequest. |
|
1015 * @return void. |
|
1016 */ |
|
1017 IMPORT_C void CancelAsyncRequest( TInt aReqToCancel ); |
|
1018 |
|
1019 /** |
|
1020 * Registers an event observer to catch connection monitor events. |
|
1021 * @param aObserver The event observer. |
|
1022 * @return KErrNone if successful, a system-wide error code if not. |
|
1023 */ |
|
1024 IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver ); |
|
1025 |
|
1026 /** |
|
1027 * Cancels the notifications. |
|
1028 * @return void. |
|
1029 */ |
|
1030 IMPORT_C void CancelNotifications(); |
|
1031 |
|
1032 private: // New methods |
|
1033 void ReceiveEvent( TDes8& aBuffer, TDes8& aExtraBuf, TRequestStatus& aStatus ); |
|
1034 void CancelReceiveEvent(); |
|
1035 TBool IsConnected() const; |
|
1036 TPtr8& NextPtr(); |
|
1037 |
|
1038 public: //Data |
|
1039 TUint iConnectionCounter; |
|
1040 TUint iConnectionId; |
|
1041 TUint iSubConnectionCount; |
|
1042 TUint iUintAttributeValue; |
|
1043 TRequestStatus iStatus; |
|
1044 TInt iConnectionInfoError; |
|
1045 private: |
|
1046 CConnMonEventHandler* iHandler; |
|
1047 RArray< TPtr8 > iPtrArray; |
|
1048 TInt iIndex; |
|
1049 HBufC8* iEmptyHbufC; |
|
1050 CMusAvaTimer* iMusAvaTimer; |
|
1051 |
|
1052 private: // Friend classes |
|
1053 friend class CConnMonEventHandler; |
|
1054 }; |
|
1055 |
|
1056 /** |
|
1057 * CConnMonEventBase |
|
1058 * Base class for all event types. |
|
1059 * @lib CONNMON.LIB |
|
1060 * @since |
|
1061 */ |
|
1062 NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase |
|
1063 { |
|
1064 public: // constructors and destructor |
|
1065 CConnMonEventBase( const TInt aEventType, const TUint iConnectionId ); |
|
1066 ~CConnMonEventBase(); |
|
1067 |
|
1068 public: // new methods |
|
1069 /** |
|
1070 * Gets the type of the event. |
|
1071 * @return Type of the event. Values are defined in TConnMonEventType. |
|
1072 */ |
|
1073 IMPORT_C TInt EventType() const; |
|
1074 |
|
1075 /** |
|
1076 * Gets the connection id of the connection. |
|
1077 * @return Connection id. |
|
1078 */ |
|
1079 IMPORT_C TUint ConnectionId() const; |
|
1080 |
|
1081 private: // Data |
|
1082 TInt iEventType; |
|
1083 TUint iConnectionId; |
|
1084 }; |
|
1085 |
|
1086 /** |
|
1087 * CConnMonCreateConnection |
|
1088 * Event is triggered when a new connection has been been created. |
|
1089 * @lib CONNMON.LIB |
|
1090 * @since |
|
1091 */ |
|
1092 NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase |
|
1093 { |
|
1094 public: // constructors and destructor |
|
1095 CConnMonCreateConnection( const TUint aConnectionId ); |
|
1096 ~CConnMonCreateConnection(); |
|
1097 }; |
|
1098 |
|
1099 /** |
|
1100 * CConnMonDeleteConnection |
|
1101 * Event is triggered when a connection has been been deleted. |
|
1102 * @lib CONNMON.LIB |
|
1103 * @since |
|
1104 */ |
|
1105 NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase |
|
1106 { |
|
1107 public: // constructors and destructor |
|
1108 CConnMonDeleteConnection( const TUint aConnectionId, |
|
1109 const TUint aDownlinkData, |
|
1110 const TUint aUplinkData, |
|
1111 const TBool aAuthDelete ); |
|
1112 ~CConnMonDeleteConnection(); |
|
1113 |
|
1114 public: // new methods |
|
1115 /** |
|
1116 * Gets the downlink data volume. |
|
1117 * @return Downlink data volume in bytes. |
|
1118 */ |
|
1119 IMPORT_C TUint DownlinkData() const; |
|
1120 |
|
1121 /** |
|
1122 * Gets the uplink data volume. |
|
1123 * @return Uplink data volume in bytes. |
|
1124 */ |
|
1125 IMPORT_C TUint UplinkData() const; |
|
1126 |
|
1127 /** |
|
1128 * Returns ETrue if the user has deactivated the connection |
|
1129 * by using Connection Monitor or if some application has issued |
|
1130 * RConnection::Stop( RConnection::EStopAuthoritative ). |
|
1131 * @return ETrue if connection has been deactivated in an |
|
1132 * authoritative way otherwise returns EFalse. |
|
1133 */ |
|
1134 IMPORT_C TBool AuthoritativeDelete() const; |
|
1135 |
|
1136 private: // Data |
|
1137 TUint iDownlinkData; |
|
1138 TUint iUplinkData; |
|
1139 TBool iAuthDelete; |
|
1140 }; |
|
1141 |
|
1142 /** |
|
1143 * CConnMonCreateSubConnection |
|
1144 * Event is triggered when a new subconnection has been been created. |
|
1145 * @lib CONNMON.LIB |
|
1146 * @since |
|
1147 */ |
|
1148 NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase |
|
1149 { |
|
1150 public: // constructors and destructor |
|
1151 CConnMonCreateSubConnection( const TUint aConnectionId, |
|
1152 const TUint aSubConnectionId ); |
|
1153 ~CConnMonCreateSubConnection(); |
|
1154 |
|
1155 public: // new methods |
|
1156 /** |
|
1157 * Gets the new subconnection id. |
|
1158 * @return Subconnection id. |
|
1159 */ |
|
1160 IMPORT_C TUint SubConnectionId() const; |
|
1161 |
|
1162 private: // Data |
|
1163 TUint iSubConnectionId; |
|
1164 }; |
|
1165 |
|
1166 /** |
|
1167 * CConnMonDeleteSubConnection |
|
1168 * Event is triggered when a subconnection has been been deleted. |
|
1169 * @lib CONNMON.LIB |
|
1170 * @since |
|
1171 */ |
|
1172 NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase |
|
1173 { |
|
1174 public: // constructors and destructor |
|
1175 CConnMonDeleteSubConnection( const TUint aConnectionId, |
|
1176 const TUint aSubConnectionId, |
|
1177 const TUint aDownlinkData, |
|
1178 const TUint aUplinkData, |
|
1179 const TBool aAuthDelete ); |
|
1180 ~CConnMonDeleteSubConnection(); |
|
1181 |
|
1182 public: // new methods |
|
1183 /** |
|
1184 * Gets the subconnection id of the deleted subconnection. |
|
1185 * @return Subconnection id. |
|
1186 */ |
|
1187 IMPORT_C TUint SubConnectionId() const; |
|
1188 |
|
1189 /** |
|
1190 * Gets the downlink data volume. |
|
1191 * @return Downlink data volume in bytes. |
|
1192 */ |
|
1193 IMPORT_C TUint DownlinkData() const; |
|
1194 |
|
1195 /** |
|
1196 * Gets the uplink data volume. |
|
1197 * @return Uplink data volume in bytes. |
|
1198 */ |
|
1199 IMPORT_C TUint UplinkData() const; |
|
1200 |
|
1201 /** |
|
1202 * Returns ETrue if the user has deactivated the connection |
|
1203 * by using Connection Monitor or if some application has issued |
|
1204 * RConnection::Stop( RConnection::EStopAuthoritative ). |
|
1205 * @return ETrue if connection has been deactivated in an |
|
1206 * authoritative way otherwise returns EFalse. |
|
1207 */ |
|
1208 IMPORT_C TBool AuthoritativeDelete() const; |
|
1209 |
|
1210 private: // Data |
|
1211 TUint iSubConnectionId; |
|
1212 TUint iDownlinkData; |
|
1213 TUint iUplinkData; |
|
1214 TBool iAuthDelete; |
|
1215 }; |
|
1216 |
|
1217 /** |
|
1218 * CConnMonDownlinkDataThreshold |
|
1219 * Event is triggered when there is a change in the volume of downlink data |
|
1220 * for some connection. The notification will only complete when the change in |
|
1221 * volume increases by a client specified amount (KDownlinkDataThreshold). |
|
1222 * If KDownlinkDataThreshold=0 (=default) events will not be sent for that connection. |
|
1223 * @lib CONNMON.LIB |
|
1224 * @since |
|
1225 */ |
|
1226 NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase |
|
1227 { |
|
1228 public: // constructors and destructor |
|
1229 CConnMonDownlinkDataThreshold( const TUint aConnectionId, |
|
1230 const TUint aSubConnectionId, |
|
1231 const TUint aDownlinkData ); |
|
1232 ~CConnMonDownlinkDataThreshold(); |
|
1233 |
|
1234 public: // new methods |
|
1235 /** |
|
1236 * Gets the subconnection id. |
|
1237 * @return Subconnection id. |
|
1238 */ |
|
1239 IMPORT_C TUint SubConnectionId() const; |
|
1240 |
|
1241 /** |
|
1242 * Gets the downlink data volume. |
|
1243 * @return Downlink data volume in bytes. |
|
1244 */ |
|
1245 IMPORT_C TUint DownlinkData() const; |
|
1246 |
|
1247 private: // Data |
|
1248 TUint iSubConnectionId; |
|
1249 TUint iDownlinkData; |
|
1250 }; |
|
1251 |
|
1252 /** |
|
1253 * CConnMonUplinkDataThreshold |
|
1254 * Event is triggered when there is a change in the volume of uplink data |
|
1255 * for some connection. The notification will only complete when the change |
|
1256 * in volume increases by a client specified amount (KUplinkDataThreshold). |
|
1257 * If KUplinkDataThreshold=0 (=default) events will not be sent for that connection. |
|
1258 * @lib CONNMON.LIB |
|
1259 * @since |
|
1260 */ |
|
1261 NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase |
|
1262 { |
|
1263 public: // constructors and destructor |
|
1264 CConnMonUplinkDataThreshold( const TUint aConnectionId, |
|
1265 const TUint aSubConnectionId, |
|
1266 const TUint aUplinkData ); |
|
1267 ~CConnMonUplinkDataThreshold(); |
|
1268 |
|
1269 public: // new methods |
|
1270 /** |
|
1271 * Gets the subconnection id. |
|
1272 * @return Subconnection id. |
|
1273 */ |
|
1274 IMPORT_C TUint SubConnectionId() const; |
|
1275 |
|
1276 /** |
|
1277 * Gets the uplink data volume. |
|
1278 * @return Uplink data volume in bytes. |
|
1279 */ |
|
1280 IMPORT_C TUint UplinkData() const; |
|
1281 |
|
1282 private: // Data |
|
1283 TUint iSubConnectionId; |
|
1284 TUint iUplinkData; |
|
1285 }; |
|
1286 |
|
1287 /** |
|
1288 * CConnMonNetworkStatusChange |
|
1289 * Event is triggered when network status changes for some connection. |
|
1290 * Connection id passed in the event is a bearer specific connection id (TConnMonBearerId). |
|
1291 * @lib CONNMON.LIB |
|
1292 * @since |
|
1293 */ |
|
1294 NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase |
|
1295 { |
|
1296 public: // constructors and destructor |
|
1297 CConnMonNetworkStatusChange( const TUint aConnectionId, |
|
1298 const TInt aNetworkStatus ); |
|
1299 ~CConnMonNetworkStatusChange(); |
|
1300 |
|
1301 public: // new methods |
|
1302 /** |
|
1303 * Gets the network status. |
|
1304 * @return Network status. Values are defined in TConnMonNetworkStatus. |
|
1305 */ |
|
1306 IMPORT_C TInt NetworkStatus() const; |
|
1307 |
|
1308 private: // Data |
|
1309 TInt iNetworkStatus; |
|
1310 }; |
|
1311 |
|
1312 /** |
|
1313 * CConnMonConnectionStatusChange |
|
1314 * Event is triggered when the status of some connection changes. |
|
1315 * @lib CONNMON.LIB |
|
1316 * @since |
|
1317 */ |
|
1318 NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase |
|
1319 { |
|
1320 public: // constructors and destructor |
|
1321 CConnMonConnectionStatusChange( const TUint aConnectionId, |
|
1322 const TUint aSubConnectionId, |
|
1323 const TInt aConnectionStatus ); |
|
1324 ~CConnMonConnectionStatusChange(); |
|
1325 |
|
1326 public: // new methods |
|
1327 /** |
|
1328 * Gets the subconnection id. |
|
1329 * @return Subconnection id. |
|
1330 */ |
|
1331 IMPORT_C TUint SubConnectionId() const; |
|
1332 |
|
1333 /** |
|
1334 * Gets the connection status. |
|
1335 * @return Connection status. Values are defined in nifvar.h. |
|
1336 */ |
|
1337 IMPORT_C TInt ConnectionStatus() const; |
|
1338 |
|
1339 private: // Data |
|
1340 TUint iSubConnectionId; |
|
1341 TInt iConnectionStatus; |
|
1342 }; |
|
1343 |
|
1344 /** |
|
1345 * CConnMonConnectionActivityChange |
|
1346 * Event is triggered when some connection changes from active to idle or vice versa. |
|
1347 * If KActivityTimeThreshold=0 (=default) events will not be sent for that connection. |
|
1348 * KActivityTimeThreshold defines the period (in seconds) for checking whether the |
|
1349 * connection is active or not. |
|
1350 * @lib CONNMON.LIB |
|
1351 * @since |
|
1352 */ |
|
1353 NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase |
|
1354 { |
|
1355 public: // constructors and destructor |
|
1356 CConnMonConnectionActivityChange( const TUint aConnectionId, |
|
1357 const TUint aSubConnectionId, |
|
1358 const TBool aActivity ); |
|
1359 ~CConnMonConnectionActivityChange(); |
|
1360 |
|
1361 public: // new methods |
|
1362 /** |
|
1363 * Gets the subconnection id. |
|
1364 * @return Subconnection id. |
|
1365 */ |
|
1366 IMPORT_C TUint SubConnectionId() const; |
|
1367 |
|
1368 /** |
|
1369 * Gets the connection activity. |
|
1370 * @return ETrue if the connection is active, EFalse if not. |
|
1371 */ |
|
1372 IMPORT_C TBool ConnectionActivity() const; |
|
1373 |
|
1374 private: // Data |
|
1375 TUint iSubConnectionId; |
|
1376 TBool iActivity; |
|
1377 }; |
|
1378 |
|
1379 /** |
|
1380 * CConnMonNetworkRegistrationChange |
|
1381 * Event is triggered when network registration status (GSM/GPRS/WCDMA) changes. |
|
1382 * Connection id passed in the event is generic (TConnMonBearerId) and the event |
|
1383 * applies to all (GSM/GPRS/WCDMA) connections. |
|
1384 * @lib CONNMON.LIB |
|
1385 * @since 2.5 |
|
1386 */ |
|
1387 NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase |
|
1388 { |
|
1389 public: // constructors and destructor |
|
1390 CConnMonNetworkRegistrationChange( const TUint aConnectionId, |
|
1391 const TInt aRegistrationStatus ); |
|
1392 ~CConnMonNetworkRegistrationChange(); |
|
1393 |
|
1394 public: // new methods |
|
1395 /** |
|
1396 * Gets the network registration status. |
|
1397 * @return Registration status. Values are defined in TConnMonNetworkRegistration. |
|
1398 */ |
|
1399 IMPORT_C TInt RegistrationStatus() const; |
|
1400 |
|
1401 private: // Data |
|
1402 TInt iRegistrationStatus; |
|
1403 }; |
|
1404 |
|
1405 /** |
|
1406 * CConnMonBearerChange |
|
1407 * Event is triggered when bearer type (GPRS / Edge GPRS / WCDMA) changes. |
|
1408 * Connection id passed in the event is generic (see. TConnMonBearerId) and the event |
|
1409 * applies to all GPRS connections (including also external GPRS connections). |
|
1410 * @lib CONNMON.LIB |
|
1411 * @since 2.1 |
|
1412 */ |
|
1413 NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase |
|
1414 { |
|
1415 public: // constructors and destructor |
|
1416 CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer ); |
|
1417 ~CConnMonBearerChange(); |
|
1418 |
|
1419 public: // new methods |
|
1420 /** |
|
1421 * Gets the new bearer. Values are defined in TConnMonBearerType. |
|
1422 * @return |
|
1423 */ |
|
1424 IMPORT_C TInt Bearer() const; |
|
1425 |
|
1426 private: // Data |
|
1427 TInt iBearer; |
|
1428 }; |
|
1429 |
|
1430 /** |
|
1431 * CConnMonSignalStrengthChange |
|
1432 * Event is triggered when signal strength (dB) changes (GSM or WLAN). |
|
1433 * Connection id passed in the event is generic (see. TConnMonBearerId) and the event |
|
1434 * applies to all GSM or WLAN connections. |
|
1435 * Client must set KSignalStrengthThreshold to 1 to receive these events. |
|
1436 * @lib CONNMON.LIB |
|
1437 * @since |
|
1438 */ |
|
1439 NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase |
|
1440 { |
|
1441 public: // constructors and destructor |
|
1442 CConnMonSignalStrengthChange( const TUint aConnectionId, const TInt aSignalStrength ); |
|
1443 ~CConnMonSignalStrengthChange(); |
|
1444 |
|
1445 public: // new methods |
|
1446 /** |
|
1447 * Gets the signal strength. |
|
1448 * @return |
|
1449 */ |
|
1450 IMPORT_C TInt SignalStrength() const; |
|
1451 |
|
1452 private: // Data |
|
1453 TInt iSignalStrength; |
|
1454 }; |
|
1455 |
|
1456 /** |
|
1457 * CConnMonBearerAvailabilityChange |
|
1458 * Event is triggered when the availability of some bearer changes. |
|
1459 * Connection id passed in the event is generic (see. TConnMonBearerId). |
|
1460 * Client must set KBearerAvailabilityThreshold to 1 to receive these events. |
|
1461 * @lib CONNMON.LIB |
|
1462 * @since |
|
1463 */ |
|
1464 NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase |
|
1465 { |
|
1466 public: // constructors and destructor |
|
1467 CConnMonBearerAvailabilityChange( const TUint aConnectionId, |
|
1468 const TBool aAvailability ); |
|
1469 ~CConnMonBearerAvailabilityChange(); |
|
1470 |
|
1471 public: // new methods |
|
1472 /** |
|
1473 * Gets the availability of a bearer . |
|
1474 * @return ETrue if the bearer is available, EFalse if not. |
|
1475 */ |
|
1476 IMPORT_C TBool Availability() const; |
|
1477 |
|
1478 private: // Data |
|
1479 TBool iAvailability; |
|
1480 }; |
|
1481 |
|
1482 /** |
|
1483 * CConnMonGenericEvent |
|
1484 * Event is triggered when a plug-in engine sends a bearer specific event |
|
1485 * that is unknown to the Connection Monitor server. |
|
1486 * Connection id passed in the event is generic (see. TConnMonBearerId). |
|
1487 * @lib CONNMON.LIB |
|
1488 * @since |
|
1489 */ |
|
1490 NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase |
|
1491 { |
|
1492 public: // constructors and destructor |
|
1493 CConnMonGenericEvent( const TUint aType, |
|
1494 const TUint aConnectionId, |
|
1495 TAny* aData ); |
|
1496 ~CConnMonGenericEvent(); |
|
1497 |
|
1498 public: // new methods |
|
1499 /** |
|
1500 * Gets a pointer to the event data. |
|
1501 * Note that the pointer is valid only inside EventL(). |
|
1502 * @return A pointer to the event data. |
|
1503 */ |
|
1504 IMPORT_C TAny* Data() const; |
|
1505 |
|
1506 private: // Data |
|
1507 TAny* iData; |
|
1508 }; |
|
1509 |
|
1510 /** |
|
1511 * CConnMonIapAvailabilityChange |
|
1512 * Event is triggered when when IAP Availability changes. |
|
1513 * Connection id passed in the event is generic (see. TConnMonBearerId). |
|
1514 * @lib CONNMON.LIB |
|
1515 * @since |
|
1516 */ |
|
1517 NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase |
|
1518 { |
|
1519 public: // constructors and destructor |
|
1520 CConnMonIapAvailabilityChange( const TUint aConnectionId, |
|
1521 const TConnMonIapInfo* aIapInfoPtr ); |
|
1522 ~CConnMonIapAvailabilityChange(); |
|
1523 |
|
1524 public: // new methods |
|
1525 /** |
|
1526 * Gets the IAP availability information. |
|
1527 * @return TConnMonIapInfo. |
|
1528 */ |
|
1529 IMPORT_C TConnMonIapInfo IapAvailability() const; |
|
1530 |
|
1531 private: // Data |
|
1532 TConnMonIapInfo iIapInfo; |
|
1533 }; |
|
1534 |
|
1535 /** |
|
1536 * CConnMonTransmitPowerChange |
|
1537 * Event is triggered when the used transmit power (mW) changes (WLAN). |
|
1538 * Connection id passed in the event is EBearerIdWLAN. |
|
1539 * @lib CONNMON.LIB |
|
1540 * @since |
|
1541 */ |
|
1542 NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase |
|
1543 { |
|
1544 public: // constructors and destructor |
|
1545 CConnMonTransmitPowerChange( const TUint aConnectionId, const TUint aTransmitPower ); |
|
1546 ~CConnMonTransmitPowerChange(); |
|
1547 |
|
1548 public: // new methods |
|
1549 /** |
|
1550 * Gets the transmit power. |
|
1551 * @return |
|
1552 */ |
|
1553 IMPORT_C TUint TransmitPower() const; |
|
1554 |
|
1555 private: // Data |
|
1556 TUint iTransmitPower; |
|
1557 }; |
|
1558 |
|
1559 /** |
|
1560 * CConnMonSNAPsAvailabilityChange |
|
1561 * Event is triggered when when SNAPs Availability changes. |
|
1562 * Connection id passed in the event is generic (see. TConnMonBearerId). |
|
1563 * @lib CONNMON.LIB |
|
1564 * @since |
|
1565 */ |
|
1566 NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase |
|
1567 { |
|
1568 public: // constructors and destructor |
|
1569 CConnMonSNAPsAvailabilityChange( const TUint aConnectionId, |
|
1570 const TUint aSNAPsAvailable, |
|
1571 const TConnMonSNAPInfo* aSNAPInfoPtr ); |
|
1572 ~CConnMonSNAPsAvailabilityChange(); |
|
1573 |
|
1574 public: // new methods |
|
1575 /** |
|
1576 * Gets the SNAP availability information. |
|
1577 * @return TConnMonSNAPInfo. |
|
1578 */ |
|
1579 IMPORT_C TConnMonSNAPInfo SNAPAvailability() const; |
|
1580 |
|
1581 /** |
|
1582 * Gets amount of available SNAPs. |
|
1583 * @return iSNAPsAvailable |
|
1584 */ |
|
1585 IMPORT_C TUint SNAPsAvailabile() const; |
|
1586 |
|
1587 private: // Data |
|
1588 TConnMonSNAPInfo iSNAPInfo; |
|
1589 TUint iSNAPsAvailable; |
|
1590 }; |
|
1591 |
|
1592 /** |
|
1593 * CConnNewWLANNetworkDetected |
|
1594 * Event is triggered when new WLAN network is detected. |
|
1595 * Connection id passed in the event is generic (TConnMonBearerWLAN). |
|
1596 * iDetected is TRUE, if new network is detected |
|
1597 * @lib CONNMON.LIB |
|
1598 * @since |
|
1599 */ |
|
1600 NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase |
|
1601 { |
|
1602 public: // constructors and destructor |
|
1603 CConnMonNewWLANNetworkDetected( const TUint aConnectionId/*, |
|
1604 const TBool aDetected*/ ); |
|
1605 ~CConnMonNewWLANNetworkDetected(); |
|
1606 |
|
1607 public: // new methods |
|
1608 /** |
|
1609 * New WLAN network is in visibility range |
|
1610 * @return ETrue if the new WLAN network detected, EFalse if not. |
|
1611 */ |
|
1612 // IMPORT_C TBool Detected() const; |
|
1613 |
|
1614 // private: // Data |
|
1615 // TBool iDetected; |
|
1616 }; |
|
1617 |
|
1618 /** |
|
1619 * CConnOldWLANNetworkLost |
|
1620 * Event is triggered when old WLAN network is lost. |
|
1621 * Connection id passed in the event is generic (TConnMonBearerWLAN). |
|
1622 * iLost is TRUE, if old network is lost |
|
1623 * @lib CONNMON.LIB |
|
1624 * @since |
|
1625 */ |
|
1626 NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase |
|
1627 { |
|
1628 public: // constructors and destructor |
|
1629 CConnMonOldWLANNetworkLost( const TUint aConnectionId/*, |
|
1630 const TBool aLost */); |
|
1631 ~CConnMonOldWLANNetworkLost(); |
|
1632 |
|
1633 public: // new methods |
|
1634 /** |
|
1635 * New WLAN network is lost from visibility range |
|
1636 * @return ETrue if the old WLAN network lost, EFalse if not. |
|
1637 */ |
|
1638 // IMPORT_C TBool Lost() const; |
|
1639 |
|
1640 private: // Data |
|
1641 // TBool iLost; |
|
1642 }; |
|
1643 #endif //__CONNECTIONMONITOR_H |
|
1644 // end of file |