epoc32/include/mw/rconnmon.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/rconnmon.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/rconnmon.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,2727 @@
     1.4 -rconnmon.h
     1.5 +/*
     1.6 +* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  RConnectionMonitor provides an interface for an application to
    1.19 +*                get information about active data connection. It also provides
    1.20 +*                a way to close any connection or all the connections.
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +#ifndef __CONNECTIONMONITOR_H
    1.25 +#define __CONNECTIONMONITOR_H
    1.26 +
    1.27 +#include <e32base.h>
    1.28 +
    1.29 +
    1.30 +// ===========================================================================
    1.31 +// TInt attribute constants, used by GetIntAttribute, SetIntAttribute.
    1.32 +// ===========================================================================
    1.33 +//
    1.34 +/** Bearer, defined in TConnMonBearerType.
    1.35 +*/
    1.36 +const TUint KBearer = 1;
    1.37 +/** Network status, defined in TConnMonNetworkStatus.
    1.38 +*/
    1.39 +const TUint KNetworkStatus = 2;
    1.40 +/** Connection status, progress constants are from nifvar.h.
    1.41 +*/
    1.42 +const TUint KConnectionStatus = 3;
    1.43 +/** Protocol, defined in TConnMonProtocolType.
    1.44 +*/
    1.45 +const TUint KProtocolType = 4;
    1.46 +/** Network registration values defined in TConnMonNetworkRegistration.
    1.47 +*/
    1.48 +const TUint KNetworkRegistration = 5;
    1.49 +/** Signal strength in dBm.
    1.50 +*/
    1.51 +const TUint KSignalStrength = 6;
    1.52 +/** WLAN mode, defined in TConnMonNetworkMode.
    1.53 +*/
    1.54 +const TUint KNetworkMode = 7;
    1.55 +/** WLAN connection security mode, defined in TConnMonSecurityMode.
    1.56 +*/
    1.57 +const TUint KSecurityMode = 8;
    1.58 +/** Bearer information, defined in TConnMonBearerInfo.
    1.59 +*/
    1.60 +const TUint KBearerInfo = 9;
    1.61 +/** Acceptable WLAN scan cache age in seconds. Set to -1 to use device
    1.62 +default. Only has meaning if KWlanScanMaxDelay is set to 0.
    1.63 +*/
    1.64 +const TUint KWlanScanCacheLifetime = 10;
    1.65 +/** QoS - Not supported.
    1.66 +*/
    1.67 +const TUint KTrafficClass = 30;
    1.68 +/** QoS - Not supported.
    1.69 +*/
    1.70 +const TUint KDeliveryOrder = 31;
    1.71 +/** QoS - Not supported.
    1.72 +*/
    1.73 +const TUint KErroneousSDUDelivery = 32;
    1.74 +/** QoS - Not supported.
    1.75 +*/
    1.76 +const TUint KResidualBitErrorRatio = 33;
    1.77 +/** QoS - Not supported.
    1.78 +*/
    1.79 +const TUint KSDUErrorRatio = 34;
    1.80 +
    1.81 +
    1.82 +// ===========================================================================
    1.83 +// TUint attribute constants, used by GetUintAttribute, SetUintAttribute.
    1.84 +// ===========================================================================
    1.85 +//
    1.86 +/** Downlink data in bytes.
    1.87 +*/
    1.88 +const TUint KDownlinkData = 100;
    1.89 +/** Uplink data in bytes.
    1.90 +*/
    1.91 +const TUint KUplinkData = 101;
    1.92 +/** Used IAP ID.
    1.93 +*/
    1.94 +const TUint KIAPId = 102;
    1.95 +/** Network ID.
    1.96 +*/
    1.97 +const TUint KNetworkIdentifier = 103;
    1.98 +/** WLAN transmit power in mW.
    1.99 +*/
   1.100 +const TUint KTransmitPower = 104;
   1.101 +/** Current network mode, defined in TConnMonMobilePhoneNetworkMode.
   1.102 +*/
   1.103 +const TUint KMobilePhoneNetworkMode = 105;
   1.104 +/** QoS - Not supported.
   1.105 +*/
   1.106 +const TUint KMaximumBitrateDownlink = 130;
   1.107 +/** QoS - Not supported.
   1.108 +*/
   1.109 +const TUint KMaximumBitrateUplink = 131;
   1.110 +/** QoS - Not supported.
   1.111 +*/
   1.112 +const TUint KMaximumSDUSize = 132;
   1.113 +/** QoS - Not supported.
   1.114 +*/
   1.115 +const TUint KTransferDelay = 133;
   1.116 +/** QoS - Not supported.
   1.117 +*/
   1.118 +const TUint KGuaranteedBitrateDownlink = 134;
   1.119 +/** QoS - Not supported.
   1.120 +*/
   1.121 +const TUint KGuaranteedBitrateUplink = 135;
   1.122 +/** QoS - Not supported.
   1.123 +*/
   1.124 +const TUint KTrafficHandlingPriority = 136;
   1.125 +/** Enables EConnMonConnectionActivityChange events.
   1.126 +0 means off, minimum allowed is 5 seconds.
   1.127 +*/
   1.128 +const TUint KActivityTimeThreshold = 150;
   1.129 +/** Enables EConnMonDownlinkDataThreshold events.
   1.130 +0 means off, minimum allowed is 4096 bytes.
   1.131 +*/
   1.132 +const TUint KDownlinkDataThreshold = 151;
   1.133 +/** Enables EConnMonUplinkDataThreshold events.
   1.134 +0 means off, minimum allowed is 4096 bytes.
   1.135 +*/
   1.136 +const TUint KUplinkDataThreshold = 152;
   1.137 +/** Enables EConnMonBearerAvailabilityChange events.
   1.138 +*/
   1.139 +const TUint KBearerAvailabilityThreshold = 153;
   1.140 +/** Enables EConnMonSignalStrengthChange events.
   1.141 +*/
   1.142 +const TUint KSignalStrengthThreshold = 154;
   1.143 +/** If set, disables EConnMonBearerChange events and enables
   1.144 +EConnMonBearerInfoChange and EConnMonBearerGroupChange events instead.
   1.145 +*/
   1.146 +const TUint KBearerGroupThreshold = 155;
   1.147 +/** Acceptable delay in seconds for receiving WLAN scan results.
   1.148 +If set to 0 (default), KWlanScanCacheLifetime will be used.
   1.149 +*/
   1.150 +const TUint KWlanScanMaxDelay = 160;
   1.151 +
   1.152 +
   1.153 +// ===========================================================================
   1.154 +// TBool attribute constants, used by GetBoolAttribute, SetBoolAttribute.
   1.155 +// ===========================================================================
   1.156 +//
   1.157 +/** Connection activity.
   1.158 +*/
   1.159 +const TUint KConnectionActive = 200;
   1.160 +/** Bearer availability.
   1.161 +*/
   1.162 +const TUint KBearerAvailability = 201;
   1.163 +/** Packet data availability. Can be blocked if phone call is active and no
   1.164 +dual transfer mode support.
   1.165 +*/
   1.166 +const TUint KPacketDataAvailability = 202;
   1.167 +/** Stop a connection.
   1.168 +*/
   1.169 +const TUint KConnectionStop = 250;
   1.170 +/** Stop all connections.
   1.171 +*/
   1.172 +const TUint KConnectionStopAll = 251;
   1.173 +
   1.174 +
   1.175 +// ===========================================================================
   1.176 +// TDes attribute constants, used by GetStringAttribute, SetStringAttribute.
   1.177 +// ===========================================================================
   1.178 +//
   1.179 +/** Name of used IAP.
   1.180 +*/
   1.181 +const TUint KIAPName = 300;
   1.182 +/** Name of used access point.
   1.183 +*/
   1.184 +const TUint KAccessPointName = 301;
   1.185 +/** Used telephone number.
   1.186 +*/
   1.187 +const TUint KTelNumber = 302;
   1.188 +/** Name (SSID) of used WLAN.
   1.189 +*/
   1.190 +const TUint KNetworkName = 303;
   1.191 +/** WLAN name (SSID) to be used in SSID scan (KWlanSsidNetworks).
   1.192 +*/
   1.193 +const TUint KWlanSsid = 304;
   1.194 +
   1.195 +
   1.196 +// ===========================================================================
   1.197 +// TPckgBuf attribute constants, used by GetPckgAttribute.
   1.198 +// ===========================================================================
   1.199 +//
   1.200 +/** Connection start time. See TConnMonTimeBuf.
   1.201 +*/
   1.202 +const TUint KStartTime = 400;
   1.203 +/** All clients using a connection. See TConnMonClientEnumBuf.
   1.204 +*/
   1.205 +const TUint KClientInfo = 401;
   1.206 +/** Basic WLAN scan information. See TConnMonNetworkNamesBuf.
   1.207 +*/
   1.208 +const TUint KNetworkNames = 402;
   1.209 +/** Available IAP IDs. See TConnMonIapInfoBuf.
   1.210 +*/
   1.211 +const TUint KIapAvailability = 403;
   1.212 +/** Deprecated. Old WLAN scan results, use KWlanNetworks instead.
   1.213 +*/
   1.214 +const TUint KWLANNetworks = 404;
   1.215 +/** Available SNAP IDs. See TConnMonSNAPInfoBuf.
   1.216 +*/
   1.217 +const TUint KSNAPsAvailability = 405;
   1.218 +/** Available SNAP IDs, in a more flexible way. See ConnMonIdsArrayPckg.
   1.219 +*/
   1.220 +const TUint KAvailableSNAPsIds = 406;
   1.221 +/** WLAN scan results. See CConnMonWlanNetworksPtrArrayPckg.
   1.222 +*/
   1.223 +const TUint KWlanNetworks = 407;
   1.224 +/** Bearer group information. See TConnMonBearerGroupInfoBuf.
   1.225 +*/
   1.226 +const TUint KBearerGroupInfo = 408;
   1.227 +/** WLAN SSID scan results. Scans for WLANs with a specific SSID.
   1.228 +See CConnMonWlanNetworksPtrArrayPckg.
   1.229 +*/
   1.230 +const TUint KWlanSsidNetworks = 409;
   1.231 +/** Information about the currently used WLAN.
   1.232 +See CConnMonWlanNetworksPtrArrayPckg.
   1.233 +*/
   1.234 +const TUint KWlanCurrentNetwork = 410;
   1.235 +/** Beacon frames from a WLAN scan. See CConnMonWlanProbeRawBuffersPckg.
   1.236 +*/
   1.237 +const TUint KWlanProbeRawBuffers = 411;
   1.238 +
   1.239 +
   1.240 +/** Base value for plug-in specific attribute IDs.
   1.241 +*/
   1.242 +const TUint KConnMonPluginAttributeBase = 3000000;
   1.243 +
   1.244 +
   1.245 +/**
   1.246 +* Bearer type.
   1.247 +*/
   1.248 +enum TConnMonBearerType
   1.249 +    {
   1.250 +    EBearerUnknown           = 0,
   1.251 +    EBearerCSD               = 1,  ///< CSD (GSM)
   1.252 +    EBearerWCDMA             = 2,  ///< PSD (WCDMA)
   1.253 +    EBearerLAN               = 3,
   1.254 +    EBearerCDMA2000          = 4,
   1.255 +    EBearerGPRS              = 5,
   1.256 +    EBearerHSCSD             = 6,  ///< HSCSD (GSM)
   1.257 +    EBearerEdgeGPRS          = 7,
   1.258 +    EBearerWLAN              = 8,
   1.259 +    EBearerBluetooth         = 9,
   1.260 +    EBearerVirtual           = 10,
   1.261 +    EBearerVirtualVPN        = 11,
   1.262 +    EBearerWcdmaCSD          = 12, ///< CSD (WCDMA)
   1.263 +
   1.264 +    EBearerExternalCSD       = 30, ///< external CSD (GSM)
   1.265 +    EBearerExternalWCDMA     = 31, ///< external PSD (WCDMA)
   1.266 +    EBearerExternalLAN       = 32,
   1.267 +    EBearerExternalCDMA2000  = 33,
   1.268 +    EBearerExternalGPRS      = 34,
   1.269 +    EBearerExternalHSCSD     = 35, ///< external HSCSD (GSM)
   1.270 +    EBearerExternalEdgeGPRS  = 36,
   1.271 +    EBearerExternalWLAN      = 37,
   1.272 +    EBearerExternalBluetooth = 38,
   1.273 +    EBearerExternalWcdmaCSD  = 39, ///< external CSD (WCDMA)
   1.274 +    };
   1.275 +
   1.276 +/**
   1.277 +* Bearer specific general connection ID.
   1.278 +*/
   1.279 +enum TConnMonBearerId
   1.280 +    {
   1.281 +    EBearerIdAll        = 0,
   1.282 +    EBearerIdGPRS       = 2000000, ///< Internal/external GPRS and EdgeGPRS
   1.283 +    EBearerIdWCDMA      = 2000001, ///< Internal/external PSD (WCDMA)
   1.284 +    EBearerIdCSD        = 2000002, ///< Internal/external CSD and HSCSD (GSM)
   1.285 +    EBearerIdGSM        = 2000003, ///< Union of EBearerIdGPRS and EBearerIdCSD
   1.286 +    EBearerIdWLAN       = 2000004,
   1.287 +    EBearerIdLAN        = 2000005,
   1.288 +    EBearerIdWcdmaCSD   = 2000006, ///< Internal/external CSD (WCDMA)
   1.289 +    EBearerIdCDMA2000   = 2000007,
   1.290 +    EBearerIdVirtualVPN = 2000008
   1.291 +    };
   1.292 +
   1.293 +/**
   1.294 +* Network status.
   1.295 +*/
   1.296 +enum TConnMonNetworkStatus
   1.297 +    {
   1.298 +    EConnMonStatusNotAvailable = 0,
   1.299 +    EConnMonStatusUnattached,
   1.300 +    EConnMonStatusAttached,
   1.301 +    EConnMonStatusActive,
   1.302 +    EConnMonStatusSuspended
   1.303 +    };
   1.304 +
   1.305 +/**
   1.306 +* Protocol type (type of PDP). It may not be available for some
   1.307 +* bearers (returns EProtocolTypeUnknown).
   1.308 +*/
   1.309 +enum TConnMonProtocolType
   1.310 +    {
   1.311 +    EProtocolTypeUnknown = 0,
   1.312 +    EProtocolTypeIPv4,
   1.313 +    EProtocolTypeIPv6,
   1.314 +    EProtocolTypeX25,
   1.315 +    EProtocolTypePPP,
   1.316 +    EProtocolTypeCDPD,
   1.317 +    EProtocolTypeIP           ///< Connection uses both IPv4 and IPv6
   1.318 +    };
   1.319 +
   1.320 +/**
   1.321 +* Asyncronous request codes.
   1.322 +*/
   1.323 +enum TConnMonAsyncRequest
   1.324 +    {
   1.325 +    EConnMonGetConnectionCount = 1,
   1.326 +    EConnMonGetIntAttribute,
   1.327 +    EConnMonGetUintAttribute,
   1.328 +    EConnMonGetBoolAttribute,
   1.329 +    EConnMonGetStringAttribute,
   1.330 +    EConnMonGetPckgAttribute
   1.331 +    };
   1.332 +
   1.333 +/**
   1.334 +* Events sent by Connection Monitor. See SDK documentation for more details.
   1.335 +*/
   1.336 +enum TConnMonEvent
   1.337 +    {
   1.338 +    EConnMonCreateConnection          = 1,
   1.339 +    EConnMonDeleteConnection          = 2,
   1.340 +    EConnMonCreateSubConnection       = 3,  ///< Not supported
   1.341 +    EConnMonDeleteSubConnection       = 4,  ///< Not supported
   1.342 +    EConnMonDownlinkDataThreshold     = 5,
   1.343 +    EConnMonUplinkDataThreshold       = 6,
   1.344 +    EConnMonNetworkStatusChange       = 7,
   1.345 +    EConnMonConnectionStatusChange    = 8,
   1.346 +    EConnMonConnectionActivityChange  = 9,
   1.347 +    EConnMonNetworkRegistrationChange = 10,
   1.348 +    EConnMonBearerChange              = 11,
   1.349 +    EConnMonSignalStrengthChange      = 12, ///< For cellular, not WLAN
   1.350 +    EConnMonBearerAvailabilityChange  = 13,
   1.351 +    EConnMonIapAvailabilityChange     = 14,
   1.352 +    EConnMonTransmitPowerChange       = 15, ///< For WLAN
   1.353 +    EConnMonSNAPsAvailabilityChange   = 16,
   1.354 +    EConnMonNewWLANNetworkDetected    = 17,
   1.355 +    EConnMonOldWLANNetworkLost        = 18,
   1.356 +    EConnMonPacketDataAvailable       = 19,
   1.357 +    EConnMonPacketDataUnavailable     = 20,
   1.358 +    EConnMonBearerInfoChange          = 21,
   1.359 +    EConnMonBearerGroupChange         = 22,
   1.360 +
   1.361 +    EConnMonPluginEventBase           = 4000000
   1.362 +    };
   1.363 +
   1.364 +/**
   1.365 +* Network registration status. Valid for CSD, GPRS and WCDMA.
   1.366 +*/
   1.367 +enum TConnMonNetworkRegistration
   1.368 +    {
   1.369 +    ENetworkRegistrationNotAvailable = 0,
   1.370 +    ENetworkRegistrationUnknown,
   1.371 +    ENetworkRegistrationNoService,
   1.372 +    ENetworkRegistrationEmergencyOnly,
   1.373 +    ENetworkRegistrationSearching,
   1.374 +    ENetworkRegistrationBusy,
   1.375 +    ENetworkRegistrationHomeNetwork,
   1.376 +    ENetworkRegistrationDenied,
   1.377 +    ENetworkRegistrationRoaming
   1.378 +    };
   1.379 +
   1.380 +/**
   1.381 +* QoS. Traffic class.
   1.382 +*/
   1.383 +enum TQosTrafficClass
   1.384 +    {
   1.385 +    EQosTrafficClassConversational = 1,
   1.386 +    EQosTrafficClassStreaming,
   1.387 +    EQosTrafficClassInteractive,
   1.388 +    EQosTrafficClassBackground
   1.389 +    };
   1.390 +
   1.391 +/**
   1.392 +* QoS. Delivery order.
   1.393 +*/
   1.394 +enum TQosDeliveryOrder
   1.395 +    {
   1.396 +    EQosDeliveryOrderYes = 1,
   1.397 +    EQosDeliveryOrderNo
   1.398 +    };
   1.399 +
   1.400 +/**
   1.401 +* QoS. Delivery of erroneous SDUs.
   1.402 +*/
   1.403 +enum TQosErroneousSDUDelivery
   1.404 +    {
   1.405 +    EQosErroneousSDUDeliveryYes = 1,
   1.406 +    EQosErroneousSDUDeliveryNo,
   1.407 +    EQosErroneousSDUDeliveryUnspecified
   1.408 +    };
   1.409 +
   1.410 +/**
   1.411 +* QoS. Residual bit error ratio.
   1.412 +*/
   1.413 +enum TQosBitErrorRatio
   1.414 +    {
   1.415 +    EQosBERFivePerHundred = 1,
   1.416 +    EQosBEROnePerHundred,
   1.417 +    EQosBERFivePerThousand,
   1.418 +    EQosBEROnePerThousand,
   1.419 +    EQosBEROnePerTenThousand,
   1.420 +    EQosBEROnePerMillion
   1.421 +    };
   1.422 +
   1.423 +/**
   1.424 +* QoS. SDU error ratio.
   1.425 +*/
   1.426 +enum TQosSDUErrorRatio
   1.427 +    {
   1.428 +    EQosSDUErrorRatioOnePerHundred = 1,
   1.429 +    EQosSDUErrorRatioSevenPerThousand,
   1.430 +    EQosSDUErrorRatioOnePerThousand,
   1.431 +    EQosSDUErrorRatioOnePerTenThousand,
   1.432 +    EQosSDUErrorRatioOnePerHundredThousand
   1.433 +    };
   1.434 +
   1.435 +/**
   1.436 +* Client-server requests.
   1.437 +*/
   1.438 +enum TConnMonRequests
   1.439 +    {
   1.440 +    EReqGetConnectionCount            = 0,
   1.441 +    EReqGetConnectionInfo             = 1,
   1.442 +    EReqGetSubConnectionInfo          = 2,
   1.443 +    EReqGetIntAttribute               = 3,
   1.444 +    EReqGetUintAttribute              = 4,
   1.445 +    EReqGetBoolAttribute              = 5,
   1.446 +    EReqGetStringAttribute            = 6,
   1.447 +    EReqGetPckgAttribute              = 7,
   1.448 +    EReqSetIntAttribute               = 8,
   1.449 +    EReqSetUintAttribute              = 9,
   1.450 +    EReqSetBoolAttribute              = 10,
   1.451 +    EReqSetStringAttribute            = 11,
   1.452 +    EReqSetPckgAttribute              = 12,
   1.453 +    EReqCancelAsyncRequest            = 13,
   1.454 +    EReqReceiveEvent                  = 14,
   1.455 +    EReqCancelReceiveEvent            = 15,
   1.456 +
   1.457 +    EReqPluginCreateSubSession        = 500,
   1.458 +    EReqPluginCloseSubSession         = 501,
   1.459 +    EReqPluginRegisterAttribute       = 502,
   1.460 +    EReqPluginCancelRegisterAttribute = 503,
   1.461 +    EReqPluginEvent                   = 504,
   1.462 +    EReqPluginGetQuery                = 505,
   1.463 +    EReqPluginCancelGetQuery          = 506,
   1.464 +    EReqPluginAttribute               = 507,
   1.465 +
   1.466 +    EReqInternalSetThreshold          = 600,
   1.467 +    EReqInternalResetThreshold        = 601
   1.468 +    };
   1.469 +
   1.470 +/**
   1.471 +* WLAN connection modes.
   1.472 +*/
   1.473 +enum TConnMonNetworkMode
   1.474 +    {
   1.475 +    EConnMonInfraStructure = 0,
   1.476 +    EConnMonAdHoc          = 1,
   1.477 +    EConnMonSecureInfra    = 2
   1.478 +    };
   1.479 +
   1.480 +/**
   1.481 +* WLAN connection security modes.
   1.482 +*/
   1.483 +enum TConnMonSecurityMode
   1.484 +    {
   1.485 +    EConnMonSecurityOpen   = 0,
   1.486 +    EConnMonSecurityWep    = 1,
   1.487 +    EConnMonSecurity802d1x = 2,
   1.488 +    EConnMonSecurityWpa    = 3,
   1.489 +    EConnMonSecurityWpaPsk = 4
   1.490 +    };
   1.491 +
   1.492 +/**
   1.493 +* Network Modes.
   1.494 +*/
   1.495 +enum TConnMonMobilePhoneNetworkMode
   1.496 +    {
   1.497 +    EConnMonNetworkModeUnknown = 0,  ///< Network mode is unknown
   1.498 +    EConnMonNetworkModeUnregistered, ///< ME is not registered
   1.499 +    EConnMonNetworkModeGsm,          ///< GSM/GPRS or DCS1800 network
   1.500 +    EConnMonNetworkModeAmps,         ///< AMPS network (CDMA)
   1.501 +    EConnMonNetworkModeCdma95,       ///< CDMA (IS-95) network
   1.502 +    EConnMonNetworkModeCdma2000,     ///< CDMA (cdma2000) network
   1.503 +    EConnMonNetworkModeWcdma,        ///< WCDMA (UTRA FDD) network
   1.504 +    EConnMonNetworkModeTdcdma        ///< TD-CDMA (UTRA TDD) network (WCDMA)
   1.505 +    };
   1.506 +
   1.507 +/** Maximum size of a plug-in's event data.
   1.508 +*/
   1.509 +const TUint KConnMonMaxPluginDataSize = 512;
   1.510 +/** Maximum size of a plug-in's attribute.
   1.511 +*/
   1.512 +const TUint KConnMonMaxStringAttributeLength = 64;
   1.513 +
   1.514 +/**
   1.515 +* Package class definition for getting the TTime.
   1.516 +*/
   1.517 +typedef TPckgBuf<TTime> TConnMonTimeBuf;
   1.518 +
   1.519 +/** Maximum number of clients contained in TConnMonClientEnum class.
   1.520 +*/
   1.521 +const TUint KConnMonMaxClientUids = 10;
   1.522 +
   1.523 +/**
   1.524 +* Class to contain client UIDs of a connection.
   1.525 +*/
   1.526 +class TConnMonClientEnum
   1.527 +    {
   1.528 +public:
   1.529 +    /**
   1.530 +    * Constructor.
   1.531 +    */
   1.532 +    inline TConnMonClientEnum():iCount( 0 )
   1.533 +        {
   1.534 +        }
   1.535 +public:
   1.536 +    /**
   1.537 +    * Number of UIDs in iUid array.
   1.538 +    */
   1.539 +    TUint iCount;
   1.540 +    /**
   1.541 +    * Array for client UIDs.
   1.542 +    */
   1.543 +    TUid iUid[KConnMonMaxClientUids];
   1.544 +    };
   1.545 +
   1.546 +/**
   1.547 +* Package class definition for getting the client information.
   1.548 +*/
   1.549 +typedef TPckgBuf<TConnMonClientEnum> TConnMonClientEnumBuf;
   1.550 +
   1.551 +/** Maximum number of WLANs contained in TConnMonNetworkNames class.
   1.552 +*/
   1.553 +const TUint KConnMonMaxNetworkCount = 10;
   1.554 +
   1.555 +/**
   1.556 +* Class to contain basic WLAN information.
   1.557 +*/
   1.558 +class TConnMonNetwork
   1.559 +{
   1.560 +public:
   1.561 +    /**
   1.562 +    * Constructor.
   1.563 +    */
   1.564 +    inline TConnMonNetwork():iType( 0 ), iSignalStrength( 0 )
   1.565 +        {
   1.566 +        }
   1.567 +public:
   1.568 +    /**
   1.569 +    * WLAN name (SSID).
   1.570 +    */
   1.571 +    TBuf8<32> iName;
   1.572 +    /**
   1.573 +    * WLAN mode, defined in TConnMonNetworkMode.
   1.574 +    */
   1.575 +    TInt8 iType;
   1.576 +    /**
   1.577 +    * Signal strength in dBm. Given as absolute, correct value is negative.
   1.578 +    */
   1.579 +    TUint8 iSignalStrength;
   1.580 +    };
   1.581 +
   1.582 +/**
   1.583 +* Class to contain an array of basic WLAN information.
   1.584 +*/
   1.585 +class TConnMonNetworkNames
   1.586 +    {
   1.587 +public:
   1.588 +    /**
   1.589 +    * Constructor.
   1.590 +    */
   1.591 +    inline TConnMonNetworkNames():iCount( 0 )
   1.592 +        {
   1.593 +        }
   1.594 +    /**
   1.595 +    * This method returns the number of WLANs contained in this class.
   1.596 +    *
   1.597 +    * @return Number of WLANs.
   1.598 +    */
   1.599 +    inline TUint Count()
   1.600 +        {
   1.601 +        return iCount;
   1.602 +        }
   1.603 +public:
   1.604 +    /**
   1.605 +    * Number of items in WLAN array.
   1.606 +    */
   1.607 +    TUint iCount;
   1.608 +    /**
   1.609 +    * Array of WLANs.
   1.610 +    */
   1.611 +    TConnMonNetwork iNetwork[KConnMonMaxNetworkCount];
   1.612 +    };
   1.613 +
   1.614 +/**
   1.615 +* Package class definition for getting basic WLAN scan information.
   1.616 +*/
   1.617 +typedef TPckgBuf<TConnMonNetworkNames> TConnMonNetworkNamesBuf;
   1.618 +
   1.619 +/** Maximum number of IAPs contained in TConnMonIapInfo class.
   1.620 +*/
   1.621 +const TUint KConnMonMaxIAPCount = 25;
   1.622 +
   1.623 +/**
   1.624 +* Class representing an IAP.
   1.625 +*/
   1.626 +class TConnMonIap
   1.627 +    {
   1.628 +public:
   1.629 +    /**
   1.630 +    * Constructor.
   1.631 +    */
   1.632 +    inline TConnMonIap():iIapId( 0 )
   1.633 +        {
   1.634 +        }
   1.635 +public:
   1.636 +    /**
   1.637 +    * IAP ID number.
   1.638 +    */
   1.639 +    TUint iIapId;
   1.640 +    };
   1.641 +
   1.642 +/**
   1.643 +* Class to contain an array of IAPs.
   1.644 +*/
   1.645 +class TConnMonIapInfo
   1.646 +    {
   1.647 +public:
   1.648 +    /**
   1.649 +    * Constructor.
   1.650 +    */
   1.651 +    inline TConnMonIapInfo():iCount( 0 )
   1.652 +        {
   1.653 +        }
   1.654 +    /**
   1.655 +    * This method returns the number of IAPs contained in this class.
   1.656 +    *
   1.657 +    * @return Number of IAPs.
   1.658 +    */
   1.659 +    inline TUint Count()
   1.660 +        {
   1.661 +        return iCount;
   1.662 +        }
   1.663 +public:
   1.664 +    /**
   1.665 +    * Number of items in IAP array.
   1.666 +    */
   1.667 +    TUint iCount;
   1.668 +    /**
   1.669 +    * Array of IAPs.
   1.670 +    */
   1.671 +    TConnMonIap iIap[KConnMonMaxIAPCount];
   1.672 +    };
   1.673 +
   1.674 +/** Package class definiton for getting available IAPs.
   1.675 +*/
   1.676 +typedef TPckgBuf<TConnMonIapInfo> TConnMonIapInfoBuf;
   1.677 +
   1.678 +/** Maximum number of SNAPs contained in TConnMonSNAPInfo class.
   1.679 +*/
   1.680 +const TUint KConnMonMaxSNAPsCount = 25;
   1.681 +
   1.682 +/**
   1.683 +* Class representing a SNAP.
   1.684 +*/
   1.685 +class TConnMonSNAPId
   1.686 +    {
   1.687 +public:
   1.688 +    /**
   1.689 +    * Constructor.
   1.690 +    */
   1.691 +    inline TConnMonSNAPId():iSNAPId( 0 )
   1.692 +        {
   1.693 +        }
   1.694 +public:
   1.695 +    /**
   1.696 +    * SNAP ID number.
   1.697 +    */
   1.698 +    TUint iSNAPId;
   1.699 +    };
   1.700 +
   1.701 +/**
   1.702 +* Class to contain an array of SNAPs.
   1.703 +*/
   1.704 +class TConnMonSNAPInfo
   1.705 +    {
   1.706 +public:
   1.707 +    /**
   1.708 +    * Constructor.
   1.709 +    */
   1.710 +    inline TConnMonSNAPInfo():iCount( 0 )
   1.711 +        {
   1.712 +        }
   1.713 +    /**
   1.714 +    * This method returns the number of SNAPs contained in this class.
   1.715 +    *
   1.716 +    * @return Number of SNAPs.
   1.717 +    */
   1.718 +    inline TUint Count()
   1.719 +        {
   1.720 +        return iCount;
   1.721 +        }
   1.722 +public:
   1.723 +    /**
   1.724 +    * Number of items in SNAP array.
   1.725 +    */
   1.726 +    TUint iCount;
   1.727 +    /**
   1.728 +    * Array of SNAPs.
   1.729 +    */
   1.730 +    TConnMonSNAPId iSNAP[KConnMonMaxSNAPsCount];
   1.731 +    };
   1.732 +
   1.733 +/** Package class definiton for getting available SNAPs.
   1.734 +*/
   1.735 +typedef TPckgBuf<TConnMonSNAPInfo> TConnMonSNAPInfoBuf;
   1.736 +
   1.737 +/**
   1.738 +* Bearer group definition, new values will be added to the end of the
   1.739 +* enumeration.
   1.740 +*/
   1.741 +enum TConnMonBearerGroup
   1.742 +    {
   1.743 +    EBearerGroupUnknown                    = 0,
   1.744 +    EBearerGroupCellular                   = 0x00000001,
   1.745 +    EBearerGroupNonCellular                = 0x00000002,
   1.746 +    EBearerGroupCellularPacket             = 0x00000004,
   1.747 +    EBearerGroupCircuitSwitched            = 0x00000008,
   1.748 +    EBearerGroup2G                         = 0x00000010,
   1.749 +    EBearerGroup2GPacket                   = 0x00000020,
   1.750 +    EBearerGroup3G                         = 0x00000040,
   1.751 +    EBearerGroup3GPacket                   = 0x00000080,
   1.752 +    EBearerGroupHSPA                       = 0x00000100,
   1.753 +    EBearerGroupLANBased                   = 0x00000200,
   1.754 +    EBearerGroupWLAN                       = 0x00000400,
   1.755 +    EBearerGroupIPOverConnectivityProtocol = 0x00000800,
   1.756 +    EBearerGroupWired                      = 0x00001000,
   1.757 +    EBearerGroupVirtual                    = 0x00002000
   1.758 +    };
   1.759 +
   1.760 +/**
   1.761 +* Bearer definition, new values will be added to the end of the enumeration.
   1.762 +* These are used if KBearerInfo attribute is set or in events if
   1.763 +* KBearerGroupThreshold is set.
   1.764 +*/
   1.765 +enum TConnMonBearerInfo
   1.766 +    {
   1.767 +    EBearerInfoUnknown = 0,
   1.768 +    EBearerInfoCSD,
   1.769 +    EBearerInfoWCDMA,
   1.770 +    EBearerInfoLAN,
   1.771 +    EBearerInfoCDMA2000,
   1.772 +    EBearerInfoGPRS,
   1.773 +    EBearerInfoHSCSD,
   1.774 +    EBearerInfoEdgeGPRS,
   1.775 +    EBearerInfoWLAN,
   1.776 +    EBearerInfoBluetooth,
   1.777 +    EBearerInfoVirtual,
   1.778 +    EBearerInfoVirtualVPN,
   1.779 +    EBearerInfoWcdmaCSD,
   1.780 +    EBearerInfoHSDPA,
   1.781 +    EBearerInfoHSUPA,
   1.782 +    EBearerInfoHSxPA
   1.783 +    };
   1.784 +
   1.785 +/**
   1.786 +* Class to contain bearer group information.
   1.787 +*/
   1.788 +class TConnMonBearerGroupInfo
   1.789 +    {
   1.790 +public:
   1.791 +    /**
   1.792 +    * Constructor.
   1.793 +    */
   1.794 +    inline TConnMonBearerGroupInfo():
   1.795 +            iInternal( ETrue ),
   1.796 +            iBearerGroups( 0 ),
   1.797 +            iBearerGroups2( 0 )
   1.798 +        {
   1.799 +        }
   1.800 +public:
   1.801 +    /**
   1.802 +    * Connection is internal or external.
   1.803 +    */
   1.804 +    TBool iInternal;
   1.805 +    /**
   1.806 +    * Bearer group bitmask.
   1.807 +    */
   1.808 +    TUint iBearerGroups;
   1.809 +    /**
   1.810 +    * Reserved for future use.
   1.811 +    */
   1.812 +    TUint iBearerGroups2;
   1.813 +    };
   1.814 +
   1.815 +/** Package class definiton for getting bearer group information.
   1.816 +*/
   1.817 +typedef TPckgBuf<TConnMonBearerGroupInfo> TConnMonBearerGroupInfoBuf;
   1.818 +
   1.819 +/**
   1.820 +* Class to represent a WLAN. Used when reporting WLAN scan results back to a
   1.821 +* client.
   1.822 +*/
   1.823 +NONSHARABLE_CLASS( CConnMonWlanNetwork ) : public CBase
   1.824 +    {
   1.825 +public:
   1.826 +    /** Maximum length of a WLAN name (SSID).
   1.827 +    */
   1.828 +    static const TUint KMaxNameLength = 32;
   1.829 +    /** WLAN BSSID length (mac address).
   1.830 +    */
   1.831 +    static const TUint KWlanBssId = 6;
   1.832 +    /** Reserved for future use.
   1.833 +    */
   1.834 +    static const TUint KExtraCount = 10;
   1.835 +
   1.836 +    /**
   1.837 +    * Constructor.
   1.838 +    *
   1.839 +    * @param aName Name (SSID) of the network.
   1.840 +    * @param aConnectionMode Mode of the network.
   1.841 +    * @param aSignalStrength Signal strength of the network.
   1.842 +    * @param aSecurityMode Security mode of the network.
   1.843 +    * @param aBssId Mac address (BSSID) of the base station.
   1.844 +    * @param aVendorData Not in use.
   1.845 +    * @return Pointer to the created CConnMonWlanNetwork object.
   1.846 +    */
   1.847 +    IMPORT_C static CConnMonWlanNetwork* NewL(
   1.848 +            const TBuf<KMaxNameLength>& aName,
   1.849 +            TUint aConnectionMode,
   1.850 +            TUint aSignalStrength,
   1.851 +            TUint aSecurityMode,
   1.852 +            const TBuf8<KWlanBssId>& aBssId,
   1.853 +            const TDesC& aVendorData );
   1.854 +
   1.855 +    /**
   1.856 +    * Constructor.
   1.857 +    *
   1.858 +    * @return Pointer to the created empty CConnMonWlanNetwork object.
   1.859 +    */
   1.860 +    IMPORT_C static CConnMonWlanNetwork* NewL();
   1.861 +
   1.862 +    /**
   1.863 +    * Copy constructor.
   1.864 +    *
   1.865 +    * @param aConnMonWlanNetwork The object which is copied.
   1.866 +    * @return Pointer to the created CConnMonWlanNetwork object.
   1.867 +    */
   1.868 +    IMPORT_C static CConnMonWlanNetwork* NewL(
   1.869 +            CConnMonWlanNetwork& aConnMonWlanNetwork );
   1.870 +
   1.871 +    /**
   1.872 +    * Destructor.
   1.873 +    */
   1.874 +    IMPORT_C ~CConnMonWlanNetwork();
   1.875 +
   1.876 +    /**
   1.877 +    * Assignment operator.
   1.878 +    *
   1.879 +    * @param aConnMonWlanNetwork The object which is assigned.
   1.880 +    */
   1.881 +    IMPORT_C CConnMonWlanNetwork& operator=(
   1.882 +            CConnMonWlanNetwork& aConnMonWlanNetwork );
   1.883 +
   1.884 +    /**
   1.885 +    * Compares two networks by signal strength.
   1.886 +    *
   1.887 +    * @param aFirst Reference to first WLAN object.
   1.888 +    * @param aSecond Reference to second WLAN object.
   1.889 +    * @return Result of the comparison, 1 if first is less than second, 0 if
   1.890 +    * they are equal and -1 otherwise.
   1.891 +    */
   1.892 +    IMPORT_C static TInt CompareBySignal(
   1.893 +            const CConnMonWlanNetwork& aFirst,
   1.894 +            const CConnMonWlanNetwork& aSecond );
   1.895 +
   1.896 +    /**
   1.897 +    * Obtains the name (SSID) of the network.
   1.898 +    *
   1.899 +    * @return Name of the wlan network.
   1.900 +    */
   1.901 +    inline TBuf<KMaxNameLength> Name()
   1.902 +        {
   1.903 +        return iName;
   1.904 +        }
   1.905 +
   1.906 +    /**
   1.907 +    * Obtains the connection mode of the network.
   1.908 +    *
   1.909 +    * @return Connection mode (defined in TConnMonNetworkMode).
   1.910 +    */
   1.911 +    inline TUint ConnectionMode()
   1.912 +        {
   1.913 +        return iConnectionMode;
   1.914 +        }
   1.915 +
   1.916 +    /**
   1.917 +    * Obtains the signal strength of the network.
   1.918 +    *
   1.919 +    * @return Signal strength in dBm.
   1.920 +    */
   1.921 +    inline TUint SignalStrength()
   1.922 +        {
   1.923 +        return iSignalStrength;
   1.924 +        }
   1.925 +
   1.926 +    /**
   1.927 +    * Obtains the security mode of the network.
   1.928 +    *
   1.929 +    * @return Security mode (defined in TConnMonSecurityMode).
   1.930 +    */
   1.931 +    inline TUint SecurityMode()
   1.932 +        {
   1.933 +        return iSecurityMode;
   1.934 +        }
   1.935 +
   1.936 +    /**
   1.937 +    * Obtains the mac address (BSSID) of the base station.
   1.938 +    *
   1.939 +    * @return Mac address (BSSID).
   1.940 +    */
   1.941 +    inline TBuf8<KWlanBssId> WlanBssid()
   1.942 +        {
   1.943 +        return iWlanBssId;
   1.944 +        }
   1.945 +
   1.946 +    /**
   1.947 +    * Obtains a pointer to vendor specific data buffer.
   1.948 +    * Ownership of the data is NOT transferred. Not in use, use package
   1.949 +    * attribute KWlanProbeRawBuffers instead.
   1.950 +    *
   1.951 +    * @return Pointer to vendor specific data if available.
   1.952 +    */
   1.953 +    inline HBufC* VendorData()
   1.954 +        {
   1.955 +        return iVendorData;
   1.956 +        }
   1.957 +
   1.958 +    /**
   1.959 +    * Writes object of class CConnMonWlanNetwork to memory.
   1.960 +    * Ownership of newly created buffer is transferred to caller.
   1.961 +    *
   1.962 +    * @return Pointer to heap descriptor. NULL if memory allocation failed.
   1.963 +    */
   1.964 +    IMPORT_C const HBufC* ToBuf() const;
   1.965 +
   1.966 +    /**
   1.967 +    * Reads object of class CConnMonWlanNetwork from memory.
   1.968 +    *
   1.969 +    * @param aPtrC Pointer to the beginning of the CConnMonWlanNetwork object
   1.970 +    * in buffer.
   1.971 +    * @param aConnMonWlanNetwork Pointer to CConnMonWlanNetwork object where
   1.972 +    * unpacked contents are written.
   1.973 +    * @return A Symbian OS error code.
   1.974 +    */
   1.975 +    IMPORT_C static TInt FromPtrC(
   1.976 +            const TPtrC& aPtrC,
   1.977 +            CConnMonWlanNetwork* aConnMonWlanNetwork );
   1.978 +
   1.979 +private:
   1.980 +    /**
   1.981 +    * Constructor.
   1.982 +    */
   1.983 +    CConnMonWlanNetwork();
   1.984 +
   1.985 +    /**
   1.986 +    * Constructor.
   1.987 +    *
   1.988 +    * @param aName Name (SSID) of the network.
   1.989 +    * @param aConnectionMode Mode of the network.
   1.990 +    * @param aSignalStrength Signal strength of the network.
   1.991 +    * @param aSecurityMode Security mode of the network.
   1.992 +    * @param aBssId Mac address (BSSID) of the base station.
   1.993 +    * @param aVendorData Not in use.
   1.994 +    */
   1.995 +    CConnMonWlanNetwork(
   1.996 +            const TBuf<KMaxNameLength>& aName,
   1.997 +            TUint aConnectionMode,
   1.998 +            TUint aSignalStrength,
   1.999 +            TUint aSecurityMode,
  1.1000 +            const TBuf8<KWlanBssId>& aBssId,
  1.1001 +            const TDesC& aVendorData );
  1.1002 +
  1.1003 +    /**
  1.1004 +    * Second-phase constructor.
  1.1005 +    */
  1.1006 +    void ConstructL();
  1.1007 +
  1.1008 +private:
  1.1009 +    TBuf<KMaxNameLength> iName;   // Network name
  1.1010 +    TUint iConnectionMode;        // WLAN mode, see TConnMonNetworkMode
  1.1011 +    TUint iSignalStrength;        // Signal strength in absolute dBm
  1.1012 +    TUint iSecurityMode;          // See TConnMonSecurityMode
  1.1013 +    TBuf8<KWlanBssId> iWlanBssId; // BSSID
  1.1014 +    HBufC* iVendorData;           // For vendor specific data
  1.1015 +    TUint iExtraBuf[KExtraCount]; // Reserved for future
  1.1016 +    };
  1.1017 +
  1.1018 +/** Class definition for a pointer array of CConnMonWlanNetwork objects.
  1.1019 +*/
  1.1020 +typedef RPointerArray<CConnMonWlanNetwork> RConnMonWlanNetworksPtrArray;
  1.1021 +
  1.1022 +/**
  1.1023 +* Class to contain a package of a pointer array of CConnMonWlanNetwork objects.
  1.1024 +*/
  1.1025 +class CConnMonWlanNetworksPtrArrayPckg : public CBase
  1.1026 +    {
  1.1027 +public:
  1.1028 +    /**
  1.1029 +    * Constructor. Constructs the package of an array of pointers to
  1.1030 +    * CConnMonWlanNetwork objects on the heap.
  1.1031 +    *
  1.1032 +    * @param aRef Array of pointers to CConnMonWlanNetwork objects.
  1.1033 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1034 +    */
  1.1035 +    CConnMonWlanNetworksPtrArrayPckg(
  1.1036 +            const RPointerArray<CConnMonWlanNetwork>& aRef,
  1.1037 +            TUint aBufSize );
  1.1038 +
  1.1039 +    /**
  1.1040 +    * Constructor. Constructs an empty package on the heap.
  1.1041 +    *
  1.1042 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1043 +    */
  1.1044 +    IMPORT_C CConnMonWlanNetworksPtrArrayPckg( TUint aBufSize );
  1.1045 +
  1.1046 +    /**
  1.1047 +    * Destructor.
  1.1048 +    */
  1.1049 +    IMPORT_C virtual ~CConnMonWlanNetworksPtrArrayPckg();
  1.1050 +
  1.1051 +    /**
  1.1052 +    * Unpacks the package to a pointer array of CConnMonWlanNetwork objects.
  1.1053 +    *
  1.1054 +    * @param aRef Array that will contain the pointers to unpacked objects.
  1.1055 +    */
  1.1056 +    IMPORT_C void UnpackToL( RPointerArray<CConnMonWlanNetwork>& aRef ) const;
  1.1057 +
  1.1058 +    /**
  1.1059 +    * Obtains a pointer to the package buffer.
  1.1060 +    *
  1.1061 +    * @return Pointer to the package buffer.
  1.1062 +    */
  1.1063 +    IMPORT_C HBufC* Buf() const;
  1.1064 +
  1.1065 +private:
  1.1066 +    /**
  1.1067 +    * Pointer to the package Buffer on the heap.
  1.1068 +    */
  1.1069 +    HBufC* iBuf;
  1.1070 +    };
  1.1071 +
  1.1072 +/**
  1.1073 +* Class to represent a WLAN beacon frame. Used when reporting WLAN scan
  1.1074 +* results back to a client.
  1.1075 +*/
  1.1076 +NONSHARABLE_CLASS( CConnMonWlanProbeRawBuffer ) : public CBase
  1.1077 +    {
  1.1078 +    public:
  1.1079 +    /**
  1.1080 +    * Constructor.
  1.1081 +    *
  1.1082 +    * @param aRawBuffer Beacon frame buffer to be copied to this object.
  1.1083 +    * @return Pointer to the created CConnMonWlanProbeRawBuffer object.
  1.1084 +    */
  1.1085 +    IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
  1.1086 +            const HBufC8* aRawBuffer );
  1.1087 +
  1.1088 +    /**
  1.1089 +    * Constructor.
  1.1090 +    *
  1.1091 +    * @return Pointer to the created empty CConnMonWlanProbeRawBuffer object.
  1.1092 +    */
  1.1093 +    IMPORT_C static CConnMonWlanProbeRawBuffer* NewL();
  1.1094 +
  1.1095 +    /**
  1.1096 +    * Copy constructor.
  1.1097 +    *
  1.1098 +    * @param aConnMonWlanProbeRawBuffer The object which is copied.
  1.1099 +    * @return Pointer to the created CConnMonWlanProbeRawBuffer object.
  1.1100 +    */
  1.1101 +    IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
  1.1102 +            CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
  1.1103 +
  1.1104 +    /**
  1.1105 +    * Destructor.
  1.1106 +    */
  1.1107 +    IMPORT_C virtual ~CConnMonWlanProbeRawBuffer();
  1.1108 +
  1.1109 +    /**
  1.1110 +    * Assignment operator.
  1.1111 +    *
  1.1112 +    * @param aConnMonWlanProbeRawBuffer The object which is assigned.
  1.1113 +    */
  1.1114 +    IMPORT_C CConnMonWlanProbeRawBuffer& operator=(
  1.1115 +            CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
  1.1116 +
  1.1117 +    /**
  1.1118 +    * Obtains a pointer to the beacon frame buffer.
  1.1119 +    *
  1.1120 +    * @return Pointer to the beacon frame buffer.
  1.1121 +    */
  1.1122 +    IMPORT_C HBufC8* RawBuffer() const;
  1.1123 +
  1.1124 +    /**
  1.1125 +    * Writes object of class CConnMonWlanProbeRawBuffer to memory.
  1.1126 +    * Ownership of newly created buffer is transferred to caller.
  1.1127 +    *
  1.1128 +    * @return Pointer to heap descriptor, NULL if memory allocation failed.
  1.1129 +    */
  1.1130 +    const HBufC8* ToBuf() const;
  1.1131 +
  1.1132 +    /**
  1.1133 +    * Reads object of class CConnMonWlanProbeRawBuffer from memory.
  1.1134 +    *
  1.1135 +    * @param aPtrC Pointer to the beginning of the CConnMonWlanProbeRawBuffer
  1.1136 +    * object in buffer.
  1.1137 +    * @param aConnMonWlanProbeRawBuffer Pointer to CConnMonWlanProbeRawBuffer
  1.1138 +    * object where unpacked contents are written.
  1.1139 +    * @return A Symbian OS error code.
  1.1140 +    */
  1.1141 +    static TInt FromPtrC(
  1.1142 +            const TPtrC8& aPtrC,
  1.1143 +            CConnMonWlanProbeRawBuffer* aConnMonWlanProbeRawBuffer );
  1.1144 +
  1.1145 +private:
  1.1146 +    /**
  1.1147 +    * Constructor.
  1.1148 +    */
  1.1149 +    CConnMonWlanProbeRawBuffer();
  1.1150 +
  1.1151 +    /**
  1.1152 +    * Second-phase constructor.
  1.1153 +    */
  1.1154 +    void ConstructL();
  1.1155 +
  1.1156 +    /**
  1.1157 +    * Second-phase constructor.
  1.1158 +    *
  1.1159 +    * @param aRawBuffer Buffer to be copied to this object.
  1.1160 +    */
  1.1161 +    void ConstructL( const HBufC8* aRawBuffer );
  1.1162 +
  1.1163 +private:
  1.1164 +    HBufC8* iRawBuffer; // Beacon frame buffer
  1.1165 +    };
  1.1166 +
  1.1167 +/** Class definition for a pointer array of CConnMonWlanProbeRawBuffer objects.
  1.1168 +*/
  1.1169 +typedef RPointerArray<CConnMonWlanProbeRawBuffer> RConnMonWlanProbeRawBuffersPtrArray;
  1.1170 +
  1.1171 +/**
  1.1172 +* Class to contain a package of a pointer array of CConnMonWlanProbeRawBuffer
  1.1173 +* objects.
  1.1174 +*/
  1.1175 +class CConnMonWlanProbeRawBuffersPckg : public CBase
  1.1176 +    {
  1.1177 +public:
  1.1178 +    /**
  1.1179 +    * Constructor. Constructs the package of an array of pointers to
  1.1180 +    * CConnMonWlanProbeRawBuffer objects on the heap.
  1.1181 +    *
  1.1182 +    * @param aRef Array of pointers to CConnMonWlanProbeRawBuffer objects.
  1.1183 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1184 +    */
  1.1185 +    CConnMonWlanProbeRawBuffersPckg(
  1.1186 +            const RConnMonWlanProbeRawBuffersPtrArray& aRef,
  1.1187 +            TUint aBufSize );
  1.1188 +
  1.1189 +    /**
  1.1190 +    * Constructor. Constructs an empty package on the heap.
  1.1191 +    *
  1.1192 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1193 +    */
  1.1194 +    IMPORT_C CConnMonWlanProbeRawBuffersPckg( TUint aBufSize );
  1.1195 +
  1.1196 +    /**
  1.1197 +    * Destructor.
  1.1198 +    */
  1.1199 +    IMPORT_C virtual ~CConnMonWlanProbeRawBuffersPckg();
  1.1200 +
  1.1201 +    /**
  1.1202 +    * Unpacks the package to a pointer array of CConnMonWlanProbeRawBuffer
  1.1203 +    * objects.
  1.1204 +    *
  1.1205 +    * @param aRef Array that will contain the pointers to unpacked objects.
  1.1206 +    */
  1.1207 +    IMPORT_C void UnpackToL( RConnMonWlanProbeRawBuffersPtrArray& aRef ) const;
  1.1208 +
  1.1209 +    /**
  1.1210 +    * Obtains a pointer to the package buffer.
  1.1211 +    *
  1.1212 +    * @return Pointer to the package buffer.
  1.1213 +    */
  1.1214 +    IMPORT_C HBufC8* Buf() const;
  1.1215 +
  1.1216 +    /**
  1.1217 +    * Obtains the total number of found WLANs.
  1.1218 +    *
  1.1219 +    * @return Total count (iBuf[0]).
  1.1220 +    */
  1.1221 +    IMPORT_C TUint Total() const;
  1.1222 +
  1.1223 +    /**
  1.1224 +    * Obtains the number of trasferred WLANs. This will be less than total
  1.1225 +    * count if there was not enough memory in buffer to include all found
  1.1226 +    * WLANs.
  1.1227 +    *
  1.1228 +    * @return Transfered count in buffer (iBuf[1]).
  1.1229 +    */
  1.1230 +    IMPORT_C TUint Count() const;
  1.1231 +
  1.1232 +private:
  1.1233 +    /**
  1.1234 +    * Pointer to the package buffer on the heap.
  1.1235 +    */
  1.1236 +    HBufC8* iBuf;
  1.1237 +    };
  1.1238 +
  1.1239 +/**
  1.1240 +* Interface template for the class T serialization to/from HBuf/TPtr.
  1.1241 +* Class T could be any type of class (T, C, etc.).
  1.1242 +*/
  1.1243 +template <class T>
  1.1244 +    class MDesSerializer
  1.1245 +    {
  1.1246 +public:
  1.1247 +    /**
  1.1248 +    * Have to pack the object of class T to HBufC.
  1.1249 +    * Ownership of newly created pointer is transferred to caller.
  1.1250 +    *
  1.1251 +    * @return Pointer to the heap descriptor.
  1.1252 +    */
  1.1253 +    virtual const HBufC* ToBuf() const = 0;
  1.1254 +
  1.1255 +    /**
  1.1256 +    * Have to unpack object of class T from aPtrC.
  1.1257 +    *
  1.1258 +    * @return Constant pointer to the heap descriptor.
  1.1259 +    */
  1.1260 +    static T FromPtrC( const TPtrC& aPtrC );
  1.1261 +    };
  1.1262 +
  1.1263 +/**
  1.1264 +* Class representing an ID number.
  1.1265 +* MDesSerializer - abstract interface for class serialization.
  1.1266 +*/
  1.1267 +class TConnMonId : public MDesSerializer<TConnMonId>
  1.1268 +    {
  1.1269 +public:
  1.1270 +    /**
  1.1271 +    * Defines the maximum size of the object in TChar's.
  1.1272 +    * +1 is for rounding to bigger integer.
  1.1273 +    */
  1.1274 +    static const TUint KMaxSize = ( sizeof( TUint ) ) / sizeof( TChar ) + 1;
  1.1275 +
  1.1276 +    /**
  1.1277 +    * Defines shifts of fields inside the object.
  1.1278 +    */
  1.1279 +    enum FieldsShifts
  1.1280 +        {
  1.1281 +        EId = 0
  1.1282 +        };
  1.1283 +
  1.1284 +    /**
  1.1285 +    * Constructor.
  1.1286 +    *
  1.1287 +    * @param aId ID number.
  1.1288 +    */
  1.1289 +    IMPORT_C TConnMonId( TUint aId );
  1.1290 +
  1.1291 +    /**
  1.1292 +    * Obtains the ID number.
  1.1293 +    *
  1.1294 +    * @return ID number.
  1.1295 +    */
  1.1296 +    IMPORT_C TUint Id() const;
  1.1297 +
  1.1298 +    // From MDesSerializer
  1.1299 +
  1.1300 +    /**
  1.1301 +    * Writes object of class TConnMonId to memory.
  1.1302 +    * Ownership of newly created buffer is transferred to caller.
  1.1303 +    *
  1.1304 +    * @return Pointer to heap descriptor, NULL if memory allocation failed.
  1.1305 +    */
  1.1306 +    IMPORT_C const HBufC* ToBuf() const;
  1.1307 +
  1.1308 +    /**
  1.1309 +    * Reads object of class TConnMonId from memory.
  1.1310 +    *
  1.1311 +    * @param aPtrC Pointer to the beginning of the TConnMonId object in buffer.
  1.1312 +    * @return The newly created TConnMonId object.
  1.1313 +    */
  1.1314 +    IMPORT_C static TConnMonId FromPtrC( const TPtrC& aPtrC );
  1.1315 +
  1.1316 +protected:
  1.1317 +    /**
  1.1318 +    * ID number.
  1.1319 +    */
  1.1320 +    const TUint iId;
  1.1321 +    };
  1.1322 +
  1.1323 +/** Class definition for an array of TConnMonId objects.
  1.1324 +*/
  1.1325 +typedef RArray<TConnMonId> RConnMonIdsArray;
  1.1326 +
  1.1327 +/**
  1.1328 +* Class to contain a package of an array of TConnMonId objects.
  1.1329 +*/
  1.1330 +class ConnMonIdsArrayPckg
  1.1331 +    {
  1.1332 +public:
  1.1333 +    /**
  1.1334 +    * Constructor. Constructs the package of an array of TConnMonId objects
  1.1335 +    * on the heap.
  1.1336 +    *
  1.1337 +    * @param aRef Array of TConnMonId objects.
  1.1338 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1339 +    */
  1.1340 +    ConnMonIdsArrayPckg( const RArray<TConnMonId>& aRef, TUint aBufSize );
  1.1341 +
  1.1342 +    /**
  1.1343 +    * Constructor. Constructs an empty package on the heap.
  1.1344 +    *
  1.1345 +    * @param aBufSize Size of the buffer, intended to contain the package.
  1.1346 +    */
  1.1347 +    IMPORT_C ConnMonIdsArrayPckg( TUint aBufSize );
  1.1348 +
  1.1349 +    /**
  1.1350 +    * Destructor.
  1.1351 +    */
  1.1352 +    IMPORT_C virtual ~ConnMonIdsArrayPckg();
  1.1353 +
  1.1354 +    /**
  1.1355 +    * Unpacks the package to an array of TConnMonId objects.
  1.1356 +    *
  1.1357 +    * @param aRef Array that will contain the unpacked objects.
  1.1358 +    */
  1.1359 +    IMPORT_C void UnpackToL( RArray<TConnMonId>& aRef ) const;
  1.1360 +
  1.1361 +    /**
  1.1362 +    * Obtains a pointer to the package buffer.
  1.1363 +    *
  1.1364 +    * @return Pointer to the package buffer.
  1.1365 +    */
  1.1366 +    IMPORT_C HBufC* Buf() const;
  1.1367 +
  1.1368 +protected:
  1.1369 +    /**
  1.1370 +    * Pointer to the package buffer on the heap.
  1.1371 +    */
  1.1372 +    HBufC* iBuf;
  1.1373 +    };
  1.1374 +
  1.1375 +// Forward declarations
  1.1376 +class CConnMonEventBase;
  1.1377 +class CConnMonEventHandler;
  1.1378 +
  1.1379 +/**
  1.1380 +* Client application must implement the MConnectionMonitorObserver interface in
  1.1381 +* order to receive notifications. MConnectionMonitorObserver::EventL() method
  1.1382 +* will be called every time an event arrives.
  1.1383 +*
  1.1384 +* @lib CONNMON.LIB
  1.1385 +*/
  1.1386 +class MConnectionMonitorObserver
  1.1387 +    {
  1.1388 +public:
  1.1389 +    /**
  1.1390 +    * This method is called every time an event occurs.
  1.1391 +    *
  1.1392 +    * @param aConnMonEvent The event information.
  1.1393 +    */
  1.1394 +    virtual void EventL( const CConnMonEventBase &aConnMonEvent ) = 0;
  1.1395 +    };
  1.1396 +
  1.1397 +/**
  1.1398 +* RConnectionMonitor
  1.1399 +*
  1.1400 +* @lib CONNMON.LIB
  1.1401 +*/
  1.1402 +class RConnectionMonitor : public RSessionBase
  1.1403 +    {
  1.1404 +public:
  1.1405 +    /**
  1.1406 +    * Constructor.
  1.1407 +    */
  1.1408 +    inline RConnectionMonitor():
  1.1409 +            RSessionBase(),
  1.1410 +            iHandler( 0 ),
  1.1411 +            iPtrArray(),
  1.1412 +            iIndex( 0 )
  1.1413 +        {
  1.1414 +        }
  1.1415 +
  1.1416 +public:
  1.1417 +    /**
  1.1418 +    * Connects the client to the Connection Monitor Server. It must be called
  1.1419 +    * before any of other methods during the Connection Monitor session.
  1.1420 +    *
  1.1421 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1422 +    */
  1.1423 +    IMPORT_C TInt ConnectL();
  1.1424 +
  1.1425 +    /**
  1.1426 +    * Closes the Connection Monitor session. An opened RConnectionMonitor must
  1.1427 +    * be closed explicitily to prevent a resource (memory) leak.
  1.1428 +    */
  1.1429 +    IMPORT_C void Close();
  1.1430 +
  1.1431 +    /**
  1.1432 +    * Gathers information on currently active connections.
  1.1433 +    *
  1.1434 +    * @param aConnectionCount On completion, contains the number of active
  1.1435 +    * connections.
  1.1436 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1437 +    */
  1.1438 +    IMPORT_C void GetConnectionCount(
  1.1439 +            TUint& aConnectionCount,
  1.1440 +            TRequestStatus& aStatus );
  1.1441 +
  1.1442 +    /**
  1.1443 +    * Gets the connection ID and the count of the subconnections for the given
  1.1444 +    * index. GetConnectionCount() must be called to gather the information on
  1.1445 +    * active connections before calling this method.
  1.1446 +    *
  1.1447 +    * @param aIndex Must be between 1 and the count returned by
  1.1448 +    * GetConnectionCount().
  1.1449 +    * @param aConnectionId On return, contains the connection ID.
  1.1450 +    * @param aSubConnectionCount On return, contains the number of
  1.1451 +    * subconnections.
  1.1452 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1453 +    */
  1.1454 +    IMPORT_C TInt GetConnectionInfo(
  1.1455 +            const TUint aIndex,
  1.1456 +            TUint& aConnectionId,
  1.1457 +            TUint& aSubConnectionCount ) const;
  1.1458 +
  1.1459 +    /**
  1.1460 +    * Gets the subconnection ID for the given index.
  1.1461 +    *
  1.1462 +    * @param aConnectionId Connection ID.
  1.1463 +    * @param aIndex Must be between 1 and the subconnection count returned by
  1.1464 +    * GetConnectionInfo().
  1.1465 +    * @param aSubConnectionId On return, contains the subconnection ID.
  1.1466 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1467 +    */
  1.1468 +    IMPORT_C TInt GetSubConnectionInfo(
  1.1469 +            const TUint aConnectionId,
  1.1470 +            const TUint aIndex,
  1.1471 +            TUint& aSubConnectionId ) const;
  1.1472 +
  1.1473 +    /**
  1.1474 +    * Gets the value for a TInt attribute.
  1.1475 +    *
  1.1476 +    * @param aConnectionId Connection ID.
  1.1477 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1478 +    * connection.
  1.1479 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1480 +    * @param aValue On completion, contains the requested TInt attribute.
  1.1481 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1482 +    */
  1.1483 +    IMPORT_C void GetIntAttribute(
  1.1484 +            const TUint aConnectionId,
  1.1485 +            const TUint aSubConnectionId,
  1.1486 +            const TUint aAttribute,
  1.1487 +            TInt& aValue,
  1.1488 +            TRequestStatus& aStatus );
  1.1489 +
  1.1490 +    /**
  1.1491 +    * Gets the value for a TUint attribute.
  1.1492 +    *
  1.1493 +    * @param aConnectionId Connection ID.
  1.1494 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1495 +    * connection.
  1.1496 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1497 +    * @param aValue On completion, contains the requested TUint attribute.
  1.1498 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1499 +    */
  1.1500 +    IMPORT_C void GetUintAttribute(
  1.1501 +            const TUint aConnectionId,
  1.1502 +            const TUint aSubConnectionId,
  1.1503 +            const TUint aAttribute,
  1.1504 +            TUint& aValue,
  1.1505 +            TRequestStatus& aStatus );
  1.1506 +
  1.1507 +    /**
  1.1508 +    * Gets the value for a TBool attribute.
  1.1509 +    *
  1.1510 +    * @param aConnectionId Connection ID.
  1.1511 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1512 +    * connection.
  1.1513 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1514 +    * @param aValue On completion, contains the requested TBool attribute.
  1.1515 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1516 +    */
  1.1517 +    IMPORT_C void GetBoolAttribute(
  1.1518 +            const TUint aConnectionId,
  1.1519 +            const TUint aSubConnectionId,
  1.1520 +            const TUint aAttribute,
  1.1521 +            TBool& aValue,
  1.1522 +            TRequestStatus& aStatus );
  1.1523 +
  1.1524 +    /**
  1.1525 +    * Gets the value for a string attribute.
  1.1526 +    *
  1.1527 +    * @param aConnectionId Connection ID.
  1.1528 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1529 +    * connection.
  1.1530 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1531 +    * @param aValue On completion, contains the requested string. Use a 16-bit
  1.1532 +    * descriptor!
  1.1533 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1534 +    */
  1.1535 +    IMPORT_C void GetStringAttribute(
  1.1536 +            const TUint aConnectionId,
  1.1537 +            const TUint aSubConnectionId,
  1.1538 +            const TUint aAttribute,
  1.1539 +            TDes& aValue,
  1.1540 +            TRequestStatus& aStatus ) const;
  1.1541 +
  1.1542 +    /**
  1.1543 +    * Gets the value for a packaged attribute.
  1.1544 +    *
  1.1545 +    * @param aConnectionId Connection ID.
  1.1546 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1547 +    * connection.
  1.1548 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1549 +    * @param aValue On completion, contains the requested packaged attribute.
  1.1550 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1551 +    */
  1.1552 +    IMPORT_C void GetPckgAttribute(
  1.1553 +            const TUint aConnectionId,
  1.1554 +            const TUint aSubConnectionId,
  1.1555 +            const TUint aAttribute,
  1.1556 +            TDes8& aValue,
  1.1557 +            TRequestStatus& aStatus ) const;
  1.1558 +
  1.1559 +    /**
  1.1560 +    * Gets the value for a packaged attribute.
  1.1561 +    *
  1.1562 +    * @param aConnectionId Connection ID.
  1.1563 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1564 +    * connection.
  1.1565 +    * @param aAttribute Identifies the attribute to be retrieved.
  1.1566 +    * @param aValue On completion, contains the requested packaged attribute.
  1.1567 +    * @param aStatus KErrNone if successful, a system-wide error code if not.
  1.1568 +    */
  1.1569 +    IMPORT_C void GetPckgAttribute(
  1.1570 +            const TUint aConnectionId,
  1.1571 +            const TUint aSubConnectionId,
  1.1572 +            const TUint aAttribute,
  1.1573 +            TDes16& aValue,
  1.1574 +            TRequestStatus& aStatus ) const;
  1.1575 +
  1.1576 +    /**
  1.1577 +    * Sets the value for a TInt attribute.
  1.1578 +    *
  1.1579 +    * @param aConnectionId Connection ID.
  1.1580 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1581 +    * connection.
  1.1582 +    * @param aAttribute Identifies the attribute to be set.
  1.1583 +    * @param aValue The value to be set.
  1.1584 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1585 +    */
  1.1586 +    IMPORT_C TInt SetIntAttribute(
  1.1587 +            const TUint aConnectionId,
  1.1588 +            const TUint aSubConnectionId,
  1.1589 +            const TUint aAttribute,
  1.1590 +            const TInt aValue ) const;
  1.1591 +
  1.1592 +    /**
  1.1593 +    * Sets the value for a TUint attribute.
  1.1594 +    *
  1.1595 +    * @param aConnectionId Connection ID.
  1.1596 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1597 +    * connection.
  1.1598 +    * @param aAttribute Identifies the attribute to be set.
  1.1599 +    * @param aValue The value to be set.
  1.1600 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1601 +    */
  1.1602 +    IMPORT_C TInt SetUintAttribute(
  1.1603 +            const TUint aConnectionId,
  1.1604 +            const TUint aSubConnectionId,
  1.1605 +            const TUint aAttribute,
  1.1606 +            const TUint aValue ) const;
  1.1607 +
  1.1608 +    /**
  1.1609 +    * Sets the value for a TBool attribute.
  1.1610 +    *
  1.1611 +    * This method can be used to stop a connection (KConnectionStop).
  1.1612 +    * @param aConnectionId Connection ID.
  1.1613 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1614 +    * connection.
  1.1615 +    * @param aAttribute Identifies the attribute to be set.
  1.1616 +    * @param aValue The value to be set.
  1.1617 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1618 +    */
  1.1619 +    IMPORT_C TInt SetBoolAttribute(
  1.1620 +            const TUint aConnectionId,
  1.1621 +            const TUint aSubConnectionId,
  1.1622 +            const TUint aAttribute,
  1.1623 +            const TBool aValue ) const;
  1.1624 +
  1.1625 +    /**
  1.1626 +    * Sets the value for a string attribute.
  1.1627 +    *
  1.1628 +    * @param aConnectionId Connection ID.
  1.1629 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1630 +    * connection.
  1.1631 +    * @param aAttribute Identifies the attribute to be set.
  1.1632 +    * @param aValue The string value to be set. Must be a 16-bit descriptor.
  1.1633 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1634 +    */
  1.1635 +    IMPORT_C TInt SetStringAttribute(
  1.1636 +            const TUint aConnectionId,
  1.1637 +            const TUint aSubConnectionId,
  1.1638 +            const TUint aAttribute,
  1.1639 +            const TDes& aValue ) const;
  1.1640 +
  1.1641 +    /**
  1.1642 +    * Sets the value for a packaged attribute. There is currently no packaged
  1.1643 +    * attributes that can be set.
  1.1644 +    *
  1.1645 +    * @param aConnectionId Connection ID.
  1.1646 +    * @param aSubConnectionId Subconnection ID. If set to 0, method applies to
  1.1647 +    * connection.
  1.1648 +    * @param aAttribute Identifies the attribute to be set.
  1.1649 +    * @param aValue The value to be set.
  1.1650 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1651 +    */
  1.1652 +    IMPORT_C TInt SetPckgAttribute(
  1.1653 +            const TUint aConnectionId,
  1.1654 +            const TUint aSubConnectionId,
  1.1655 +            const TUint aAttribute,
  1.1656 +            const TDes8& aValue ) const;
  1.1657 +
  1.1658 +    /**
  1.1659 +    * Cancels an asyncronous request. If there is several active requests of
  1.1660 +    * the same type (for example GetIntAttribute), they will all be cancelled.
  1.1661 +    * When a request is cancelled, it is completed with error code KErrCancel.
  1.1662 +    *
  1.1663 +    * @param aReqToCancel Identifies the request type to be cancelled.
  1.1664 +    * The different types are defined in TConnMonAsyncRequest.
  1.1665 +    */
  1.1666 +    IMPORT_C void CancelAsyncRequest( TInt aReqToCancel );
  1.1667 +
  1.1668 +    /**
  1.1669 +    * Registers an event observer to catch connection monitor events.
  1.1670 +    *
  1.1671 +    * @param aObserver The event observer.
  1.1672 +    * @return KErrNone if successful, a system-wide error code if not.
  1.1673 +    */
  1.1674 +    IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver );
  1.1675 +
  1.1676 +    /**
  1.1677 +    * Cancels the notifications from connection monitor.
  1.1678 +    */
  1.1679 +    IMPORT_C void CancelNotifications();
  1.1680 +
  1.1681 +private:
  1.1682 +    void ReceiveEvent(
  1.1683 +            TDes8& aBuffer,
  1.1684 +            TDes8& aExtraBuf,
  1.1685 +            TRequestStatus& aStatus );
  1.1686 +    void CancelReceiveEvent();
  1.1687 +    TBool IsConnected() const;
  1.1688 +    TPtr8& NextPtr();
  1.1689 +
  1.1690 +private:
  1.1691 +    CConnMonEventHandler* iHandler;
  1.1692 +    RArray<TPtr8> iPtrArray;
  1.1693 +    TInt iIndex;
  1.1694 +
  1.1695 +private:
  1.1696 +    friend class CConnMonEventHandler;
  1.1697 +    };
  1.1698 +
  1.1699 +/**
  1.1700 +* Base class for all ConnMon event types.
  1.1701 +*
  1.1702 +* Example how to convert an event according to type.
  1.1703 +* @code
  1.1704 +* void CMyConnMonObserver::EventL( const CConnMonEventBase& aEvent )
  1.1705 +*     {
  1.1706 +*     switch( aEvent.EventType() )
  1.1707 +*         {
  1.1708 +*         case EConnMonCreateConnection:
  1.1709 +*             CConnMonCreateConnection* realEvent;
  1.1710 +*             realEvent = (CConnMonCreateConnection*) &aEvent;
  1.1711 +*             //...
  1.1712 +* @endcode
  1.1713 +*/
  1.1714 +NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase
  1.1715 +    {
  1.1716 +public:
  1.1717 +    /**
  1.1718 +    * Constructor.
  1.1719 +    *
  1.1720 +    * @param aEventType Event type.
  1.1721 +    * @param iConnectionId Connection ID.
  1.1722 +    */
  1.1723 +    CConnMonEventBase( const TInt aEventType, const TUint iConnectionId );
  1.1724 +
  1.1725 +    /**
  1.1726 +    * Destructor.
  1.1727 +    */
  1.1728 +    ~CConnMonEventBase();
  1.1729 +
  1.1730 +public:
  1.1731 +    /**
  1.1732 +    * Gets the type of the event.
  1.1733 +    *
  1.1734 +    * @return Type of the event. Values are defined in TConnMonEventType.
  1.1735 +    */
  1.1736 +    IMPORT_C TInt EventType() const;
  1.1737 +
  1.1738 +    /**
  1.1739 +    * Gets the connection ID of the connection.
  1.1740 +    *
  1.1741 +    * @return Connection ID.
  1.1742 +    */
  1.1743 +    IMPORT_C TUint ConnectionId() const;
  1.1744 +
  1.1745 +private:
  1.1746 +    TInt iEventType;
  1.1747 +    TUint iConnectionId;
  1.1748 +    };
  1.1749 +
  1.1750 +/**
  1.1751 +* This event is triggered when a new connection has been created. The
  1.1752 +* connection ID passed in the event is a new ID number that ConnMon assigned to
  1.1753 +* the new connection.
  1.1754 +*
  1.1755 +* @lib CONNMON.LIB
  1.1756 +*/
  1.1757 +NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase
  1.1758 +    {
  1.1759 +public:
  1.1760 +    /**
  1.1761 +    * Constructor.
  1.1762 +    *
  1.1763 +    * @param aConnectionId Connection ID.
  1.1764 +    */
  1.1765 +    CConnMonCreateConnection( const TUint aConnectionId );
  1.1766 +
  1.1767 +    /**
  1.1768 +    * Destructor.
  1.1769 +    */
  1.1770 +    ~CConnMonCreateConnection();
  1.1771 +    };
  1.1772 +
  1.1773 +/**
  1.1774 +* This event is triggered when a connection has been deleted. The connection ID
  1.1775 +* passed in the event is the connection ID of the deleted connection.
  1.1776 +*
  1.1777 +* @lib CONNMON.LIB
  1.1778 +*/
  1.1779 +NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase
  1.1780 +    {
  1.1781 +public:
  1.1782 +    /**
  1.1783 +    * Constructor.
  1.1784 +    *
  1.1785 +    * @param aConnectionId Connection ID.
  1.1786 +    * @param aDownlinkData Downlink data volume.
  1.1787 +    * @param aUplinkData Uplink data volume.
  1.1788 +    * @param aAuthDelete Was connection stopped in an authoritative way.
  1.1789 +    */
  1.1790 +    CConnMonDeleteConnection(
  1.1791 +            const TUint aConnectionId,
  1.1792 +            const TUint aDownlinkData,
  1.1793 +            const TUint aUplinkData,
  1.1794 +            const TBool aAuthDelete );
  1.1795 +
  1.1796 +    /**
  1.1797 +    * Destructor.
  1.1798 +    */
  1.1799 +    ~CConnMonDeleteConnection();
  1.1800 +
  1.1801 +public:
  1.1802 +    /**
  1.1803 +    * Gets the downlink data volume.
  1.1804 +    *
  1.1805 +    * @return Downlink data volume in bytes.
  1.1806 +    */
  1.1807 +    IMPORT_C TUint DownlinkData() const;
  1.1808 +
  1.1809 +    /**
  1.1810 +    * Gets the uplink data volume.
  1.1811 +    *
  1.1812 +    * @return Uplink data volume in bytes.
  1.1813 +    */
  1.1814 +    IMPORT_C TUint UplinkData() const;
  1.1815 +
  1.1816 +    /**
  1.1817 +    * Checks if the connection was stopped in an authoritative way.
  1.1818 +    * ETrue will be returned if the user has deactivated the connection by
  1.1819 +    * using Connection Monitor or if some application has issued
  1.1820 +    * RConnection::Stop( RConnection::EStopAuthoritative ).
  1.1821 +    *
  1.1822 +    * @return ETrue if connection has been deactivated in an authoritative
  1.1823 +    * way, otherwise returns EFalse.
  1.1824 +    */
  1.1825 +    IMPORT_C TBool AuthoritativeDelete() const;
  1.1826 +
  1.1827 +private:
  1.1828 +    TUint iDownlinkData;
  1.1829 +    TUint iUplinkData;
  1.1830 +    TBool iAuthDelete;
  1.1831 +    };
  1.1832 +
  1.1833 +/**
  1.1834 +* This event is triggered when a new subconnection has been created.
  1.1835 +* Subconnections are not supported currently.
  1.1836 +*
  1.1837 +* @lib CONNMON.LIB
  1.1838 +*/
  1.1839 +NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase
  1.1840 +    {
  1.1841 +public:
  1.1842 +    /**
  1.1843 +    * Constructor.
  1.1844 +    *
  1.1845 +    * @param aConnectionId Connection ID.
  1.1846 +    * @param aSubConnectionId Subconnection ID.
  1.1847 +    */
  1.1848 +    CConnMonCreateSubConnection(
  1.1849 +            const TUint aConnectionId,
  1.1850 +            const TUint aSubConnectionId );
  1.1851 +
  1.1852 +    /**
  1.1853 +    * Destructor.
  1.1854 +    */
  1.1855 +    ~CConnMonCreateSubConnection();
  1.1856 +
  1.1857 +public:
  1.1858 +    /**
  1.1859 +    * Gets the new subconnection ID.
  1.1860 +    *
  1.1861 +    * @return Subconnection ID.
  1.1862 +    */
  1.1863 +    IMPORT_C TUint SubConnectionId() const;
  1.1864 +
  1.1865 +private:
  1.1866 +    TUint iSubConnectionId;
  1.1867 +    };
  1.1868 +
  1.1869 +/**
  1.1870 +* This event is triggered when a subconnection has been deleted.
  1.1871 +* Subconnections are not supported currently.
  1.1872 +*
  1.1873 +* @lib CONNMON.LIB
  1.1874 +*/
  1.1875 +NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase
  1.1876 +    {
  1.1877 +public:
  1.1878 +    /**
  1.1879 +    * Constructor.
  1.1880 +    *
  1.1881 +    * @param aConnectionId Connection ID.
  1.1882 +    * @param aSubConnectionId Subconnection ID.
  1.1883 +    * @param aDownlinkData Downlink data volume.
  1.1884 +    * @param aUplinkData Uplink data volume.
  1.1885 +    * @param aAuthDelete Was connection stopped in an authoritative way.
  1.1886 +    */
  1.1887 +    CConnMonDeleteSubConnection(
  1.1888 +            const TUint aConnectionId,
  1.1889 +            const TUint aSubConnectionId,
  1.1890 +            const TUint aDownlinkData,
  1.1891 +            const TUint aUplinkData,
  1.1892 +            const TBool aAuthDelete );
  1.1893 +
  1.1894 +    /**
  1.1895 +    * Destructor.
  1.1896 +    */
  1.1897 +    ~CConnMonDeleteSubConnection();
  1.1898 +
  1.1899 +public:
  1.1900 +    /**
  1.1901 +    * Gets the subconnection ID of the deleted subconnection.
  1.1902 +    *
  1.1903 +    * @return Subconnection ID.
  1.1904 +    */
  1.1905 +    IMPORT_C TUint SubConnectionId() const;
  1.1906 +
  1.1907 +    /**
  1.1908 +    * Gets the downlink data volume.
  1.1909 +    *
  1.1910 +    * @return Downlink data volume in bytes.
  1.1911 +    */
  1.1912 +    IMPORT_C TUint DownlinkData() const;
  1.1913 +
  1.1914 +    /**
  1.1915 +    * Gets the uplink data volume.
  1.1916 +    *
  1.1917 +    * @return Uplink data volume in bytes.
  1.1918 +    */
  1.1919 +    IMPORT_C TUint UplinkData() const;
  1.1920 +
  1.1921 +    /**
  1.1922 +    * Checks if the connection was stopped in an authoritative way.
  1.1923 +    * ETrue will be returned if the user has deactivated the connection by
  1.1924 +    * using Connection Monitor or if some application has issued
  1.1925 +    * RConnection::Stop( RConnection::EStopAuthoritative ).
  1.1926 +    *
  1.1927 +    * @return ETrue if connection has been deactivated in an authoritative
  1.1928 +    * way, otherwise returns EFalse.
  1.1929 +    */
  1.1930 +    IMPORT_C TBool AuthoritativeDelete() const;
  1.1931 +
  1.1932 +private:
  1.1933 +    TUint iSubConnectionId;
  1.1934 +    TUint iDownlinkData;
  1.1935 +    TUint iUplinkData;
  1.1936 +    TBool iAuthDelete;
  1.1937 +    };
  1.1938 +
  1.1939 +/**
  1.1940 +* This event is triggered when there is a sufficient change in the volume of
  1.1941 +* downlink data for a specific connection. The event is sent each time a client
  1.1942 +* specified amount (KDownlinkDataThreshold) of new data has been sent. If
  1.1943 +* another ConnMon client has requested for these events for the same
  1.1944 +* connection, the smallest threshold value will be used globally. If
  1.1945 +* KDownlinkDataThreshold is 0 (default), events will not be sent for that
  1.1946 +* connection. To prevent rapid flooding of these events, different bearers have
  1.1947 +* appropriate minimum threshold values which will be used to override too small
  1.1948 +* thresholds when necessary.
  1.1949 +*
  1.1950 +* @lib CONNMON.LIB
  1.1951 +*/
  1.1952 +NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase
  1.1953 +    {
  1.1954 +public:
  1.1955 +    /**
  1.1956 +    * Constructor.
  1.1957 +    *
  1.1958 +    * @param aConnectionId Connection ID.
  1.1959 +    * @param aSubConnectionId Subconnection ID.
  1.1960 +    * @param aDownlinkData Downlink data volume.
  1.1961 +    */
  1.1962 +    CConnMonDownlinkDataThreshold(
  1.1963 +            const TUint aConnectionId,
  1.1964 +            const TUint aSubConnectionId,
  1.1965 +            const TUint aDownlinkData );
  1.1966 +
  1.1967 +    /**
  1.1968 +    * Destructor.
  1.1969 +    */
  1.1970 +    ~CConnMonDownlinkDataThreshold();
  1.1971 +
  1.1972 +public:
  1.1973 +    /**
  1.1974 +    * Gets the subconnection ID.
  1.1975 +    *
  1.1976 +    * @return Subconnection ID.
  1.1977 +    */
  1.1978 +    IMPORT_C TUint SubConnectionId() const;
  1.1979 +
  1.1980 +    /**
  1.1981 +    * Gets the downlink data volume.
  1.1982 +    *
  1.1983 +    * @return Downlink data volume in bytes.
  1.1984 +    */
  1.1985 +    IMPORT_C TUint DownlinkData() const;
  1.1986 +
  1.1987 +private:
  1.1988 +    TUint iSubConnectionId;
  1.1989 +    TUint iDownlinkData;
  1.1990 +    };
  1.1991 +
  1.1992 +/**
  1.1993 +* This event is triggered when there is a sufficient change in the volume of
  1.1994 +* uplink data for a specific connection. The event is sent each time a client
  1.1995 +* specified amount (KUplinkDataThreshold) of new data has been received. If
  1.1996 +* another ConnMon client has requested for these events for the same
  1.1997 +* connection, the smallest threshold value will be used globally. If
  1.1998 +* KUplinkDataThreshold is 0 (default), events will not be sent for that
  1.1999 +* connection. To prevent rapid flooding of these events, different bearers have
  1.2000 +* appropriate minimum threshold values which will be used to override too small
  1.2001 +* thresholds when necessary.
  1.2002 +*
  1.2003 +* @lib CONNMON.LIB
  1.2004 +*/
  1.2005 +NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase
  1.2006 +    {
  1.2007 +public:
  1.2008 +    /**
  1.2009 +    * Constructor.
  1.2010 +    *
  1.2011 +    * @param aConnectionId Connection ID.
  1.2012 +    * @param aSubConnectionId Subconnection ID.
  1.2013 +    * @param aUplinkData Uplink data volume.
  1.2014 +    */
  1.2015 +    CConnMonUplinkDataThreshold(
  1.2016 +            const TUint aConnectionId,
  1.2017 +            const TUint aSubConnectionId,
  1.2018 +            const TUint aUplinkData );
  1.2019 +
  1.2020 +    /**
  1.2021 +    * Destructor.
  1.2022 +    */
  1.2023 +    ~CConnMonUplinkDataThreshold();
  1.2024 +
  1.2025 +public:
  1.2026 +    /**
  1.2027 +    * Gets the subconnection ID.
  1.2028 +    *
  1.2029 +    * @return Subconnection ID.
  1.2030 +    */
  1.2031 +    IMPORT_C TUint SubConnectionId() const;
  1.2032 +
  1.2033 +    /**
  1.2034 +    * Gets the uplink data volume.
  1.2035 +    *
  1.2036 +    * @return Uplink data volume in bytes.
  1.2037 +    */
  1.2038 +    IMPORT_C TUint UplinkData() const;
  1.2039 +
  1.2040 +private:
  1.2041 +    TUint iSubConnectionId;
  1.2042 +    TUint iUplinkData;
  1.2043 +    };
  1.2044 +
  1.2045 +/**
  1.2046 +* This event is triggered when network status changes for some packet data
  1.2047 +* connection. The connection ID passed in the event is a bearer specific
  1.2048 +* connection ID (see TConnMonBearerId). The same information can be retrieved
  1.2049 +* with TInt attribute KNetworkStatus.
  1.2050 +*
  1.2051 +* @lib CONNMON.LIB
  1.2052 +*/
  1.2053 +NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase
  1.2054 +    {
  1.2055 +public:
  1.2056 +    /**
  1.2057 +    * Constructor.
  1.2058 +    *
  1.2059 +    * @param aConnectionId Connection ID.
  1.2060 +    * @param aNetworkStatus Network status.
  1.2061 +    */
  1.2062 +    CConnMonNetworkStatusChange(
  1.2063 +            const TUint aConnectionId,
  1.2064 +            const TInt aNetworkStatus );
  1.2065 +
  1.2066 +    /**
  1.2067 +    * Destructor.
  1.2068 +    */
  1.2069 +    ~CConnMonNetworkStatusChange();
  1.2070 +
  1.2071 +public:
  1.2072 +    /**
  1.2073 +    * Gets the network status.
  1.2074 +    *
  1.2075 +    * @return Network status. Values are defined in TConnMonNetworkStatus.
  1.2076 +    */
  1.2077 +    IMPORT_C TInt NetworkStatus() const;
  1.2078 +
  1.2079 +private:
  1.2080 +    TInt iNetworkStatus;
  1.2081 +    };
  1.2082 +
  1.2083 +/**
  1.2084 +* This event is triggered when the status of some connection changes.
  1.2085 +* The same information can be retrieved with TInt attribute KConnectionStatus.
  1.2086 +* Connection status values are defined in nifvar.h.
  1.2087 +*
  1.2088 +* @lib CONNMON.LIB
  1.2089 +*/
  1.2090 +NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase
  1.2091 +    {
  1.2092 +public:
  1.2093 +    /**
  1.2094 +    * Constructor.
  1.2095 +    *
  1.2096 +    * @param aConnectionId Connection ID.
  1.2097 +    * @param aSubConnectionId Subconnection ID.
  1.2098 +    * @param aConnectionStatus Connection status.
  1.2099 +    */
  1.2100 +    CConnMonConnectionStatusChange(
  1.2101 +            const TUint aConnectionId,
  1.2102 +            const TUint aSubConnectionId,
  1.2103 +            const TInt aConnectionStatus );
  1.2104 +
  1.2105 +    /**
  1.2106 +    * Destructor.
  1.2107 +    */
  1.2108 +    ~CConnMonConnectionStatusChange();
  1.2109 +
  1.2110 +public:
  1.2111 +    /**
  1.2112 +    * Gets the subconnection ID.
  1.2113 +    *
  1.2114 +    * @return Subconnection ID.
  1.2115 +    */
  1.2116 +    IMPORT_C TUint SubConnectionId() const;
  1.2117 +
  1.2118 +    /**
  1.2119 +    * Gets the connection status.
  1.2120 +    *
  1.2121 +    * @return Connection status. Values are defined in nifvar.h.
  1.2122 +    */
  1.2123 +    IMPORT_C TInt ConnectionStatus() const;
  1.2124 +
  1.2125 +private:
  1.2126 +    TUint iSubConnectionId;
  1.2127 +    TInt iConnectionStatus;
  1.2128 +    };
  1.2129 +
  1.2130 +/**
  1.2131 +* This event is triggered when some connection changes from active to idle or
  1.2132 +* vice versa. The client must set KActivityTimeThreshold to receive these
  1.2133 +* events. KActivityTimeThreshold defines the period (in seconds) for checking
  1.2134 +* wether the connection is active or not. The minimum allowed value is 5
  1.2135 +* seconds. The connection is considered active, if data has been passed during
  1.2136 +* the last period, otherwise it is considered inactive. The same information
  1.2137 +* can be retrieved with TBool attribute KConnectionActive.
  1.2138 +*
  1.2139 +* @lib CONNMON.LIB
  1.2140 +*/
  1.2141 +NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase
  1.2142 +    {
  1.2143 +public:
  1.2144 +    /**
  1.2145 +    * Constructor.
  1.2146 +    *
  1.2147 +    * @param aConnectionId Connection ID.
  1.2148 +    * @param aSubConnectionId Subconnection ID.
  1.2149 +    * @param aActivity Connection activity.
  1.2150 +    */
  1.2151 +    CConnMonConnectionActivityChange(
  1.2152 +            const TUint aConnectionId,
  1.2153 +            const TUint aSubConnectionId,
  1.2154 +            const TBool aActivity );
  1.2155 +
  1.2156 +    /**
  1.2157 +    * Destructor.
  1.2158 +    */
  1.2159 +    ~CConnMonConnectionActivityChange();
  1.2160 +
  1.2161 +public:
  1.2162 +    /**
  1.2163 +    * Gets the subconnection ID.
  1.2164 +    *
  1.2165 +    * @return Subconnection ID.
  1.2166 +    */
  1.2167 +    IMPORT_C TUint SubConnectionId() const;
  1.2168 +
  1.2169 +    /**
  1.2170 +    * Gets the connection activity.
  1.2171 +    *
  1.2172 +    * @return ETrue if the connection is active, EFalse if not.
  1.2173 +    */
  1.2174 +    IMPORT_C TBool ConnectionActivity() const;
  1.2175 +
  1.2176 +private:
  1.2177 +    TUint iSubConnectionId;
  1.2178 +    TBool iActivity;
  1.2179 +    };
  1.2180 +
  1.2181 +/**
  1.2182 +* This event is triggered when network registration status (GSM/GPRS/WCDMA)
  1.2183 +* changes. The connection ID passed in the event is a bearer specific
  1.2184 +* connection ID (see TConnMonBearerId). The same information can be retrieved
  1.2185 +* with TInt attribute KNetworkRegistration. Network registration values are
  1.2186 +* defined in TConnMonNetworkRegistration.
  1.2187 +*
  1.2188 +* @lib CONNMON.LIB
  1.2189 +*/
  1.2190 +NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase
  1.2191 +    {
  1.2192 +public:
  1.2193 +    /**
  1.2194 +    * Constructor.
  1.2195 +    *
  1.2196 +    * @param aConnectionId Connection ID.
  1.2197 +    * @param aRegistrationStatus Network registration status.
  1.2198 +    */
  1.2199 +    CConnMonNetworkRegistrationChange(
  1.2200 +            const TUint aConnectionId,
  1.2201 +            const TInt aRegistrationStatus );
  1.2202 +
  1.2203 +    /**
  1.2204 +    * Destructor.
  1.2205 +    */
  1.2206 +    ~CConnMonNetworkRegistrationChange();
  1.2207 +
  1.2208 +public:
  1.2209 +    /**
  1.2210 +    * Gets the network registration status.
  1.2211 +    *
  1.2212 +    * @return Registration status. Values are defined in
  1.2213 +    * TConnMonNetworkRegistration.
  1.2214 +    */
  1.2215 +    IMPORT_C TInt RegistrationStatus() const;
  1.2216 +
  1.2217 +private:
  1.2218 +    TInt iRegistrationStatus;
  1.2219 +    };
  1.2220 +
  1.2221 +/**
  1.2222 +* This event is triggered when bearer type (GPRS/EdgeGPRS/WCDMA) changes. The
  1.2223 +* connection ID passed in the event is a bearer specific connection ID, either
  1.2224 +* EBearerIdGPRS or EBearerIdWCDMA (see TConnMonBearerId). The new bearer passed
  1.2225 +* in the event can be EBearerGPRS, EBearerEdgeGPRS or EBearerWCDMA (see
  1.2226 +* TConnMonBearerType). The same information can be retrieved with TInt
  1.2227 +* attribute KBearer.
  1.2228 +*
  1.2229 +* Note: If TUint attribute KBearerGroupThreshold is set, these events are
  1.2230 +* disabled and events EConnMonBearerInfoChange and EConnMonBearerGroupChange
  1.2231 +* are used instead. Use these events, for example, if HSDPA related information
  1.2232 +* is required.
  1.2233 +*
  1.2234 +* @lib CONNMON.LIB
  1.2235 +*/
  1.2236 +NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase
  1.2237 +    {
  1.2238 +public:
  1.2239 +    /**
  1.2240 +    * Constructor.
  1.2241 +    *
  1.2242 +    * @param aConnectionId Connection ID.
  1.2243 +    * @param aBearer Bearer.
  1.2244 +    */
  1.2245 +    CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer );
  1.2246 +
  1.2247 +    /**
  1.2248 +    * Destructor.
  1.2249 +    */
  1.2250 +    ~CConnMonBearerChange();
  1.2251 +
  1.2252 +public:
  1.2253 +    /**
  1.2254 +    * Gets the new bearer.
  1.2255 +    *
  1.2256 +    * @return New bearer. Values are defined in TConnMonBearerType.
  1.2257 +    */
  1.2258 +    IMPORT_C TInt Bearer() const;
  1.2259 +
  1.2260 +private:
  1.2261 +    TInt iBearer;
  1.2262 +    };
  1.2263 +
  1.2264 +/**
  1.2265 +* This event is triggered when signal strength changes. The connection ID
  1.2266 +* passed in the event is a bearer specific connection ID (see
  1.2267 +* TConnMonBearerId). This event is valid only for cellular (GPRS, WCDMA, etc.)
  1.2268 +* bearers and not for other bearers, e.g. WLAN. The client must set
  1.2269 +* KSignalStrengthThreshold to 1 to receive these events.
  1.2270 +*
  1.2271 +* @lib CONNMON.LIB
  1.2272 +*/
  1.2273 +NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase
  1.2274 +    {
  1.2275 +public:
  1.2276 +    /**
  1.2277 +    * Constructor.
  1.2278 +    *
  1.2279 +    * @param aConnectionId Connection ID.
  1.2280 +    * @param aSignalStrength Signal strength in dBm.
  1.2281 +    */
  1.2282 +    CConnMonSignalStrengthChange(
  1.2283 +            const TUint aConnectionId,
  1.2284 +            const TInt aSignalStrength );
  1.2285 +
  1.2286 +    /**
  1.2287 +    * Destructor.
  1.2288 +    */
  1.2289 +    ~CConnMonSignalStrengthChange();
  1.2290 +
  1.2291 +public:
  1.2292 +    /**
  1.2293 +    * Gets the signal strength.
  1.2294 +    *
  1.2295 +    * @return Signal strength in dBm.
  1.2296 +    */
  1.2297 +    IMPORT_C TInt SignalStrength() const;
  1.2298 +
  1.2299 +private:
  1.2300 +    TInt iSignalStrength;
  1.2301 +    };
  1.2302 +
  1.2303 +/**
  1.2304 +* This event is triggered when the availability of some bearer changes. The
  1.2305 +* connection ID passed in the event is a bearer specific connection ID (see
  1.2306 +* TConnMonBearerId). The client must set KBearerAvailabilityThreshold to 1 to
  1.2307 +* receive these events. Using this event for detecting changes in WLAN
  1.2308 +* availability requires WLAN background scanning to be enabled.
  1.2309 +*
  1.2310 +* @lib CONNMON.LIB
  1.2311 +*/
  1.2312 +NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase
  1.2313 +    {
  1.2314 +public:
  1.2315 +    /**
  1.2316 +    * Constructor.
  1.2317 +    *
  1.2318 +    * @param aConnectionId Connection ID.
  1.2319 +    * @param aAvailability Availability of the bearer.
  1.2320 +    */
  1.2321 +    CConnMonBearerAvailabilityChange(
  1.2322 +            const TUint aConnectionId,
  1.2323 +            const TBool aAvailability );
  1.2324 +
  1.2325 +    /**
  1.2326 +    * Destructor.
  1.2327 +    */
  1.2328 +    ~CConnMonBearerAvailabilityChange();
  1.2329 +
  1.2330 +public:
  1.2331 +    /**
  1.2332 +    * Gets the availability of the bearer.
  1.2333 +    *
  1.2334 +    * @return ETrue if the bearer is available, EFalse if not.
  1.2335 +    */
  1.2336 +    IMPORT_C TBool Availability() const;
  1.2337 +
  1.2338 +private:
  1.2339 +    TBool iAvailability;
  1.2340 +    };
  1.2341 +
  1.2342 +/**
  1.2343 +* This event is triggered when a plug-in sends a bearer specific event that is
  1.2344 +* unknown to ConnMon.
  1.2345 +*
  1.2346 +* @lib CONNMON.LIB
  1.2347 +*/
  1.2348 +NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase
  1.2349 +    {
  1.2350 +public:
  1.2351 +    /**
  1.2352 +    * Constructor.
  1.2353 +    *
  1.2354 +    * @param aType Event type.
  1.2355 +    * @param aConnectionId Connection ID.
  1.2356 +    * @param aData Pointer to the event data.
  1.2357 +    */
  1.2358 +    CConnMonGenericEvent(
  1.2359 +            const TUint aType,
  1.2360 +            const TUint aConnectionId,
  1.2361 +            TAny* aData );
  1.2362 +
  1.2363 +    /**
  1.2364 +    * Destructor.
  1.2365 +    */
  1.2366 +    ~CConnMonGenericEvent();
  1.2367 +
  1.2368 +public:
  1.2369 +    /**
  1.2370 +    * Gets a pointer to the event data.
  1.2371 +    * The pointer is valid only inside EventL().
  1.2372 +    *
  1.2373 +    * @return Pointer to the event data.
  1.2374 +    */
  1.2375 +    IMPORT_C TAny* Data() const;
  1.2376 +
  1.2377 +private:
  1.2378 +    TAny* iData;
  1.2379 +    };
  1.2380 +
  1.2381 +/**
  1.2382 +* This event is triggered when IAP availability changes. The connection ID
  1.2383 +* passed in the event is the generic connection ID EBearerIdAll. The ID numbers
  1.2384 +* of available IAPs are included in the event (see TConnMonIapInfo). The same
  1.2385 +* information can be retrieved with packaged attribute KIapAvailability.
  1.2386 +*
  1.2387 +* @lib CONNMON.LIB
  1.2388 +*/
  1.2389 +NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase
  1.2390 +    {
  1.2391 +public:
  1.2392 +    /**
  1.2393 +    * Constructor.
  1.2394 +    *
  1.2395 +    * @param aConnectionId Connection ID.
  1.2396 +    * @param aIapInfoPtr Pointer to the IAP availability information.
  1.2397 +    */
  1.2398 +    CConnMonIapAvailabilityChange(
  1.2399 +            const TUint aConnectionId,
  1.2400 +            const TConnMonIapInfo* aIapInfoPtr );
  1.2401 +
  1.2402 +    /**
  1.2403 +    * Destructor.
  1.2404 +    */
  1.2405 +    ~CConnMonIapAvailabilityChange();
  1.2406 +
  1.2407 +public:
  1.2408 +    /**
  1.2409 +    * Gets the IAP availability information.
  1.2410 +    *
  1.2411 +    * @return IAP availability information.
  1.2412 +    */
  1.2413 +    IMPORT_C TConnMonIapInfo IapAvailability() const;
  1.2414 +
  1.2415 +private:
  1.2416 +    TConnMonIapInfo iIapInfo;
  1.2417 +    };
  1.2418 +
  1.2419 +/**
  1.2420 +* This event is triggered when the used WLAN transmit power changes. The
  1.2421 +* connection ID passed in the event is the bearer specific connection ID
  1.2422 +* EBearerIdWLAN. Transmit power is given in milliwatts (mW). The same
  1.2423 +* information can be retrieved with TUint attribute KTransmitPower.
  1.2424 +*
  1.2425 +* @lib CONNMON.LIB
  1.2426 +*/
  1.2427 +NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase
  1.2428 +    {
  1.2429 +public:
  1.2430 +    /**
  1.2431 +    * Constructor.
  1.2432 +    *
  1.2433 +    * @param aConnectionId Connection ID.
  1.2434 +    * @param aTransmitPower Transmit power in mW.
  1.2435 +    */
  1.2436 +    CConnMonTransmitPowerChange(
  1.2437 +            const TUint aConnectionId,
  1.2438 +            const TUint aTransmitPower );
  1.2439 +
  1.2440 +    /**
  1.2441 +    * Destructor.
  1.2442 +    */
  1.2443 +    ~CConnMonTransmitPowerChange();
  1.2444 +
  1.2445 +public:
  1.2446 +    /**
  1.2447 +    * Gets the transmit power.
  1.2448 +    *
  1.2449 +    * @return Transmit power in mW.
  1.2450 +    */
  1.2451 +    IMPORT_C TUint TransmitPower() const;
  1.2452 +
  1.2453 +private:
  1.2454 +    TUint iTransmitPower;
  1.2455 +    };
  1.2456 +
  1.2457 +/**
  1.2458 +* This event is triggered when SNAP availability changes. The connection ID
  1.2459 +* passed in the event is the generic connection ID EBearerIdAll. The ID numbers
  1.2460 +* of available SNAPs are included in the event (see TConnMonSNAPInfo). The same
  1.2461 +* information can be retrieved with packaged attributes KSNAPsAvailability and
  1.2462 +* KAvailableSNAPsIds.
  1.2463 +*
  1.2464 +* @lib CONNMON.LIB
  1.2465 +*/
  1.2466 +NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase
  1.2467 +    {
  1.2468 +public:
  1.2469 +    /**
  1.2470 +    * Constructor.
  1.2471 +    *
  1.2472 +    * @param aConnectionId Connection ID.
  1.2473 +    * @param aSNAPsAvailable Number of available SNAPs.
  1.2474 +    * @param aSNAPInfoPtr Pointer to the SNAP availability information.
  1.2475 +    */
  1.2476 +    CConnMonSNAPsAvailabilityChange(
  1.2477 +            const TUint aConnectionId,
  1.2478 +            const TUint aSNAPsAvailable,
  1.2479 +            const TConnMonSNAPInfo* aSNAPInfoPtr );
  1.2480 +
  1.2481 +    /**
  1.2482 +    * Destructor.
  1.2483 +    */
  1.2484 +    ~CConnMonSNAPsAvailabilityChange();
  1.2485 +
  1.2486 +public:
  1.2487 +    /**
  1.2488 +    * Gets the SNAP availability information.
  1.2489 +    *
  1.2490 +    * @return SNAP availability information.
  1.2491 +    */
  1.2492 +    IMPORT_C TConnMonSNAPInfo SNAPAvailability() const;
  1.2493 +
  1.2494 +    /**
  1.2495 +    * Gets the number of available SNAPs.
  1.2496 +    *
  1.2497 +    * @return Number of available SNAPs.
  1.2498 +    */
  1.2499 +    IMPORT_C TUint SNAPsAvailabile() const;
  1.2500 +
  1.2501 +private:
  1.2502 +    TConnMonSNAPInfo iSNAPInfo;
  1.2503 +    TUint iSNAPsAvailable;
  1.2504 +    };
  1.2505 +
  1.2506 +/**
  1.2507 +* This event is triggered when new WLAN networks are detected during a WLAN
  1.2508 +* scan. The connection ID passed in the event is the bearer specific connection
  1.2509 +* ID EBearerIdWLAN. To receive these events, WLAN background scanning must be
  1.2510 +* enabled, or some other mechanism must be used to trigger the necessary WLAN
  1.2511 +* scans.
  1.2512 +*
  1.2513 +* @lib CONNMON.LIB
  1.2514 +*/
  1.2515 +NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase
  1.2516 +    {
  1.2517 +public:
  1.2518 +    /**
  1.2519 +    * Constructor.
  1.2520 +    *
  1.2521 +    * @param aConnectionId Connection ID.
  1.2522 +    */
  1.2523 +    CConnMonNewWLANNetworkDetected( const TUint aConnectionId );
  1.2524 +
  1.2525 +    /**
  1.2526 +    * Destructor.
  1.2527 +    */
  1.2528 +    ~CConnMonNewWLANNetworkDetected();
  1.2529 +    };
  1.2530 +
  1.2531 +/**
  1.2532 +* This event is triggered when one or more WLAN networks have been lost since
  1.2533 +* the last WLAN scan. The connection ID passed in the event is the bearer
  1.2534 +* specific connection ID EBearerIdWLAN. To receive these events, WLAN
  1.2535 +* background scanning must be enabled, or some other mechanism must be used to
  1.2536 +* trigger the necessary WLAN scans.
  1.2537 +*
  1.2538 +* @lib CONNMON.LIB
  1.2539 +*/
  1.2540 +NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase
  1.2541 +    {
  1.2542 +public:
  1.2543 +    /**
  1.2544 +    * Constructor.
  1.2545 +    *
  1.2546 +    * @param aConnectionId Connection ID.
  1.2547 +    */
  1.2548 +    CConnMonOldWLANNetworkLost( const TUint aConnectionId );
  1.2549 +
  1.2550 +    /**
  1.2551 +    * Destructor.
  1.2552 +    */
  1.2553 +    ~CConnMonOldWLANNetworkLost();
  1.2554 +    };
  1.2555 +
  1.2556 +/**
  1.2557 +* This event is triggered when GPRS or WCDMA bearer availability changes, a
  1.2558 +* phone call is started, or a phone call ends. The connection ID passed in the
  1.2559 +* event is a bearer specific connection ID, either EBearerIdGPRS or
  1.2560 +* EBearerIdWCDMA (see TConnMonBearerId).
  1.2561 +*
  1.2562 +* EConnMonPacketDataUnavailable and EConnMonPacketDataAvailable events form a
  1.2563 +* pair. Two events are always sent, one with connection ID EBearerIdGPRS for 2G
  1.2564 +* network, and one with connection ID EBearerIdWCDMA for 3G network. The event
  1.2565 +* for the network that the phone is not registered to is always of type
  1.2566 +* EConnMonPacketDataUnavailable. If the phone does not support dual transfer
  1.2567 +* mode and a call is started, a GPRS or WCDMA packet data connection will be
  1.2568 +* put on hold. In this scenario, both will be of type
  1.2569 +* EConnMonPacketDataUnavailable. The same information can be retrieved with
  1.2570 +* TBool attribute KPacketDataAvailability.
  1.2571 +*
  1.2572 +* @lib CONNMON.LIB
  1.2573 +*/
  1.2574 +NONSHARABLE_CLASS( CConnMonPacketDataUnavailable ) : public CConnMonEventBase
  1.2575 +    {
  1.2576 +public:
  1.2577 +    /**
  1.2578 +    * Constructor.
  1.2579 +    *
  1.2580 +    * @param aConnectionId Bearer specific connection ID, EBearerIdGPRS or
  1.2581 +    * EBearerIdWCDMA.
  1.2582 +    */
  1.2583 +    CConnMonPacketDataUnavailable( const TUint aConnectionId );
  1.2584 +
  1.2585 +    /**
  1.2586 +    * Destructor.
  1.2587 +    */
  1.2588 +    virtual ~CConnMonPacketDataUnavailable();
  1.2589 +    };
  1.2590 +
  1.2591 +/**
  1.2592 +* This event is triggered when GPRS or WCDMA bearer availability changes, a
  1.2593 +* phone call is started, or a phone call ends. The connection ID passed in the
  1.2594 +* event is a bearer specific connection ID, either EBearerIdGPRS or
  1.2595 +* EBearerIdWCDMA (see TConnMonBearerId).
  1.2596 +*
  1.2597 +* EConnMonPacketDataAvailable and EConnMonPacketDataUnavailable events form a
  1.2598 +* pair. Two events are always sent, one with connection ID EBearerIdGPRS for 2G
  1.2599 +* network, and one with connection ID EBearerIdWCDMA for 3G network. The event
  1.2600 +* for the network that the phone is not registered to is always of type
  1.2601 +* EConnMonPacketDataUnavailable. If the phone does not support dual transfer
  1.2602 +* mode and a call is started, a GPRS or WCDMA packet data connection will be
  1.2603 +* put on hold. In this scenario, both will be of type
  1.2604 +* EConnMonPacketDataUnavailable. The same information can be retrieved with
  1.2605 +* TBool attribute KPacketDataAvailability.
  1.2606 +*
  1.2607 +* @lib CONNMON.LIB
  1.2608 +*/
  1.2609 +NONSHARABLE_CLASS( CConnMonPacketDataAvailable ) : public CConnMonEventBase
  1.2610 +    {
  1.2611 +public:
  1.2612 +    /**
  1.2613 +    * Constructor.
  1.2614 +    *
  1.2615 +    * @param aConnectionId Bearer specific connection ID, EBearerIdGPRS or
  1.2616 +    * EBearerIdWCDMA.
  1.2617 +    */
  1.2618 +    CConnMonPacketDataAvailable( const TUint aConnectionId );
  1.2619 +
  1.2620 +    /**
  1.2621 +    * Destructor.
  1.2622 +    */
  1.2623 +    virtual ~CConnMonPacketDataAvailable();
  1.2624 +    };
  1.2625 +
  1.2626 +/**
  1.2627 +* This event is triggered when there is a change in bearer information for an
  1.2628 +* existing connection, or if the network mode changes e.g. from 2G to 3G. For
  1.2629 +* connection specific events, the connection ID passed in the event is the
  1.2630 +* respective connection specific ID, and for network level events, the
  1.2631 +* connection ID is EBearerIdAll. The same connection level information can be
  1.2632 +* retrieved with TInt attribute KBearerInfo. The bearer info values are defined
  1.2633 +* in TConnMonBearerInfo.
  1.2634 +*
  1.2635 +* Note: The client needs to set the TUint attribute KBearerGroupThreshold in
  1.2636 +* order to receive these events. This also disables EConnMonBearerChange events.
  1.2637 +*
  1.2638 +* @lib CONNMON.LIB
  1.2639 +*/
  1.2640 +NONSHARABLE_CLASS( CConnMonBearerInfoChange ) : public CConnMonEventBase
  1.2641 +    {
  1.2642 +public:
  1.2643 +    /**
  1.2644 +    * Constructor.
  1.2645 +    *
  1.2646 +    * @param aConnectionId Connection ID.
  1.2647 +    * @param aBearerInfo Bearer information.
  1.2648 +    */
  1.2649 +    CConnMonBearerInfoChange(
  1.2650 +            const TUint aConnectionId,
  1.2651 +            const TInt aBearerInfo );
  1.2652 +
  1.2653 +    /**
  1.2654 +    * Destructor.
  1.2655 +    */
  1.2656 +    ~CConnMonBearerInfoChange();
  1.2657 +
  1.2658 +public:
  1.2659 +    /**
  1.2660 +    * Gets the new bearer information. Values are defined in TConnMonBearerInfo.
  1.2661 +    *
  1.2662 +    * @return New bearer information.
  1.2663 +    */
  1.2664 +    IMPORT_C TInt BearerInfo() const;
  1.2665 +
  1.2666 +private:
  1.2667 +    TInt iBearerInfo;
  1.2668 +    };
  1.2669 +
  1.2670 +/**
  1.2671 +* This event is triggered when there is a change in bearer group information
  1.2672 +* for an existing connection. The connection ID passed in the event is the
  1.2673 +* respective connection specific ID. The same information can be retrieved with
  1.2674 +* packaged attribute KBearerGroupInfo. The bearer group bitmask is defined in
  1.2675 +* TConnMonBearerGroup.
  1.2676 +*
  1.2677 +* Note: The client needs to set the TUint attribute KBearerGroupThreshold in
  1.2678 +* order to receive these events. This also disables EConnMonBearerChange events.
  1.2679 +*
  1.2680 +* @lib CONNMON.LIB
  1.2681 +*/
  1.2682 +NONSHARABLE_CLASS( CConnMonBearerGroupChange ) : public CConnMonEventBase
  1.2683 +    {
  1.2684 +public:
  1.2685 +    /**
  1.2686 +    * Constructor.
  1.2687 +    *
  1.2688 +    * @param aConnectionId Connection ID.
  1.2689 +    * @param aBearerGroups1 First bearer group bitmask.
  1.2690 +    * @param aBearerGroups2 Second bearer group bitmask.
  1.2691 +    * @param aInternal ETrue if connection is internal, EFalse if external.
  1.2692 +    */
  1.2693 +    CConnMonBearerGroupChange(
  1.2694 +            const TUint aConnectionId,
  1.2695 +            const TUint aBearerGroups1,
  1.2696 +            const TUint aBearerGroups2,
  1.2697 +            const TBool aInternal );
  1.2698 +
  1.2699 +    /**
  1.2700 +    * Destructor.
  1.2701 +    */
  1.2702 +    ~CConnMonBearerGroupChange();
  1.2703 +
  1.2704 +public:
  1.2705 +    /**
  1.2706 +    * Gets the new bearer groups. Values are defined in TConnMonBearerGroup.
  1.2707 +    *
  1.2708 +    * @param aBearerGroups1 Will contain the first bearer group bitmask.
  1.2709 +    * @param aBearerGroups2 Will contain the second bearer group bitmask.
  1.2710 +    */
  1.2711 +    IMPORT_C void BearerGroups(
  1.2712 +            TUint& aBearerGroups1,
  1.2713 +            TUint& aBearerGroups2 ) const;
  1.2714 +
  1.2715 +    /**
  1.2716 +    * Gets the information whether the current connection bearer is internal
  1.2717 +    * or external.
  1.2718 +    *
  1.2719 +    * @return ETrue if the bearer is internal and EFalse if external.
  1.2720 +    */
  1.2721 +    IMPORT_C TBool Internal() const;
  1.2722 +
  1.2723 +private:
  1.2724 +    TBool iInternal;      // ETrue for internal, EFalse for external connection.
  1.2725 +    TUint iBearerGroups1; // Contains the groups as bitmask.
  1.2726 +    TUint iBearerGroups2; // Reserved for the future use.
  1.2727 +    };
  1.2728 +
  1.2729 +#endif // __CONNECTIONMONITOR_H
  1.2730 +
  1.2731 +// End of file