Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: RConnectionMonitor provides an interface for an application to
15 * get information about active data connection. It also provides
16 * a way to close any connection or all the connections.
20 #ifndef __CONNECTIONMONITOR_H
21 #define __CONNECTIONMONITOR_H
26 // ===========================================================================
27 // TInt attribute constants, used by GetIntAttribute, SetIntAttribute.
28 // ===========================================================================
30 /** Bearer, defined in TConnMonBearerType.
32 const TUint KBearer = 1;
33 /** Network status, defined in TConnMonNetworkStatus.
35 const TUint KNetworkStatus = 2;
36 /** Connection status, progress constants are from nifvar.h.
38 const TUint KConnectionStatus = 3;
39 /** Protocol, defined in TConnMonProtocolType.
41 const TUint KProtocolType = 4;
42 /** Network registration values defined in TConnMonNetworkRegistration.
44 const TUint KNetworkRegistration = 5;
45 /** Signal strength in dBm.
47 const TUint KSignalStrength = 6;
48 /** WLAN mode, defined in TConnMonNetworkMode.
50 const TUint KNetworkMode = 7;
51 /** WLAN connection security mode, defined in TConnMonSecurityMode.
53 const TUint KSecurityMode = 8;
54 /** Bearer information, defined in TConnMonBearerInfo.
56 const TUint KBearerInfo = 9;
57 /** Acceptable WLAN scan cache age in seconds. Set to -1 to use device
58 default. Only has meaning if KWlanScanMaxDelay is set to 0.
60 const TUint KWlanScanCacheLifetime = 10;
61 /** QoS - Not supported.
63 const TUint KTrafficClass = 30;
64 /** QoS - Not supported.
66 const TUint KDeliveryOrder = 31;
67 /** QoS - Not supported.
69 const TUint KErroneousSDUDelivery = 32;
70 /** QoS - Not supported.
72 const TUint KResidualBitErrorRatio = 33;
73 /** QoS - Not supported.
75 const TUint KSDUErrorRatio = 34;
78 // ===========================================================================
79 // TUint attribute constants, used by GetUintAttribute, SetUintAttribute.
80 // ===========================================================================
82 /** Downlink data in bytes.
84 const TUint KDownlinkData = 100;
85 /** Uplink data in bytes.
87 const TUint KUplinkData = 101;
90 const TUint KIAPId = 102;
93 const TUint KNetworkIdentifier = 103;
94 /** WLAN transmit power in mW.
96 const TUint KTransmitPower = 104;
97 /** Current network mode, defined in TConnMonMobilePhoneNetworkMode.
99 const TUint KMobilePhoneNetworkMode = 105;
100 /** QoS - Not supported.
102 const TUint KMaximumBitrateDownlink = 130;
103 /** QoS - Not supported.
105 const TUint KMaximumBitrateUplink = 131;
106 /** QoS - Not supported.
108 const TUint KMaximumSDUSize = 132;
109 /** QoS - Not supported.
111 const TUint KTransferDelay = 133;
112 /** QoS - Not supported.
114 const TUint KGuaranteedBitrateDownlink = 134;
115 /** QoS - Not supported.
117 const TUint KGuaranteedBitrateUplink = 135;
118 /** QoS - Not supported.
120 const TUint KTrafficHandlingPriority = 136;
121 /** Enables EConnMonConnectionActivityChange events.
122 0 means off, minimum allowed is 5 seconds.
124 const TUint KActivityTimeThreshold = 150;
125 /** Enables EConnMonDownlinkDataThreshold events.
126 0 means off, minimum allowed is 4096 bytes.
128 const TUint KDownlinkDataThreshold = 151;
129 /** Enables EConnMonUplinkDataThreshold events.
130 0 means off, minimum allowed is 4096 bytes.
132 const TUint KUplinkDataThreshold = 152;
133 /** Enables EConnMonBearerAvailabilityChange events.
135 const TUint KBearerAvailabilityThreshold = 153;
136 /** Enables EConnMonSignalStrengthChange events.
138 const TUint KSignalStrengthThreshold = 154;
139 /** If set, disables EConnMonBearerChange events and enables
140 EConnMonBearerInfoChange and EConnMonBearerGroupChange events instead.
142 const TUint KBearerGroupThreshold = 155;
143 /** Acceptable delay in seconds for receiving WLAN scan results.
144 If set to 0 (default), KWlanScanCacheLifetime will be used.
146 const TUint KWlanScanMaxDelay = 160;
149 // ===========================================================================
150 // TBool attribute constants, used by GetBoolAttribute, SetBoolAttribute.
151 // ===========================================================================
153 /** Connection activity.
155 const TUint KConnectionActive = 200;
156 /** Bearer availability.
158 const TUint KBearerAvailability = 201;
159 /** Packet data availability. Can be blocked if phone call is active and no
160 dual transfer mode support.
162 const TUint KPacketDataAvailability = 202;
163 /** Stop a connection.
165 const TUint KConnectionStop = 250;
166 /** Stop all connections.
168 const TUint KConnectionStopAll = 251;
171 // ===========================================================================
172 // TDes attribute constants, used by GetStringAttribute, SetStringAttribute.
173 // ===========================================================================
175 /** Name of used IAP.
177 const TUint KIAPName = 300;
178 /** Name of used access point.
180 const TUint KAccessPointName = 301;
181 /** Used telephone number.
183 const TUint KTelNumber = 302;
184 /** Name (SSID) of used WLAN.
186 const TUint KNetworkName = 303;
187 /** WLAN name (SSID) to be used in SSID scan (KWlanSsidNetworks).
189 const TUint KWlanSsid = 304;
192 // ===========================================================================
193 // TPckgBuf attribute constants, used by GetPckgAttribute.
194 // ===========================================================================
196 /** Connection start time. See TConnMonTimeBuf.
198 const TUint KStartTime = 400;
199 /** All clients using a connection. See TConnMonClientEnumBuf.
201 const TUint KClientInfo = 401;
202 /** Basic WLAN scan information. See TConnMonNetworkNamesBuf.
204 const TUint KNetworkNames = 402;
205 /** Available IAP IDs. See TConnMonIapInfoBuf.
207 const TUint KIapAvailability = 403;
208 /** Deprecated. Old WLAN scan results, use KWlanNetworks instead.
210 const TUint KWLANNetworks = 404;
211 /** Available SNAP IDs. See TConnMonSNAPInfoBuf.
213 const TUint KSNAPsAvailability = 405;
214 /** Available SNAP IDs, in a more flexible way. See ConnMonIdsArrayPckg.
216 const TUint KAvailableSNAPsIds = 406;
217 /** WLAN scan results. See CConnMonWlanNetworksPtrArrayPckg.
219 const TUint KWlanNetworks = 407;
220 /** Bearer group information. See TConnMonBearerGroupInfoBuf.
222 const TUint KBearerGroupInfo = 408;
223 /** WLAN SSID scan results. Scans for WLANs with a specific SSID.
224 See CConnMonWlanNetworksPtrArrayPckg.
226 const TUint KWlanSsidNetworks = 409;
227 /** Information about the currently used WLAN.
228 See CConnMonWlanNetworksPtrArrayPckg.
230 const TUint KWlanCurrentNetwork = 410;
231 /** Beacon frames from a WLAN scan. See CConnMonWlanProbeRawBuffersPckg.
233 const TUint KWlanProbeRawBuffers = 411;
236 /** Base value for plug-in specific attribute IDs.
238 const TUint KConnMonPluginAttributeBase = 3000000;
244 enum TConnMonBearerType
247 EBearerCSD = 1, ///< CSD (GSM)
248 EBearerWCDMA = 2, ///< PSD (WCDMA)
252 EBearerHSCSD = 6, ///< HSCSD (GSM)
255 EBearerBluetooth = 9,
257 EBearerVirtualVPN = 11,
258 EBearerWcdmaCSD = 12, ///< CSD (WCDMA)
260 EBearerExternalCSD = 30, ///< external CSD (GSM)
261 EBearerExternalWCDMA = 31, ///< external PSD (WCDMA)
262 EBearerExternalLAN = 32,
263 EBearerExternalCDMA2000 = 33,
264 EBearerExternalGPRS = 34,
265 EBearerExternalHSCSD = 35, ///< external HSCSD (GSM)
266 EBearerExternalEdgeGPRS = 36,
267 EBearerExternalWLAN = 37,
268 EBearerExternalBluetooth = 38,
269 EBearerExternalWcdmaCSD = 39, ///< external CSD (WCDMA)
273 * Bearer specific general connection ID.
275 enum TConnMonBearerId
278 EBearerIdGPRS = 2000000, ///< Internal/external GPRS and EdgeGPRS
279 EBearerIdWCDMA = 2000001, ///< Internal/external PSD (WCDMA)
280 EBearerIdCSD = 2000002, ///< Internal/external CSD and HSCSD (GSM)
281 EBearerIdGSM = 2000003, ///< Union of EBearerIdGPRS and EBearerIdCSD
282 EBearerIdWLAN = 2000004,
283 EBearerIdLAN = 2000005,
284 EBearerIdWcdmaCSD = 2000006, ///< Internal/external CSD (WCDMA)
285 EBearerIdCDMA2000 = 2000007,
286 EBearerIdVirtualVPN = 2000008
292 enum TConnMonNetworkStatus
294 EConnMonStatusNotAvailable = 0,
295 EConnMonStatusUnattached,
296 EConnMonStatusAttached,
297 EConnMonStatusActive,
298 EConnMonStatusSuspended
302 * Protocol type (type of PDP). It may not be available for some
303 * bearers (returns EProtocolTypeUnknown).
305 enum TConnMonProtocolType
307 EProtocolTypeUnknown = 0,
313 EProtocolTypeIP ///< Connection uses both IPv4 and IPv6
317 * Asyncronous request codes.
319 enum TConnMonAsyncRequest
321 EConnMonGetConnectionCount = 1,
322 EConnMonGetIntAttribute,
323 EConnMonGetUintAttribute,
324 EConnMonGetBoolAttribute,
325 EConnMonGetStringAttribute,
326 EConnMonGetPckgAttribute
330 * Events sent by Connection Monitor. See SDK documentation for more details.
334 EConnMonCreateConnection = 1,
335 EConnMonDeleteConnection = 2,
336 EConnMonCreateSubConnection = 3, ///< Not supported
337 EConnMonDeleteSubConnection = 4, ///< Not supported
338 EConnMonDownlinkDataThreshold = 5,
339 EConnMonUplinkDataThreshold = 6,
340 EConnMonNetworkStatusChange = 7,
341 EConnMonConnectionStatusChange = 8,
342 EConnMonConnectionActivityChange = 9,
343 EConnMonNetworkRegistrationChange = 10,
344 EConnMonBearerChange = 11,
345 EConnMonSignalStrengthChange = 12, ///< For cellular, not WLAN
346 EConnMonBearerAvailabilityChange = 13,
347 EConnMonIapAvailabilityChange = 14,
348 EConnMonTransmitPowerChange = 15, ///< For WLAN
349 EConnMonSNAPsAvailabilityChange = 16,
350 EConnMonNewWLANNetworkDetected = 17,
351 EConnMonOldWLANNetworkLost = 18,
352 EConnMonPacketDataAvailable = 19,
353 EConnMonPacketDataUnavailable = 20,
354 EConnMonBearerInfoChange = 21,
355 EConnMonBearerGroupChange = 22,
357 EConnMonPluginEventBase = 4000000
361 * Network registration status. Valid for CSD, GPRS and WCDMA.
363 enum TConnMonNetworkRegistration
365 ENetworkRegistrationNotAvailable = 0,
366 ENetworkRegistrationUnknown,
367 ENetworkRegistrationNoService,
368 ENetworkRegistrationEmergencyOnly,
369 ENetworkRegistrationSearching,
370 ENetworkRegistrationBusy,
371 ENetworkRegistrationHomeNetwork,
372 ENetworkRegistrationDenied,
373 ENetworkRegistrationRoaming
377 * QoS. Traffic class.
379 enum TQosTrafficClass
381 EQosTrafficClassConversational = 1,
382 EQosTrafficClassStreaming,
383 EQosTrafficClassInteractive,
384 EQosTrafficClassBackground
388 * QoS. Delivery order.
390 enum TQosDeliveryOrder
392 EQosDeliveryOrderYes = 1,
397 * QoS. Delivery of erroneous SDUs.
399 enum TQosErroneousSDUDelivery
401 EQosErroneousSDUDeliveryYes = 1,
402 EQosErroneousSDUDeliveryNo,
403 EQosErroneousSDUDeliveryUnspecified
407 * QoS. Residual bit error ratio.
409 enum TQosBitErrorRatio
411 EQosBERFivePerHundred = 1,
412 EQosBEROnePerHundred,
413 EQosBERFivePerThousand,
414 EQosBEROnePerThousand,
415 EQosBEROnePerTenThousand,
420 * QoS. SDU error ratio.
422 enum TQosSDUErrorRatio
424 EQosSDUErrorRatioOnePerHundred = 1,
425 EQosSDUErrorRatioSevenPerThousand,
426 EQosSDUErrorRatioOnePerThousand,
427 EQosSDUErrorRatioOnePerTenThousand,
428 EQosSDUErrorRatioOnePerHundredThousand
432 * Client-server requests.
434 enum TConnMonRequests
436 EReqGetConnectionCount = 0,
437 EReqGetConnectionInfo = 1,
438 EReqGetSubConnectionInfo = 2,
439 EReqGetIntAttribute = 3,
440 EReqGetUintAttribute = 4,
441 EReqGetBoolAttribute = 5,
442 EReqGetStringAttribute = 6,
443 EReqGetPckgAttribute = 7,
444 EReqSetIntAttribute = 8,
445 EReqSetUintAttribute = 9,
446 EReqSetBoolAttribute = 10,
447 EReqSetStringAttribute = 11,
448 EReqSetPckgAttribute = 12,
449 EReqCancelAsyncRequest = 13,
450 EReqReceiveEvent = 14,
451 EReqCancelReceiveEvent = 15,
453 EReqPluginCreateSubSession = 500,
454 EReqPluginCloseSubSession = 501,
455 EReqPluginRegisterAttribute = 502,
456 EReqPluginCancelRegisterAttribute = 503,
457 EReqPluginEvent = 504,
458 EReqPluginGetQuery = 505,
459 EReqPluginCancelGetQuery = 506,
460 EReqPluginAttribute = 507,
462 EReqInternalSetThreshold = 600,
463 EReqInternalResetThreshold = 601
467 * WLAN connection modes.
469 enum TConnMonNetworkMode
471 EConnMonInfraStructure = 0,
473 EConnMonSecureInfra = 2
477 * WLAN connection security modes.
479 enum TConnMonSecurityMode
481 EConnMonSecurityOpen = 0,
482 EConnMonSecurityWep = 1,
483 EConnMonSecurity802d1x = 2,
484 EConnMonSecurityWpa = 3,
485 EConnMonSecurityWpaPsk = 4
491 enum TConnMonMobilePhoneNetworkMode
493 EConnMonNetworkModeUnknown = 0, ///< Network mode is unknown
494 EConnMonNetworkModeUnregistered, ///< ME is not registered
495 EConnMonNetworkModeGsm, ///< GSM/GPRS or DCS1800 network
496 EConnMonNetworkModeAmps, ///< AMPS network (CDMA)
497 EConnMonNetworkModeCdma95, ///< CDMA (IS-95) network
498 EConnMonNetworkModeCdma2000, ///< CDMA (cdma2000) network
499 EConnMonNetworkModeWcdma, ///< WCDMA (UTRA FDD) network
500 EConnMonNetworkModeTdcdma ///< TD-CDMA (UTRA TDD) network (WCDMA)
503 /** Maximum size of a plug-in's event data.
505 const TUint KConnMonMaxPluginDataSize = 512;
506 /** Maximum size of a plug-in's attribute.
508 const TUint KConnMonMaxStringAttributeLength = 64;
511 * Package class definition for getting the TTime.
513 typedef TPckgBuf<TTime> TConnMonTimeBuf;
515 /** Maximum number of clients contained in TConnMonClientEnum class.
517 const TUint KConnMonMaxClientUids = 10;
520 * Class to contain client UIDs of a connection.
522 class TConnMonClientEnum
528 inline TConnMonClientEnum():iCount( 0 )
533 * Number of UIDs in iUid array.
537 * Array for client UIDs.
539 TUid iUid[KConnMonMaxClientUids];
543 * Package class definition for getting the client information.
545 typedef TPckgBuf<TConnMonClientEnum> TConnMonClientEnumBuf;
547 /** Maximum number of WLANs contained in TConnMonNetworkNames class.
549 const TUint KConnMonMaxNetworkCount = 10;
552 * Class to contain basic WLAN information.
554 class TConnMonNetwork
560 inline TConnMonNetwork():iType( 0 ), iSignalStrength( 0 )
569 * WLAN mode, defined in TConnMonNetworkMode.
573 * Signal strength in dBm. Given as absolute, correct value is negative.
575 TUint8 iSignalStrength;
579 * Class to contain an array of basic WLAN information.
581 class TConnMonNetworkNames
587 inline TConnMonNetworkNames():iCount( 0 )
591 * This method returns the number of WLANs contained in this class.
593 * @return Number of WLANs.
601 * Number of items in WLAN array.
607 TConnMonNetwork iNetwork[KConnMonMaxNetworkCount];
611 * Package class definition for getting basic WLAN scan information.
613 typedef TPckgBuf<TConnMonNetworkNames> TConnMonNetworkNamesBuf;
615 /** Maximum number of IAPs contained in TConnMonIapInfo class.
617 const TUint KConnMonMaxIAPCount = 25;
620 * Class representing an IAP.
628 inline TConnMonIap():iIapId( 0 )
639 * Class to contain an array of IAPs.
641 class TConnMonIapInfo
647 inline TConnMonIapInfo():iCount( 0 )
651 * This method returns the number of IAPs contained in this class.
653 * @return Number of IAPs.
661 * Number of items in IAP array.
667 TConnMonIap iIap[KConnMonMaxIAPCount];
670 /** Package class definiton for getting available IAPs.
672 typedef TPckgBuf<TConnMonIapInfo> TConnMonIapInfoBuf;
674 /** Maximum number of SNAPs contained in TConnMonSNAPInfo class.
676 const TUint KConnMonMaxSNAPsCount = 25;
679 * Class representing a SNAP.
687 inline TConnMonSNAPId():iSNAPId( 0 )
698 * Class to contain an array of SNAPs.
700 class TConnMonSNAPInfo
706 inline TConnMonSNAPInfo():iCount( 0 )
710 * This method returns the number of SNAPs contained in this class.
712 * @return Number of SNAPs.
720 * Number of items in SNAP array.
726 TConnMonSNAPId iSNAP[KConnMonMaxSNAPsCount];
729 /** Package class definiton for getting available SNAPs.
731 typedef TPckgBuf<TConnMonSNAPInfo> TConnMonSNAPInfoBuf;
734 * Bearer group definition, new values will be added to the end of the
737 enum TConnMonBearerGroup
739 EBearerGroupUnknown = 0,
740 EBearerGroupCellular = 0x00000001,
741 EBearerGroupNonCellular = 0x00000002,
742 EBearerGroupCellularPacket = 0x00000004,
743 EBearerGroupCircuitSwitched = 0x00000008,
744 EBearerGroup2G = 0x00000010,
745 EBearerGroup2GPacket = 0x00000020,
746 EBearerGroup3G = 0x00000040,
747 EBearerGroup3GPacket = 0x00000080,
748 EBearerGroupHSPA = 0x00000100,
749 EBearerGroupLANBased = 0x00000200,
750 EBearerGroupWLAN = 0x00000400,
751 EBearerGroupIPOverConnectivityProtocol = 0x00000800,
752 EBearerGroupWired = 0x00001000,
753 EBearerGroupVirtual = 0x00002000
757 * Bearer definition, new values will be added to the end of the enumeration.
758 * These are used if KBearerInfo attribute is set or in events if
759 * KBearerGroupThreshold is set.
761 enum TConnMonBearerInfo
763 EBearerInfoUnknown = 0,
772 EBearerInfoBluetooth,
774 EBearerInfoVirtualVPN,
782 * Class to contain bearer group information.
784 class TConnMonBearerGroupInfo
790 inline TConnMonBearerGroupInfo():
798 * Connection is internal or external.
802 * Bearer group bitmask.
806 * Reserved for future use.
808 TUint iBearerGroups2;
811 /** Package class definiton for getting bearer group information.
813 typedef TPckgBuf<TConnMonBearerGroupInfo> TConnMonBearerGroupInfoBuf;
816 * Class to represent a WLAN. Used when reporting WLAN scan results back to a
819 NONSHARABLE_CLASS( CConnMonWlanNetwork ) : public CBase
822 /** Maximum length of a WLAN name (SSID).
824 static const TUint KMaxNameLength = 32;
825 /** WLAN BSSID length (mac address).
827 static const TUint KWlanBssId = 6;
828 /** Reserved for future use.
830 static const TUint KExtraCount = 10;
835 * @param aName Name (SSID) of the network.
836 * @param aConnectionMode Mode of the network.
837 * @param aSignalStrength Signal strength of the network.
838 * @param aSecurityMode Security mode of the network.
839 * @param aBssId Mac address (BSSID) of the base station.
840 * @param aVendorData Not in use.
841 * @return Pointer to the created CConnMonWlanNetwork object.
843 IMPORT_C static CConnMonWlanNetwork* NewL(
844 const TBuf<KMaxNameLength>& aName,
845 TUint aConnectionMode,
846 TUint aSignalStrength,
848 const TBuf8<KWlanBssId>& aBssId,
849 const TDesC& aVendorData );
854 * @return Pointer to the created empty CConnMonWlanNetwork object.
856 IMPORT_C static CConnMonWlanNetwork* NewL();
861 * @param aConnMonWlanNetwork The object which is copied.
862 * @return Pointer to the created CConnMonWlanNetwork object.
864 IMPORT_C static CConnMonWlanNetwork* NewL(
865 CConnMonWlanNetwork& aConnMonWlanNetwork );
870 IMPORT_C ~CConnMonWlanNetwork();
873 * Assignment operator.
875 * @param aConnMonWlanNetwork The object which is assigned.
877 IMPORT_C CConnMonWlanNetwork& operator=(
878 CConnMonWlanNetwork& aConnMonWlanNetwork );
881 * Compares two networks by signal strength.
883 * @param aFirst Reference to first WLAN object.
884 * @param aSecond Reference to second WLAN object.
885 * @return Result of the comparison, 1 if first is less than second, 0 if
886 * they are equal and -1 otherwise.
888 IMPORT_C static TInt CompareBySignal(
889 const CConnMonWlanNetwork& aFirst,
890 const CConnMonWlanNetwork& aSecond );
893 * Obtains the name (SSID) of the network.
895 * @return Name of the wlan network.
897 inline TBuf<KMaxNameLength> Name()
903 * Obtains the connection mode of the network.
905 * @return Connection mode (defined in TConnMonNetworkMode).
907 inline TUint ConnectionMode()
909 return iConnectionMode;
913 * Obtains the signal strength of the network.
915 * @return Signal strength in dBm.
917 inline TUint SignalStrength()
919 return iSignalStrength;
923 * Obtains the security mode of the network.
925 * @return Security mode (defined in TConnMonSecurityMode).
927 inline TUint SecurityMode()
929 return iSecurityMode;
933 * Obtains the mac address (BSSID) of the base station.
935 * @return Mac address (BSSID).
937 inline TBuf8<KWlanBssId> WlanBssid()
943 * Obtains a pointer to vendor specific data buffer.
944 * Ownership of the data is NOT transferred. Not in use, use package
945 * attribute KWlanProbeRawBuffers instead.
947 * @return Pointer to vendor specific data if available.
949 inline HBufC* VendorData()
955 * Writes object of class CConnMonWlanNetwork to memory.
956 * Ownership of newly created buffer is transferred to caller.
958 * @return Pointer to heap descriptor. NULL if memory allocation failed.
960 IMPORT_C const HBufC* ToBuf() const;
963 * Reads object of class CConnMonWlanNetwork from memory.
965 * @param aPtrC Pointer to the beginning of the CConnMonWlanNetwork object
967 * @param aConnMonWlanNetwork Pointer to CConnMonWlanNetwork object where
968 * unpacked contents are written.
969 * @return A Symbian OS error code.
971 IMPORT_C static TInt FromPtrC(
973 CConnMonWlanNetwork* aConnMonWlanNetwork );
979 CConnMonWlanNetwork();
984 * @param aName Name (SSID) of the network.
985 * @param aConnectionMode Mode of the network.
986 * @param aSignalStrength Signal strength of the network.
987 * @param aSecurityMode Security mode of the network.
988 * @param aBssId Mac address (BSSID) of the base station.
989 * @param aVendorData Not in use.
992 const TBuf<KMaxNameLength>& aName,
993 TUint aConnectionMode,
994 TUint aSignalStrength,
996 const TBuf8<KWlanBssId>& aBssId,
997 const TDesC& aVendorData );
1000 * Second-phase constructor.
1005 TBuf<KMaxNameLength> iName; // Network name
1006 TUint iConnectionMode; // WLAN mode, see TConnMonNetworkMode
1007 TUint iSignalStrength; // Signal strength in absolute dBm
1008 TUint iSecurityMode; // See TConnMonSecurityMode
1009 TBuf8<KWlanBssId> iWlanBssId; // BSSID
1010 HBufC* iVendorData; // For vendor specific data
1011 TUint iExtraBuf[KExtraCount]; // Reserved for future
1014 /** Class definition for a pointer array of CConnMonWlanNetwork objects.
1016 typedef RPointerArray<CConnMonWlanNetwork> RConnMonWlanNetworksPtrArray;
1019 * Class to contain a package of a pointer array of CConnMonWlanNetwork objects.
1021 class CConnMonWlanNetworksPtrArrayPckg : public CBase
1025 * Constructor. Constructs the package of an array of pointers to
1026 * CConnMonWlanNetwork objects on the heap.
1028 * @param aRef Array of pointers to CConnMonWlanNetwork objects.
1029 * @param aBufSize Size of the buffer, intended to contain the package.
1031 CConnMonWlanNetworksPtrArrayPckg(
1032 const RPointerArray<CConnMonWlanNetwork>& aRef,
1036 * Constructor. Constructs an empty package on the heap.
1038 * @param aBufSize Size of the buffer, intended to contain the package.
1040 IMPORT_C CConnMonWlanNetworksPtrArrayPckg( TUint aBufSize );
1045 IMPORT_C virtual ~CConnMonWlanNetworksPtrArrayPckg();
1048 * Unpacks the package to a pointer array of CConnMonWlanNetwork objects.
1050 * @param aRef Array that will contain the pointers to unpacked objects.
1052 IMPORT_C void UnpackToL( RPointerArray<CConnMonWlanNetwork>& aRef ) const;
1055 * Obtains a pointer to the package buffer.
1057 * @return Pointer to the package buffer.
1059 IMPORT_C HBufC* Buf() const;
1063 * Pointer to the package Buffer on the heap.
1069 * Class to represent a WLAN beacon frame. Used when reporting WLAN scan
1070 * results back to a client.
1072 NONSHARABLE_CLASS( CConnMonWlanProbeRawBuffer ) : public CBase
1078 * @param aRawBuffer Beacon frame buffer to be copied to this object.
1079 * @return Pointer to the created CConnMonWlanProbeRawBuffer object.
1081 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
1082 const HBufC8* aRawBuffer );
1087 * @return Pointer to the created empty CConnMonWlanProbeRawBuffer object.
1089 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL();
1094 * @param aConnMonWlanProbeRawBuffer The object which is copied.
1095 * @return Pointer to the created CConnMonWlanProbeRawBuffer object.
1097 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
1098 CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
1103 IMPORT_C virtual ~CConnMonWlanProbeRawBuffer();
1106 * Assignment operator.
1108 * @param aConnMonWlanProbeRawBuffer The object which is assigned.
1110 IMPORT_C CConnMonWlanProbeRawBuffer& operator=(
1111 CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
1114 * Obtains a pointer to the beacon frame buffer.
1116 * @return Pointer to the beacon frame buffer.
1118 IMPORT_C HBufC8* RawBuffer() const;
1121 * Writes object of class CConnMonWlanProbeRawBuffer to memory.
1122 * Ownership of newly created buffer is transferred to caller.
1124 * @return Pointer to heap descriptor, NULL if memory allocation failed.
1126 const HBufC8* ToBuf() const;
1129 * Reads object of class CConnMonWlanProbeRawBuffer from memory.
1131 * @param aPtrC Pointer to the beginning of the CConnMonWlanProbeRawBuffer
1133 * @param aConnMonWlanProbeRawBuffer Pointer to CConnMonWlanProbeRawBuffer
1134 * object where unpacked contents are written.
1135 * @return A Symbian OS error code.
1137 static TInt FromPtrC(
1138 const TPtrC8& aPtrC,
1139 CConnMonWlanProbeRawBuffer* aConnMonWlanProbeRawBuffer );
1145 CConnMonWlanProbeRawBuffer();
1148 * Second-phase constructor.
1153 * Second-phase constructor.
1155 * @param aRawBuffer Buffer to be copied to this object.
1157 void ConstructL( const HBufC8* aRawBuffer );
1160 HBufC8* iRawBuffer; // Beacon frame buffer
1163 /** Class definition for a pointer array of CConnMonWlanProbeRawBuffer objects.
1165 typedef RPointerArray<CConnMonWlanProbeRawBuffer> RConnMonWlanProbeRawBuffersPtrArray;
1168 * Class to contain a package of a pointer array of CConnMonWlanProbeRawBuffer
1171 class CConnMonWlanProbeRawBuffersPckg : public CBase
1175 * Constructor. Constructs the package of an array of pointers to
1176 * CConnMonWlanProbeRawBuffer objects on the heap.
1178 * @param aRef Array of pointers to CConnMonWlanProbeRawBuffer objects.
1179 * @param aBufSize Size of the buffer, intended to contain the package.
1181 CConnMonWlanProbeRawBuffersPckg(
1182 const RConnMonWlanProbeRawBuffersPtrArray& aRef,
1186 * Constructor. Constructs an empty package on the heap.
1188 * @param aBufSize Size of the buffer, intended to contain the package.
1190 IMPORT_C CConnMonWlanProbeRawBuffersPckg( TUint aBufSize );
1195 IMPORT_C virtual ~CConnMonWlanProbeRawBuffersPckg();
1198 * Unpacks the package to a pointer array of CConnMonWlanProbeRawBuffer
1201 * @param aRef Array that will contain the pointers to unpacked objects.
1203 IMPORT_C void UnpackToL( RConnMonWlanProbeRawBuffersPtrArray& aRef ) const;
1206 * Obtains a pointer to the package buffer.
1208 * @return Pointer to the package buffer.
1210 IMPORT_C HBufC8* Buf() const;
1213 * Obtains the total number of found WLANs.
1215 * @return Total count (iBuf[0]).
1217 IMPORT_C TUint Total() const;
1220 * Obtains the number of trasferred WLANs. This will be less than total
1221 * count if there was not enough memory in buffer to include all found
1224 * @return Transfered count in buffer (iBuf[1]).
1226 IMPORT_C TUint Count() const;
1230 * Pointer to the package buffer on the heap.
1236 * Interface template for the class T serialization to/from HBuf/TPtr.
1237 * Class T could be any type of class (T, C, etc.).
1240 class MDesSerializer
1244 * Have to pack the object of class T to HBufC.
1245 * Ownership of newly created pointer is transferred to caller.
1247 * @return Pointer to the heap descriptor.
1249 virtual const HBufC* ToBuf() const = 0;
1252 * Have to unpack object of class T from aPtrC.
1254 * @return Constant pointer to the heap descriptor.
1256 static T FromPtrC( const TPtrC& aPtrC );
1260 * Class representing an ID number.
1261 * MDesSerializer - abstract interface for class serialization.
1263 class TConnMonId : public MDesSerializer<TConnMonId>
1267 * Defines the maximum size of the object in TChar's.
1268 * +1 is for rounding to bigger integer.
1270 static const TUint KMaxSize = ( sizeof( TUint ) ) / sizeof( TChar ) + 1;
1273 * Defines shifts of fields inside the object.
1283 * @param aId ID number.
1285 IMPORT_C TConnMonId( TUint aId );
1288 * Obtains the ID number.
1290 * @return ID number.
1292 IMPORT_C TUint Id() const;
1294 // From MDesSerializer
1297 * Writes object of class TConnMonId to memory.
1298 * Ownership of newly created buffer is transferred to caller.
1300 * @return Pointer to heap descriptor, NULL if memory allocation failed.
1302 IMPORT_C const HBufC* ToBuf() const;
1305 * Reads object of class TConnMonId from memory.
1307 * @param aPtrC Pointer to the beginning of the TConnMonId object in buffer.
1308 * @return The newly created TConnMonId object.
1310 IMPORT_C static TConnMonId FromPtrC( const TPtrC& aPtrC );
1319 /** Class definition for an array of TConnMonId objects.
1321 typedef RArray<TConnMonId> RConnMonIdsArray;
1324 * Class to contain a package of an array of TConnMonId objects.
1326 class ConnMonIdsArrayPckg
1330 * Constructor. Constructs the package of an array of TConnMonId objects
1333 * @param aRef Array of TConnMonId objects.
1334 * @param aBufSize Size of the buffer, intended to contain the package.
1336 ConnMonIdsArrayPckg( const RArray<TConnMonId>& aRef, TUint aBufSize );
1339 * Constructor. Constructs an empty package on the heap.
1341 * @param aBufSize Size of the buffer, intended to contain the package.
1343 IMPORT_C ConnMonIdsArrayPckg( TUint aBufSize );
1348 IMPORT_C virtual ~ConnMonIdsArrayPckg();
1351 * Unpacks the package to an array of TConnMonId objects.
1353 * @param aRef Array that will contain the unpacked objects.
1355 IMPORT_C void UnpackToL( RArray<TConnMonId>& aRef ) const;
1358 * Obtains a pointer to the package buffer.
1360 * @return Pointer to the package buffer.
1362 IMPORT_C HBufC* Buf() const;
1366 * Pointer to the package buffer on the heap.
1371 // Forward declarations
1372 class CConnMonEventBase;
1373 class CConnMonEventHandler;
1376 * Client application must implement the MConnectionMonitorObserver interface in
1377 * order to receive notifications. MConnectionMonitorObserver::EventL() method
1378 * will be called every time an event arrives.
1382 class MConnectionMonitorObserver
1386 * This method is called every time an event occurs.
1388 * @param aConnMonEvent The event information.
1390 virtual void EventL( const CConnMonEventBase &aConnMonEvent ) = 0;
1394 * RConnectionMonitor
1398 class RConnectionMonitor : public RSessionBase
1404 inline RConnectionMonitor():
1414 * Connects the client to the Connection Monitor Server. It must be called
1415 * before any of other methods during the Connection Monitor session.
1417 * @return KErrNone if successful, a system-wide error code if not.
1419 IMPORT_C TInt ConnectL();
1422 * Closes the Connection Monitor session. An opened RConnectionMonitor must
1423 * be closed explicitily to prevent a resource (memory) leak.
1425 IMPORT_C void Close();
1428 * Gathers information on currently active connections.
1430 * @param aConnectionCount On completion, contains the number of active
1432 * @param aStatus KErrNone if successful, a system-wide error code if not.
1434 IMPORT_C void GetConnectionCount(
1435 TUint& aConnectionCount,
1436 TRequestStatus& aStatus );
1439 * Gets the connection ID and the count of the subconnections for the given
1440 * index. GetConnectionCount() must be called to gather the information on
1441 * active connections before calling this method.
1443 * @param aIndex Must be between 1 and the count returned by
1444 * GetConnectionCount().
1445 * @param aConnectionId On return, contains the connection ID.
1446 * @param aSubConnectionCount On return, contains the number of
1448 * @return KErrNone if successful, a system-wide error code if not.
1450 IMPORT_C TInt GetConnectionInfo(
1452 TUint& aConnectionId,
1453 TUint& aSubConnectionCount ) const;
1456 * Gets the subconnection ID for the given index.
1458 * @param aConnectionId Connection ID.
1459 * @param aIndex Must be between 1 and the subconnection count returned by
1460 * GetConnectionInfo().
1461 * @param aSubConnectionId On return, contains the subconnection ID.
1462 * @return KErrNone if successful, a system-wide error code if not.
1464 IMPORT_C TInt GetSubConnectionInfo(
1465 const TUint aConnectionId,
1467 TUint& aSubConnectionId ) const;
1470 * Gets the value for a TInt attribute.
1472 * @param aConnectionId Connection ID.
1473 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1475 * @param aAttribute Identifies the attribute to be retrieved.
1476 * @param aValue On completion, contains the requested TInt attribute.
1477 * @param aStatus KErrNone if successful, a system-wide error code if not.
1479 IMPORT_C void GetIntAttribute(
1480 const TUint aConnectionId,
1481 const TUint aSubConnectionId,
1482 const TUint aAttribute,
1484 TRequestStatus& aStatus );
1487 * Gets the value for a TUint attribute.
1489 * @param aConnectionId Connection ID.
1490 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1492 * @param aAttribute Identifies the attribute to be retrieved.
1493 * @param aValue On completion, contains the requested TUint attribute.
1494 * @param aStatus KErrNone if successful, a system-wide error code if not.
1496 IMPORT_C void GetUintAttribute(
1497 const TUint aConnectionId,
1498 const TUint aSubConnectionId,
1499 const TUint aAttribute,
1501 TRequestStatus& aStatus );
1504 * Gets the value for a TBool attribute.
1506 * @param aConnectionId Connection ID.
1507 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1509 * @param aAttribute Identifies the attribute to be retrieved.
1510 * @param aValue On completion, contains the requested TBool attribute.
1511 * @param aStatus KErrNone if successful, a system-wide error code if not.
1513 IMPORT_C void GetBoolAttribute(
1514 const TUint aConnectionId,
1515 const TUint aSubConnectionId,
1516 const TUint aAttribute,
1518 TRequestStatus& aStatus );
1521 * Gets the value for a string attribute.
1523 * @param aConnectionId Connection ID.
1524 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1526 * @param aAttribute Identifies the attribute to be retrieved.
1527 * @param aValue On completion, contains the requested string. Use a 16-bit
1529 * @param aStatus KErrNone if successful, a system-wide error code if not.
1531 IMPORT_C void GetStringAttribute(
1532 const TUint aConnectionId,
1533 const TUint aSubConnectionId,
1534 const TUint aAttribute,
1536 TRequestStatus& aStatus ) const;
1539 * Gets the value for a packaged attribute.
1541 * @param aConnectionId Connection ID.
1542 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1544 * @param aAttribute Identifies the attribute to be retrieved.
1545 * @param aValue On completion, contains the requested packaged attribute.
1546 * @param aStatus KErrNone if successful, a system-wide error code if not.
1548 IMPORT_C void GetPckgAttribute(
1549 const TUint aConnectionId,
1550 const TUint aSubConnectionId,
1551 const TUint aAttribute,
1553 TRequestStatus& aStatus ) const;
1556 * Gets the value for a packaged attribute.
1558 * @param aConnectionId Connection ID.
1559 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1561 * @param aAttribute Identifies the attribute to be retrieved.
1562 * @param aValue On completion, contains the requested packaged attribute.
1563 * @param aStatus KErrNone if successful, a system-wide error code if not.
1565 IMPORT_C void GetPckgAttribute(
1566 const TUint aConnectionId,
1567 const TUint aSubConnectionId,
1568 const TUint aAttribute,
1570 TRequestStatus& aStatus ) const;
1573 * Sets the value for a TInt attribute.
1575 * @param aConnectionId Connection ID.
1576 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1578 * @param aAttribute Identifies the attribute to be set.
1579 * @param aValue The value to be set.
1580 * @return KErrNone if successful, a system-wide error code if not.
1582 IMPORT_C TInt SetIntAttribute(
1583 const TUint aConnectionId,
1584 const TUint aSubConnectionId,
1585 const TUint aAttribute,
1586 const TInt aValue ) const;
1589 * Sets the value for a TUint attribute.
1591 * @param aConnectionId Connection ID.
1592 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1594 * @param aAttribute Identifies the attribute to be set.
1595 * @param aValue The value to be set.
1596 * @return KErrNone if successful, a system-wide error code if not.
1598 IMPORT_C TInt SetUintAttribute(
1599 const TUint aConnectionId,
1600 const TUint aSubConnectionId,
1601 const TUint aAttribute,
1602 const TUint aValue ) const;
1605 * Sets the value for a TBool attribute.
1607 * This method can be used to stop a connection (KConnectionStop).
1608 * @param aConnectionId Connection ID.
1609 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1611 * @param aAttribute Identifies the attribute to be set.
1612 * @param aValue The value to be set.
1613 * @return KErrNone if successful, a system-wide error code if not.
1615 IMPORT_C TInt SetBoolAttribute(
1616 const TUint aConnectionId,
1617 const TUint aSubConnectionId,
1618 const TUint aAttribute,
1619 const TBool aValue ) const;
1622 * Sets the value for a string attribute.
1624 * @param aConnectionId Connection ID.
1625 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1627 * @param aAttribute Identifies the attribute to be set.
1628 * @param aValue The string value to be set. Must be a 16-bit descriptor.
1629 * @return KErrNone if successful, a system-wide error code if not.
1631 IMPORT_C TInt SetStringAttribute(
1632 const TUint aConnectionId,
1633 const TUint aSubConnectionId,
1634 const TUint aAttribute,
1635 const TDes& aValue ) const;
1638 * Sets the value for a packaged attribute. There is currently no packaged
1639 * attributes that can be set.
1641 * @param aConnectionId Connection ID.
1642 * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
1644 * @param aAttribute Identifies the attribute to be set.
1645 * @param aValue The value to be set.
1646 * @return KErrNone if successful, a system-wide error code if not.
1648 IMPORT_C TInt SetPckgAttribute(
1649 const TUint aConnectionId,
1650 const TUint aSubConnectionId,
1651 const TUint aAttribute,
1652 const TDes8& aValue ) const;
1655 * Cancels an asyncronous request. If there is several active requests of
1656 * the same type (for example GetIntAttribute), they will all be cancelled.
1657 * When a request is cancelled, it is completed with error code KErrCancel.
1659 * @param aReqToCancel Identifies the request type to be cancelled.
1660 * The different types are defined in TConnMonAsyncRequest.
1662 IMPORT_C void CancelAsyncRequest( TInt aReqToCancel );
1665 * Registers an event observer to catch connection monitor events.
1667 * @param aObserver The event observer.
1668 * @return KErrNone if successful, a system-wide error code if not.
1670 IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver );
1673 * Cancels the notifications from connection monitor.
1675 IMPORT_C void CancelNotifications();
1681 TRequestStatus& aStatus );
1682 void CancelReceiveEvent();
1683 TBool IsConnected() const;
1687 CConnMonEventHandler* iHandler;
1688 RArray<TPtr8> iPtrArray;
1692 friend class CConnMonEventHandler;
1696 * Base class for all ConnMon event types.
1698 * Example how to convert an event according to type.
1700 * void CMyConnMonObserver::EventL( const CConnMonEventBase& aEvent )
1702 * switch( aEvent.EventType() )
1704 * case EConnMonCreateConnection:
1705 * CConnMonCreateConnection* realEvent;
1706 * realEvent = (CConnMonCreateConnection*) &aEvent;
1710 NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase
1716 * @param aEventType Event type.
1717 * @param iConnectionId Connection ID.
1719 CConnMonEventBase( const TInt aEventType, const TUint iConnectionId );
1724 ~CConnMonEventBase();
1728 * Gets the type of the event.
1730 * @return Type of the event. Values are defined in TConnMonEventType.
1732 IMPORT_C TInt EventType() const;
1735 * Gets the connection ID of the connection.
1737 * @return Connection ID.
1739 IMPORT_C TUint ConnectionId() const;
1743 TUint iConnectionId;
1747 * This event is triggered when a new connection has been created. The
1748 * connection ID passed in the event is a new ID number that ConnMon assigned to
1749 * the new connection.
1753 NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase
1759 * @param aConnectionId Connection ID.
1761 CConnMonCreateConnection( const TUint aConnectionId );
1766 ~CConnMonCreateConnection();
1770 * This event is triggered when a connection has been deleted. The connection ID
1771 * passed in the event is the connection ID of the deleted connection.
1775 NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase
1781 * @param aConnectionId Connection ID.
1782 * @param aDownlinkData Downlink data volume.
1783 * @param aUplinkData Uplink data volume.
1784 * @param aAuthDelete Was connection stopped in an authoritative way.
1786 CConnMonDeleteConnection(
1787 const TUint aConnectionId,
1788 const TUint aDownlinkData,
1789 const TUint aUplinkData,
1790 const TBool aAuthDelete );
1795 ~CConnMonDeleteConnection();
1799 * Gets the downlink data volume.
1801 * @return Downlink data volume in bytes.
1803 IMPORT_C TUint DownlinkData() const;
1806 * Gets the uplink data volume.
1808 * @return Uplink data volume in bytes.
1810 IMPORT_C TUint UplinkData() const;
1813 * Checks if the connection was stopped in an authoritative way.
1814 * ETrue will be returned if the user has deactivated the connection by
1815 * using Connection Monitor or if some application has issued
1816 * RConnection::Stop( RConnection::EStopAuthoritative ).
1818 * @return ETrue if connection has been deactivated in an authoritative
1819 * way, otherwise returns EFalse.
1821 IMPORT_C TBool AuthoritativeDelete() const;
1824 TUint iDownlinkData;
1830 * This event is triggered when a new subconnection has been created.
1831 * Subconnections are not supported currently.
1835 NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase
1841 * @param aConnectionId Connection ID.
1842 * @param aSubConnectionId Subconnection ID.
1844 CConnMonCreateSubConnection(
1845 const TUint aConnectionId,
1846 const TUint aSubConnectionId );
1851 ~CConnMonCreateSubConnection();
1855 * Gets the new subconnection ID.
1857 * @return Subconnection ID.
1859 IMPORT_C TUint SubConnectionId() const;
1862 TUint iSubConnectionId;
1866 * This event is triggered when a subconnection has been deleted.
1867 * Subconnections are not supported currently.
1871 NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase
1877 * @param aConnectionId Connection ID.
1878 * @param aSubConnectionId Subconnection ID.
1879 * @param aDownlinkData Downlink data volume.
1880 * @param aUplinkData Uplink data volume.
1881 * @param aAuthDelete Was connection stopped in an authoritative way.
1883 CConnMonDeleteSubConnection(
1884 const TUint aConnectionId,
1885 const TUint aSubConnectionId,
1886 const TUint aDownlinkData,
1887 const TUint aUplinkData,
1888 const TBool aAuthDelete );
1893 ~CConnMonDeleteSubConnection();
1897 * Gets the subconnection ID of the deleted subconnection.
1899 * @return Subconnection ID.
1901 IMPORT_C TUint SubConnectionId() const;
1904 * Gets the downlink data volume.
1906 * @return Downlink data volume in bytes.
1908 IMPORT_C TUint DownlinkData() const;
1911 * Gets the uplink data volume.
1913 * @return Uplink data volume in bytes.
1915 IMPORT_C TUint UplinkData() const;
1918 * Checks if the connection was stopped in an authoritative way.
1919 * ETrue will be returned if the user has deactivated the connection by
1920 * using Connection Monitor or if some application has issued
1921 * RConnection::Stop( RConnection::EStopAuthoritative ).
1923 * @return ETrue if connection has been deactivated in an authoritative
1924 * way, otherwise returns EFalse.
1926 IMPORT_C TBool AuthoritativeDelete() const;
1929 TUint iSubConnectionId;
1930 TUint iDownlinkData;
1936 * This event is triggered when there is a sufficient change in the volume of
1937 * downlink data for a specific connection. The event is sent each time a client
1938 * specified amount (KDownlinkDataThreshold) of new data has been sent. If
1939 * another ConnMon client has requested for these events for the same
1940 * connection, the smallest threshold value will be used globally. If
1941 * KDownlinkDataThreshold is 0 (default), events will not be sent for that
1942 * connection. To prevent rapid flooding of these events, different bearers have
1943 * appropriate minimum threshold values which will be used to override too small
1944 * thresholds when necessary.
1948 NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase
1954 * @param aConnectionId Connection ID.
1955 * @param aSubConnectionId Subconnection ID.
1956 * @param aDownlinkData Downlink data volume.
1958 CConnMonDownlinkDataThreshold(
1959 const TUint aConnectionId,
1960 const TUint aSubConnectionId,
1961 const TUint aDownlinkData );
1966 ~CConnMonDownlinkDataThreshold();
1970 * Gets the subconnection ID.
1972 * @return Subconnection ID.
1974 IMPORT_C TUint SubConnectionId() const;
1977 * Gets the downlink data volume.
1979 * @return Downlink data volume in bytes.
1981 IMPORT_C TUint DownlinkData() const;
1984 TUint iSubConnectionId;
1985 TUint iDownlinkData;
1989 * This event is triggered when there is a sufficient change in the volume of
1990 * uplink data for a specific connection. The event is sent each time a client
1991 * specified amount (KUplinkDataThreshold) of new data has been received. If
1992 * another ConnMon client has requested for these events for the same
1993 * connection, the smallest threshold value will be used globally. If
1994 * KUplinkDataThreshold is 0 (default), events will not be sent for that
1995 * connection. To prevent rapid flooding of these events, different bearers have
1996 * appropriate minimum threshold values which will be used to override too small
1997 * thresholds when necessary.
2001 NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase
2007 * @param aConnectionId Connection ID.
2008 * @param aSubConnectionId Subconnection ID.
2009 * @param aUplinkData Uplink data volume.
2011 CConnMonUplinkDataThreshold(
2012 const TUint aConnectionId,
2013 const TUint aSubConnectionId,
2014 const TUint aUplinkData );
2019 ~CConnMonUplinkDataThreshold();
2023 * Gets the subconnection ID.
2025 * @return Subconnection ID.
2027 IMPORT_C TUint SubConnectionId() const;
2030 * Gets the uplink data volume.
2032 * @return Uplink data volume in bytes.
2034 IMPORT_C TUint UplinkData() const;
2037 TUint iSubConnectionId;
2042 * This event is triggered when network status changes for some packet data
2043 * connection. The connection ID passed in the event is a bearer specific
2044 * connection ID (see TConnMonBearerId). The same information can be retrieved
2045 * with TInt attribute KNetworkStatus.
2049 NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase
2055 * @param aConnectionId Connection ID.
2056 * @param aNetworkStatus Network status.
2058 CConnMonNetworkStatusChange(
2059 const TUint aConnectionId,
2060 const TInt aNetworkStatus );
2065 ~CConnMonNetworkStatusChange();
2069 * Gets the network status.
2071 * @return Network status. Values are defined in TConnMonNetworkStatus.
2073 IMPORT_C TInt NetworkStatus() const;
2076 TInt iNetworkStatus;
2080 * This event is triggered when the status of some connection changes.
2081 * The same information can be retrieved with TInt attribute KConnectionStatus.
2082 * Connection status values are defined in nifvar.h.
2086 NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase
2092 * @param aConnectionId Connection ID.
2093 * @param aSubConnectionId Subconnection ID.
2094 * @param aConnectionStatus Connection status.
2096 CConnMonConnectionStatusChange(
2097 const TUint aConnectionId,
2098 const TUint aSubConnectionId,
2099 const TInt aConnectionStatus );
2104 ~CConnMonConnectionStatusChange();
2108 * Gets the subconnection ID.
2110 * @return Subconnection ID.
2112 IMPORT_C TUint SubConnectionId() const;
2115 * Gets the connection status.
2117 * @return Connection status. Values are defined in nifvar.h.
2119 IMPORT_C TInt ConnectionStatus() const;
2122 TUint iSubConnectionId;
2123 TInt iConnectionStatus;
2127 * This event is triggered when some connection changes from active to idle or
2128 * vice versa. The client must set KActivityTimeThreshold to receive these
2129 * events. KActivityTimeThreshold defines the period (in seconds) for checking
2130 * wether the connection is active or not. The minimum allowed value is 5
2131 * seconds. The connection is considered active, if data has been passed during
2132 * the last period, otherwise it is considered inactive. The same information
2133 * can be retrieved with TBool attribute KConnectionActive.
2137 NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase
2143 * @param aConnectionId Connection ID.
2144 * @param aSubConnectionId Subconnection ID.
2145 * @param aActivity Connection activity.
2147 CConnMonConnectionActivityChange(
2148 const TUint aConnectionId,
2149 const TUint aSubConnectionId,
2150 const TBool aActivity );
2155 ~CConnMonConnectionActivityChange();
2159 * Gets the subconnection ID.
2161 * @return Subconnection ID.
2163 IMPORT_C TUint SubConnectionId() const;
2166 * Gets the connection activity.
2168 * @return ETrue if the connection is active, EFalse if not.
2170 IMPORT_C TBool ConnectionActivity() const;
2173 TUint iSubConnectionId;
2178 * This event is triggered when network registration status (GSM/GPRS/WCDMA)
2179 * changes. The connection ID passed in the event is a bearer specific
2180 * connection ID (see TConnMonBearerId). The same information can be retrieved
2181 * with TInt attribute KNetworkRegistration. Network registration values are
2182 * defined in TConnMonNetworkRegistration.
2186 NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase
2192 * @param aConnectionId Connection ID.
2193 * @param aRegistrationStatus Network registration status.
2195 CConnMonNetworkRegistrationChange(
2196 const TUint aConnectionId,
2197 const TInt aRegistrationStatus );
2202 ~CConnMonNetworkRegistrationChange();
2206 * Gets the network registration status.
2208 * @return Registration status. Values are defined in
2209 * TConnMonNetworkRegistration.
2211 IMPORT_C TInt RegistrationStatus() const;
2214 TInt iRegistrationStatus;
2218 * This event is triggered when bearer type (GPRS/EdgeGPRS/WCDMA) changes. The
2219 * connection ID passed in the event is a bearer specific connection ID, either
2220 * EBearerIdGPRS or EBearerIdWCDMA (see TConnMonBearerId). The new bearer passed
2221 * in the event can be EBearerGPRS, EBearerEdgeGPRS or EBearerWCDMA (see
2222 * TConnMonBearerType). The same information can be retrieved with TInt
2223 * attribute KBearer.
2225 * Note: If TUint attribute KBearerGroupThreshold is set, these events are
2226 * disabled and events EConnMonBearerInfoChange and EConnMonBearerGroupChange
2227 * are used instead. Use these events, for example, if HSDPA related information
2232 NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase
2238 * @param aConnectionId Connection ID.
2239 * @param aBearer Bearer.
2241 CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer );
2246 ~CConnMonBearerChange();
2250 * Gets the new bearer.
2252 * @return New bearer. Values are defined in TConnMonBearerType.
2254 IMPORT_C TInt Bearer() const;
2261 * This event is triggered when signal strength changes. The connection ID
2262 * passed in the event is a bearer specific connection ID (see
2263 * TConnMonBearerId). This event is valid only for cellular (GPRS, WCDMA, etc.)
2264 * bearers and not for other bearers, e.g. WLAN. The client must set
2265 * KSignalStrengthThreshold to 1 to receive these events.
2269 NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase
2275 * @param aConnectionId Connection ID.
2276 * @param aSignalStrength Signal strength in dBm.
2278 CConnMonSignalStrengthChange(
2279 const TUint aConnectionId,
2280 const TInt aSignalStrength );
2285 ~CConnMonSignalStrengthChange();
2289 * Gets the signal strength.
2291 * @return Signal strength in dBm.
2293 IMPORT_C TInt SignalStrength() const;
2296 TInt iSignalStrength;
2300 * This event is triggered when the availability of some bearer changes. The
2301 * connection ID passed in the event is a bearer specific connection ID (see
2302 * TConnMonBearerId). The client must set KBearerAvailabilityThreshold to 1 to
2303 * receive these events. Using this event for detecting changes in WLAN
2304 * availability requires WLAN background scanning to be enabled.
2308 NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase
2314 * @param aConnectionId Connection ID.
2315 * @param aAvailability Availability of the bearer.
2317 CConnMonBearerAvailabilityChange(
2318 const TUint aConnectionId,
2319 const TBool aAvailability );
2324 ~CConnMonBearerAvailabilityChange();
2328 * Gets the availability of the bearer.
2330 * @return ETrue if the bearer is available, EFalse if not.
2332 IMPORT_C TBool Availability() const;
2335 TBool iAvailability;
2339 * This event is triggered when a plug-in sends a bearer specific event that is
2340 * unknown to ConnMon.
2344 NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase
2350 * @param aType Event type.
2351 * @param aConnectionId Connection ID.
2352 * @param aData Pointer to the event data.
2354 CConnMonGenericEvent(
2356 const TUint aConnectionId,
2362 ~CConnMonGenericEvent();
2366 * Gets a pointer to the event data.
2367 * The pointer is valid only inside EventL().
2369 * @return Pointer to the event data.
2371 IMPORT_C TAny* Data() const;
2378 * This event is triggered when IAP availability changes. The connection ID
2379 * passed in the event is the generic connection ID EBearerIdAll. The ID numbers
2380 * of available IAPs are included in the event (see TConnMonIapInfo). The same
2381 * information can be retrieved with packaged attribute KIapAvailability.
2385 NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase
2391 * @param aConnectionId Connection ID.
2392 * @param aIapInfoPtr Pointer to the IAP availability information.
2394 CConnMonIapAvailabilityChange(
2395 const TUint aConnectionId,
2396 const TConnMonIapInfo* aIapInfoPtr );
2401 ~CConnMonIapAvailabilityChange();
2405 * Gets the IAP availability information.
2407 * @return IAP availability information.
2409 IMPORT_C TConnMonIapInfo IapAvailability() const;
2412 TConnMonIapInfo iIapInfo;
2416 * This event is triggered when the used WLAN transmit power changes. The
2417 * connection ID passed in the event is the bearer specific connection ID
2418 * EBearerIdWLAN. Transmit power is given in milliwatts (mW). The same
2419 * information can be retrieved with TUint attribute KTransmitPower.
2423 NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase
2429 * @param aConnectionId Connection ID.
2430 * @param aTransmitPower Transmit power in mW.
2432 CConnMonTransmitPowerChange(
2433 const TUint aConnectionId,
2434 const TUint aTransmitPower );
2439 ~CConnMonTransmitPowerChange();
2443 * Gets the transmit power.
2445 * @return Transmit power in mW.
2447 IMPORT_C TUint TransmitPower() const;
2450 TUint iTransmitPower;
2454 * This event is triggered when SNAP availability changes. The connection ID
2455 * passed in the event is the generic connection ID EBearerIdAll. The ID numbers
2456 * of available SNAPs are included in the event (see TConnMonSNAPInfo). The same
2457 * information can be retrieved with packaged attributes KSNAPsAvailability and
2458 * KAvailableSNAPsIds.
2462 NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase
2468 * @param aConnectionId Connection ID.
2469 * @param aSNAPsAvailable Number of available SNAPs.
2470 * @param aSNAPInfoPtr Pointer to the SNAP availability information.
2472 CConnMonSNAPsAvailabilityChange(
2473 const TUint aConnectionId,
2474 const TUint aSNAPsAvailable,
2475 const TConnMonSNAPInfo* aSNAPInfoPtr );
2480 ~CConnMonSNAPsAvailabilityChange();
2484 * Gets the SNAP availability information.
2486 * @return SNAP availability information.
2488 IMPORT_C TConnMonSNAPInfo SNAPAvailability() const;
2491 * Gets the number of available SNAPs.
2493 * @return Number of available SNAPs.
2495 IMPORT_C TUint SNAPsAvailabile() const;
2498 TConnMonSNAPInfo iSNAPInfo;
2499 TUint iSNAPsAvailable;
2503 * This event is triggered when new WLAN networks are detected during a WLAN
2504 * scan. The connection ID passed in the event is the bearer specific connection
2505 * ID EBearerIdWLAN. To receive these events, WLAN background scanning must be
2506 * enabled, or some other mechanism must be used to trigger the necessary WLAN
2511 NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase
2517 * @param aConnectionId Connection ID.
2519 CConnMonNewWLANNetworkDetected( const TUint aConnectionId );
2524 ~CConnMonNewWLANNetworkDetected();
2528 * This event is triggered when one or more WLAN networks have been lost since
2529 * the last WLAN scan. The connection ID passed in the event is the bearer
2530 * specific connection ID EBearerIdWLAN. To receive these events, WLAN
2531 * background scanning must be enabled, or some other mechanism must be used to
2532 * trigger the necessary WLAN scans.
2536 NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase
2542 * @param aConnectionId Connection ID.
2544 CConnMonOldWLANNetworkLost( const TUint aConnectionId );
2549 ~CConnMonOldWLANNetworkLost();
2553 * This event is triggered when GPRS or WCDMA bearer availability changes, a
2554 * phone call is started, or a phone call ends. The connection ID passed in the
2555 * event is a bearer specific connection ID, either EBearerIdGPRS or
2556 * EBearerIdWCDMA (see TConnMonBearerId).
2558 * EConnMonPacketDataUnavailable and EConnMonPacketDataAvailable events form a
2559 * pair. Two events are always sent, one with connection ID EBearerIdGPRS for 2G
2560 * network, and one with connection ID EBearerIdWCDMA for 3G network. The event
2561 * for the network that the phone is not registered to is always of type
2562 * EConnMonPacketDataUnavailable. If the phone does not support dual transfer
2563 * mode and a call is started, a GPRS or WCDMA packet data connection will be
2564 * put on hold. In this scenario, both will be of type
2565 * EConnMonPacketDataUnavailable. The same information can be retrieved with
2566 * TBool attribute KPacketDataAvailability.
2570 NONSHARABLE_CLASS( CConnMonPacketDataUnavailable ) : public CConnMonEventBase
2576 * @param aConnectionId Bearer specific connection ID, EBearerIdGPRS or
2579 CConnMonPacketDataUnavailable( const TUint aConnectionId );
2584 virtual ~CConnMonPacketDataUnavailable();
2588 * This event is triggered when GPRS or WCDMA bearer availability changes, a
2589 * phone call is started, or a phone call ends. The connection ID passed in the
2590 * event is a bearer specific connection ID, either EBearerIdGPRS or
2591 * EBearerIdWCDMA (see TConnMonBearerId).
2593 * EConnMonPacketDataAvailable and EConnMonPacketDataUnavailable events form a
2594 * pair. Two events are always sent, one with connection ID EBearerIdGPRS for 2G
2595 * network, and one with connection ID EBearerIdWCDMA for 3G network. The event
2596 * for the network that the phone is not registered to is always of type
2597 * EConnMonPacketDataUnavailable. If the phone does not support dual transfer
2598 * mode and a call is started, a GPRS or WCDMA packet data connection will be
2599 * put on hold. In this scenario, both will be of type
2600 * EConnMonPacketDataUnavailable. The same information can be retrieved with
2601 * TBool attribute KPacketDataAvailability.
2605 NONSHARABLE_CLASS( CConnMonPacketDataAvailable ) : public CConnMonEventBase
2611 * @param aConnectionId Bearer specific connection ID, EBearerIdGPRS or
2614 CConnMonPacketDataAvailable( const TUint aConnectionId );
2619 virtual ~CConnMonPacketDataAvailable();
2623 * This event is triggered when there is a change in bearer information for an
2624 * existing connection, or if the network mode changes e.g. from 2G to 3G. For
2625 * connection specific events, the connection ID passed in the event is the
2626 * respective connection specific ID, and for network level events, the
2627 * connection ID is EBearerIdAll. The same connection level information can be
2628 * retrieved with TInt attribute KBearerInfo. The bearer info values are defined
2629 * in TConnMonBearerInfo.
2631 * Note: The client needs to set the TUint attribute KBearerGroupThreshold in
2632 * order to receive these events. This also disables EConnMonBearerChange events.
2636 NONSHARABLE_CLASS( CConnMonBearerInfoChange ) : public CConnMonEventBase
2642 * @param aConnectionId Connection ID.
2643 * @param aBearerInfo Bearer information.
2645 CConnMonBearerInfoChange(
2646 const TUint aConnectionId,
2647 const TInt aBearerInfo );
2652 ~CConnMonBearerInfoChange();
2656 * Gets the new bearer information. Values are defined in TConnMonBearerInfo.
2658 * @return New bearer information.
2660 IMPORT_C TInt BearerInfo() const;
2667 * This event is triggered when there is a change in bearer group information
2668 * for an existing connection. The connection ID passed in the event is the
2669 * respective connection specific ID. The same information can be retrieved with
2670 * packaged attribute KBearerGroupInfo. The bearer group bitmask is defined in
2671 * TConnMonBearerGroup.
2673 * Note: The client needs to set the TUint attribute KBearerGroupThreshold in
2674 * order to receive these events. This also disables EConnMonBearerChange events.
2678 NONSHARABLE_CLASS( CConnMonBearerGroupChange ) : public CConnMonEventBase
2684 * @param aConnectionId Connection ID.
2685 * @param aBearerGroups1 First bearer group bitmask.
2686 * @param aBearerGroups2 Second bearer group bitmask.
2687 * @param aInternal ETrue if connection is internal, EFalse if external.
2689 CConnMonBearerGroupChange(
2690 const TUint aConnectionId,
2691 const TUint aBearerGroups1,
2692 const TUint aBearerGroups2,
2693 const TBool aInternal );
2698 ~CConnMonBearerGroupChange();
2702 * Gets the new bearer groups. Values are defined in TConnMonBearerGroup.
2704 * @param aBearerGroups1 Will contain the first bearer group bitmask.
2705 * @param aBearerGroups2 Will contain the second bearer group bitmask.
2707 IMPORT_C void BearerGroups(
2708 TUint& aBearerGroups1,
2709 TUint& aBearerGroups2 ) const;
2712 * Gets the information whether the current connection bearer is internal
2715 * @return ETrue if the bearer is internal and EFalse if external.
2717 IMPORT_C TBool Internal() const;
2720 TBool iInternal; // ETrue for internal, EFalse for external connection.
2721 TUint iBearerGroups1; // Contains the groups as bitmask.
2722 TUint iBearerGroups2; // Reserved for the future use.
2725 #endif // __CONNECTIONMONITOR_H